https://gcc.gnu.org/bugzilla/show_bug.cgi?id=112415

--- Comment #46 from Manolis Tsamis <manolis.tsamis at vrull dot eu> ---
I have reproduced the segfault with f-m-o limited to only fold insn 272 from
compiler_call_helper. The exact transformation is:

Memory offset changed from 0 to 388 for instruction:
(insn 273 272 276 30 (set (mem:SI (reg/f:SI 22 %r22 [478]) [4 MEM[(intD.1
*)_107 + 388B]+0 S4 A32])
        (reg:SI 14 %r14 [orig:167 vect_pretmp_36.2448D.32932 ] [167]))
"Python/compile.c":5970:20 42 {*pa.md:2193}
     (nil))
deferring rescan insn with uid = 273.
Instruction folded:(insn 272 269 273 30 (set (reg/f:SI 22 %r22 [478])
        (plus:SI (reg/f:SI 19 %r19 [orig:127 prephitmp_37 ] [127])
            (const_int 388 [0x184]))) "Python/compile.c":5970:20 120 {addsi3}
     (nil))

This instruction is also included to the ones that Dave mentioned. Again, if
I'm missing something as to why this transformation is illegal please tell me.
Given these are also consecutive instructions, I'm just seeing here that 

%r22 = %r19 + 388
[%r22] = %r14

is transformed to

%r22 = %r19
[%r22 + 388] = %r14

I haven't tracked all other uses of %r22 yet, but in theory if there was any
non-foldable use of that register then the transformation wouldn't be made.

Manolis

Reply via email to