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

            Bug ID: 112501
           Summary: GCC: 14: internal compiler error: in extract_insn, at
                    recog.cc:2804
           Product: gcc
           Version: 14.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c
          Assignee: unassigned at gcc dot gnu.org
          Reporter: 141242068 at smail dot nju.edu.cn
  Target Milestone: ---

Compiler Explorer: https://gcc.godbolt.org/z/65TGaK86r

When compiling this program with `gcc-14 -O1`, gcc crashes:
```
short b;

int main() {
  if (b + 2) __builtin_abort();
  if (__builtin_speculation_safe_value(b) != 2)
    __builtin_abort();
  return 0;
}
```

A interesting finding: after replacing `b + 2` by `b` in the first if-stmt's
condition expr, this crash disappears, though it seems the root cause ought to
be the second if-stmt.

The crash output:
```
<source>: In function 'main':
<source>:8:1: error: unrecognizable insn:
    8 | }
      | ^
(insn 15 14 16 5 (set (reg:HI 99 [ _4 ])
        (const_int 65534 [0xfffe])) "<source>":5:7 -1
     (nil))
during RTL pass: vregs
<source>:8:1: internal compiler error: in extract_insn, at recog.cc:2804
0x238b15e internal_error(char const*, ...)
        ???:0
0xa11270 fancy_abort(char const*, int, char const*)
        ???:0
0x827c80 _fatal_insn(char const*, rtx_def const*, char const*, int, char
const*)
        ???:0
0x827ca2 _fatal_insn_not_found(rtx_def const*, char const*, int, char const*)
        ???:0
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.
Compiler returned: 1
```
  • [Bug c/112501] New: GCC: 14... 141242068 at smail dot nju.edu.cn via Gcc-bugs

Reply via email to