Commit 2a23183e by Richard Stallman

(convert_for_assignment): Warn about constant integer

overflow even if no conversion is involved.

From-SVN: r2075
parent 850cba29
...@@ -3238,11 +3238,13 @@ fold (expr) ...@@ -3238,11 +3238,13 @@ fold (expr)
if (! TREE_UNSIGNED (type) if (! TREE_UNSIGNED (type)
&& TREE_INT_CST_HIGH (arg0) < 0) && TREE_INT_CST_HIGH (arg0) < 0)
{ {
if (TREE_INT_CST_LOW (arg0) == 0) HOST_WIDE_INT low, high;
t = build_int_2 (0, - TREE_INT_CST_HIGH (arg0)); int overflow = neg_double (TREE_INT_CST_LOW (arg0),
else TREE_INT_CST_HIGH (arg0),
t = build_int_2 (- TREE_INT_CST_LOW (arg0), &low, &high);
~ TREE_INT_CST_HIGH (arg0)); t = build_int_2 (low, high);
TREE_TYPE (t) = type;
force_fit_type (t, overflow);
} }
} }
else if (TREE_CODE (arg0) == REAL_CST) else if (TREE_CODE (arg0) == REAL_CST)
......
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