aboutsummaryrefslogtreecommitdiff
path: root/gcc/tree-vectorizer.h
diff options
context:
space:
mode:
authorAndrew Pinski <quic_apinski@quicinc.com>2025-01-16 12:53:21 -0800
committerAndrew Pinski <quic_apinski@quicinc.com>2025-01-21 14:07:47 -0800
commit0d25d45c9d3a54b21f9dce43beb0b5ced4db0409 (patch)
tree11c79a1a7087f262f382cf659a6b0f3b7998c7c5 /gcc/tree-vectorizer.h
parent16d778239397b2f70a1e0680c0b82ae6ee98fe9e (diff)
downloadgcc-0d25d45c9d3a54b21f9dce43beb0b5ced4db0409.zip
gcc-0d25d45c9d3a54b21f9dce43beb0b5ced4db0409.tar.gz
gcc-0d25d45c9d3a54b21f9dce43beb0b5ced4db0409.tar.bz2
c++: Don't call fold from cp_fold if one of the operands is an error_mark [PR118525]
While adding a new match pattern, g++.dg/cpp2a/consteval36.C started to ICE and that was because we would call fold even if one of the operands of the comparison was an error_mark_node. I found a new testcase which also ICEs before this patch too so show the issue was latent. So there is code in cp_fold to avoid calling fold when one of the operands become error_mark_node but with the addition of consteval, the replacement of an invalid call is replaced before the call to cp_fold and there is no way to pop up the error_mark. So this patch changes the current code to check if the operands of the expression are error_mark_node before checking if the folded operand is different from the previous one. Bootstrapped and tested on x86_64-linux-gnu. PR c++/118525 gcc/cp/ChangeLog: * cp-gimplify.cc (cp_fold): Check operands of unary, binary, cond/vec_cond and array_ref for error_mark before checking if the operands had changed. gcc/testsuite/ChangeLog: * g++.dg/cpp2a/consteval38.C: New test. Signed-off-by: Andrew Pinski <quic_apinski@quicinc.com>
Diffstat (limited to 'gcc/tree-vectorizer.h')
0 files changed, 0 insertions, 0 deletions