This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] Fix PR C/9163, ICE in C99 mode after error withchecking
Andrew Pinski <pinskia@physics.uc.edu> writes:
>> This patch does not interfere with my rewrite, and is mostly the right
>> thing. One question...
>>
>>> - BLOCK_SUPERCONTEXT (DECL_INITIAL (fndecl)) = fndecl;
>>> + if (DECL_INITIAL (fndecl) != error_mark_node)
>>> + BLOCK_SUPERCONTEXT (DECL_INITIAL (fndecl)) = fndecl;
>>
>> as long as we're being paranoid here, what about the possibility that
>> DECL_INITIAL is null? Same below in c_expand_body, and for
>> DECL_RESULT.
>
> No reason, just the testcase was only producing error_mark_nodes that
> is all.
Well, it would be nice to know whether or not they actually can be
null at these junctures, but let's be defensive and assume they can.
> Here is the updated patch which I checked in.
Stylistically I think it would be better to write
if (DECL_INITIAL (fndecl) && DECL_INITIAL (fndecl) != error_mark_node)
rather than the other way around. Patch which switches them is pre-approved.
Please also make sure the test case got added to the testsuite.
zw