mirror of
git://gcc.gnu.org/git/gcc.git
synced 2025-04-21 00:11:00 +08:00
tree-optimization/109331 - make sure to clean up the CFG after forwprop
When forwprop discovers unreachable code or makes decisions based on unreachable edges make sure to cleanup the CFG since otherwise SSA form can become invalid. PR tree-optimization/109331 * tree-ssa-forwprop.cc (pass_forwprop::execute): When we discover a taken edge make sure to cleanup the CFG. * gcc.dg/torture/pr109331.c: New testcase.
This commit is contained in:
parent
ad32fcb8e9
commit
86efc490ab
16
gcc/testsuite/gcc.dg/torture/pr109331.c
Normal file
16
gcc/testsuite/gcc.dg/torture/pr109331.c
Normal file
@ -0,0 +1,16 @@
|
||||
/* { dg-do compile } */
|
||||
|
||||
char *ustol_dpp;
|
||||
void ustol(int flags)
|
||||
{
|
||||
char *s;
|
||||
if (s)
|
||||
flags |= 3;
|
||||
switch (flags & 3)
|
||||
case 3:
|
||||
while (*s)
|
||||
case '+':
|
||||
++s;
|
||||
if (flags)
|
||||
ustol_dpp = s;
|
||||
}
|
@ -4046,7 +4046,11 @@ pass_forwprop::execute (function *fun)
|
||||
|
||||
/* Mark outgoing exectuable edges. */
|
||||
if (edge e = find_taken_edge (bb, NULL))
|
||||
e->flags |= EDGE_EXECUTABLE;
|
||||
{
|
||||
e->flags |= EDGE_EXECUTABLE;
|
||||
if (EDGE_COUNT (bb->succs) > 1)
|
||||
cfg_changed = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
FOR_EACH_EDGE (e, ei, bb->succs)
|
||||
|
Loading…
x
Reference in New Issue
Block a user