This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: C++ PATCH for c++/43555 (wrong code with VLA and conditional branches)
- From: Olivier Hainque <hainque at adacore dot com>
- To: Jason Merrill <jason at redhat dot com>
- Cc: gcc-patches List <gcc-patches at gcc dot gnu dot org>, hainque at adacore dot com
- Date: Fri, 28 May 2010 11:57:09 +0200
- Subject: Re: C++ PATCH for c++/43555 (wrong code with VLA and conditional branches)
- References: <4BFEBB91.3080304@redhat.com>
Jason Merrill wrote:
> Back in 2006 (r117493) Olivier fixed the C front end to avoid a problem
> with the SAVE_EXPR for a VLA type size being evaluated on one side of a
> condition but not the other,
Oula, old memories ... thanks for cc'ing me.
> but the fix never made it into the C++ front end. This patch adapts
> that fix a bit: we don't really need to introduce an artificial
> TYPE_DECL just to force the evaluation of the SAVE_EXPR at the point
> where we see the abstract declarator, we can just introduce it as a
> dummy expression statement.
Nice. I remember we discussed different possible approaches and that
avoiding the introduction of dummy TYPE_DECL was of interest if possible.
(thread at http://gcc.gnu.org/ml/gcc-patches/2006-09/msg00009.html
then http://gcc.gnu.org/ml/gcc-patches/2006-10/msg00239.html),
I eventually introduced one on the grounds of
<< A key aspect is the call to finish_decl, which builds the DECL_EXPR
node required to push the gimplifier into gimplify_type_sizes.
>>
This was my first dive in the C front-end, so could maybe be avoided
there as well today.
Olivier