public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug middle-end/95442] New: LRA inserts a reload insn for REG_DEAD register
@ 2020-05-30 21:50 hjl.tools at gmail dot com
  2020-06-11  5:38 ` [Bug middle-end/95442] " xerofoify at gmail dot com
  0 siblings, 1 reply; 2+ messages in thread
From: hjl.tools at gmail dot com @ 2020-05-30 21:50 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 95442
           Summary: LRA inserts a reload insn for REG_DEAD register
           Product: gcc
           Version: 11.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: middle-end
          Assignee: unassigned at gcc dot gnu.org
          Reporter: hjl.tools at gmail dot com
                CC: vmakarov at redhat dot com
  Target Milestone: ---

match_reload has

  if (find_reg_note (curr_insn, REG_UNUSED, out_rtx) == NULL_RTX)
    {    
      start_sequence ();
      lra_emit_move (out_rtx, copy_rtx (new_out_reg));
      emit_insn (*after);
      *after = get_insns ();
      end_sequence ();
    }    

For

(insn 68 67 69 10 (parallel [
            (set (reg:CC 17 flags)
                (if_then_else:CC (ne (reg:DI 104 [ _1 ])
                        (const_int 0 [0]))
                    (compare:CC (mem:BLK (reg/v/f:DI 86 [ s2 ]) [0 MEM
<char[1:(sizetype) _1]> [(void *)s2_5(D)]+0 A8])
                        (mem:BLK (reg/v/f:DI 85 [ s1 ]) [0 MEM
<char[1:(sizetype) _1]> [(void *)s1_6(D)]+0 A8]))
                    (const_int 0 [0])))
            (use (const_int 8 [0x8]))
            (use (reg:CC 17 flags))
            (clobber (reg/f:DI 102 [ s2 ]))
            (clobber (reg/f:DI 103 [ s1 ]))
            (clobber (reg:DI 104 [ _1 ]))
        ]) "foo.c":9:7 1011 {*cmpstrnqi_1}
     (expr_list:REG_DEAD (reg:DI 104 [ _1 ])
        (expr_list:REG_UNUSED (reg:DI 104 [ _1 ])
            (expr_list:REG_UNUSED (reg/f:DI 103 [ s1 ])
                (expr_list:REG_UNUSED (reg/f:DI 102 [ s2 ])
                    (expr_list:REG_EQUAL (if_then_else:CC (ne (reg:DI 82 [ _1
])
                                (const_int 0 [0]))
                            (compare:CC (mem:BLK (reg/v/f:DI 86 [ s2 ]) [0 MEM
<char[1:(sizetype) _1]> [(void *)s2_5(D)]+0 A8])
                                (mem:BLK (reg/v/f:DI 85 [ s1 ]) [0 MEM
<char[1:(sizetype) _1]> [(void *)s1_6(D)]+0 A8]))
                            (const_int 0 [0]))
                        (nil)))))))
(insn 69 68 70 10 (set (reg:QI 105)
        (gtu:QI (reg:CC 17 flags)
            (const_int 0 [0]))) "foo.c":9:7 732 {*setcc_qi}
     (nil))

LRA inserts a reload insn for REG_DEAD (reg:DI 104 [ _1 ] after it.  Should
it be

diff --git a/gcc/lra-constraints.c b/gcc/lra-constraints.c
index bf6d4a2fd4b..570ee37e34d 100644
--- a/gcc/lra-constraints.c
+++ b/gcc/lra-constraints.c
@@ -1068,7 +1068,8 @@ match_reload (signed char out, signed char *ins, signed
char *outs,
     return;
   /* See a comment for the input operand above.  */
   narrow_reload_pseudo_class (out_rtx, goal_class);
-  if (find_reg_note (curr_insn, REG_UNUSED, out_rtx) == NULL_RTX)
+  if (find_reg_note (curr_insn, REG_UNUSED, out_rtx) == NULL_RTX
+      && find_reg_note (curr_insn, REG_DEAD, out_rtx) == NULL_RTX)
     {
       start_sequence ();
       lra_emit_move (out_rtx, copy_rtx (new_out_reg));

^ permalink raw reply	[flat|nested] 2+ messages in thread

* [Bug middle-end/95442] LRA inserts a reload insn for REG_DEAD register
  2020-05-30 21:50 [Bug middle-end/95442] New: LRA inserts a reload insn for REG_DEAD register hjl.tools at gmail dot com
@ 2020-06-11  5:38 ` xerofoify at gmail dot com
  0 siblings, 0 replies; 2+ messages in thread
From: xerofoify at gmail dot com @ 2020-06-11  5:38 UTC (permalink / raw)
  To: gcc-bugs

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

Nicholas Krause <xerofoify at gmail dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |xerofoify at gmail dot com

--- Comment #1 from Nicholas Krause <xerofoify at gmail dot com> ---
That seems right to be, last commit to touch it was 55a2c3226a3e. After looking
at it the reload insn and the related commit we should not be adding the reload
insn here.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2020-06-11  5:38 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-05-30 21:50 [Bug middle-end/95442] New: LRA inserts a reload insn for REG_DEAD register hjl.tools at gmail dot com
2020-06-11  5:38 ` [Bug middle-end/95442] " xerofoify at gmail dot com

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).