Blame SOURCES/gcc32-rh173224.patch

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