From 3135d8fe8a2ac2a88c9681494c6f1ea68d3ae614 Mon Sep 17 00:00:00 2001 From: Marek Polacek Date: Wed, 23 Nov 2016 03:17:14 +0000 Subject: [PATCH] re PR tree-optimization/78455 (ICE in operator[], at vec.h:732) 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 | 5 +++++ gcc/testsuite/ChangeLog | 5 +++++ gcc/testsuite/gcc.dg/uninit-23.c | 27 +++++++++++++++++++++++++++ gcc/tree-ssa-uninit.c | 2 +- 4 files changed, 38 insertions(+), 1 deletion(-) create mode 100644 gcc/testsuite/gcc.dg/uninit-23.c diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 6bc37d3d52c..8d11c29d1a6 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,8 @@ +2016-11-22 Marek Polacek + + PR tree-optimization/78455 + * tree-ssa-uninit.c (can_chain_union_be_invalidated_p): Fix typo. + 2016-11-22 Ian Lance Taylor PR go/78431 diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index e3012bf4bb0..9e8b7468290 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2016-11-22 Marek Polacek + + PR tree-optimization/78455 + * gcc.dg/uninit-23.c: New. + 2016-11-22 Steven G. Kargl 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 index 00000000000..b38e1d08eab --- /dev/null +++ b/gcc/testsuite/gcc.dg/uninit-23.c @@ -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; + } +} diff --git a/gcc/tree-ssa-uninit.c b/gcc/tree-ssa-uninit.c index 68dcf156da2..4557403d934 100644 --- a/gcc/tree-ssa-uninit.c +++ b/gcc/tree-ssa-uninit.c @@ -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; -- 2.30.2