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

            Bug ID: 123364
           Summary: ICE: in emit_swap_insn, at reg-stack.cc with fsincos
                    inline asm
           Product: gcc
           Version: 15.2.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: rtl-optimization
          Assignee: unassigned at gcc dot gnu.org
          Reporter: 522024330006 at smail dot nju.edu.cn
  Target Milestone: ---

It is only reproducible with the optimization flag.

Reproducer: https://godbolt.org/z/616nbohMq

```c
__attribute__((noipa)) void bug(float b) {
    float a;
    __asm__ volatile("fsincos" : "+t"(b), "=u"(a) : "0"(b));
    __asm__ volatile("fsca" ::: "st"); 
}
```

Traceback:
```
 internal compiler error: in emit_swap_insn, at reg-stack.cc:850
   23 | }
      | ^
0x5da1dc8 internal_error(char const*, ...)
        /workspace/install/gcc/src/gcc/gcc/diagnostic-global-context.cc:517
0x5d3f858 fancy_abort(char const*, int, char const*)
        /workspace/install/gcc/src/gcc/gcc/diagnostic.cc:1749
0x2582c2d emit_swap_insn
        /workspace/install/gcc/src/gcc/gcc/reg-stack.cc:850
0x25844ee move_for_stack_reg
        /workspace/install/gcc/src/gcc/gcc/reg-stack.cc:1145
0x2586bba subst_stack_regs_pat
        /workspace/install/gcc/src/gcc/gcc/reg-stack.cc:1620
0x258b8eb subst_stack_regs
        /workspace/install/gcc/src/gcc/gcc/reg-stack.cc:2505
0x258e073 convert_regs_1
        /workspace/install/gcc/src/gcc/gcc/reg-stack.cc:3141
0x258e827 convert_regs_2
        /workspace/install/gcc/src/gcc/gcc/reg-stack.cc:3277
0x258e95c convert_regs
        /workspace/install/gcc/src/gcc/gcc/reg-stack.cc:3313
0x258f37b reg_to_stack
        /workspace/install/gcc/src/gcc/gcc/reg-stack.cc:3441
0x258f4db rest_of_handle_stack_regs
        /workspace/install/gcc/src/gcc/gcc/reg-stack.cc:3497
0x258f5b0 execute
        /workspace/install/gcc/src/gcc/gcc/reg-stack.cc:3529
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.
```

Reply via email to