re PR tree-optimization/57441 (ICE in gimple-ssa-strength-reduction.c:3447 at -O3)
authorBill Schmidt <wschmidt@linux.vnet.ibm.com>
Wed, 29 May 2013 16:00:54 +0000 (16:00 +0000)
committerWilliam Schmidt <wschmidt@gcc.gnu.org>
Wed, 29 May 2013 16:00:54 +0000 (16:00 +0000)
2013-05-29  Bill Schmidt  <wschmidt@linux.vnet.ibm.com>

PR tree-optimization/57441
* gimple-ssa-strength-reduction.c (analyze_candidates_and_replace):
Don't limit size of incr_vec to number of candidates.

2013-05-29  Bill Schmidt  <wschmidt@linux.vnet.ibm.com>

PR tree-optimization/57441
* gcc.c-torture/compile/pr57441.c: New.

From-SVN: r199414

gcc/ChangeLog
gcc/gimple-ssa-strength-reduction.c
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.c-torture/compile/pr57441.c [new file with mode: 0644]

index e074334841decaa39cdb0d720126357ecc9e7932..1307e736386b93333cfd31be58bfd6af3962ed93 100644 (file)
@@ -1,3 +1,9 @@
+2013-05-29  Bill Schmidt  <wschmidt@linux.vnet.ibm.com>
+
+       PR tree-optimization/57441
+       * gimple-ssa-strength-reduction.c (analyze_candidates_and_replace):
+       Don't limit size of incr_vec to number of candidates.
+
 2013-05-29  Steve Ellcey  <sellcey@imgtec.com>
 
        * config/mips/mti-linux.h (SYSROOT_SUFFIX_SPEC): Add micromips
index dcd31809ab643fb135d4a5cbb12e1455866175d6..9a53bf7c3397c2576c7e151dbb738cd244e2d442 100644 (file)
@@ -3361,7 +3361,6 @@ analyze_candidates_and_replace (void)
         less expensive to calculate than the replaced statements.  */
       else
        {
-         int length;
          enum machine_mode mode;
          bool speed;
 
@@ -3372,14 +3371,11 @@ analyze_candidates_and_replace (void)
 
          /* If all candidates have already been replaced under other
             interpretations, nothing remains to be done.  */
-         length = count_candidates (c);
-         if (!length)
+         if (!count_candidates (c))
            continue;
-         if (length > MAX_INCR_VEC_LEN)
-           length = MAX_INCR_VEC_LEN;
 
          /* Construct an array of increments for this candidate chain.  */
-         incr_vec = XNEWVEC (incr_info, length);
+         incr_vec = XNEWVEC (incr_info, MAX_INCR_VEC_LEN);
          incr_vec_len = 0;
          record_increments (c);
 
index 4dc91bcec9d32b36f98060fb6902a942786a2be3..4aedfc94fb7507f5d421317fae895dff682b7b73 100644 (file)
@@ -1,3 +1,8 @@
+2013-05-29  Bill Schmidt  <wschmidt@linux.vnet.ibm.com>
+
+       PR tree-optimization/57441
+       * gcc.c-torture/compile/pr57441.c: New.
+
 2013-05-29  Dehao Chen  <dehao@google.com>
 
        PR testsuite/57413
diff --git a/gcc/testsuite/gcc.c-torture/compile/pr57441.c b/gcc/testsuite/gcc.c-torture/compile/pr57441.c
new file mode 100644 (file)
index 0000000..e357c10
--- /dev/null
@@ -0,0 +1,26 @@
+/* PR tree-optimization/57441 */
+
+int a, c, d, *e;
+unsigned char b;
+
+char
+baz (char p1)
+{
+    return p1 * a;
+}
+
+void func_65 ();
+func_1 ()
+{
+    func_65 ();
+    func_65 ();
+}
+
+void
+func_65 ()
+{
+    d = baz (b--);
+    if (*e)
+        b--;
+    c = 0;
+}