aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMark Mitchell <mark@codesourcery.com>2004-08-24 01:45:23 +0000
committerMark Mitchell <mmitchel@gcc.gnu.org>2004-08-24 01:45:23 +0000
commita9b5a054c9f01420bb53f371cdc32ee622e12041 (patch)
treec9d083c24be88a20dabd512ccffb4d44c044050a
parent2e6ae27f33e22dd7781dafd2e27f319489613372 (diff)
downloadgcc-a9b5a054c9f01420bb53f371cdc32ee622e12041.zip
gcc-a9b5a054c9f01420bb53f371cdc32ee622e12041.tar.gz
gcc-a9b5a054c9f01420bb53f371cdc32ee622e12041.tar.bz2
re PR rtl-optimization/16180 (gcc crashes when optimization is turned on)
PR c/16180 * jump.c (duplicate_loop_exit_test): If the location reached by the unconditional jump at the top of the loop is outside the loop, then do not treat it as the exit test. PR c/16180 * gcc.dg/loop-5.c: New test. From-SVN: r86459
-rw-r--r--gcc/testsuite/ChangeLog5
-rw-r--r--gcc/testsuite/gcc.dg/loop-5.c16
2 files changed, 21 insertions, 0 deletions
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index 617aee6..7a3fde2 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -1,3 +1,8 @@
+2004-08-23 Mark Mitchell <mark@codesourcery.com>
+
+ PR c/16180
+ * gcc.dg/loop-5.c: New test.
+
2004-08-23 Zdenek Dvorak <rakdver@atrey.karlin.mff.cuni.cz>
* gcc.c-torture/execute/20040823-1.c: New test.
diff --git a/gcc/testsuite/gcc.dg/loop-5.c b/gcc/testsuite/gcc.dg/loop-5.c
new file mode 100644
index 0000000..198823b
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/loop-5.c
@@ -0,0 +1,16 @@
+/* PR c/16180 */
+/* { dg-options "-O2" } */
+
+extern int b;
+int foo (int a)
+{
+ if (a)
+ {
+ b = 0;
+ for(;;)
+ goto L;
+ }
+ L:
+ for(;;)
+ return 0;
+}