]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
re PR middle-end/16790 (Integer down cast ignored in larger expression)
authorRoger Sayle <roger@eyesopen.com>
Sun, 8 Aug 2004 18:55:34 +0000 (18:55 +0000)
committerRoger Sayle <sayle@gcc.gnu.org>
Sun, 8 Aug 2004 18:55:34 +0000 (18:55 +0000)
2004-08-08  Roger Sayle  <roger@eyesopen.com>

PR middle-end/16790
Backport from mainline.
* fold-const.c (expand_muldiv_1) <NOP_EXPR>: Disallow local
truncations, not just global truncations.

* gcc.c-torture/execute/pr16790-1.c: New test case.

From-SVN: r85691

gcc/ChangeLog
gcc/fold-const.c
gcc/testsuite/ChangeLog

index d2088262f4b2ea3b180b159d6ea25d499449ff28..2a64568f9cb493c9e9e7e39f0582dcff207fadee 100644 (file)
@@ -1,3 +1,9 @@
+2004-08-08  Roger Sayle  <roger@eyesopen.com>
+
+       PR middle-end/16790
+       * fold-const.c (expand_muldiv_1) <NOP_EXPR>: Disallow local
+       truncations, not just global truncations.
+
 2004-08-02  Ulrich Weigand  <uweigand@de.ibm.com>
 
        Backport from mainline:
index 9be3ddfa6abfc8befd16410dccb0e3d03a2aa9a0..308d60e6bbe925236da2b36bc49c4c66c95f0f96 100644 (file)
@@ -4114,9 +4114,9 @@ extract_muldiv_1 (t, c, code, wide_type)
                     && TYPE_IS_SIZETYPE (TREE_TYPE (op0)))
               && (GET_MODE_SIZE (TYPE_MODE (ctype))
                   > GET_MODE_SIZE (TYPE_MODE (TREE_TYPE (op0)))))
-             /* ... or its type is larger than ctype,
-                then we cannot pass through this truncation.  */
-             || (GET_MODE_SIZE (TYPE_MODE (ctype))
+             /* ... or this is a truncation (t is narrower than op0),
+                then we cannot pass through this narrowing.  */
+             || (GET_MODE_SIZE (TYPE_MODE (type))
                  < GET_MODE_SIZE (TYPE_MODE (TREE_TYPE (op0))))
              /* ... or signedness changes for division or modulus,
                 then we cannot pass through this conversion.  */
index 12fb3d6834ce11d0755e5e241bb9995ebdbae6a6..a9a5863efd9ff84d389e4bedb26bb5d16ff07fa8 100644 (file)
@@ -1,3 +1,8 @@
+2004-08-08  Roger Sayle  <roger@eyesopen.com>
+
+       PR middle-end/16790
+       * gcc.c-torture/execute/pr16790-1.c: New test case.
+
 2004-08-04  Ulrich Weigand  <uweigand@de.ibm.com>
 
        Backport from mainline: