]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
re PR other/22313 (profiledbootstrap is broken on the mainline)
authorRoger Sayle <roger@eyesopen.com>
Thu, 31 Aug 2006 17:35:32 +0000 (17:35 +0000)
committerRoger Sayle <sayle@gcc.gnu.org>
Thu, 31 Aug 2006 17:35:32 +0000 (17:35 +0000)
PR other/22313
* dwarf2out.c (add_fde_cfi): Use a set_loc if the current label is
NULL, otherwise use an advance_loc4 to adjust relative to the
current label.
(output_cfi) <DW_CFA_set_loc>: Update the current label.
(dwarf2out_switch_text_section): Reset the current label to avoid
using advance_loc4 over section boundaries.

From-SVN: r116604

gcc/ChangeLog
gcc/dwarf2out.c

index 8f1fd3476169b745b64c64d94ae6f5800d1e9e38..7a6c3e167b9baa563e3b9c6ad21ce7e9241c8f30 100644 (file)
@@ -1,3 +1,13 @@
+2006-08-31  Roger Sayle  <roger@eyesopen.com>
+
+       PR other/22313
+       * dwarf2out.c (add_fde_cfi): Use a set_loc if the current label is
+       NULL, otherwise use an advance_loc4 to adjust relative to the 
+       current label.
+       (output_cfi) <DW_CFA_set_loc>: Update the current label.
+       (dwarf2out_switch_text_section): Reset the current label to avoid
+       using advance_loc4 over section boundaries.
+
 2006-08-31  Andreas Krebbel  <krebbel1@de.ibm.com>
 
        PR target/24367
index 76fd7f07f9e82c9df97c42e077e3f947d66f74c3..9342236966deac5ee6b3abb361d6452daad86481 100644 (file)
@@ -628,13 +628,19 @@ add_fde_cfi (const char *label, dw_cfi_ref cfi)
        {
          dw_cfi_ref xcfi;
 
-         fde->dw_fde_current_label = label = xstrdup (label);
+         label = xstrdup (label);
 
          /* Set the location counter to the new label.  */
          xcfi = new_cfi ();
-         xcfi->dw_cfi_opc = DW_CFA_advance_loc4;
+         /* If we have a current label, advance from there, otherwise
+            set the location directly using set_loc.  */
+         xcfi->dw_cfi_opc = fde->dw_fde_current_label
+                            ? DW_CFA_advance_loc4
+                            : DW_CFA_set_loc;
          xcfi->dw_cfi_oprnd1.dw_cfi_addr = label;
          add_cfi (&fde->dw_fde_cfi, xcfi);
+
+         fde->dw_fde_current_label = label;
        }
 
       add_cfi (&fde->dw_fde_cfi, cfi);
@@ -2069,6 +2075,7 @@ output_cfi (dw_cfi_ref cfi, dw_fde_ref fde, int for_eh)
          else
            dw2_asm_output_addr (DWARF2_ADDR_SIZE,
                                 cfi->dw_cfi_oprnd1.dw_cfi_addr, NULL);
+         fde->dw_fde_current_label = cfi->dw_cfi_oprnd1.dw_cfi_addr;
          break;
 
        case DW_CFA_advance_loc1:
@@ -6919,6 +6926,10 @@ dwarf2out_switch_text_section (void)
   fde->dw_fde_unlikely_section_label = cfun->cold_section_label;
   fde->dw_fde_unlikely_section_end_label = cfun->cold_section_end_label;
   have_multiple_function_sections = true;
+
+  /* Reset the current label on switching text sections, so that we
+     don't attempt to advance_loc4 between labels in different sections.  */
+  fde->dw_fde_current_label = NULL;
 }
 
 /* Output the location list given to us.  */