Commit d08230fe by Nick Clifton Committed by Nick Clifton

(extract_muldiv): When constructing a multiplier/divisor...

(extract_muldiv): When constructing a multiplier/divisor, do not expect
const_binop to correctly determine if overflow has occured, so check explicitly.

From-SVN: r34135
parent 3c7673a5
2000-05-24 Nick Clifton <nickc@cygnus.com>
* fold-const.c (extract_muldiv): When constructing a
multiplier/divisor, do not expect const_binop to correctly
determine if overflow has occured, so check explicitly.
2000-05-24 Alexandre Oliva <aoliva@cygnus.com>
* c-decl.c (build_enumerator): Don't modify the value's type,
......@@ -4451,6 +4451,10 @@ extract_muldiv (t, c, code, wide_type)
or floor division, by a power of two, so we can treat it that
way unless the multiplier or divisor overflows. */
if (TREE_CODE (op1) == INTEGER_CST
/* const_binop may not detect overflow correctly,
so check for it explicitly here. */
&& TYPE_PRECISION (TREE_TYPE (size_one_node)) > TREE_INT_CST_LOW (op1)
&& TREE_INT_CST_HIGH (op1) == 0
&& 0 != (t1 = convert (ctype,
const_binop (LSHIFT_EXPR, size_one_node,
op1, 0)))
......
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