https://gcc.gnu.org/bugzilla/show_bug.cgi?id=114913
Bug ID: 114913
Summary: "verify_gimple failed" due to addition of two
constexpr strings
Product: gcc
Version: 15.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c++
Assignee: unassigned at gcc dot gnu.org
Reporter: jorg.brown at gmail dot com
Target Milestone: ---
Source:
#include <string>
constexpr std::string Hello = "Hello, ", World = "World.";
constexpr std::string HelloWorld = Hello + World;
int main() { printf("%s\n", HelloWorld.c_str()); }
= - = - = - = - = - = - = - = - = - = - = - = - = - = - = - =
Version:
g++
(Compiler-Explorer-Build-gcc-610415bb7ddc5626ec301ca20833e78696978601-binutils-2.40)
15.0.0 20240501 (experimental)
Copyright (C) 2024 Free Software Foundation, Inc.
ASM generation compiler returned: 0
g++
(Compiler-Explorer-Build-gcc-610415bb7ddc5626ec301ca20833e78696978601-binutils-2.40)
15.0.0 20240501 (experimental)
Copyright (C) 2024 Free Software Foundation, Inc.
= - = - = - = - = - = - = - = - = - = - = - = - = - = - = - =
As seen at https://godbolt.org/z/hd1TbM61Y , I got:
<source>: In function 'int main()':
<source>:8:50: error: constant not recomputed when 'ADDR_EXPR' changed
8 | int main() { printf("%s\n", HelloWorld.c_str()); }
| ^
_3 = &HelloWorld.D.38876._M_local_buf;
during GIMPLE pass: einline
<source>:8:50: internal compiler error: verify_gimple failed
0x267adac internal_error(char const*, ...)
???:0
0x13e317e verify_gimple_in_cfg(function*, bool, bool)
???: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
= - = - = - = - = - = - = - = - = - = - = - = - = - = - = - =
I don't have access to the gcc executable causing this problem, and
-freport-bug doesn't work from godbolt, so I can't give you the preprocessed
input.