[debug-early] Allow checking of DECL_ABSTRACT in decl_ultimate_origin
diff mbox

Message ID 541C4C97.2010503@redhat.com
State New
Headers show

Commit Message

Aldy Hernandez Sept. 19, 2014, 3:32 p.m. UTC
Michael, I really don't understand the need for this change in your 
original patch.  I don't know if this was a temporary testing change or 
what.

For instance, you had the following commented out in your original patch:

   if (/*DECL_ABSTRACT (decl) &&*/ DECL_ABSTRACT_ORIGIN (decl) == decl)
      return NULL_TREE;

but then you also had:

  tree origin = decl_ultimate_origin (decl);
<snip>
<snip>
-  if (origin != NULL)
+  if (origin != NULL && origin != decl)

It seems to me that if origin is not null, then "origin != decl" will 
always be true, since with your change, decl_ultimate_origin() will 
always return NULL when DECL_ABSTRACT_ORIGIN (decl) == decl.

I suppose your /*DECL_ABSTRACT (decl) &&*/ change could be used in other 
uses of decl_ultimate_origin() that don't have this "&& origin != decl" 
business.

Anyway... I don't understand the need for it (actually, to be honest, I 
don't understand what you were trying to do).  I'm going to remove it.

If you feel strongly about it, please chime in, and perhaps provide an 
explanation so I can include a comment.

I'm happy to report that with this and the last set of patches, both C 
and C++ guality tests have <= regressions than mainline.  Yay.

Committing to mainline.

Thanks.
Aldy
commit 7254ec0893f9b56a0ba78de9eab8895c9582c24b
Author: Aldy Hernandez <aldyh@redhat.com>
Date:   Thu Sep 18 16:54:39 2014 -0600

    	* dwarf2out.c (decl_ultimate_origin): Allow checking of
    	DECL_ABSTRACT.

Comments

Michael Matz Sept. 22, 2014, 2:17 p.m. UTC | #1
Hi,

On Fri, 19 Sep 2014, Aldy Hernandez wrote:

> Michael, I really don't understand the need for this change in your original
> patch.  I don't know if this was a temporary testing change or what.

I'm pretty sure it was temporary testing, when I still was finding my way 
through dwarf2out limitations/constraints.

> I'm happy to report that with this and the last set of patches, both C 
> and C++ guality tests have <= regressions than mainline.  Yay.

Super.


Ciao,
Michael.
Aldy Hernandez Sept. 22, 2014, 3:44 p.m. UTC | #2
On 09/22/14 08:17, Michael Matz wrote:
> Hi,
>
> On Fri, 19 Sep 2014, Aldy Hernandez wrote:
>
>> Michael, I really don't understand the need for this change in your original
>> patch.  I don't know if this was a temporary testing change or what.
>
> I'm pretty sure it was temporary testing, when I still was finding my way
> through dwarf2out limitations/constraints.

Ah perfect!

>
>> I'm happy to report that with this and the last set of patches, both C
>> and C++ guality tests have <= regressions than mainline.  Yay.
>
> Super.

Again, thank you for your original patchset, which has immensely helped 
me navigate my way around the black box which was/is dwarf2out.

Aldy

Patch
diff mbox

diff --git a/gcc/dwarf2out.c b/gcc/dwarf2out.c
index f6c7f4a..68b4650 100644
--- a/gcc/dwarf2out.c
+++ b/gcc/dwarf2out.c
@@ -3683,7 +3683,7 @@  decl_ultimate_origin (const_tree decl)
   /* output_inline_function sets DECL_ABSTRACT_ORIGIN for all the
      nodes in the function to point to themselves; ignore that if
      we're trying to output the abstract instance of this function.  */
-  if (/*DECL_ABSTRACT (decl) &&*/ DECL_ABSTRACT_ORIGIN (decl) == decl)
+  if (DECL_ABSTRACT (decl) && DECL_ABSTRACT_ORIGIN (decl) == decl)
     return NULL_TREE;
 
   /* Since the DECL_ABSTRACT_ORIGIN for a DECL is supposed to be the