https://gcc.gnu.org/bugzilla/show_bug.cgi?id=119450
Bug ID: 119450
Summary: Crash at -O3: during RTL pass: peephole2
Product: gcc
Version: 14.1.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: rtl-optimization
Assignee: unassigned at gcc dot gnu.org
Reporter: yunboni at smail dot nju.edu.cn
Target Milestone: ---
This code crashes at -O3:
long *a;
int b;
void c() {
unsigned d = b >> 30;
a = (long *)d;
if (*a & 1 << 30)
*a = 0;
}
void main() {}
Crash:
during RTL pass: peephole2
<source>:8:1: internal compiler error: in change_address_1, at emit-rtl.cc:2299
8 | }
| ^
0x25fc575 diagnostic_context::diagnostic_impl(rich_location*,
diagnostic_metadata const*, diagnostic_option_id, char const*, __va_list_tag
(*) [1], diagnostic_t)
???:0
0x2613546 internal_error(char const*, ...)
???:0
0x9ea5ec fancy_abort(char const*, int, char const*)
???:0
0xcb9282 adjust_address_1(rtx_def*, machine_mode, poly_int<1u, long>, int, int,
int, poly_int<1u, long>)
???:0
0x1d177e2 gen_peephole2_126(rtx_insn*, rtx_def**)
???:0
0x22d27ff peephole2_insns(rtx_def*, rtx_insn*, int*)
???:0
Compiler Explorer: https://godbolt.org/z/EcK4abv53
Bisected to
https://github.com/gcc-mirror/gcc/commit/678e6c328c77db383431751bcfcf867b02369bd6