This is the mail archive of the
gcc-patches@gcc.gnu.org
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 ();
Oh, indeed.
> 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
(20050527-1.c)
> 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
> sizes).
OK.
Thanks for your feedback.
Olivier