On Thu, Mar 17, 2011 at 5:30 PM, H.J. Lu <hjl.to...@gmail.com> wrote: > On Tue, Feb 15, 2011 at 2:55 PM, Bernd Schmidt <ber...@codesourcery.com> > wrote: >> On 02/14/2011 08:46 PM, Eric Botcazou wrote: >>>> I agree with Jeff that combine would be the correct place to fix this. >>>> At least it takes class_likely_spilled_p into account, so it will >>>> restrict only those machines where extending the lifetime of hard regs >>>> is dangerous. >>> >>> OK, but I don't see how copying to a new pseudo would interfere with that. >> >> For one thing, the set no longer matches the REG_EQUIV note we make >> here, and that does seem to interfere with the optimization. I've tested >> both patches on ARM, -march=armv7-a. The combiner patch produced no code >> changes. The function.c patch produced regressions (increased register >> pressure). Both results are as expected. >> >> To put it another way: the combiner change is conservatively correct, >> and necessary if we're going to have extends of hard registers in the >> RTL. The function.c change is demonstrably incorrect as shown by the ARM >> codegen regressions. >> > > I checked in my patch into trunk. >
I noticed that for x32, all pointers passed in registers are zero-extended by caller. If we can fix http://gcc.gnu.org/bugzilla/show_bug.cgi?id=48085 by avoiding zero-extension in callee, this issue won't happen for x32. I will revert the combine change for now and try to implement this approach. Thanks. -- H.J.