From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 2703F3858CDA; Tue, 28 Mar 2023 05:33:56 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 2703F3858CDA DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1679981636; bh=xP/xIm8CdXb7PxTiDGkV9QDc4Ei1NPBH1uugVtqhTRI=; h=From:To:Subject:Date:From; b=SwCpJtYadz+nfSFFWX1AH7nZ7Qcwwm8D3g7pJfppJrVBgnwg82AqHgmwtkxs4rlSV 49Knmh/dcjQN1NyilSfP2sGXy9Q4mRXYKdqMd82mTJrw3KuU+UJySs9dxQi8Mq2Lxw Q+XEh1C8NWIsC3FjM7wLdnm/mWpJIG2kvbNI9pzc= From: "linkw at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug rtl-optimization/109311] New: [13 Regression] bb_is_just_return miss to realize some bb from r13-6873-g776a5bb5894315 Date: Tue, 28 Mar 2023 05:33:55 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: rtl-optimization X-Bugzilla-Version: 13.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: critical X-Bugzilla-Who: linkw at gcc dot gnu.org X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: bug_id short_desc product version bug_status bug_severity priority component assigned_to reporter target_milestone Message-ID: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 List-Id: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D109311 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,=20 if (!*ret && ANY_RETURN_P (pat)) *ret =3D insn; - else if (!*ret && !*use && GET_CODE (pat) =3D=3D USE + else if (!*use && GET_CODE (pat) =3D=3D USE && REG_P (XEXP (pat, 0)) && REG_FUNCTION_VALUE_P (XEXP (pat, 0))) *use =3D 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=