aboutsummaryrefslogtreecommitdiff
path: root/gcc/gimple-range.h
diff options
context:
space:
mode:
authorAndrew MacLeod <amacleod@redhat.com>2020-11-12 19:25:59 -0500
committerAndrew MacLeod <amacleod@redhat.com>2020-11-12 19:28:45 -0500
commitee24da1b983a89b05303f2ac8828dd8cbe28d3b4 (patch)
treeabfe913cd3b691b5b7c000d6390103365fb1fa88 /gcc/gimple-range.h
parenta5a115258afd6c0bdd8ff4c8071dcffbafb88186 (diff)
downloadgcc-ee24da1b983a89b05303f2ac8828dd8cbe28d3b4.zip
gcc-ee24da1b983a89b05303f2ac8828dd8cbe28d3b4.tar.gz
gcc-ee24da1b983a89b05303f2ac8828dd8cbe28d3b4.tar.bz2
Change range_handler, was Re: Fix gimple_expr_code?
Adjust the range_handler to not use gimple_expr_code/type. * gimple-range.h (gimple_range_handler): Use gimple_assign and gimple_cond routines to get type and code. * range-op.cc (range_op_handler): Check for integral types.
Diffstat (limited to 'gcc/gimple-range.h')
-rw-r--r--gcc/gimple-range.h8
1 files changed, 6 insertions, 2 deletions
diff --git a/gcc/gimple-range.h b/gcc/gimple-range.h
index 0aa6d46..88d2ada 100644
--- a/gcc/gimple-range.h
+++ b/gcc/gimple-range.h
@@ -97,8 +97,12 @@ extern bool gimple_range_calc_op2 (irange &r, const gimple *s,
static inline range_operator *
gimple_range_handler (const gimple *s)
{
- if ((gimple_code (s) == GIMPLE_ASSIGN) || (gimple_code (s) == GIMPLE_COND))
- return range_op_handler (gimple_expr_code (s), gimple_expr_type (s));
+ if (gimple_code (s) == GIMPLE_ASSIGN)
+ return range_op_handler (gimple_assign_rhs_code (s),
+ TREE_TYPE (gimple_assign_lhs (s)));
+ if (gimple_code (s) == GIMPLE_COND)
+ return range_op_handler (gimple_cond_code (s),
+ TREE_TYPE (gimple_cond_lhs (s)));
return NULL;
}