From 65f8bbbcc74a4777f0629190ea9121fc94a79257 Mon Sep 17 00:00:00 2001 From: Sebastian Pop Date: Fri, 28 Aug 2015 15:51:12 -0500 Subject: backport fix for PR65735 PR tree-optimization/65735 * tree-ssa-threadedge.c (fsm_find_control_statement_thread_paths): Remove visited_phis argument, add visited_bbs, avoid recursing into the same bb rather than just into the same phi node. (thread_through_normal_block): Adjust caller. * gcc.c-torture/compile/pr65735.c: New test. --- .../gcc/testsuite/gcc.c-torture/compile/pr65735.c | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 gcc-4.9/gcc/testsuite/gcc.c-torture/compile/pr65735.c (limited to 'gcc-4.9/gcc/testsuite/gcc.c-torture') diff --git a/gcc-4.9/gcc/testsuite/gcc.c-torture/compile/pr65735.c b/gcc-4.9/gcc/testsuite/gcc.c-torture/compile/pr65735.c new file mode 100644 index 000000000..c30de8ea3 --- /dev/null +++ b/gcc-4.9/gcc/testsuite/gcc.c-torture/compile/pr65735.c @@ -0,0 +1,21 @@ +/* PR tree-optimization/65735 */ + +int foo (void); + +void +bar (int a, int b, int c) +{ + while (!a) + { + c = foo (); + if (c == 7) + c = b; + switch (c) + { + case 1: + a = b++; + if (b) + b = 1; + } + } +} -- cgit v1.2.3