This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: C++ PATCH: Remove THUNK_DECLs
>>>>> Mark Mitchell <mark@codesourcery.com> writes:
>>>>> "Jason" == Jason Merrill <jason@cygnus.com> writes:
Jason> I don't think this is safe. The reason for using a
> When we hand thunks to the back-end for emission, in the generic
> thunks case, all of these things have to be right anyhow.
But by that point we don't need the thunk information anymore, and we turn
the _DECL back into a normal-looking FUNCTION_DECL. Or at least we should.
> The points you raise are, however, quite scary. There are indeed
> other cases where there could be trouble.
> I think we have no pleasant choice. I don't relish trying to teach
> the back-end about THUNK_DECLs, either explicitly or via hooks in
> `staticp' and all similar functions.
> I will think about this. I would welcome patches/suggestions. And,
> of course, I'll fix any bug reports that relate to this.
How about this, instead? Or moving the thunk info into DECL_LANG_SPECIFIC
as I suggested in my last mail?
Jason
2000-05-03 Jason Merrill <jason@casey.cygnus.com>
* tree.c (staticp): Assume that language-specific decls are static.
Index: tree.c
===================================================================
RCS file: /cvs/gcc/egcs/gcc/tree.c,v
retrieving revision 1.140
diff -c -p -r1.140 tree.c
*** tree.c 2000/04/28 20:52:29 1.140
--- tree.c 2000/05/03 22:52:00
*************** staticp (arg)
*** 2478,2483 ****
--- 2478,2487 ----
return staticp (TREE_OPERAND (arg, 0));
default:
+ /* Assume that language-specific decls are static. This is needed
+ for C++ thunks. */
+ if (DECL_P (arg) && TREE_CODE (arg) > LAST_AND_UNUSED_TREE_CODE)
+ return 1;
return 0;
}
}