https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97538
Bug ID: 97538 Summary: ICE in during GIMPLE pass: wrestrict Product: gcc Version: 11.0 Status: UNCONFIRMED Keywords: ice-on-valid-code Severity: normal Priority: P3 Component: tree-optimization Assignee: unassigned at gcc dot gnu.org Reporter: marxin at gcc dot gnu.org CC: msebor at gcc dot gnu.org Target Milestone: --- Host: x86_64-linux Target: aarch64-linux-gnu The following fails with a cross compiler: $ cat restrict.C void *b, *c; struct H { virtual bool accept(const char *, unsigned long, int *, bool); }; char accept_bt[1], accept_cd[1]; int accept_cb; bool accept_cb_0; class t : H { bool accept(const char *, unsigned long bd, int *bg, bool) { long bu = sizeof(int) + bd; char *bw = bu > sizeof(accept_bt) ? new char : accept_bt, *cf = bd ? new char : accept_cd; __builtin___memcpy_chk(b, c, bd, 0); if (bw != accept_bt) delete bw; bool ci = cj((int *)cf, bg), atran = bp && accept_cb_0; atran &&ci &&cm(&accept_cb); } bool cj(int *, int *); bool cm(int *); bool bp; }; void bj() { new t; } $ ~/BIG/bin/aarch64/dev/shm/buildbot/install/gcc/bin/aarch64-linux-gnu-gcc restrict.C -fno-guess-branch-probability -fno-tree-pta -O1 -c restrict.C: In member function ‘virtual bool t::accept(const char*, long unsigned int, int*, bool)’: restrict.C:18:3: warning: no return statement in function returning non-void [-Wreturn-type] 18 | } | ^ during GIMPLE pass: wrestrict restrict.C:9:8: internal compiler error: Segmentation fault 9 | bool accept(const char *, unsigned long bd, int *bg, bool) { | ^~~~~~ 0xcc48bf crash_signal /home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-trunk-aarch64/build/gcc/toplev.c:330 0x7ffff76ae6bf ??? /usr/src/debug/glibc-2.32-1.1.x86_64/signal/../sysdeps/unix/sysv/linux/x86_64/sigaction.c:0 0xf85dc7 wi::force_to_size(long*, long const*, unsigned int, unsigned int, unsigned int, signop) /home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-trunk-aarch64/build/gcc/wide-int.cc:369 0xf3094e wide_int_storage::from(generic_wide_int<wide_int_ref_storage<false, true> > const&, unsigned int, signop) /home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-trunk-aarch64/build/gcc/wide-int.h:1172 0xf3094e wide_int_to_tree_1 /home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-trunk-aarch64/build/gcc/tree.c:1538 0x8d402d get_size_range(range_query*, tree_node*, gimple*, tree_node**, int) /home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-trunk-aarch64/build/gcc/calls.c:1383 0xa68ce0 builtin_memref /home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-trunk-aarch64/build/gcc/gimple-ssa-warn-restrict.c:259 0xa6c5e7 check_bounds_or_overlap(range_query*, gimple*, tree_node*, tree_node*, tree_node*, tree_node*, bool, bool) /home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-trunk-aarch64/build/gcc/gimple-ssa-warn-restrict.c:2011 0xa6f70b check_call /home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-trunk-aarch64/build/gcc/gimple-ssa-warn-restrict.c:1977 0xa6f70b wrestrict_walk /home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-trunk-aarch64/build/gcc/gimple-ssa-warn-restrict.c:93 0xa6f70b execute /home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-trunk-aarch64/build/gcc/gimple-ssa-warn-restrict.c:103 Please submit a full bug report, with preprocessed source if appropriate. Please include the complete backtrace with any bug report. See <https://gcc.gnu.org/bugs/> for instructions.