]> git.ipfire.org Git - thirdparty/gcc.git/commit
middle-end/121216 - ICE with VLA const string initializer
authorRichard Biener <rguenther@suse.de>
Tue, 22 Jul 2025 13:41:20 +0000 (15:41 +0200)
committerRichard Biener <rguenth@gcc.gnu.org>
Wed, 23 Jul 2025 06:50:50 +0000 (08:50 +0200)
commit6acf9501771b8a26643fe6b887eb2d9b6d008b47
tree5f778c68ab447a31c9e846b9c8dd3fc27d447210
parent2fda72d1315b72e9d43b05da2f260e5c59aaad41
middle-end/121216 - ICE with VLA const string initializer

constant_byte_string fails to consider the string type might be VLA
when initialized by an empty string CTOR.

PR middle-end/121216
* expr.cc (constant_byte_string): Check the string type
size fits an uhwi before converting to uhwi.

* gcc.dg/pr121216.c: New testcase.
gcc/expr.cc
gcc/testsuite/gcc.dg/pr121216.c [new file with mode: 0644]