aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorAldy Hernandez <aldyh@redhat.com>2024-05-16 09:22:55 +0200
committerAldy Hernandez <aldyh@redhat.com>2024-05-16 11:57:48 +0200
commitf6bed6d3fcc13880ffa786b6c616e2306efe2bf3 (patch)
treeeeeb7537916c9a66ec28ce02bde849ab582f4b7f /gcc
parentb8b82bb05c10544da05cd0d3d39e6bc3763a8d9f (diff)
downloadgcc-f6bed6d3fcc13880ffa786b6c616e2306efe2bf3.zip
gcc-f6bed6d3fcc13880ffa786b6c616e2306efe2bf3.tar.gz
gcc-f6bed6d3fcc13880ffa786b6c616e2306efe2bf3.tar.bz2
Use a boolean type when folding conditionals in simplify_using_ranges.
In adding some traps for PR114985 I noticed that the conditional folding code in simplify_using_ranges was using the wrong type. This cleans up the oversight. gcc/ChangeLog: PR tree-optimization/114985 * vr-values.cc (simplify_using_ranges::fold_cond_with_ops): Use boolean type when folding conditionals.
Diffstat (limited to 'gcc')
-rw-r--r--gcc/vr-values.cc3
1 files changed, 1 insertions, 2 deletions
diff --git a/gcc/vr-values.cc b/gcc/vr-values.cc
index 0572bf6..e6ea959 100644
--- a/gcc/vr-values.cc
+++ b/gcc/vr-values.cc
@@ -316,10 +316,9 @@ simplify_using_ranges::fold_cond_with_ops (enum tree_code code,
|| !query->range_of_expr (r1, op1, s))
return NULL_TREE;
- tree type = TREE_TYPE (op0);
int_range<1> res;
range_op_handler handler (code);
- if (handler && handler.fold_range (res, type, r0, r1))
+ if (handler && handler.fold_range (res, boolean_type_node, r0, r1))
{
if (res == range_true ())
return boolean_true_node;