]> gcc.gnu.org Git - gcc.git/commitdiff
(extract_muldiv): When constructing a multiplier/divisor...
authorNick Clifton <nickc@cygnus.com>
Wed, 24 May 2000 18:24:06 +0000 (18:24 +0000)
committerNick Clifton <nickc@gcc.gnu.org>
Wed, 24 May 2000 18:24:06 +0000 (18:24 +0000)
(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

gcc/ChangeLog
gcc/fold-const.c

index b874d9ff920784aa3dacbb1d9bc57d309180866a..d3f281efbca79ca909f85f3e616074e15295bae0 100644 (file)
@@ -1,3 +1,9 @@
+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,
index 12a8d1a7a4064d8286a95626ae0164b63eeceff1..eec3bc48b76ae3b6c58862865e4851d0f181a0fb 100644 (file)
@@ -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)))
This page took 0.096911 seconds and 5 git commands to generate.