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: [PATCH] Fix PRs59125 and 54570


On Fri, Nov 15, 2013 at 02:56:51PM +0100, Richard Biener wrote:
> Now that there is (finally :() a wrong-code testcase for the
> PR54570 issue we can no longer ignore it (bah).  So the following
> tries to paper over the fact that object-size sucks and disables
> value-numbering of equal addresses the same before that pass
> had a chance to finally look at the structure of the addresses.
> 
> To make this "fix" suck less I moved the object-size pass before
> the final FRE pass runs which is after IPA inlining and the
> propagation of constants and addresses.  You won't catch
> any "improvements" you'd get by memory CSE opportunities that
> IPA inlining exposes, but you cannot have everything here.

If it doesn't regress anything in the testsuite, I guess that is ok.

> (IMHO object-size would should run during early optimizations)

It can't, because inlining and some limited cleanup afterwards is essential
for it.  Otherwise you'd regress not just for __builtin_object_size (x, 1),
which admittedly is problematic since the introduction of MEM_REFs and
various other changes, but also for __builtin_object_size (x, 0), which
would be much more important.

As discussed earlier, perhaps instead of checking cfun->after_inlining
you could just introduce a new flag whether cfun contains any
__builtin_object_size (x, {1,3}) calls, initialized by the gimplifier,
propagated by the inliner and finally cleared again by objsz pass.
Of course, if moving objsz earlier seems to work, it could stay where you
put it, but the flag could make it clearer why you want to avoid certain
optimizations.

> Bootstrap / regtest pending on x86_64-unknown-linux-gnu.
> 
> Similar candidate for the 4.8 branch.

Please wait sufficiently long for trunk issues before you backport.

	Jakub


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