]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
re PR middle-end/45182 (Failed to build SPEC CPU 2000/2006)
authorBernd Schmidt <bernds@codesourcery.com>
Tue, 10 Aug 2010 12:48:16 +0000 (12:48 +0000)
committerBernd Schmidt <bernds@gcc.gnu.org>
Tue, 10 Aug 2010 12:48:16 +0000 (12:48 +0000)
PR middle-end/45182
* combine.c (make_compound_operation): Don't try to convert
shifts into multiplications for modes that aren't SCALAR_INT_MODE_P.

PR middle-end/45182
* gcc.c-torture/compile/pr45182.c: New test.

From-SVN: r163057

gcc/ChangeLog
gcc/combine.c
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.c-torture/compile/pr45182.c [new file with mode: 0644]

index 49a95d0cd736be8bba419af119dbbd436e025354..68a1c8c7b130482f58ab8ef5462d506ef92f674f 100644 (file)
@@ -1,3 +1,9 @@
+2010-08-10  Bernd Schmidt  <bernds@codesourcery.com>
+
+       PR middle-end/45182
+       * combine.c (make_compound_operation): Don't try to convert
+       shifts into multiplications for modes that aren't SCALAR_INT_MODE_P.
+
 2010-08-10  Richard Guenther  <rguenther@suse.de>
 
        * tree.h (get_object_alignment): Adjust prototype.
index 41a0ec1dcb6fa7e015f1ee8861e86832d25204fc..d336e5a56134a510893670ff1b231c81606e3219 100644 (file)
@@ -7093,7 +7093,9 @@ make_compound_operation (rtx x, enum rtx_code in_code)
      address, we stay there.  If we have a comparison, set to COMPARE,
      but once inside, go back to our default of SET.  */
 
-  next_code = (code == MEM || code == PLUS || code == MINUS ? MEM
+  next_code = (code == MEM ? MEM
+              : ((code == PLUS || code == MINUS)
+                 && SCALAR_INT_MODE_P (mode)) ? MEM
               : ((code == COMPARE || COMPARISON_P (x))
                  && XEXP (x, 1) == const0_rtx) ? COMPARE
               : in_code == COMPARE ? SET : in_code);
@@ -7127,8 +7129,8 @@ make_compound_operation (rtx x, enum rtx_code in_code)
     case PLUS:
       lhs = XEXP (x, 0);
       rhs = XEXP (x, 1);
-      lhs = make_compound_operation (lhs, MEM);
-      rhs = make_compound_operation (rhs, MEM);
+      lhs = make_compound_operation (lhs, next_code);
+      rhs = make_compound_operation (rhs, next_code);
       if (GET_CODE (lhs) == MULT && GET_CODE (XEXP (lhs, 0)) == NEG
          && SCALAR_INT_MODE_P (mode))
        {
@@ -7157,8 +7159,8 @@ make_compound_operation (rtx x, enum rtx_code in_code)
     case MINUS:
       lhs = XEXP (x, 0);
       rhs = XEXP (x, 1);
-      lhs = make_compound_operation (lhs, MEM);
-      rhs = make_compound_operation (rhs, MEM);
+      lhs = make_compound_operation (lhs, next_code);
+      rhs = make_compound_operation (rhs, next_code);
       if (GET_CODE (rhs) == MULT && GET_CODE (XEXP (rhs, 0)) == NEG
          && SCALAR_INT_MODE_P (mode))
        {
index 8e73a3b7b22abad911f42a6ade3c2f5ffad77aca..3f38faf0fbd4e9e44f8495ddbeec70ff8c925e10 100644 (file)
@@ -1,3 +1,8 @@
+2010-08-10  Bernd Schmidt  <bernds@codesourcery.com>
+
+       PR middle-end/45182
+       * gcc.c-torture/compile/pr45182.c: New test.
+
 2010-08-09  Jason Merrill  <jason@redhat.com>
 
        PR c++/45236
diff --git a/gcc/testsuite/gcc.c-torture/compile/pr45182.c b/gcc/testsuite/gcc.c-torture/compile/pr45182.c
new file mode 100644 (file)
index 0000000..ad27ff8
--- /dev/null
@@ -0,0 +1,10 @@
+typedef struct TypHeader {
+  struct TypHeader ** ptr;
+} *TypHandle;
+void PlainRange (TypHandle hdList, long lenList, long low, long inc)
+{
+  long i;
+  for (i = 1; i <= lenList; i++ )
+    (((TypHandle*)((hdList)->ptr))[i] = (((TypHandle) (((long)(low + (i-1) *
+inc) << 2) + 1))));
+}