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

            Bug ID: 123453
           Summary: ICE in lra_constraints: maximum number of generated
                    reload insns per insn achieved (90) when passing
                    _Complex float to "f" constraint
           Product: gcc
           Version: 15.2.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: middle-end
          Assignee: unassigned at gcc dot gnu.org
          Reporter: 522024330006 at smail dot nju.edu.cn
  Target Milestone: ---

To reproduce: https://godbolt.org/z/crPvz1d6Y

The compiler triggers an ICE during the reload pass (LRA) when a _Complex type
is passed to an inline assembly constraint that expects a single scalar
register.
The Local Register Allocator (LRA) fails to reconcile the multi-register nature
of the complex type with the single-register constraint, leading to an infinite
reload loop.

Program:
```c
#include <complex.h>

int main() {
    _Complex float comp_val = 1.0 + 2.0 * I; 

    __asm__ volatile (
        "c.add.s %0, %1" 
        : "+f"(comp_val)
        : "f"(comp_val)
    );
}
```

Traceback:
```
internal compiler error: maximum number of generated reload insns per insn
achieved (90)
   12 | }
      | ^
0x5da1dc8 internal_error(char const*, ...)
        /workspace/install/gcc/src/gcc/gcc/diagnostic-global-context.cc:517
0x228ca69 lra_constraints(bool)
        /workspace/install/gcc/src/gcc/gcc/lra-constraints.cc:5480
0x22634a6 lra(_IO_FILE*, int)
        /workspace/install/gcc/src/gcc/gcc/lra.cc:2455
0x21c7d60 do_reload
        /workspace/install/gcc/src/gcc/gcc/ira.cc:5987
0x21c883a execute
        /workspace/install/gcc/src/gcc/gcc/ira.cc:6175
Please submit a full bug report, with preprocessed source (by using
-freport-bug).
Please include the complete backtrace with any bug report.
See <https://gcc.gnu.org/bugs/> for instructions.
```
  • [Bug middle-end/123453] ... 522024330006 at smail dot nju.edu.cn via Gcc-bugs

Reply via email to