public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug rtl-optimization/109311] New: [13 Regression] bb_is_just_return miss to realize some bb from r13-6873-g776a5bb5894315
@ 2023-03-28  5:33 linkw at gcc dot gnu.org
  2023-03-28  5:36 ` [Bug rtl-optimization/109311] " linkw at gcc dot gnu.org
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: linkw at gcc dot gnu.org @ 2023-03-28  5:33 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 109311
           Summary: [13 Regression] bb_is_just_return miss to realize some
                    bb from r13-6873-g776a5bb5894315
           Product: gcc
           Version: 13.0
            Status: UNCONFIRMED
          Severity: critical
          Priority: P3
         Component: rtl-optimization
          Assignee: unassigned at gcc dot gnu.org
          Reporter: linkw at gcc dot gnu.org
  Target Milestone: ---

Commit r13-6873-g776a5bb5894315 changed BB insns walking order under the
assumption that the handlings in the loop is order independent. But
unfortunately some failures shows it's not.

For a BB:

   15: L15:
   20: NOTE_INSN_BASIC_BLOCK 5
   19: use %3:SI
   32: NOTE_INSN_EPILOGUE_BEG
   33: simple_return
;;  succ:       EXIT

Previously function bb_is_just_return would return true while now it returns
false, since backward walking will meet return insn first, the USE insn isn't
considered as one use to be in *use but instead is taken as unexpected insn
then return false.

By adjusting it not to check !*ret for use can workaround it, 

         if (!*ret && ANY_RETURN_P (pat))
           *ret = insn;
-        else if (!*ret && !*use && GET_CODE (pat) == USE
+        else if (!*use && GET_CODE (pat) == USE
             && REG_P (XEXP (pat, 0))
             && REG_FUNCTION_VALUE_P (XEXP (pat, 0)))
           *use = insn;

but I'm not sure if there is some reason to check both !*ret && !*use, such as
to exclude something like:

    simple_return
    use %3:SI

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

end of thread, other threads:[~2023-03-28  7:35 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-03-28  5:33 [Bug rtl-optimization/109311] New: [13 Regression] bb_is_just_return miss to realize some bb from r13-6873-g776a5bb5894315 linkw at gcc dot gnu.org
2023-03-28  5:36 ` [Bug rtl-optimization/109311] " linkw at gcc dot gnu.org
2023-03-28  7:31 ` rguenth at gcc dot gnu.org
2023-03-28  7:33 ` cvs-commit at gcc dot gnu.org
2023-03-28  7:35 ` rguenth at gcc dot gnu.org

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).