This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug target/55023] hppa: wrong code generated with tail call optimisation


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

--- Comment #9 from dave.anglin at bell dot net ---
After some more digging, I think the problem is in dse, not dce.  It  
deletes this instruction
which stores part of the sibcall arguments:

(insn 31 27 50 2 (set (mem:SI (reg/f:SI 115) [0  S4 A64])
         (reg:SI 125)) pr55023.c:17 40 {*pa.md:2204}
      (expr_list:REG_DEAD (reg:SI 125)
         (expr_list:REG_DEAD (reg/f:SI 115)
             (nil))))

**scanning insn=31
   mem: (reg/f:SI 115)

    after canon_rtx address: (plus:SI (reg/f:SI 3 %r3)
     (const_int -56 [0xffffffffffffffc8]))
   gid=0 offset=-56
  processing const base store gid=0[-56..-52)
     trying store in insn=26 gid=0[-52..-48)
mems_found = 1, cannot_delete = false
[...]
Locally deleting insn 31
deferring deletion of insn with uid = 31.
Locally deleting insn 26
deferring deletion of insn with uid = 26.

The argument setup for this argument is:

(insn 25 22 26 2 (set (reg/f:SI 124)
         (plus:SI (reg/f:SI 3 %r3)
             (const_int -52 [0xffffffffffffffcc]))) pr55023.c:17 112  
{addsi3}
      (nil))
(insn 26 25 27 2 (set (mem:SI (reg/f:SI 124) [0  S4 A32])         
(reg:SI 119 [ D.1503 ])) pr55023.c:17 40 {*pa.md:2204}
      (expr_list:REG_DEAD (reg/f:SI 124)
         (nil)))
(insn 27 26 31 2 (set (reg:SI 125)
         (ashiftrt:SI (reg:SI 119 [ D.1503 ])
             (const_int 31 [0x1f]))) pr55023.c:17 174 {*pa.md:6548}
      (expr_list:REG_DEAD (reg:SI 119 [ D.1503 ])
         (nil)))
(insn 31 27 50 2 (set (mem:SI (reg/f:SI 115) [0  S4 A64])
         (reg:SI 125)) pr55023.c:17 40 {*pa.md:2204}      
(expr_list:REG_DEAD (reg:SI 125)
         (expr_list:REG_DEAD (reg/f:SI 115)
             (nil))))

Pseudo "SI 115" was loaded earlier:

(insn 16 12 20 2 (set (reg/f:SI 115)
         (plus:SI (reg/f:SI 3 %r3)
             (const_int -56 [0xffffffffffffffc8]))) pr55023.c:16 112  
{addsi3}
      (nil))

Dave
--
John David Anglin    dave.anglin@bell.net


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]