[C, PATCH] Improve/Fix the gimplifier of C complex/vector compound literals

Andrew Pinski pinskia@gmail.com
Wed Dec 20 04:43:00 GMT 2006


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



More information about the Gcc-patches mailing list