re PR middle-end/54211 (ICE: verify_gimple failed building freetype with -Os)
authorBill Schmidt <wschmidt@linux.vnet.ibm.com>
Fri, 10 Aug 2012 12:16:04 +0000 (12:16 +0000)
committerWilliam Schmidt <wschmidt@gcc.gnu.org>
Fri, 10 Aug 2012 12:16:04 +0000 (12:16 +0000)
gcc:

2012-08-10  Bill Schmidt  <wschmidt@linux.vnet.ibm.com>

PR middle-end/54211
* gimple-ssa-strength-reduction.c (analyze_candidates_and_replace):
Use cand_type to determine whether pointer arithmetic will be generated.

gcc/testsuite:

2012-08-10  Bill Schmidt  <wschmidt@linux.vnet.ibm.com>

PR middle-end/54211
* gcc.dg/tree-ssa/pr54211.c: New test.

From-SVN: r190294

gcc/ChangeLog
gcc/gimple-ssa-strength-reduction.c
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.dg/tree-ssa/pr54211.c [new file with mode: 0644]

index 1050c568d07175a2997544c0da17648d0357e1e2..41e0db3741304bdfb4261abeccd930e5f715ad19 100644 (file)
@@ -1,3 +1,9 @@
+2012-08-10  Bill Schmidt  <wschmidt@linux.vnet.ibm.com>
+
+       PR middle-end/54211
+       * gimple-ssa-strength-reduction.c (analyze_candidates_and_replace):
+       Use cand_type to determine whether pointer arithmetic will be generated.
+
 2012-08-10  Bill Schmidt  <wschmidt@linux.vnet.ibm.com>
 
        * doc/sourcebuild.texi: Document long_neq_int effective target.
index ccc361e900a5c156fb075f7a1ebdb088a7e8b28f..237c0c9b42598ea407d8870fa2dd774d36e7cd1b 100644 (file)
@@ -2534,7 +2534,7 @@ analyze_candidates_and_replace (void)
          /* Determine whether we'll be generating pointer arithmetic
             when replacing candidates.  */
          address_arithmetic_p = (c->kind == CAND_ADD
-                                 && POINTER_TYPE_P (TREE_TYPE (c->base_expr)));
+                                 && POINTER_TYPE_P (c->cand_type));
 
          /* If all candidates have already been replaced under other
             interpretations, nothing remains to be done.  */
index c9e312d0ec55806b61766a4a62bbc776c9ebee5d..243f5950fcc8ab79ec92867215356aeb429afe17 100644 (file)
@@ -1,3 +1,8 @@
+2012-08-10  Bill Schmidt  <wschmidt@linux.vnet.ibm.com>
+
+       PR middle-end/54211
+       * gcc.dg/tree-ssa/pr54211.c: New test.
+
 2012-08-10  Bill Schmidt  <wschmidt@linux.vnet.ibm.com>
 
        * lib/target-supports.exp (check_effective_target_long_neq_int): New.
diff --git a/gcc/testsuite/gcc.dg/tree-ssa/pr54211.c b/gcc/testsuite/gcc.dg/tree-ssa/pr54211.c
new file mode 100644 (file)
index 0000000..c8a1591
--- /dev/null
@@ -0,0 +1,28 @@
+/* { dg-do compile } */
+/* { dg-options "-Os" } */
+
+int a, b;
+unsigned char e;
+void fn1 ()
+{
+    unsigned char *c=0;
+    for (;; a++)
+    {
+        unsigned char d = *(c + b);
+        for (; &e<&d; c++)
+            goto Found_Top;
+    }
+Found_Top:
+    if (0)
+        goto Empty_Bitmap;
+    for (;; a++)
+    {
+        unsigned char *e = c + b;
+        for (; c < e; c++)
+            goto Found_Bottom;
+        c -= b;
+    }
+Found_Bottom:
+Empty_Bitmap:
+    ;
+}