]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
darwin - backport r263763 to fix PR81033
authorIain Sandoe <iain@sandoe.co.uk>
Mon, 26 Nov 2018 19:49:19 +0000 (19:49 +0000)
committerIain Sandoe <iains@gcc.gnu.org>
Mon, 26 Nov 2018 19:49:19 +0000 (19:49 +0000)
2018-11-26  Iain Sandoe  <iain@sandoe.co.uk>

Backport from mainline
2018-08-22  Iain Sandoe  <iain@sandoe.co.uk>

PR bootstrap/81033
PR target/81733
PR target/52795
* gcc/dwarf2out.c (FUNC_SECOND_SECT_LABEL): New.
(dwarf2out_switch_text_section): Generate a local label for the second
function sub-section and apply it as the second FDE start label.
* gcc/final.c (final_scan_insn_1): Emit second FDE label after the second
sub-section start.

From-SVN: r266478

gcc/ChangeLog
gcc/dwarf2out.c
gcc/final.c

index 8e19a157538e637276ba65284140a56eeecba3e9..2c82d0793f97e74dbd27bb8c04670b30fa15da9e 100644 (file)
@@ -1,6 +1,19 @@
 2018-11-26  Iain Sandoe  <iain@sandoe.co.uk>
 
        Backport from mainline
+       2018-08-22  Iain Sandoe  <iain@sandoe.co.uk>
+
+       PR bootstrap/81033
+       PR target/81733
+       PR target/52795
+       * gcc/dwarf2out.c (FUNC_SECOND_SECT_LABEL): New.
+       (dwarf2out_switch_text_section): Generate a local label for the second
+       function sub-section and apply it as the second FDE start label.
+       * gcc/final.c (final_scan_insn_1): Emit second FDE label after the second
+       sub-section start.
+
+2018-11-26  Iain Sandoe  <iain@sandoe.co.uk>
+
        2018-08-15  Iain Sandoe  <iain@sandoe.co.uk>
  
        * config/darwin.c
index 600bc36a3e99fcae55bde44438f81280540f8509..5223e3b2fb4395e96cd636d87ac7dabb8cedb450 100644 (file)
@@ -297,6 +297,10 @@ static unsigned int rnglist_idx;
 #define FUNC_BEGIN_LABEL       "LFB"
 #endif
 
+#ifndef FUNC_SECOND_SECT_LABEL
+#define FUNC_SECOND_SECT_LABEL "LFSB"
+#endif
+
 #ifndef FUNC_END_LABEL
 #define FUNC_END_LABEL         "LFE"
 #endif
@@ -1200,21 +1204,24 @@ static void set_cur_line_info_table (section *);
 void
 dwarf2out_switch_text_section (void)
 {
+  char label[MAX_ARTIFICIAL_LABEL_BYTES];
   section *sect;
   dw_fde_ref fde = cfun->fde;
 
   gcc_assert (cfun && fde && fde->dw_fde_second_begin == NULL);
 
+  ASM_GENERATE_INTERNAL_LABEL (label, FUNC_SECOND_SECT_LABEL,
+                              current_function_funcdef_no);
+
+  fde->dw_fde_second_begin = ggc_strdup (label);
   if (!in_cold_section_p)
     {
       fde->dw_fde_end = crtl->subsections.cold_section_end_label;
-      fde->dw_fde_second_begin = crtl->subsections.hot_section_label;
       fde->dw_fde_second_end = crtl->subsections.hot_section_end_label;
     }
   else
     {
       fde->dw_fde_end = crtl->subsections.hot_section_end_label;
-      fde->dw_fde_second_begin = crtl->subsections.cold_section_label;
       fde->dw_fde_second_end = crtl->subsections.cold_section_end_label;
     }
   have_multiple_function_sections = true;
index 20af67816bb1168ae53e475885328200ec5b425e..c3023285c216d15e937d0fc70c55b2a6eb5728cc 100644 (file)
@@ -2232,6 +2232,9 @@ final_scan_insn (rtx_insn *insn, FILE *file, int optimize_p ATTRIBUTE_UNUSED,
              ASM_OUTPUT_LABEL (asm_out_file,
                                IDENTIFIER_POINTER (cold_function_name));
 #endif
+             if (dwarf2out_do_frame ()
+                 && cfun->fde->dw_fde_second_begin != NULL)
+               ASM_OUTPUT_LABEL (asm_out_file, cfun->fde->dw_fde_second_begin);
            }
          break;