[Bug rtl-optimization/89414] wrong code with -Og -fno-forward-propagate -fno-tree-fre

jakub at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Wed Feb 20 14:33:00 GMT 2019


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

Jakub Jelinek <jakub at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
   Last reconfirmed|                            |2019-02-20
                 CC|                            |jakub at gcc dot gnu.org,
                   |                            |ktkachov at gcc dot gnu.org
     Ever confirmed|0                           |1

--- Comment #1 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
Can reproduce even with r208764 (oldest arm cross I have around).
Looks like a backend issue to me, in *.ira we still have:
(insn 32 42 33 2 (set (mem/c:QI (reg/f:SI 103 afp) [0 MEM[(void *)&h]+0 S1 A8])
        (subreg:QI (reg:SI 132) 0)) "pr89414.c":7:3 189 {*arm_movqi_insn}
     (expr_list:REG_DEAD (reg:SI 132)
        (nil)))
and it is eliminated to:
(insn 32 42 33 2 (set (mem/c:QI (plus:SI (reg/f:SI 13 sp)
                (const_int 4 [0x4])) [0 MEM[(void *)&h]+0 S1 A8])
        (reg:QI 2 r2 [132])) "pr89414.c":7:3 189 {*arm_movqi_insn}
     (nil))
even when pro_and_epilogue adds:
(insn/f 51 8 52 2 (parallel [
            (set (mem/c:BLK (pre_modify:SI (reg/f:SI 13 sp)
                        (plus:SI (reg/f:SI 13 sp)
                            (const_int -8 [0xfffffffffffffff8]))) [2  A8])
                (unspec:BLK [
                        (reg:SI 4 r4)
                    ] UNSPEC_PUSH_MULT))
            (use (reg:SI 14 lr))
        ]) "pr89414.c":4:1 -1
     (expr_list:REG_FRAME_RELATED_EXPR (sequence [
                (set/f (reg/f:SI 13 sp)
                    (plus:SI (reg/f:SI 13 sp)
                        (const_int -8 [0xfffffffffffffff8])))
                (set/f (mem/c:SI (reg/f:SI 13 sp) [2  S4 A32])
                    (reg:SI 4 r4))
                (set/f (mem/c:SI (plus:SI (reg/f:SI 13 sp)
                            (const_int 4 [0x4])) [2  S4 A32])
                    (reg:SI 14 lr))
            ])
        (nil)))
in the prologue, so sp+4 can't be right.  So, either something changed in the
frame size computation between RA and pro_and_epilogue (that would be a bug) or
the afp -> sp + offset elimination is incorrect.


More information about the Gcc-bugs mailing list