On Tue, 17 Mar 2020, Jakub Jelinek via Gcc-patches wrote:

> Hi!
> 
> The following testcases ICE, because they contain extern variable
> declarations with incomplete enum types that is later completed and after
> that those variables are accessed.  The ICEs are because the vars then may 
> have
> incorrect DECL_MODE etc., e.g. in the first case the var has SImode
> DECL_MODE (the guessed mode for the enum), but the enum then actually has
> DImode because its enumerators don't fit into unsigned int.
> 
> The following patch fixes it by using C_TYPE_INCOMPLETE_VARS not just on
> incomplete struct/union types, but also incomplete enum types.
> TYPE_VFIELD can't be used as it is TYPE_MIN_VALUE on ENUMERAL_TYPE,
> thankfully TYPE_LANG_SLOT_1 has been used in the C FE only on
> FUNCTION_TYPEs.
> 
> Bootstrapped/regtested on x86_64-linux and i686-linux, ok for trunk?

OK.

-- 
Joseph S. Myers
jos...@codesourcery.com

Reply via email to