diff options
author | Sebastian Pop <s.pop@samsung.com> | 2015-08-28 15:36:58 -0500 |
---|---|---|
committer | Sebastian Pop <s.pop@samsung.com> | 2015-08-28 16:47:04 -0500 |
commit | fa0139c9969e54f37f0add025af87cc21b46ffcb (patch) | |
tree | 22bc0625401e4f1eb473c944b11bc9dadc48d2c2 /gcc-4.9/gcc/testsuite | |
parent | c39d2a2bd89ed7a9ff995f2fc1e2e693fab8ee9f (diff) | |
download | toolchain_gcc-fa0139c9969e54f37f0add025af87cc21b46ffcb.zip toolchain_gcc-fa0139c9969e54f37f0add025af87cc21b46ffcb.tar.gz toolchain_gcc-fa0139c9969e54f37f0add025af87cc21b46ffcb.tar.bz2 |
backport patch to fix PR65048
PR tree-optimization/65048
* tree-ssa-threadupdate.c (valid_jump_thread_path): New.
(thread_through_all_blocks): Call valid_jump_thread_path. Remove invalid
FSM jump-thread paths.
PR tree-optimization/65048
* gcc.dg/tree-ssa/ssa-dom-thread-9.c: New.
Diffstat (limited to 'gcc-4.9/gcc/testsuite')
-rw-r--r-- | gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ssa-dom-thread-9.c | 50 |
1 files changed, 50 insertions, 0 deletions
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ssa-dom-thread-9.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ssa-dom-thread-9.c new file mode 100644 index 0000000..6be4203 --- /dev/null +++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ssa-dom-thread-9.c @@ -0,0 +1,50 @@ +/* PR 65048 */ +/* { dg-do compile } */ +/* { dg-options "-O3" } */ + +int a, b, c, d; +void fn (void); + +int +foo (x) +{ + switch (x) + { + case 'A': + return 'T'; + case 'U': + return 'A'; + } +} + +void +bar (int x, int y) +{ + switch (c) + { + case 'U': + switch (x) + { + default: + fn (); + case 'G': + switch (y) + { + case 'A': + d = 7; + } + } + } +} + +void +baz (void) +{ + while (1) + { + a = foo (); + b = foo (); + bar (a, b); + } +} + |