public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [PATCH] Fix PR82144
@ 2017-09-12 13:46 Richard Biener
  2017-09-21 12:17 ` Richard Biener
  0 siblings, 1 reply; 4+ messages in thread
From: Richard Biener @ 2017-09-12 13:46 UTC (permalink / raw)
  To: gcc-patches; +Cc: aoliva


The following avoids adding DW_AT_alignment twice by not doing it
for incomplete types.

Bootstrapped on x86_64-unknown-linux-gnu, testing in progress.

Alex, is that ok or do we want DW_AT_alignment for incomplete types as 
well?

Thanks,
Richard.

2017-09-12  Richard Biener  <rguenther@suse.de>

	PR middle-end/82144
	* dwarf2out.c (gen_enumeration_type_die): Do not add alignment
	attribute for incomplete types nor twice for complete ones.

Index: gcc/dwarf2out.c
===================================================================
--- gcc/dwarf2out.c	(revision 252002)
+++ gcc/dwarf2out.c	(working copy)
@@ -21258,8 +21258,6 @@ gen_enumeration_type_die (tree type, dw_
   else
     add_AT_flag (type_die, DW_AT_declaration, 1);
 
-  add_alignment_attribute (type_die, type);
-
   add_pubtype (type, type_die);
 
   return type_die;

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

* Re: [PATCH] Fix PR82144
  2017-09-12 13:46 [PATCH] Fix PR82144 Richard Biener
@ 2017-09-21 12:17 ` Richard Biener
  2017-09-22 20:38   ` Alexandre Oliva
  0 siblings, 1 reply; 4+ messages in thread
From: Richard Biener @ 2017-09-21 12:17 UTC (permalink / raw)
  To: gcc-patches; +Cc: aoliva

On Tue, 12 Sep 2017, Richard Biener wrote:

> 
> The following avoids adding DW_AT_alignment twice by not doing it
> for incomplete types.
> 
> Bootstrapped on x86_64-unknown-linux-gnu, testing in progress.
> 
> Alex, is that ok or do we want DW_AT_alignment for incomplete types as 
> well?

Alex, ping?

Thanks,
Richard.

> 2017-09-12  Richard Biener  <rguenther@suse.de>
> 
> 	PR middle-end/82144
> 	* dwarf2out.c (gen_enumeration_type_die): Do not add alignment
> 	attribute for incomplete types nor twice for complete ones.
> 
> Index: gcc/dwarf2out.c
> ===================================================================
> --- gcc/dwarf2out.c	(revision 252002)
> +++ gcc/dwarf2out.c	(working copy)
> @@ -21258,8 +21258,6 @@ gen_enumeration_type_die (tree type, dw_
>    else
>      add_AT_flag (type_die, DW_AT_declaration, 1);
>  
> -  add_alignment_attribute (type_die, type);
> -
>    add_pubtype (type, type_die);
>  
>    return type_die;

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

* Re: [PATCH] Fix PR82144
  2017-09-21 12:17 ` Richard Biener
@ 2017-09-22 20:38   ` Alexandre Oliva
  2017-09-25  7:25     ` Richard Biener
  0 siblings, 1 reply; 4+ messages in thread
From: Alexandre Oliva @ 2017-09-22 20:38 UTC (permalink / raw)
  To: Richard Biener; +Cc: gcc-patches

On Sep 21, 2017, Richard Biener <rguenther@suse.de> wrote:

> On Tue, 12 Sep 2017, Richard Biener wrote:
>> 
>> The following avoids adding DW_AT_alignment twice by not doing it
>> for incomplete types.
>> 
>> Bootstrapped on x86_64-unknown-linux-gnu, testing in progress.
>> 
>> Alex, is that ok or do we want DW_AT_alignment for incomplete types as 
>> well?

> Alex, ping?

Sorry, still catching up after Cauldron and recovery from the bug I
caught at the conference ;-)

Since incomplete enum types are non-standard, there's no standard to
guide us.  Pointers (the primary viable use of such types) generally
benefit from alignment information, but I don't see how the alignment
could be meaningfully determined for such types.  For debug information,
we're probably better off leaving any tentative or uninitialized
alignment information out of the DIE, so the patch looks good to me.
Thanks for your patience!

Reviewed-by: Alexandre Oliva <aoliva@redhat.com>

>> PR middle-end/82144
>> * dwarf2out.c (gen_enumeration_type_die): Do not add alignment
>> attribute for incomplete types nor twice for complete ones.

-- 
Alexandre Oliva, freedom fighter    http://FSFLA.org/~lxoliva/
You must be the change you wish to see in the world. -- Gandhi
Be Free! -- http://FSFLA.org/   FSF Latin America board member
Free Software Evangelist|Red Hat Brasil GNU Toolchain Engineer

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

* Re: [PATCH] Fix PR82144
  2017-09-22 20:38   ` Alexandre Oliva
@ 2017-09-25  7:25     ` Richard Biener
  0 siblings, 0 replies; 4+ messages in thread
From: Richard Biener @ 2017-09-25  7:25 UTC (permalink / raw)
  To: Alexandre Oliva; +Cc: gcc-patches

On Fri, 22 Sep 2017, Alexandre Oliva wrote:

> On Sep 21, 2017, Richard Biener <rguenther@suse.de> wrote:
> 
> > On Tue, 12 Sep 2017, Richard Biener wrote:
> >> 
> >> The following avoids adding DW_AT_alignment twice by not doing it
> >> for incomplete types.
> >> 
> >> Bootstrapped on x86_64-unknown-linux-gnu, testing in progress.
> >> 
> >> Alex, is that ok or do we want DW_AT_alignment for incomplete types as 
> >> well?
> 
> > Alex, ping?
> 
> Sorry, still catching up after Cauldron and recovery from the bug I
> caught at the conference ;-)
> 
> Since incomplete enum types are non-standard, there's no standard to
> guide us.  Pointers (the primary viable use of such types) generally
> benefit from alignment information, but I don't see how the alignment
> could be meaningfully determined for such types.  For debug information,
> we're probably better off leaving any tentative or uninitialized
> alignment information out of the DIE, so the patch looks good to me.
> Thanks for your patience!

Thanks, applied as rev. 253134.

Richard.

> Reviewed-by: Alexandre Oliva <aoliva@redhat.com>
> 
> >> PR middle-end/82144
> >> * dwarf2out.c (gen_enumeration_type_die): Do not add alignment
> >> attribute for incomplete types nor twice for complete ones.
> 
> 

-- 
Richard Biener <rguenther@suse.de>
SUSE LINUX GmbH, GF: Felix Imendoerffer, Jane Smithard, Graham Norton, HRB 21284 (AG Nuernberg)

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

end of thread, other threads:[~2017-09-25  7:25 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-09-12 13:46 [PATCH] Fix PR82144 Richard Biener
2017-09-21 12:17 ` Richard Biener
2017-09-22 20:38   ` Alexandre Oliva
2017-09-25  7:25     ` Richard Biener

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).