OSDN Git Service

PR c/16180
authormmitchel <mmitchel@138bc75d-0d04-0410-961f-82ee72b054a4>
Tue, 24 Aug 2004 01:45:23 +0000 (01:45 +0000)
committermmitchel <mmitchel@138bc75d-0d04-0410-961f-82ee72b054a4>
Tue, 24 Aug 2004 01:45:23 +0000 (01:45 +0000)
* 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.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@86459 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/testsuite/ChangeLog
gcc/testsuite/gcc.dg/loop-5.c [new file with mode: 0644]

index 617aee6..7a3fde2 100644 (file)
@@ -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.
 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 (file)
index 0000000..198823b
--- /dev/null
@@ -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;
+}