diff options
author | Jeff Law <law@redhat.com> | 2016-03-11 15:32:11 -0700 |
---|---|---|
committer | Jeff Law <law@gcc.gnu.org> | 2016-03-11 15:32:11 -0700 |
commit | cebde9e9ebb9b9a29f2b6cd07b14fd88089f088f (patch) | |
tree | 1c289de319b6b0e834082080de232185abce2ed8 /gcc/tree-ssa-threadbackward.c | |
parent | 015782a5aea37b0cd80b5f1888988d5c79398b81 (diff) | |
download | gcc-cebde9e9ebb9b9a29f2b6cd07b14fd88089f088f.zip gcc-cebde9e9ebb9b9a29f2b6cd07b14fd88089f088f.tar.gz gcc-cebde9e9ebb9b9a29f2b6cd07b14fd88089f088f.tar.bz2 |
re PR tree-optimization/70190 (ICE (segfault) at -O2 and -O3 on x86_64-linux-gnu)
PR tree-optimization/70190
* tree-ssa-threadbackward.c (fsm_find_control_statement_thread_paths):
Handle cases where we can not extract the taken edge, even though we
found a constant value.
PR tree-optimization/70190
* gcc.c-torture/compile/pr70190.c: New test.
From-SVN: r234151
Diffstat (limited to 'gcc/tree-ssa-threadbackward.c')
-rw-r--r-- | gcc/tree-ssa-threadbackward.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/gcc/tree-ssa-threadbackward.c b/gcc/tree-ssa-threadbackward.c index 6f1b757..88f8d5e 100644 --- a/gcc/tree-ssa-threadbackward.c +++ b/gcc/tree-ssa-threadbackward.c @@ -385,6 +385,16 @@ fsm_find_control_statement_thread_paths (tree name, We have to know the outgoing edge to figure this out. */ edge taken_edge = find_taken_edge ((*path)[0], arg); + + /* There are cases where we may not be able to extract the + taken edge. For example, a computed goto to an absolute + address. Handle those cases gracefully. */ + if (taken_edge == NULL) + { + path->pop (); + continue; + } + bool creates_irreducible_loop = false; if (threaded_through_latch && loop == taken_edge->dest->loop_father |