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

            Bug ID: 122862
           Summary: ICE: in move_for_stack_reg, at reg-stack.cc
           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: ---

Only go to crash when using the flag -O3.
The details can be found here: https://godbolt.org/z/MT4e5MqxT

The program:
```c
#include <stdio.h>

int main() {
    double a = 0.1, b = 0.2, c = 0;

    for (int i = 0; i < 10; ++i) {
        asm volatile("" : "+f"(a), "+f"(b), "+f"(c));

        c = a * (b + a);

    }

    return c;
}
```

Part of the traceback:
915.fuzz:19:1: internal compiler error: in move_for_stack_reg, at
reg-stack.cc:1199
   19 | }
      | ^
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
0x258491c move_for_stack_reg
        /workspace/install/gcc/src/gcc/gcc/reg-stack.cc:1199
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.

The gcc version I used is:

Using built-in specs.
COLLECT_GCC=/workspace/install/gcc/install_15.2.0/bin/gcc
COLLECT_LTO_WRAPPER=/workspace/install/gcc/install_15.2.0/libexec/gcc/x86_64-pc-linux-gnu/15.2.0/lto-wrapper
Target: x86_64-pc-linux-gnu
Configured with: /workspace/install/gcc/src/gcc/configure --enable-coverage
--enable-checking --disable-multilib --disable-shared --disable-bootstrap
--enable-languages=c,c++ --prefix=/workspace/install/gcc/install_15.2.0
Thread model: posix
Supported LTO compression algorithms: zlib
gcc version 15.2.0 (GCC)
  • [Bug rtl-optimization/12... 522024330006 at smail dot nju.edu.cn via Gcc-bugs

Reply via email to