]> git.ipfire.org Git - thirdparty/gcc.git/commit
middle-end/119204 - ICE with strcspn folding
authorRichard Biener <rguenther@suse.de>
Tue, 11 Mar 2025 07:40:44 +0000 (08:40 +0100)
committerRichard Biener <rguenth@gcc.gnu.org>
Tue, 11 Mar 2025 11:05:01 +0000 (12:05 +0100)
commit68932eeb38f66fbc0c3cf4b77ff7dde8a408f2e4
treeee522c94a0cb127023651b54b094e97e900710de
parent1b7a05770833eb210783ec8babd0027ec237d191
middle-end/119204 - ICE with strcspn folding

The following makes sure to convert the folded expression to the
original expression type.

PR middle-end/119204
* builtins.cc (fold_builtin_strcspn): Preserve the original
expression type.

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