This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: Query about the TREE_TYPE field
- From: Andrew MacLeod <amacleod at redhat dot com>
- To: Jeff Law <law at redhat dot com>, Jason Merrill <jason at redhat dot com>, GCC <gcc at gcc dot gnu dot org>, gcc-patches <gcc-patches at gcc dot gnu dot org>
- Cc: Richard Biener <richard dot guenther at gmail dot com>
- Date: Tue, 18 Nov 2014 14:32:58 -0500
- Subject: Re: Query about the TREE_TYPE field
- Authentication-results: sourceware.org; auth=none
- References: <546B572F dot 7070103 at redhat dot com> <546B5A64 dot 3080807 at redhat dot com> <546B5D2B dot 2000208 at redhat dot com> <546B7414 dot 3070500 at redhat dot com> <546B91C0 dot 1080904 at redhat dot com>
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
* 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