Commit e2cfa983 by Richard Biener Committed by Richard Biener

tree-vrp.c (extract_range_from_multiplicative_op): Add type parameter and use it…

tree-vrp.c (extract_range_from_multiplicative_op): Add type parameter and use it instead of guessing expression type from the...

2019-07-25  Richard Biener  <rguenther@suse.de>

	* tree-vrp.c (extract_range_from_multiplicative_op): Add
	type parameter and use it instead of guessing expression
	type from the first operand.
	(extract_range_from_binary_expr): Pass expr_type down.

From-SVN: r273797
parent c9357dc1
2019-07-25 Richard Biener <rguenther@suse.de>
* tree-vrp.c (extract_range_from_multiplicative_op): Add
type parameter and use it instead of guessing expression
type from the first operand.
(extract_range_from_binary_expr): Pass expr_type down.
2019-07-25 Kyrylo Tkachov <kyrylo.tkachov@arm.com> 2019-07-25 Kyrylo Tkachov <kyrylo.tkachov@arm.com>
* config/arm/arm.md (SATrev): Change to code attribute. * config/arm/arm.md (SATrev): Change to code attribute.
......
...@@ -1238,7 +1238,7 @@ extract_range_into_wide_ints (const value_range_base *vr, ...@@ -1238,7 +1238,7 @@ extract_range_into_wide_ints (const value_range_base *vr,
static void static void
extract_range_from_multiplicative_op (value_range_base *vr, extract_range_from_multiplicative_op (value_range_base *vr,
enum tree_code code, enum tree_code code, tree type,
const value_range_base *vr0, const value_range_base *vr0,
const value_range_base *vr1) const value_range_base *vr1)
{ {
...@@ -1253,7 +1253,6 @@ extract_range_from_multiplicative_op (value_range_base *vr, ...@@ -1253,7 +1253,6 @@ extract_range_from_multiplicative_op (value_range_base *vr,
gcc_assert (vr0->kind () == VR_RANGE gcc_assert (vr0->kind () == VR_RANGE
&& vr0->kind () == vr1->kind ()); && vr0->kind () == vr1->kind ());
tree type = vr0->type ();
wide_int res_lb, res_ub; wide_int res_lb, res_ub;
wide_int vr0_lb = wi::to_wide (vr0->min ()); wide_int vr0_lb = wi::to_wide (vr0->min ());
wide_int vr0_ub = wi::to_wide (vr0->max ()); wide_int vr0_ub = wi::to_wide (vr0->max ());
...@@ -1785,7 +1784,7 @@ extract_range_from_binary_expr (value_range_base *vr, ...@@ -1785,7 +1784,7 @@ extract_range_from_binary_expr (value_range_base *vr,
vr->set_varying (); vr->set_varying ();
return; return;
} }
extract_range_from_multiplicative_op (vr, code, &vr0, &vr1); extract_range_from_multiplicative_op (vr, code, expr_type, &vr0, &vr1);
return; return;
} }
else if (code == RSHIFT_EXPR else if (code == RSHIFT_EXPR
...@@ -1806,7 +1805,8 @@ extract_range_from_binary_expr (value_range_base *vr, ...@@ -1806,7 +1805,8 @@ extract_range_from_binary_expr (value_range_base *vr,
if (vr0.kind () != VR_RANGE || vr0.symbolic_p ()) if (vr0.kind () != VR_RANGE || vr0.symbolic_p ())
vr0.set (VR_RANGE, vrp_val_min (expr_type), vr0.set (VR_RANGE, vrp_val_min (expr_type),
vrp_val_max (expr_type)); vrp_val_max (expr_type));
extract_range_from_multiplicative_op (vr, code, &vr0, &vr1); extract_range_from_multiplicative_op (vr, code, expr_type,
&vr0, &vr1);
return; return;
} }
else if (code == LSHIFT_EXPR else if (code == LSHIFT_EXPR
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment