mirror of
git://gcc.gnu.org/git/gcc.git
synced 2025-04-08 06:50:27 +08:00
tree-chrec.c (chrec_convert_aggressive): Do not eliminate conversions where TYPE_MIN_VALUE/TYPE_MAX_VALUE do not cover...
* tree-chrec.c (chrec_convert_aggressive): Do not eliminate conversions where TYPE_MIN_VALUE/TYPE_MAX_VALUE do not cover the range allowed by TYPE_PRECISION. From-SVN: r111568
This commit is contained in:
parent
ea45681a7a
commit
e5c7f9f582
@ -1,5 +1,9 @@
|
||||
2006-02-28 Jeff Law <law@redhat.com>
|
||||
|
||||
* tree-chrec.c (chrec_convert_aggressive): Do not eliminate
|
||||
conversions where TYPE_MIN_VALUE/TYPE_MAX_VALUE do not cover
|
||||
the range allowed by TYPE_PRECISION.
|
||||
|
||||
* tree.h (strct phi_arg_d): Remove unused NONZERO field.
|
||||
|
||||
2006-02-28 Dorit Nuzman <dorit@il.ibm.com>
|
||||
|
@ -1219,6 +1219,26 @@ chrec_convert_aggressive (tree type, tree chrec)
|
||||
if (!rc)
|
||||
rc = chrec_convert (type, right, NULL_TREE);
|
||||
|
||||
/* Ada creates sub-types where TYPE_MIN_VALUE/TYPE_MAX_VALUE do not
|
||||
cover the entire range of values allowed by TYPE_PRECISION.
|
||||
|
||||
We do not want to optimize away conversions to such types. Long
|
||||
term I'd rather see the Ada front-end fixed. */
|
||||
if (INTEGRAL_TYPE_P (type))
|
||||
{
|
||||
tree t;
|
||||
|
||||
t = upper_bound_in_type (type, inner_type);
|
||||
if (! TYPE_MAX_VALUE (type)
|
||||
|| ! operand_equal_p (TYPE_MAX_VALUE (type), t, 0))
|
||||
return NULL_TREE;
|
||||
|
||||
t = lower_bound_in_type (type, inner_type);
|
||||
if (! TYPE_MIN_VALUE (type)
|
||||
|| ! operand_equal_p (TYPE_MIN_VALUE (type), t, 0))
|
||||
return NULL_TREE;
|
||||
}
|
||||
|
||||
return build_polynomial_chrec (CHREC_VARIABLE (chrec), lc, rc);
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user