This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [patch preprocessor]: PR/45362 Dangling reference
>>>>> "Kai" == Kai Tietz <ktietz70@googlemail.com> writes:
Tom> It seems to me that this patch loses some information currently in
Tom> cpp_macro, specifically the 'syshdr' and 'used' fields. Â(It also loses
Tom> the location, but I am not sure that matters so much at the moment.)
Kai> Well, at the moment this seems to me not that important, but you are
Kai> right that those informations getting lost.
It seems to me that it can definitely matter.
syshdr in particular is tested before emitting various kinds of errors.
Tom> Since a cpp_macro is marked with GTY, wouldn't a fix be to also mark
Tom> struct def_pragma_macro, perhaps also with a change to pch.c to write
Tom> out the chain?
Kai> Well, not sure if this would solve this. As libcpp can't have a root
Kai> gc element, I am not sure if the marking of def_pragma_macro by GTY
Kai> would really help.
It also seems like instead of having a separate list for push/pop, we
could simply store a pointer to the pushed macro into the cpp_macro
object itself. This will grow cpp_macro, but maybe that isn't so bad.
Tom