From 5363d9d949cf4e0527037cd1a7032fdd3f6964ed Mon Sep 17 00:00:00 2001 From: Jeff Law Date: Tue, 10 Jan 2017 13:55:59 -0700 Subject: [PATCH] re PR middle-end/77766 (wrong code at -O2 and -O3 in 64-bit mode on x86_64-linux-gnu (executable hangs)) PR tree-optimization/77766 PR tree-optimization/78856 * gcc.c-torture/execute/pr77766.c: New test. From-SVN: r244287 --- gcc/testsuite/ChangeLog | 6 ++++ gcc/testsuite/gcc.c-torture/execute/pr77766.c | 28 +++++++++++++++++++ 2 files changed, 34 insertions(+) create mode 100644 gcc/testsuite/gcc.c-torture/execute/pr77766.c diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index bc86b4f37de..009d32d730a 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,9 @@ +2017-01-10 Jeff Law + + PR tree-optimization/77766 + PR tree-optimization/78856 + * gcc.c-torture/execute/pr77766.c: New test. + 2016-01-10 Richard Biener PR tree-optimization/79034 diff --git a/gcc/testsuite/gcc.c-torture/execute/pr77766.c b/gcc/testsuite/gcc.c-torture/execute/pr77766.c new file mode 100644 index 00000000000..f8f61ad0f7b --- /dev/null +++ b/gcc/testsuite/gcc.c-torture/execute/pr77766.c @@ -0,0 +1,28 @@ +char a; +short b, d = 5, h; +char c[1]; +int e, f = 4, g, j; +int main() { + int i; + for (; f; f = a) { + g = 0; + for (; g <= 32; ++g) { + i = 0; + for (; i < 3; i++) + while (1 > d) + if (c[b]) + break; + L: + if (j) + break; + } + } + e = 0; + for (; e; e = 0) { + d++; + for (; h;) + goto L; + } + return 0; +} + -- 2.30.2