[C PATCH] Fix ICE with assignment to FUNCTION_DECL (PR c/64766)

Jeff Law law@redhat.com
Mon Jan 26 23:30:00 GMT 2015


On 01/26/15 14:13, Jakub Jelinek wrote:
> Hi!
>
> On the following testcase we ICE during error recovery.
> Setting DECL_INITIAL of a FUNCTION_DECL to error_mark_node can't
> be possibly helpful, the error must have been diagnosed already;
> DECL_INITIAL on the FUNCTION_DECL should be kept as BLOCK.
>
> Bootstrapped/regtested on x86_64-linux and i686-linux, ok for trunk?
>
> 2015-01-26  Jakub Jelinek  <jakub@redhat.com>
>
> 	PR c/64766
> 	* c-typeck.c (store_init_value): Don't overwrite DECL_INITIAL
> 	of FUNCTION_DECLs with error_mark_node.
>
> 	* gcc.dg/pr64766.c: New test.
OK.  Though keep your eye out for any fallout -- IIRC we use 
error_type_node in similar situtions to prevent walking down into 
certain nodes again.  I don't think we need to worry about that in this 
case, but again, keep an eye out.


jeff



More information about the Gcc-patches mailing list