public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [patch] prevent .cfi_personality/.cfi_lsda on !dwarf eh configurations
@ 2017-11-30  9:26 Olivier Hainque
  2017-11-30 12:33 ` Eric Botcazou
                   ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: Olivier Hainque @ 2017-11-30  9:26 UTC (permalink / raw)
  To: GCC Patches

[-- Attachment #1: Type: text/plain, Size: 1013 bytes --]

Hello,

Bootstrap is currently broken with Ada on x86_64-windows using SEH exceptions,
with several stage2/stage3 object comparison failures like

  Bootstrap comparison failure!
  gcc/ada/ali-util.o differs
  gcc/ada/ali.o differs
  ...

(PR 81470)

The differences come from variations between -g and -g0 on the placement of
data attached to LDFCM labels, in particular those related to the emission of
.cfi_personality and .cfi_lsda by dwarf2out_do_cfi_startproc.

These aren't needed for SEH anyway, so the proposed patch just prevents the
generation of those .cfi notes if the target eh format isn't dwarf2.

We have used this for a couple of years on gcc-6, it cures the same
bootstrap failure on gcc-7, and bootstraps + regression-tests fine
with mainline on x86_64-linux.

OK to commit ?

2017-11-30  Tristan Gingold  <gingold@adacore.com>

        * dwarf2out.c (dwarf2out_do_cfi_startproc): Only emit
        .cfi_personality or .cfi_lsda if the eh data format is dwarf2.


[-- Attachment #2: cfi_startproc-nondwarf2.diff --]
[-- Type: application/octet-stream, Size: 682 bytes --]

diff --git a/gcc/dwarf2out.c b/gcc/dwarf2out.c
index 3d619b8..62b5c77 100644
--- a/gcc/dwarf2out.c
+++ b/gcc/dwarf2out.c
@@ -958,10 +958,16 @@ dwarf2out_do_cfi_startproc (bool second)
 {
   int enc;
   rtx ref;
-  rtx personality = get_personality_function (current_function_decl);
 
   fprintf (asm_out_file, "\t.cfi_startproc\n");
 
+  /* .cfi_personality and .cfi_lsda are only relevant to DWARF2
+     eh unwinders.  */
+  if (targetm_common.except_unwind_info (&global_options) != UI_DWARF2)
+    return;
+
+  rtx personality = get_personality_function (current_function_decl);
+
   if (personality)
     {
       enc = ASM_PREFERRED_EH_DATA_FORMAT (/*code=*/2, /*global=*/1);

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [patch] prevent .cfi_personality/.cfi_lsda on !dwarf eh configurations
  2017-11-30  9:26 [patch] prevent .cfi_personality/.cfi_lsda on !dwarf eh configurations Olivier Hainque
@ 2017-11-30 12:33 ` Eric Botcazou
  2017-11-30 14:13   ` Olivier Hainque
  2017-12-06 22:56 ` Olivier Hainque
  2017-12-07 22:57 ` Jeff Law
  2 siblings, 1 reply; 6+ messages in thread
From: Eric Botcazou @ 2017-11-30 12:33 UTC (permalink / raw)
  To: Olivier Hainque; +Cc: gcc-patches

> 2017-11-30  Tristan Gingold  <gingold@adacore.com>
> 
>         * dwarf2out.c (dwarf2out_do_cfi_startproc): Only emit
>         .cfi_personality or .cfi_lsda if the eh data format is dwarf2.

PR ada/81470 must be put on the first line to trigger xref in Bugzilla.

-- 
Eric Botcazou

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [patch] prevent .cfi_personality/.cfi_lsda on !dwarf eh configurations
  2017-11-30 12:33 ` Eric Botcazou
@ 2017-11-30 14:13   ` Olivier Hainque
  0 siblings, 0 replies; 6+ messages in thread
From: Olivier Hainque @ 2017-11-30 14:13 UTC (permalink / raw)
  To: Eric Botcazou; +Cc: gcc-patches


> On 30 Nov 2017, at 13:04, Eric Botcazou <ebotcazou@adacore.com> wrote:
> 
>> 2017-11-30  Tristan Gingold  <gingold@adacore.com>
>> 
>>        * dwarf2out.c (dwarf2out_do_cfi_startproc): Only emit
>>        .cfi_personality or .cfi_lsda if the eh data format is dwarf2.
> 
> PR ada/81470 must be put on the first line to trigger xref in Bugzilla.

Oh, indeed. Will add if the patch gets approved. Thanks!

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [patch] prevent .cfi_personality/.cfi_lsda on !dwarf eh configurations
  2017-11-30  9:26 [patch] prevent .cfi_personality/.cfi_lsda on !dwarf eh configurations Olivier Hainque
  2017-11-30 12:33 ` Eric Botcazou
@ 2017-12-06 22:56 ` Olivier Hainque
  2017-12-07 22:57 ` Jeff Law
  2 siblings, 0 replies; 6+ messages in thread
From: Olivier Hainque @ 2017-12-06 22:56 UTC (permalink / raw)
  To: GCC Patches; +Cc: Olivier Hainque, rainer

Hello,

ping for https://gcc.gnu.org/ml/gcc-patches/2017-11/msg02537.html

> On Nov 30, 2017, at 10:18 , Olivier Hainque <hainque@adacore.com> wrote:
> 
> Bootstrap is currently broken with Ada on x86_64-windows using SEH exceptions,

>        PR ada/81470 

>        * dwarf2out.c (dwarf2out_do_cfi_startproc): Only emit
>        .cfi_personality or .cfi_lsda if the eh data format is dwarf2.

Thanks much in advance!

With Kind Regards,

Olivier

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [patch] prevent .cfi_personality/.cfi_lsda on !dwarf eh configurations
  2017-11-30  9:26 [patch] prevent .cfi_personality/.cfi_lsda on !dwarf eh configurations Olivier Hainque
  2017-11-30 12:33 ` Eric Botcazou
  2017-12-06 22:56 ` Olivier Hainque
@ 2017-12-07 22:57 ` Jeff Law
  2017-12-08  9:43   ` Olivier Hainque
  2 siblings, 1 reply; 6+ messages in thread
From: Jeff Law @ 2017-12-07 22:57 UTC (permalink / raw)
  To: Olivier Hainque, GCC Patches

On 11/30/2017 02:18 AM, Olivier Hainque wrote:
> Hello,
> 
> Bootstrap is currently broken with Ada on x86_64-windows using SEH exceptions,
> with several stage2/stage3 object comparison failures like
> 
>   Bootstrap comparison failure!
>   gcc/ada/ali-util.o differs
>   gcc/ada/ali.o differs
>   ...
> 
> (PR 81470)
> 
> The differences come from variations between -g and -g0 on the placement of
> data attached to LDFCM labels, in particular those related to the emission of
> .cfi_personality and .cfi_lsda by dwarf2out_do_cfi_startproc.
> 
> These aren't needed for SEH anyway, so the proposed patch just prevents the
> generation of those .cfi notes if the target eh format isn't dwarf2.
> 
> We have used this for a couple of years on gcc-6, it cures the same
> bootstrap failure on gcc-7, and bootstraps + regression-tests fine
> with mainline on x86_64-linux.
> 
> OK to commit ?
> 
> 2017-11-30  Tristan Gingold  <gingold@adacore.com>
> 
>         * dwarf2out.c (dwarf2out_do_cfi_startproc): Only emit
>         .cfi_personality or .cfi_lsda if the eh data format is dwarf2.
> 
OK.
jeff

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [patch] prevent .cfi_personality/.cfi_lsda on !dwarf eh configurations
  2017-12-07 22:57 ` Jeff Law
@ 2017-12-08  9:43   ` Olivier Hainque
  0 siblings, 0 replies; 6+ messages in thread
From: Olivier Hainque @ 2017-12-08  9:43 UTC (permalink / raw)
  To: Jeff Law; +Cc: Olivier Hainque, GCC Patches


> On Dec 7, 2017, at 23:57 , Jeff Law <law@redhat.com> wrote:
> 
>>        * dwarf2out.c (dwarf2out_do_cfi_startproc): Only emit
>>        .cfi_personality or .cfi_lsda if the eh data format is dwarf2.
>> 
> OK.

Now in, thanks Jeff!

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2017-12-08  9:43 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-11-30  9:26 [patch] prevent .cfi_personality/.cfi_lsda on !dwarf eh configurations Olivier Hainque
2017-11-30 12:33 ` Eric Botcazou
2017-11-30 14:13   ` Olivier Hainque
2017-12-06 22:56 ` Olivier Hainque
2017-12-07 22:57 ` Jeff Law
2017-12-08  9:43   ` Olivier Hainque

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).