https://gcc.gnu.org/bugzilla/show_bug.cgi?id=115411
Bug ID: 115411 Summary: ICE : in expand_call, at calls.cc:3668 Product: gcc Version: 15.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c Assignee: unassigned at gcc dot gnu.org Reporter: iamanonymous.cs at gmail dot com Target Milestone: --- ******************************************************************************* The compiler produces an internal error during the expand RTL pass when compiling the provided code with the specified options. This problem occurs on both gcc and g++. The issue can also be reproduced on Compiler Explorer. ******************************************************************************* OS and Platform: # uname -a Linux ubuntu 4.15.0-213-generic #224-Ubuntu SMP Mon Jun 19 13:30:12 UTC 2023 x86_64 x86_64 x86_64 GNU/Linux ******************************************************************************* # gcc -v Using built-in specs. COLLECT_GCC=gcc COLLECT_LTO_WRAPPER=/root/gdbtest/gcc/gcc-15/libexec/gcc/x86_64-pc-linux-gnu/15.0.0/lto-wrapper Target: x86_64-pc-linux-gnu Configured with: /root/gdbtest/gcc/obj/../gcc/configure --prefix=/root/gdbtest/gcc/gcc-15 --enable-languages=c,c++,fortran,go --disable-multilib Thread model: posix Supported LTO compression algorithms: zlib gcc version 15.0.0 20240509 (experimental) (GCC) # g++ -v Using built-in specs. COLLECT_GCC=g++ COLLECT_LTO_WRAPPER=/root/gdbtest/gcc/gcc-15/libexec/gcc/x86_64-pc-linux-gnu/15.0.0/lto-wrapper Target: x86_64-pc-linux-gnu Configured with: /root/gdbtest/gcc/obj/../gcc/configure --prefix=/root/gdbtest/gcc/gcc-15 --enable-languages=c,c++,fortran,go --disable-multilib Thread model: posix Supported LTO compression algorithms: zlib gcc version 15.0.0 20240509 (experimental) (GCC) ******************************************************************************* Program: # z2.cc typedef struct { char c[0x40000001]; } s; void f (s); int g (s *x) { f (*x); } ******************************************************************************* Command Lines: For g++: # g++ z2.cc -Werror -O2 -ftrapv -fstack-protector-strong -o z2.out /root/gdbtest/gcctest/gcc_llvm/gcc/z2.cc: In function ‘int g(s*)’: /root/gdbtest/gcctest/gcc_llvm/gcc/z2.cc:6:1: error: no return statement in function returning non-void [-Werror=return-type] 6 | } | ^ /root/gdbtest/gcctest/gcc_llvm/gcc/z2.cc:5:5: sorry, unimplemented: passing too large argument on stack 5 | f (*x); | ~~^~~~ during RTL pass: expand /root/gdbtest/gcctest/gcc_llvm/gcc/z2.cc:5:5: internal compiler error: in expand_call, at calls.cc:3668 0x894771 expand_call(tree_node*, rtx_def*, int) /root/gdbtest/gcc/obj/../gcc/gcc/calls.cc:3668 0xf8fe8e expand_expr_real_1(tree_node*, rtx_def*, machine_mode, expand_modifier, rtx_def**, bool) /root/gdbtest/gcc/obj/../gcc/gcc/expr.cc:12364 0xe65f8d expand_expr(tree_node*, rtx_def*, machine_mode, expand_modifier) /root/gdbtest/gcc/obj/../gcc/gcc/expr.h:316 0xe65f8d expand_call_stmt /root/gdbtest/gcc/obj/../gcc/gcc/cfgexpand.cc:2884 0xe65f8d expand_gimple_stmt_1 /root/gdbtest/gcc/obj/../gcc/gcc/cfgexpand.cc:3951 0xe65f8d expand_gimple_stmt /root/gdbtest/gcc/obj/../gcc/gcc/cfgexpand.cc:4093 0xe66a47 expand_gimple_basic_block /root/gdbtest/gcc/obj/../gcc/gcc/cfgexpand.cc:6149 0xe686c6 execute /root/gdbtest/gcc/obj/../gcc/gcc/cfgexpand.cc:6888 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. For gcc: # gcc z2.cc -Werror -O2 -ftrapv -fstack-protector-strong -o z2.out z2.cc: In function ‘int g(s*)’: z2.cc:6:1: error: no return statement in function returning non-void [-Werror=return-type] 6 | } | ^ z2.cc:5:5: sorry, unimplemented: passing too large argument on stack 5 | f (*x); | ~~^~~~ during RTL pass: expand z2.cc:5:5: internal compiler error: in expand_call, at calls.cc:3668 0x894771 expand_call(tree_node*, rtx_def*, int) /root/gdbtest/gcc/obj/../gcc/gcc/calls.cc:3668 0xf8fe8e expand_expr_real_1(tree_node*, rtx_def*, machine_mode, expand_modifier, rtx_def**, bool) /root/gdbtest/gcc/obj/../gcc/gcc/expr.cc:12364 0xe65f8d expand_expr(tree_node*, rtx_def*, machine_mode, expand_modifier) /root/gdbtest/gcc/obj/../gcc/gcc/expr.h:316 0xe65f8d expand_call_stmt /root/gdbtest/gcc/obj/../gcc/gcc/cfgexpand.cc:2884 0xe65f8d expand_gimple_stmt_1 /root/gdbtest/gcc/obj/../gcc/gcc/cfgexpand.cc:3951 0xe65f8d expand_gimple_stmt /root/gdbtest/gcc/obj/../gcc/gcc/cfgexpand.cc:4093 0xe66a47 expand_gimple_basic_block /root/gdbtest/gcc/obj/../gcc/gcc/cfgexpand.cc:6149 0xe686c6 execute /root/gdbtest/gcc/obj/../gcc/gcc/cfgexpand.cc:6888 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. ******************************************************************************* Also ICE on trunk, compiler explorer: g++: https://godbolt.org/z/Kr4dvWKrE gcc : https://godbolt.org/z/cdb87oG84 *******************************************************************************