aboutsummaryrefslogtreecommitdiff
path: root/gcc/gimple-fold.c
diff options
context:
space:
mode:
authorJakub Jelinek <jakub@redhat.com>2012-02-21 10:24:42 +0100
committerJakub Jelinek <jakub@gcc.gnu.org>2012-02-21 10:24:42 +0100
commit949e47e5767ae98fe1f30b1b632d02fe8f553abe (patch)
treeec15c0db9203945d35dffdf34ff7e724e6fd048b /gcc/gimple-fold.c
parentc2885517fdda8081eca8036dc7715fe9c2c7f5a2 (diff)
downloadgcc-949e47e5767ae98fe1f30b1b632d02fe8f553abe.zip
gcc-949e47e5767ae98fe1f30b1b632d02fe8f553abe.tar.gz
gcc-949e47e5767ae98fe1f30b1b632d02fe8f553abe.tar.bz2
re PR tree-optimization/52318 (ICE: in execute_todo, at passes.c:1748 with -O3 -ftracer -fno-tree-ccp -fno-tree-copy-prop -fno-tree-dce and stpcpy_chk())
PR tree-optimization/52318 * gimple-fold.c (gimplify_and_update_call_from_tree): Add vdef also to non-pure/const call stmts in the sequence. * gcc.dg/pr52318.c: New test. From-SVN: r184428
Diffstat (limited to 'gcc/gimple-fold.c')
-rw-r--r--gcc/gimple-fold.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/gcc/gimple-fold.c b/gcc/gimple-fold.c
index 935bbda..eae4cbe 100644
--- a/gcc/gimple-fold.c
+++ b/gcc/gimple-fold.c
@@ -1,5 +1,5 @@
/* Statement simplification on GIMPLE.
- Copyright (C) 2010, 2011 Free Software Foundation, Inc.
+ Copyright (C) 2010, 2011, 2012 Free Software Foundation, Inc.
Split out from tree-ssa-ccp.c.
This file is part of GCC.
@@ -591,8 +591,11 @@ gimplify_and_update_call_from_tree (gimple_stmt_iterator *si_p, tree expr)
for (i = gsi_last (stmts); !gsi_end_p (i); gsi_prev (&i))
{
new_stmt = gsi_stmt (i);
- if (gimple_assign_single_p (new_stmt)
- && !is_gimple_reg (gimple_assign_lhs (new_stmt)))
+ if ((gimple_assign_single_p (new_stmt)
+ && !is_gimple_reg (gimple_assign_lhs (new_stmt)))
+ || (is_gimple_call (new_stmt)
+ && (gimple_call_flags (new_stmt)
+ & (ECF_NOVOPS | ECF_PURE | ECF_CONST | ECF_NORETURN)) == 0))
{
tree vdef;
if (!laststore)