]> gcc.gnu.org Git - gcc.git/commit
c++: Fix up constant expression __builtin_convertvector folding [PR104472]
authorJakub Jelinek <jakub@redhat.com>
Fri, 11 Feb 2022 12:52:44 +0000 (13:52 +0100)
committerJakub Jelinek <jakub@redhat.com>
Tue, 10 May 2022 08:14:32 +0000 (10:14 +0200)
commitf755dd4bda6cb1ae5c6d8e9c3a285faea236d3c3
tree9aed1d4f6172c0c8aaf6326aea1b772b0d9e61b6
parent2ae27346fb5909fb6284f65bec55bcec83533d1e
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)
gcc/cp/constexpr.c
gcc/testsuite/g++.dg/cpp0x/constexpr-104472.C [new file with mode: 0644]
This page took 0.066954 seconds and 6 git commands to generate.