cfglayout.c (insn_locators_initialize): Update the current location before initializi...
authorNathan Sidwell <nathan@codesourcery.com>
Wed, 4 Aug 2004 11:30:31 +0000 (11:30 +0000)
committerNathan Sidwell <nathan@gcc.gnu.org>
Wed, 4 Aug 2004 11:30:31 +0000 (11:30 +0000)
* cfglayout.c (insn_locators_initialize): Update the current
location before initializing a location.

From-SVN: r85554

gcc/ChangeLog
gcc/cfglayout.c

index c08e8d219b7e810feb7f79f81cf4ee0aa343c960..c6ee6602ceac9af7217501ada6e95410283f9014 100644 (file)
@@ -1,3 +1,8 @@
+2004-08-04  Nathan Sidwell  <nathan@codesourcery.com>
+
+       * cfglayout.c (insn_locators_initialize): Update the current
+       location before initializing a location.
+
 2004-08-03  Zack Weinberg  <zack@codesourcery.com>
 
        * dbxout.c (dbxout_function_decl): Always call dbxout_function_end.
index a81ce4c7f8cafc8029b85906015b1bee4867cfda..b805ae5bda996c272d7e9385fb248581da3c4a53 100644 (file)
@@ -267,12 +267,38 @@ insn_locators_initialize (void)
 
   for (insn = get_insns (); insn; insn = next)
     {
+      int active = 0;
+      
       next = NEXT_INSN (insn);
 
-      if ((active_insn_p (insn)
-          && GET_CODE (PATTERN (insn)) != ADDR_VEC
-          && GET_CODE (PATTERN (insn)) != ADDR_DIFF_VEC)
-         || !NEXT_INSN (insn)
+      if (NOTE_P (insn))
+       {
+         switch (NOTE_LINE_NUMBER (insn))
+           {
+           case NOTE_INSN_BLOCK_BEG:
+           case NOTE_INSN_BLOCK_END:
+             abort ();
+             
+           default:
+             if (NOTE_LINE_NUMBER (insn) > 0)
+               {
+                 expanded_location xloc;
+                 NOTE_EXPANDED_LOCATION (xloc, insn);
+                 line_number = xloc.line;
+                 file_name = xloc.file;
+               }
+             break;
+           }
+       }
+      else
+       active = (active_insn_p (insn)
+                 && GET_CODE (PATTERN (insn)) != ADDR_VEC
+                 && GET_CODE (PATTERN (insn)) != ADDR_DIFF_VEC);
+      
+      check_block_change (insn, &block);
+
+      if (active
+         || !next
          || (!prologue_locator && file_name))
        {
          if (last_block != block)
@@ -296,34 +322,13 @@ insn_locators_initialize (void)
              VARRAY_PUSH_CHAR_PTR (file_locators_files, (char *) file_name);
              last_file_name = file_name;
            }
+         if (!prologue_locator && file_name)
+           prologue_locator = loc;
+         if (!next)
+           epilogue_locator = loc;
+         if (active)
+           INSN_LOCATOR (insn) = loc;
        }
-      if (!prologue_locator && file_name)
-       prologue_locator = loc;
-      if (!NEXT_INSN (insn))
-       epilogue_locator = loc;
-      if (active_insn_p (insn))
-        INSN_LOCATOR (insn) = loc;
-      else if (NOTE_P (insn))
-       {
-         switch (NOTE_LINE_NUMBER (insn))
-           {
-           case NOTE_INSN_BLOCK_BEG:
-           case NOTE_INSN_BLOCK_END:
-             abort ();
-
-           default:
-             if (NOTE_LINE_NUMBER (insn) > 0)
-               {
-                 expanded_location xloc;
-                 NOTE_EXPANDED_LOCATION (xloc, insn);
-                 line_number = xloc.line;
-                 file_name = xloc.file;
-               }
-             break;
-           }
-       }
-
-      check_block_change (insn, &block);
     }
 
   /* Tag the blocks with a depth number so that change_scope can find