Commit 949e47e5 by Jakub Jelinek Committed by Jakub Jelinek

re PR tree-optimization/52318 (ICE: in execute_todo, at passes.c:1748 with -O3…

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
parent c2885517
2012-02-21 Jakub Jelinek <jakub@redhat.com>
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.
2012-02-20 David S. Miller <davem@davemloft.net> 2012-02-20 David S. Miller <davem@davemloft.net>
* config/sparc/sparc.md (load_pcrel_sym<P:mode>): Explain why we * config/sparc/sparc.md (load_pcrel_sym<P:mode>): Explain why we
......
/* Statement simplification on GIMPLE. /* 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. Split out from tree-ssa-ccp.c.
This file is part of GCC. This file is part of GCC.
...@@ -591,8 +591,11 @@ gimplify_and_update_call_from_tree (gimple_stmt_iterator *si_p, tree expr) ...@@ -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)) for (i = gsi_last (stmts); !gsi_end_p (i); gsi_prev (&i))
{ {
new_stmt = gsi_stmt (i); new_stmt = gsi_stmt (i);
if (gimple_assign_single_p (new_stmt) if ((gimple_assign_single_p (new_stmt)
&& !is_gimple_reg (gimple_assign_lhs (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; tree vdef;
if (!laststore) if (!laststore)
......
2012-02-21 Jakub Jelinek <jakub@redhat.com>
PR tree-optimization/52318
* gcc.dg/pr52318.c: New test.
2012-02-20 Kai Tietz <ktietz@redhat.com> 2012-02-20 Kai Tietz <ktietz@redhat.com>
* gcc.dg/bf-ms-layout-3.c: New testcase. * gcc.dg/bf-ms-layout-3.c: New testcase.
......
/* PR tree-optimization/52318 */
/* { dg-do compile } */
/* { dg-options "-O3 -ftracer -fno-tree-ccp -fno-tree-copy-prop -fno-tree-dce" } */
int c;
char *p;
void
foo (int i)
{
char a[2];
char b[20];
p = __builtin___stpcpy_chk (a, "", 2);
p = __builtin___stpcpy_chk (&b[16], i ? "e" : "jkl", 4);
if (c)
foo (i);
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment