(convert_for_assignment): Warn about constant integer
overflow even if no conversion is involved. From-SVN: r2075
This commit is contained in:
parent
850cba2976
commit
2a23183eba
@ -3238,11 +3238,13 @@ fold (expr)
|
||||
if (! TREE_UNSIGNED (type)
|
||||
&& TREE_INT_CST_HIGH (arg0) < 0)
|
||||
{
|
||||
if (TREE_INT_CST_LOW (arg0) == 0)
|
||||
t = build_int_2 (0, - TREE_INT_CST_HIGH (arg0));
|
||||
else
|
||||
t = build_int_2 (- TREE_INT_CST_LOW (arg0),
|
||||
~ TREE_INT_CST_HIGH (arg0));
|
||||
HOST_WIDE_INT low, high;
|
||||
int overflow = neg_double (TREE_INT_CST_LOW (arg0),
|
||||
TREE_INT_CST_HIGH (arg0),
|
||||
&low, &high);
|
||||
t = build_int_2 (low, high);
|
||||
TREE_TYPE (t) = type;
|
||||
force_fit_type (t, overflow);
|
||||
}
|
||||
}
|
||||
else if (TREE_CODE (arg0) == REAL_CST)
|
||||
|
Loading…
Reference in New Issue
Block a user