]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
re PR rtl-optimization/16968 (loop optimizer miscompilation)
authorEric Botcazou <ebotcazou@gcc.gnu.org>
Sat, 18 Dec 2004 07:58:12 +0000 (07:58 +0000)
committerEric Botcazou <ebotcazou@gcc.gnu.org>
Sat, 18 Dec 2004 07:58:12 +0000 (07:58 +0000)
PR rtl-optimization/16968
* loop.c (scan_loop): Stop scanning the loop for movable
insns as soon as an optimization barrier is encountered.

From-SVN: r92350

gcc/ChangeLog
gcc/loop.c
gcc/testsuite/ChangeLog

index 99c53cb2de190036a6c1297ca75c222984ae0b1a..c0a6bd10ebd370b336beed679499ceaf8aa664e6 100644 (file)
@@ -1,3 +1,9 @@
+2004-12-18  Eric Botcazou  <ebotcazou@libertysurf.fr>
+
+       PR rtl-optimization/16968
+       * loop.c (scan_loop): Stop scanning the loop for movable
+       insns as soon as an optimization barrier is encountered.
+
 2004-12-16  H.J. Lu  <hongjiu.lu@intel.com>
 
        PR other/18508
index 5a47309b8e996b3406aaa35768baea2f128caf3d..7249e5fdd31a93995eb000193ae497906ad2520e 100644 (file)
@@ -765,6 +765,9 @@ scan_loop (struct loop *loop, int flags)
        in_libcall--;
       if (GET_CODE (p) == INSN)
        {
+         /* Do not scan past an optimization barrier.  */
+         if (GET_CODE (PATTERN (p)) == ASM_INPUT)
+           break;
          temp = find_reg_note (p, REG_LIBCALL, NULL_RTX);
          if (temp)
            in_libcall++;
index 4aba99a4f4c62da9b9357eee7cb60c5df2d73b60..505f5fa33707a9e6e1889d3948278146b6497416 100644 (file)
@@ -1,3 +1,7 @@
+2004-12-18  Jakub Jelinek  <jakub@redhat.com>
+
+       * gcc.c-torture/execute/20041218-1.c: New test.
+
 2004-12-17  Nathan Sidwell  <nathan@codesourcery.com>
 
        PR c++/18975