[Bug rtl-optimization/99041] combine creates invalid address which ICEs in decompose_normal_address

bergner at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Tue Feb 9 18:52:27 GMT 2021


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

Peter Bergner <bergner at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
     Ever confirmed|0                           |1
   Last reconfirmed|                            |2021-02-09

--- Comment #1 from Peter Bergner <bergner at gcc dot gnu.org> ---
This looks like a combine issue.  Before combine, we have:

(insn 124 123 125 3 (set (reg:V2DF 198 [ MEM <ax> [(void *)_75] ])
        (mem:V2DF (reg:DI 149 [ ivtmp.49 ]) [0 MEM <ax> [(void *)_75]+0 S16
A8])) "bug.ii":22:67 1130 {vsx_movv2df_64bit}
     (nil))

(insn 125 124 126 3 (set (reg:DI 199)
        (plus:DI (reg:DI 142 [ _63 ])
            (reg:DI 149 [ ivtmp.49 ]))) "bug.ii":22:67 66 {*adddi3}
     (nil))

(insn 126 125 127 3 (set (reg:V2DF 200 [ MEM <ax> [(void *)_24 + _16 * 1] ])
        (mem:V2DF (plus:DI (reg:DI 199)
                (reg:DI 197)) [0 MEM <ax> [(void *)_24 + _16 * 1]+0 S16 A8]))
"bug.ii":22:67 1130 {vsx_movv2df_64bit}
     (expr_list:REG_DEAD (reg:DI 199)
        (nil)))

(insn 127 126 128 3 (set (reg:OO 138 [ _41 ])
        (unspec:OO [
                (subreg:V16QI (reg:V2DF 198 [ MEM <ax> [(void *)_75] ]) 0)
                (subreg:V16QI (reg:V2DF 200 [ MEM <ax> [(void *)_24 + _16 * 1]
]) 0)
            ] UNSPEC_MMA_ASSEMBLE)) 2074 {*mma_assemble_pair}
     (expr_list:REG_DEAD (reg:V2DF 200 [ MEM <ax> [(void *)_24 + _16 * 1] ])
        (expr_list:REG_DEAD (reg:V2DF 198 [ MEM <ax> [(void *)_75] ])
            (nil))))


After combine, we have:

(note 124 123 125 3 NOTE_INSN_DELETED)

(note 125 124 126 3 NOTE_INSN_DELETED)

(note 126 125 127 3 NOTE_INSN_DELETED)

(insn 127 126 128 3 (set (reg:OO 138 [ _41 ])
        (unspec:OO [
                (mem:V16QI (reg:DI 149 [ ivtmp.49 ]) [0 MEM <ax> [(void
*)_75]+0 S16 A8])
                (mem:V16QI (plus:DI (plus:DI (reg:DI 142 [ _63 ])
                            (reg:DI 149 [ ivtmp.49 ]))
                        (reg:DI 197)) [0 MEM <ax> [(void *)_24 + _16 * 1]+0 S16
A8])
            ] UNSPEC_MMA_ASSEMBLE)) 2074 {*mma_assemble_pair}
     (nil))

That bad address on the 2nd mem then makes it all the way to LRA which
eventually dies when it calls decompose_normal_address on it.

Segher, is combine allowed to create invalid addresses like that and LRA is
supposed to fix it up or is this really a combine issue?


More information about the Gcc-bugs mailing list