re PR tree-optimization/78455 (ICE in operator[], at vec.h:732)
authorMarek Polacek <polacek@redhat.com>
Wed, 23 Nov 2016 03:17:14 +0000 (03:17 +0000)
committerMarek Polacek <mpolacek@gcc.gnu.org>
Wed, 23 Nov 2016 03:17:14 +0000 (03:17 +0000)
PR tree-optimization/78455
* tree-ssa-uninit.c (can_chain_union_be_invalidated_p): Fix typo.

* gcc.dg/uninit-23.c: New.

From-SVN: r242733

gcc/ChangeLog
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.dg/uninit-23.c [new file with mode: 0644]
gcc/tree-ssa-uninit.c

index 6bc37d3d52c81c8651a4be2c3ca47c05207994d7..8d11c29d1a6fae96b875cefefc35d604b6caa278 100644 (file)
@@ -1,3 +1,8 @@
+2016-11-22  Marek Polacek  <polacek@redhat.com>
+
+       PR tree-optimization/78455
+       * tree-ssa-uninit.c (can_chain_union_be_invalidated_p): Fix typo.
+
 2016-11-22  Ian Lance Taylor  <iant@golang.org>
 
        PR go/78431
index e3012bf4bb0ebbdb8f73f71ebe09365a8ff3b23c..9e8b74682901dc4d0d605075f4bca434f833bcbe 100644 (file)
@@ -1,3 +1,8 @@
+2016-11-22  Marek Polacek  <polacek@redhat.com>
+
+       PR tree-optimization/78455
+       * gcc.dg/uninit-23.c: New.
+
 2016-11-22  Steven G. Kargl  <kargl@gcc.gnu.org>
 
        PR fortran/78479
diff --git a/gcc/testsuite/gcc.dg/uninit-23.c b/gcc/testsuite/gcc.dg/uninit-23.c
new file mode 100644 (file)
index 0000000..b38e1d0
--- /dev/null
@@ -0,0 +1,27 @@
+/* PR tree-optimization/78455 */
+/* { dg-do compile } */
+/* { dg-options "-O2 -Wuninitialized" } */
+
+int ij;
+
+void
+ql (void)
+{
+  int m5 = 0;
+
+  for (;;)
+  {
+    if (0)
+      for (;;)
+      {
+        int *go;
+        int *t4 = go;
+
+ l1:
+        *t4 = (*t4 != 0) ? 0 : 2; /* { dg-warning "may be used uninitialized" } */
+      }
+
+    if (ij != 0)
+      goto l1;
+  }
+}
index 68dcf156da2082446495743e7ef40996d8a9c4ee..4557403d9347168987c9e679b7083f7c90ec059a 100644 (file)
@@ -2192,7 +2192,7 @@ can_chain_union_be_invalidated_p (pred_chain_union use_preds,
       pred_chain c = use_preds[i];
       bool entire_pred_chain_invalidated = false;
       for (size_t j = 0; j < c.length (); ++j)
-       if (can_one_predicate_be_invalidated_p (c[i], worklist))
+       if (can_one_predicate_be_invalidated_p (c[j], worklist))
          {
            entire_pred_chain_invalidated = true;
            break;