From: Richard Biener Date: Tue, 14 Oct 2014 07:36:02 +0000 (+0000) Subject: re PR tree-optimization/63512 (ICE: error: virtual use of statement not up-to-date) X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=b6fed550a33a4ea5005b52c0361f6386d9d70a65;p=gcc.git re PR tree-optimization/63512 (ICE: error: virtual use of statement not up-to-date) 2014-10-14 Richard Biener PR tree-optimization/63512 * tree-ssa-pre.c (create_expression_by_pieces): Mark stmts modified. * g++.dg/torture/pr63512.C: New testcase. From-SVN: r216174 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 2890d52df98..c7aa8f603f4 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2014-10-14 Richard Biener + + PR tree-optimization/63512 + * tree-ssa-pre.c (create_expression_by_pieces): Mark stmts + modified. + 2014-10-14 Oleg Endo PR target/63260 diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index d42991f0120..59aca0d68c1 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2014-10-14 Richard Biener + + PR tree-optimization/63512 + * g++.dg/torture/pr63512.C: New testcase. + 2014-10-14 Oleg Endo PR target/63260 diff --git a/gcc/testsuite/g++.dg/torture/pr63512.C b/gcc/testsuite/g++.dg/torture/pr63512.C new file mode 100644 index 00000000000..954901443fd --- /dev/null +++ b/gcc/testsuite/g++.dg/torture/pr63512.C @@ -0,0 +1,46 @@ +// { dg-do compile } + +extern "C" { +void __assert_fail (); +unsigned long strlen (const char *); +} +class A +{ + int Data; + int Length; + +public: + A (const char *p1) : Data () + { + p1 ? void() : __assert_fail (); + Length = strlen (p1); + } +}; +enum TokenKind +{ + semi +}; +class B +{ +public: + void m_fn1 (); +}; +class C +{ + void m_fn2 (TokenKind, int, A); + struct D + { + D (int); + B Range; + }; + int *m_fn3 (const int &, int &, int **); +}; +int a, b; +int * +C::m_fn3 (const int &, int &, int **) +{ + D c (0); + if (a) + c.Range.m_fn1 (); + m_fn2 (semi, 0, b ? "" : a ? "alias declaration" : "using declaration"); +} diff --git a/gcc/tree-ssa-pre.c b/gcc/tree-ssa-pre.c index 60ff70fa42b..c3dad70db01 100644 --- a/gcc/tree-ssa-pre.c +++ b/gcc/tree-ssa-pre.c @@ -2897,6 +2897,7 @@ create_expression_by_pieces (basic_block block, pre_expr expr, } gimple_set_vuse (stmt, BB_LIVE_VOP_ON_EXIT (block)); + gimple_set_modified (stmt, true); } gimple_seq_add_seq (stmts, forced_stmts); } @@ -2904,6 +2905,7 @@ create_expression_by_pieces (basic_block block, pre_expr expr, name = make_temp_ssa_name (exprtype, NULL, "pretmp"); newstmt = gimple_build_assign (name, folded); gimple_set_vuse (newstmt, BB_LIVE_VOP_ON_EXIT (block)); + gimple_set_modified (newstmt, true); gimple_set_plf (newstmt, NECESSARY, false); gimple_seq_add_stmt (stmts, newstmt);