From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 47BE23858CDA; Thu, 30 Mar 2023 18:59:38 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 47BE23858CDA DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1680202778; bh=+jxPvlGGA4dDZsxw84icPcscFxckpvUP1zjrAZfUmPw=; h=From:To:Subject:Date:From; b=AuL3/2n2ImlQGhX+7UOOJDCVUvuuoTTavc5Ut5PqF9DKoU56XmlWizFaDfnb6/3Vg 6whJUL9LtE5D24kpkgtmLLVTpL5dAyWFc1iqmsLzLGvTVXSBExbu+ltw3DDmAVE6Wd DxYYdwunrZPQfiTVhZcc4Z4dYNwZGV+lhEblAxvE= From: "piggynl at outlook dot com" To: gcc-bugs@gcc.gnu.org Subject: [Bug middle-end/109347] New: [lra] Spill failure for architecture without CC Date: Thu, 30 Mar 2023 18:59:37 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: middle-end X-Bugzilla-Version: 12.2.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: piggynl at outlook dot com 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 attachments.created 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=3D109347 Bug ID: 109347 Summary: [lra] Spill failure for architecture without CC Product: gcc Version: 12.2.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: middle-end Assignee: unassigned at gcc dot gnu.org Reporter: piggynl at outlook dot com Target Milestone: --- Created attachment 54791 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=3D54791&action=3Dedit Reproduce for riscv64 For all architectures without condition code, when all registers are in use, gcc fails to perform a spill. mips64 and riscv64 are failing with certain code.=20 For example, the codes for mips64 and riscv64 reproducing the bug are in attachments. The expected behavior is generating a spill asm sequence before the `if` bl= ock and a restore sequence after, so it will be a free register in the `if` blo= ck. gcc is failing an assertion error with the examples. With a release build, = gcc falls into an infinity loop. The assertion fails in lra.c: if (e->dest !=3D EXIT_BLOCK_PTR_FOR_FN (cfun)) { /* We already made the edge no-critical in ira.c::ira */ lra_assert (!EDGE_CRITICAL_P (e)); ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ rtx_insn *tmp =3D BB_HEAD (e->dest); if (LABEL_P (tmp)) The assertion was introduced in e3b3b59683c1.=