https://gcc.gnu.org/bugzilla/show_bug.cgi?id=125898
Bug ID: 125898
Summary: ice in gimplify_var_or_parm_decl, at gimplify.cc:3267
with -O1 on arm32
Product: gcc
Version: 16.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: target
Assignee: unassigned at gcc dot gnu.org
Reporter: dcb314 at hotmail dot com
Target Milestone: ---
For this C++ code
struct TrueView {
int p;
constexpr TrueView() {}
constexpr operator bool() { return true; }
} binary_conditional_folded_true_fb;
void binary_conditional_folded_true() {
TrueView() ?: binary_conditional_folded_true_fb;
}
on arm32, does this:
dcb@raspberrypi:~/cvise $ ~/gcc/results/bin/g++ -c -w -O1 bug1221.cc
bug1221.cc: In function ‘void binary_conditional_folded_true()’:
bug1221.cc:7:14: internal compiler error: in gimplify_var_or_parm_decl, at
gimplify.cc:3267
7 | TrueView() ?: binary_conditional_folded_true_fb;
| ~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
0x2067b8b internal_error(char const*, ...)
../../trunk/gcc/diagnostic-global-context.cc:787
0x2de417 fancy_abort(char const*, int, char const*)
../../trunk/gcc/diagnostics/context.cc:1813
0xb16d8b gimplify_var_or_parm_decl
../../trunk/gcc/gimplify.cc:3267
Compiler is
dcb@raspberrypi:~/cvise $ ~/gcc/results/bin/g++ -v
Using built-in specs.
COLLECT_GCC=/home/dcb/gcc/results/bin/g++
COLLECT_LTO_WRAPPER=/home/dcb/gcc/results.20260618.asan/libexec/gcc/arm-linux-gnueabihf/17.0.0/lto-wrapper
Target: arm-linux-gnueabihf
Configured with: ../trunk/configure
--prefix=/home/dcb/gcc/results.20260618.asan --disable-bootstrap --disable-doc
--disable-multilib --with-build-config=bootstrap-asan
--with-pkgversion=ccfe2771c6f5272a --enable-checking=yes
--enable-languages=c,c++,fortran --with-cpu=cortex-a76 --with-fpu=neon-fp-armv8
--with-float=hard --build=arm-linux-gnueabihf --host=arm-linux-gnueabihf
--target=arm-linux-gnueabihf
Thread model: posix
Supported LTO compression algorithms: zlib
gcc version 17.0.0 20260618 (experimental) (ccfe2771c6f5272a)
dcb@raspberrypi:~/cvise $
The code is reduced from clang's testsuite, file Sema/LifetimeSafety/safety.cpp
The problem doesn't seem to occur on x86_64.