[PATCH] Don't ICE if COMPOUND_LITERAL_EXPR's DECL_INITIAL isn't CONSTRUCTOR (PR c/54363)
Joseph S. Myers
joseph@codesourcery.com
Fri Aug 24 21:39:00 GMT 2012
On Fri, 24 Aug 2012, Jakub Jelinek wrote:
> Hi!
>
> On this testcase, we ICE in optimize_compound_literals_in_ctor
> because init isn't CONSTRUCTOR, but the recursive call relies on it
> being a CONSTRUCTOR.
>
> Either we can add that check as the patch does, making the optimization
> tiny bit more robust (the rest of the gimplifier handles non-CONSTRUCTOR
> DECL_INITIAL of COMPOUND_LITERAL_EXPR just fine), or the C FE would need to
> be somehow fixed to always emit a CONSTRUCTOR.
>
> Joseph, what do you prefer here?
I prefer the gimplifier approach here (allowing COMPOUND_LITERAL_EXPRs to
use anything that would be a valid initializer for the relevant type).
--
Joseph S. Myers
joseph@codesourcery.com
More information about the Gcc-patches
mailing list