OSDN Git Service

(copy_loop_body): Only copy VTOP note if it will end up
authorwilson <wilson@138bc75d-0d04-0410-961f-82ee72b054a4>
Tue, 11 Aug 1992 19:42:35 +0000 (19:42 +0000)
committerwilson <wilson@138bc75d-0d04-0410-961f-82ee72b054a4>
Tue, 11 Aug 1992 19:42:35 +0000 (19:42 +0000)
before a loop exit test.

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

gcc/unroll.c

index f8c2fca..18ab396 100644 (file)
@@ -1807,7 +1807,12 @@ copy_loop_body (copy_start, copy_end, map, exit_label, last_iteration,
          break;
          
        case NOTE:
-         if (NOTE_LINE_NUMBER (insn) != NOTE_INSN_DELETED)
+         /* VTOP notes are valid only before the loop exit test.  If placed
+            anywhere else, loop may generate bad code.  */
+            
+         if (NOTE_LINE_NUMBER (insn) != NOTE_INSN_DELETED
+             && (NOTE_LINE_NUMBER (insn) != NOTE_INSN_LOOP_VTOP
+                 || (last_iteration && unroll_type != UNROLL_COMPLETELY)))
            copy = emit_note (NOTE_SOURCE_FILE (insn),
                              NOTE_LINE_NUMBER (insn));
          else