[Bug c++/104472] ICE: SIGSEGV in cxx_eval_internal_function with __builtin_convertvector and -frounding-math
cvs-commit at gcc dot gnu.org
gcc-bugzilla@gcc.gnu.org
Wed May 11 06:24:32 GMT 2022
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=104472
--- Comment #6 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The releases/gcc-9 branch has been updated by Jakub Jelinek
<jakub@gcc.gnu.org>:
https://gcc.gnu.org/g:c7e7ca915dc4c526b1f58a4808c7ec4ceaa30348
commit r9-10125-gc7e7ca915dc4c526b1f58a4808c7ec4ceaa30348
Author: Jakub Jelinek <jakub@redhat.com>
Date: Fri Feb 11 13:52:44 2022 +0100
c++: Fix up constant expression __builtin_convertvector folding [PR104472]
The following testcase ICEs, because due to the -frounding-math
fold_const_call fails, which is it returns NULL, and returning NULL from
cxx_eval* is wrong, all the callers rely on them to either return folded
value or original with *non_constant_p = true.
The following patch does that, and additionally falls through into the
default case where there is diagnostics for the !ctx->quiet case too.
2022-02-11 Jakub Jelinek <jakub@redhat.com>
PR c++/104472
* constexpr.c (cxx_eval_internal_function) <case IFN_VEC_CONVERT>:
Only return fold_const_call result if it is non-NULL. Otherwise
fall through into the default: case to return t, set
*non_constant_p
and emit diagnostics if needed.
* g++.dg/cpp0x/constexpr-104472.C: New test.
(cherry picked from commit 84993d94e13ad2ab3aee151bb5a5e767cf75d51e)
More information about the Gcc-bugs
mailing list