Blame SOURCES/gcc32-rh173224.patch

4ac4fd
2005-01-09  Alexandre Oliva  <aoliva@redhat.com>
4ac4fd
4ac4fd
	* config/i386/i386.md: Adjust sse conditional move patterns to
4ac4fd
	match both nonimm&reg and reg&nonimm in compare operands.
4ac4fd
4ac4fd
2006-04-25  Jakub Jelinek  <jakub@redhat.com>
4ac4fd
4ac4fd
	* gcc.dg/20060425-1.c: New test.
4ac4fd
4ac4fd
--- gcc/config/i386/i386.md	2005-10-24 18:18:40.000000000 -0200
4ac4fd
+++ gcc/config/i386/i386.md	2006-01-09 16:16:06.000000000 -0200
4ac4fd
@@ -16815,25 +16815,30 @@
4ac4fd
 (define_split
4ac4fd
   [(set (match_operand 0 "register_operand" "")
4ac4fd
 	(if_then_else (match_operator 1 "comparison_operator"
4ac4fd
-			[(match_operand 4 "register_operand" "")
4ac4fd
+			[(match_operand 4 "nonimmediate_operand" "")
4ac4fd
 			 (match_operand 5 "nonimmediate_operand" "")])
4ac4fd
 		      (match_operand 2 "nonmemory_operand" "")
4ac4fd
 		      (match_operand 3 "nonmemory_operand" "")))]
4ac4fd
   "SSE_REG_P (operands[0]) && reload_completed
4ac4fd
+   && ((REG_P (operands[4]) && REGNO (operands[4]) == REGNO (operands[0]))
4ac4fd
+       || (REG_P (operands[5]) && REGNO (operands[5]) == REGNO (operands[0])))
4ac4fd
    && (const0_operand (operands[2], GET_MODE (operands[0]))
4ac4fd
        || const0_operand (operands[3], GET_MODE (operands[0])))"
4ac4fd
-  [(set (match_dup 0) (match_op_dup 1 [(match_dup 0) (match_dup 5)]))
4ac4fd
+  [(set (match_dup 0) (match_op_dup 1 [(match_dup 4) (match_dup 5)]))
4ac4fd
    (set (subreg:TI (match_dup 0) 0) (and:TI (match_dup 6)
4ac4fd
 					    (subreg:TI (match_dup 7) 0)))]
4ac4fd
 {
4ac4fd
   PUT_MODE (operands[1], GET_MODE (operands[0]));
4ac4fd
-  if (!sse_comparison_operator (operands[1], VOIDmode))
4ac4fd
+  if (REGNO (operands[4]) != REGNO (operands[0])
4ac4fd
+      || !sse_comparison_operator (operands[1], VOIDmode))
4ac4fd
     {
4ac4fd
       rtx tmp = operands[5];
4ac4fd
       operands[5] = operands[4];
4ac4fd
       operands[4] = tmp;
4ac4fd
       PUT_CODE (operands[1], swap_condition (GET_CODE (operands[1])));
4ac4fd
     }
4ac4fd
+  if (!sse_comparison_operator (operands[1], VOIDmode))
4ac4fd
+    abort ();
4ac4fd
   if (const0_operand (operands[2], GET_MODE (operands[0])))
4ac4fd
     {
4ac4fd
       operands[7] = operands[3];
4ac4fd
--- gcc/testsuite/gcc.dg/20060425-1.c	2004-06-24 14:04:38.000000000 -0400
4ac4fd
+++ gcc/testsuite/gcc.dg/20060425-1.c	2006-04-25 09:15:04.000000000 -0400
4ac4fd
@@ -0,0 +1,10 @@
4ac4fd
+/* { dg-do compile } */
4ac4fd
+/* { dg-options "-O2" } */
4ac4fd
+
4ac4fd
+double
4ac4fd
+crashme (double v, double *p)
4ac4fd
+{
4ac4fd
+  if (v < 0. && *p == 1.)
4ac4fd
+    v = 0.;
4ac4fd
+  return v;
4ac4fd
+}