This is the mail archive of the
mailing list for the GCC project.
Re: [patch] fix wrong gimple code with ptr to forward vla
Joseph S. Myers wrote:
> The pointer declaration point is in general in the middle of an
> expression. This patch breaks
> int a = 1;
> if (sizeof (*(++a, (char (*)[a])0)) != 2)
> abort ();
> This patch might be safer if the TYPE_DECL were only inserted in the case
> of decl_context == NORMAL.
Humm, I see. We at least need FIELD as well to cover the initial bug
> That should avoid the TYPENAME problems like the testcase I give
> (which should be added to the gcc.c-torture/execute testsuite)
Right. One concern, still: are we sure that the initial bug (sizes
evaluated in a conditional branch and reused in another) couldn't
show up in the TYPENAME case ?
> and also avoid possible problems with PARM (where in the case of
> declarations that aren't definitions, no special handling should be
> needed, and in the case of those that are definitions,
> gimplify_parameters should arrange the necessary evaluation of array
Thanks for your feedback.