* unroll.c (copy_loop_body): Don't copy VTOP notes from copy_notes_from.
authorJ"orn Rennecke <amylaar@cygnus.co.uk>
Wed, 5 May 1999 15:47:48 +0000 (15:47 +0000)
committerJoern Rennecke <amylaar@gcc.gnu.org>
Wed, 5 May 1999 15:47:48 +0000 (16:47 +0100)
From-SVN: r26786

gcc/ChangeLog
gcc/unroll.c

index a56814c51ad2a7841f6eabde58524fd337f74d15..e61f1541b66724d15874dfffca93765b88f9cbed 100644 (file)
@@ -1,3 +1,7 @@
+Wed May  5 23:44:15 1999  J"orn Rennecke <amylaar@cygnus.co.uk>
+
+       * unroll.c (copy_loop_body): Don't copy VTOP notes from copy_notes_from.
+
 Wed May  5 16:26:13 1999  Vladimir Makarov  <vmakarov@tofu.to.cygnus.com>
 
        * function.c (purge_addressof_replacements): Rename into
index f1080aae701f9ba8f0e5f8960ebb83bd860f1e62..7e584c961d065cee468532513d7bd1f2e0056848 100644 (file)
@@ -2193,9 +2193,17 @@ copy_loop_body (copy_start, copy_end, map, exit_label, last_iteration,
     {
       for (insn = copy_notes_from; insn != loop_end; insn = NEXT_INSN (insn))
        {
+         /* VTOP notes are valid only before the loop exit test.
+            If placed anywhere else, loop may generate bad code.
+            There is no need to test for NOTE_INSN_LOOP_CONT notes
+            here, since COPY_NOTES_FROM will be at most one or two (for cc0)
+            instructions before the last insn in the loop, and if the
+            end test is that short, there will be a VTOP note between
+            the CONT note and the test.  */
          if (GET_CODE (insn) == NOTE
              && NOTE_LINE_NUMBER (insn) != NOTE_INSN_DELETED
-             && NOTE_LINE_NUMBER (insn) != NOTE_INSN_BASIC_BLOCK)
+             && NOTE_LINE_NUMBER (insn) != NOTE_INSN_BASIC_BLOCK
+             && NOTE_LINE_NUMBER (insn) != NOTE_INSN_LOOP_VTOP)
            emit_note (NOTE_SOURCE_FILE (insn), NOTE_LINE_NUMBER (insn));
        }
     }