public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug middle-end/109347] New: [lra] Spill failure for architecture without CC
@ 2023-03-30 18:59 piggynl at outlook dot com
  2023-03-30 18:59 ` [Bug middle-end/109347] " piggynl at outlook dot com
                   ` (9 more replies)
  0 siblings, 10 replies; 11+ messages in thread
From: piggynl at outlook dot com @ 2023-03-30 18:59 UTC (permalink / raw)
  To: gcc-bugs

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

            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=54791&action=edit
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. 

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` block
and a restore sequence after, so it will be a free register in the `if` block.

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 != 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 = BB_HEAD (e->dest);
                if (LABEL_P (tmp))

The assertion was introduced in e3b3b59683c1.

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

end of thread, other threads:[~2023-03-30 19:47 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-03-30 18:59 [Bug middle-end/109347] New: [lra] Spill failure for architecture without CC piggynl at outlook dot com
2023-03-30 18:59 ` [Bug middle-end/109347] " piggynl at outlook dot com
2023-03-30 19:32 ` pinskia at gcc dot gnu.org
2023-03-30 19:36 ` pinskia at gcc dot gnu.org
2023-03-30 19:38 ` pinskia at gcc dot gnu.org
2023-03-30 19:39 ` pinskia at gcc dot gnu.org
2023-03-30 19:40 ` pinskia at gcc dot gnu.org
2023-03-30 19:42 ` pinskia at gcc dot gnu.org
2023-03-30 19:42 ` pinskia at gcc dot gnu.org
2023-03-30 19:46 ` pinskia at gcc dot gnu.org
2023-03-30 19:47 ` pinskia 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).