This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

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


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]