This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: patch: handle vector constants in arrays


Aldy Hernandez <aldyh@redhat.com> writes:

>> Could you explain how we get to this bit of digest_init with
>> inside_init not being a CONSTRUCTOR?
>
> output_init_element():
>
>    if (TREE_CODE (value) == COMPOUND_LITERAL_EXPR
>        && require_constant_value && !flag_isoc99 && pending)
>      {
>        /* As an extension, allow initializing objects with static storage
>           duration with compound literals (which are then treated just as
>           the brace enclosed list they contain).  */
>        tree decl = COMPOUND_LITERAL_EXPR_DECL (value);
>        value = DECL_INITIAL (decl);
>      }
>
> After the above code is executed, 'value' ends up being the VECTOR_CST
> that gets passed to digest_init().

Ah, okay.  I just wanted to make sure that the VECTOR_CST could
legitimately appear at this point.  Go ahead and check your patch in.

zw


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]