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

            Bug ID: 123397
           Summary: ICE: in make_edges, at cfgbuild.cc during RTL pass:
                    pro_and_epilogue
           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 specifically reproducible with the optimization flag.
Reproducer: https://godbolt.org/z/4coP4rMvK

The compiler fails with an ICE in make_edges when a mismatched declaration of
the built-in function cabs is used in conjunction with a computed goto. The
error occurs during the pro_and_epilogue RTL pass, suggesting an inconsistency
in the Control Flow Graph (CFG) when handling stack/register states for the
mismatched call alongside an indirect jump.

```c
void dummy_func() {}

int main() {
    double cabs(double __x);
    double result = cabs(3.0);

    union {
        void (*op)();
    } pc[1];

    pc[0].op = dummy_func; 

    goto *(pc + 0)->op;
}
```

Traceback:
```
internal compiler error: in make_edges, at cfgbuild.cc:307
   36 | }
      | ^
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
0x5577643 make_edges
        /workspace/install/gcc/src/gcc/gcc/cfgbuild.cc:307
0x5579644 find_many_sub_basic_blocks(simple_bitmap_def*)
        /workspace/install/gcc/src/gcc/gcc/cfgbuild.cc:777
0x1dda1af thread_prologue_and_epilogue_insns()
        /workspace/install/gcc/src/gcc/gcc/function.cc:6247
0x1ddb8c1 rest_of_handle_thread_prologue_and_epilogue
        /workspace/install/gcc/src/gcc/gcc/function.cc:6627
0x1ddbd0f execute
        /workspace/install/gcc/src/gcc/gcc/function.cc:6713
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 rtl-optimization/12... 522024330006 at smail dot nju.edu.cn via Gcc-bugs

Reply via email to