diff mbox

Query about the TREE_TYPE field

Message ID 546B9EEA.2060102@redhat.com
State New
Headers show

Commit Message

Andrew MacLeod Nov. 18, 2014, 7:32 p.m. UTC
On 11/18/2014 01:36 PM, Jeff Law wrote:
> On 11/18/14 09:30, Andrew MacLeod wrote:
>
>> I tried doing the if before chaning to TREE_TYPE...  absolutely no
>> effect on the testsuite or anything else :-)
>>
>> What do you think, should I check this in?   What is there is clearly
>> incorrect.    we could also revert the original patch since that is what
>> the code base is effectively is doing at the moment...
> What I tend to do in these situations is roll back to the version 
> prior to the "fix" and try the testcase with that compiler.  Then I 
> can walk through under GDB control to find out whatever I need.
>
> Clearly something needs to change here, but the question is what :-) 
> And I think rolling back and debugging that compiler is the best way 
> to know get more information to allow this to move forward.

 From 2008. gah.  anyway, Doesn't help.   The code snippet never 
triggers. The function is called 240 times on the testcase, and each 
time its a FUNCTION_DECL, which becomes a FUNCTION_TYPE when we take 
TREE_TYPE.

Test testcase ICE's before and after the change.

So it effectively does nothing.   Unless Jason can think of a good 
reason for it, we probably ought to turf it.  Its effectively a NOP.

Andrew

Comments

Jason Merrill Nov. 18, 2014, 8:47 p.m. UTC | #1
On 11/18/2014 02:32 PM, Andrew MacLeod wrote:
> So it effectively does nothing.   Unless Jason can think of a good
> reason for it, we probably ought to turf it.  Its effectively a NOP.

Yeah, go ahead.

Jason
diff mbox

Patch

	* attribs.c: Remove always true condition, as TREE_TYPE(x) will never
	compare equal to a TYPE_DECL.

Index: attribs.c
===================================================================
*** attribs.c	(revision 217234)
--- attribs.c	(working copy)
*************** decl_attributes (tree *node, tree attrib
*** 502,512 ****
        if (spec->type_required && DECL_P (*anode))
  	{
  	  anode = &TREE_TYPE (*anode);
! 	  /* Allow ATTR_FLAG_TYPE_IN_PLACE for the type's naming decl.  */
! 	  if (!(TREE_CODE (*anode) == TYPE_DECL
! 		&& *anode == TYPE_NAME (TYPE_MAIN_VARIANT
! 					(TREE_TYPE (*anode)))))
! 	    flags &= ~(int) ATTR_FLAG_TYPE_IN_PLACE;
  	}
  
        if (spec->function_type_required && TREE_CODE (*anode) != FUNCTION_TYPE
--- 502,508 ----
        if (spec->type_required && DECL_P (*anode))
  	{
  	  anode = &TREE_TYPE (*anode);
! 	  flags &= ~(int) ATTR_FLAG_TYPE_IN_PLACE;
  	}
  
        if (spec->function_type_required && TREE_CODE (*anode) != FUNCTION_TYPE