aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorliuhongt <hongtao.liu@intel.com>2023-10-25 14:36:57 +0800
committerliuhongt <hongtao.liu@intel.com>2023-10-26 16:36:06 +0800
commit2f592b7b55b545ea4e3bd4fe88fc8d6fbfa3c5a5 (patch)
treeae9b10e50be1aa0d2af70431d88fa486ed71794f /gcc
parent60c11c9a239e8d48d5426ca48ed40349074d1d0b (diff)
downloadgcc-2f592b7b55b545ea4e3bd4fe88fc8d6fbfa3c5a5.zip
gcc-2f592b7b55b545ea4e3bd4fe88fc8d6fbfa3c5a5.tar.gz
gcc-2f592b7b55b545ea4e3bd4fe88fc8d6fbfa3c5a5.tar.bz2
Pass type of comparison operands instead of comparison result to truth_type_for in build_vec_cmp.
gcc/c/ChangeLog: * c-typeck.cc (build_vec_cmp): Pass type of arg0 to truth_type_for. gcc/cp/ChangeLog: * typeck.cc (build_vec_cmp): Pass type of arg0 to truth_type_for.
Diffstat (limited to 'gcc')
-rw-r--r--gcc/c/c-typeck.cc2
-rw-r--r--gcc/cp/typeck.cc2
2 files changed, 2 insertions, 2 deletions
diff --git a/gcc/c/c-typeck.cc b/gcc/c/c-typeck.cc
index 1eee653..0de4662 100644
--- a/gcc/c/c-typeck.cc
+++ b/gcc/c/c-typeck.cc
@@ -11986,7 +11986,7 @@ build_vec_cmp (tree_code code, tree type,
{
tree zero_vec = build_zero_cst (type);
tree minus_one_vec = build_minus_one_cst (type);
- tree cmp_type = truth_type_for (type);
+ tree cmp_type = truth_type_for (TREE_TYPE (arg0));
tree cmp = build2 (code, cmp_type, arg0, arg1);
return build3 (VEC_COND_EXPR, type, cmp, minus_one_vec, zero_vec);
}
diff --git a/gcc/cp/typeck.cc b/gcc/cp/typeck.cc
index 3b71932..00570f1 100644
--- a/gcc/cp/typeck.cc
+++ b/gcc/cp/typeck.cc
@@ -4820,7 +4820,7 @@ build_vec_cmp (tree_code code, tree type,
{
tree zero_vec = build_zero_cst (type);
tree minus_one_vec = build_minus_one_cst (type);
- tree cmp_type = truth_type_for (type);
+ tree cmp_type = truth_type_for (TREE_TYPE (arg0));
tree cmp = build2 (code, cmp_type, arg0, arg1);
return build3 (VEC_COND_EXPR, type, cmp, minus_one_vec, zero_vec);
}