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 Tue, Jun 26, 2012 at 06:07:09PM +0200, Michael Matz wrote:
> I agree with Jason.  TARGET_EXPR and CLEANUP_POINT_EXPR might currently be 
> used only for C++, but I think they are sensible general constructs to be 
> supported by the gimplifier.
> 
> But I also think that the option to disable stack slot sharing should be 
> moved to cfgexpand to trigger non-sharing of everything, not just these 
> cleanup temporaries.  After all using the (c++)temporary after expression 
> end is a source bug that the option is supposed to work around, just like 
> this is:

If you move it solely to cfgexpand time, broken code will still often not
work the way it happened to work with 4.6 and earlier.  You'd need to both
disable the sharing and disable additions of gimple clobbers.
Because otherwise DCE/DSE and other passes happily optimize (broken) code
away.  So, if we want a -fno-strict-aliasing like option to work around
broken code, we should IMHO do both of those.
> 
>   char *p; { char str[50]; p = str; } use(p);
> 
> So, IMO the option should also work around this source bug.  We had at 
> least one example of that in our own code base.

Yeah, gengtype I think.

	Jakub


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