This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [C, PATCH] Improve/Fix the gimplifier of C complex/vector compound literals
- From: Andrew Pinski <pinskia at gmail dot com>
- To: gcc-patches at gcc dot gnu dot org
- Date: Tue, 19 Dec 2006 20:43:40 -0800
- Subject: Re: [C, PATCH] Improve/Fix the gimplifier of C complex/vector compound literals
- References: <1166164547.3805.15.camel@celery.andrew.com>
On Thu, 2006-12-14 at 22:35 -0800, Andrew Pinski wrote:
> Hi,
> Since the decl for a compound literal is added to the temporary
> variable list while gimplifing, we don't get the chance to mark the decl
> as DECL_GIMPLE_REG_P unlike if the decl was in the BLOCK. Since the
> decl is not marked with DECL_GIMPLE_REG_P, we get an extra temporary for
> complex and vector compound literals which seems wrong.
>
> OK? Bootstrapped and tested on i686-linux-gnu with no regressions.
I withdraw this patch for now as I found another issue with compound
literals and invalid gimple.
The following testcase can produce invalid gimple:
int f(float *);
int g(float x)
{
return f(&(float){x}) + f(&x);
}
So for this patch, we mark the decl as DECL_GIMPLE_REG_P which is not
true as it is TREE_ADDRESSABLE but that is only marked too late now.
I am testing a correct patch to fix this invalid gimple.
Thanks,
Andrew Pinski