diff options
author | Richard Guenther <rguenther@suse.de> | 2012-04-11 08:12:33 +0000 |
---|---|---|
committer | Richard Biener <rguenth@gcc.gnu.org> | 2012-04-11 08:12:33 +0000 |
commit | 12df9a2f926759175599d20c5c2b0c7f50b7ad6d (patch) | |
tree | af40e041d52aa7d52fea8c63f02402da2b3098ef /gcc | |
parent | f06fe36d991c992ec07202eae8764349db40ae15 (diff) | |
download | gcc-12df9a2f926759175599d20c5c2b0c7f50b7ad6d.zip gcc-12df9a2f926759175599d20c5c2b0c7f50b7ad6d.tar.gz gcc-12df9a2f926759175599d20c5c2b0c7f50b7ad6d.tar.bz2 |
re PR tree-optimization/52912 (ICE: verify_ssa failed)
2012-04-11 Richard Guenther <rguenther@suse.de>
PR tree-optimization/52912
* tree-ssa-threadupdate.c (thread_block): Tell the cfg
manipulation code we are threading through a loop header
to an exit destination.
* gcc.dg/torture/pr52912.c: New testcase.
From-SVN: r186303
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/ChangeLog | 7 | ||||
-rw-r--r-- | gcc/testsuite/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/testsuite/gcc.dg/torture/pr52912.c | 17 | ||||
-rw-r--r-- | gcc/tree-ssa-threadupdate.c | 11 |
4 files changed, 40 insertions, 0 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index cc84f50..24efa85 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,10 @@ +2012-04-11 Richard Guenther <rguenther@suse.de> + + PR tree-optimization/52912 + * tree-ssa-threadupdate.c (thread_block): Tell the cfg + manipulation code we are threading through a loop header + to an exit destination. + 2012-04-10 Manuel López-Ibáñez <manu@gcc.gnu.org> * tree.h (warn_if_unused_value): Move declaration from here. diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index def1d1f..0829316 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2012-04-11 Richard Guenther <rguenther@suse.de> + + PR tree-optimization/52912 + * gcc.dg/torture/pr52912.c: New testcase. + 2010-04-10 Michael Matz <matz@suse.de> * gcc.dg/vect/vect-outer-1-big-array.c: Adjust. diff --git a/gcc/testsuite/gcc.dg/torture/pr52912.c b/gcc/testsuite/gcc.dg/torture/pr52912.c new file mode 100644 index 0000000..3ae5758 --- /dev/null +++ b/gcc/testsuite/gcc.dg/torture/pr52912.c @@ -0,0 +1,17 @@ +/* { dg-do compile } */ + +int a, b, c; +static int +fn1 (p1) +{ +lbl_549: + if (p1) + goto lbl_549; + return 0; +} + +void +fn2 () +{ + b = (c && a) > fn1 (c) >= c; +} diff --git a/gcc/tree-ssa-threadupdate.c b/gcc/tree-ssa-threadupdate.c index 687eee0..018092a 100644 --- a/gcc/tree-ssa-threadupdate.c +++ b/gcc/tree-ssa-threadupdate.c @@ -661,6 +661,13 @@ thread_block (basic_block bb, bool noloop_only) /* We do not update dominance info. */ free_dominance_info (CDI_DOMINATORS); + /* We know we only thread through the loop header to loop exits. + Let the basic block duplication hook know we are not creating + a multiple entry loop. */ + if (noloop_only + && bb == bb->loop_father->header) + set_loop_copy (bb->loop_father, loop_outer (bb->loop_father)); + /* Now create duplicates of BB. Note that for a block with a high outgoing degree we can waste @@ -692,6 +699,10 @@ thread_block (basic_block bb, bool noloop_only) htab_delete (redirection_data); redirection_data = NULL; + if (noloop_only + && bb == bb->loop_father->header) + set_loop_copy (bb->loop_father, NULL); + /* Indicate to our caller whether or not any jumps were threaded. */ return local_info.jumps_threaded; } |