2014-08-28 0:19 GMT+04:00 Vladimir Makarov <vmaka...@redhat.com>: > On 2014-08-26 5:42 PM, Ilya Enkovich wrote: >> >> Hi, >> >> Here is a patch I tried. I apply it over revision 214215. Unfortunately >> I do not have a small reproducer but the problem can be easily reproduced on >> SPEC2000 benchmark 175.vpr. The problem is in read_arch.c:701 where float >> value is compared with float constant 1.0. It is inlined into read_arch >> function and can be easily found in RTL dump of function read_arch as a >> float comparison with 1.0 after the first call to strtod function. >> >> Here is a compilation string I use: >> >> gcc -m32 -mno-movbe -g3 -fdump-rtl-all-details -O2 -ffast-math >> -mfpmath=sse -m32 -march=slm -fPIE -pie -c -o read_arch.o >> -DSPEC_CPU2000 read_arch.c >> >> In my final assembler comparison with 1.0 looks like: >> >> comiss .LC11@GOTOFF(%ebp), %xmm0 # 1101 *cmpisf_sse [length = >> 7] >> >> and %ebp here doesn't have a proper value. >> >> I'll try to make a smaller reproducer if these instructions don't help. > > > I've managed to reproduce it. Although it would be better to send the patch > as an attachment. > > The problem is actually in IRA not LRA. IRA splits pseudo used for PIC. > Then in a region when a *new* pseudo used as PIC we rematerialize a constant > which transformed in memory addressed through *original* PIC pseudo. > > To solve the problem we should prevent such splitting and guarantee that PIC > pseudo allocnos in different region gets the same hard reg. > > The following patch should solve the problem. >
Thanks for the patch! I'll try it and be back with results. Ilya >