[trunk][patch] gimplify type sizes in a pointer type

Richard Guenther richard.guenther@gmail.com
Thu Jun 12 09:11:00 GMT 2008


On Thu, Jun 12, 2008 at 9:30 AM, Rafael Espindola <espindola@google.com> wrote:
> My previous idea of changing the C++ FE to create a temp var to avoid
> having a SAVE_EXPR on a type turned out to be hard to implement in the
> case of new being used in static initialization. The middle end
> complains about a non static variable being used :-(
>
> I decide to try to find out why the gimplifier avoids recursing into
> pointer types, but I couldn't. Adding the recursion solves the problem
> on the lto branch and introduces no problems on trunk. I have
> bootstrapped gcc and there is no regression on the tests.
>
> I assume that the case it was getting to uninitialized types no longer
> exists (that code is from 2006).

Hm, it sounds like a real possible problem - though I cannot come up
with a valid testcase with this scenario.

> Is the attached patch OK for trunk?

Ok if you boostrapped / tested this with Ada enabled.  But please wait
for comments from people that may remember what was going on here.

Thanks,
Richard.

> 2008-06-11  Rafael Espindola  <espindola@google.com>
>
>        * gimplify.c (gimplify_target_expr): Always gimplify the type of INIT.
>        (gimplify_type_sizes): Recurse on pointer types.
>
>
> Cheers,
> --
> Rafael Avila de Espindola
>
> Google Ireland Ltd.
> Gordon House
> Barrow Street
> Dublin 4
> Ireland
>
> Registered in Dublin, Ireland
> Registration Number: 368047
>



More information about the Gcc-patches mailing list