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: New option to turn off stack reuse for temporaries


On Thu, Jun 21, 2012 at 5:53 PM, Michael Matz <matz@suse.de> wrote:
> Hi,
>
> On Thu, 21 Jun 2012, Richard Guenther wrote:
>
>> The flag is not restricted to the C++ compiler and applies to all
>> automatic variables.
>
> The use of that flag in the gimplifier (->in_cleanup_expr) makes it
> actually c++ specific.

We don't have any other users of WITH_CLEANUP_EXPR?  Indeed.

>> Also even with this flag there is no guarantee we cannot figure out
>> lifetime in other ways, for example if the temporary gets promoted to a
>> register. Also with this patch you remove code motion barriers which
>> might cause other issues.
>>
>> A more "proper" place to fix this is when we actually do the stack
>> reuse, in cfgexpand.
>
> That is true, though. ?It would then also enable debugging help for
> pointers to things that go out-of-scope.

Yes.  So I think if the flag is supposed to be used for debugging (instead
of as fix or workaround for invalid programs) then we should go one step
further and have it disable stack slot sharing alltogether - without any
other side-effect on pre-RTL optimizations (which undoubtedly not having
the CLOBBERS have).

Richard.

>
> Ciao,
> Michael.


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