aboutsummaryrefslogtreecommitdiff
path: root/gcc/fold-const.c
diff options
context:
space:
mode:
authorJakub Jelinek <jakub@redhat.com>2001-04-02 10:08:22 +0200
committerJakub Jelinek <jakub@gcc.gnu.org>2001-04-02 10:08:22 +0200
commitd791ea1e0a2341a8fb2ca8b593063af8e471fcac (patch)
tree6f9d0c57a696399a9f82b1e41a0aad581a8490a3 /gcc/fold-const.c
parentc6955d85188d84404ae1fdfe594e59166d90b755 (diff)
downloadgcc-d791ea1e0a2341a8fb2ca8b593063af8e471fcac.zip
gcc-d791ea1e0a2341a8fb2ca8b593063af8e471fcac.tar.gz
gcc-d791ea1e0a2341a8fb2ca8b593063af8e471fcac.tar.bz2
fold-const.c (fold): Before optimizing unsigned comparison with 0x7fffffffU...
* fold-const.c (fold): Before optimizing unsigned comparison with 0x7fffffffU, make sure arg0 is integral type. * gcc.c-torture/execute/20010329-1.c: New test. From-SVN: r41000
Diffstat (limited to 'gcc/fold-const.c')
-rw-r--r--gcc/fold-const.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/gcc/fold-const.c b/gcc/fold-const.c
index ed98822..a595b6e 100644
--- a/gcc/fold-const.c
+++ b/gcc/fold-const.c
@@ -6613,7 +6613,9 @@ fold (expr)
else if (TREE_INT_CST_HIGH (arg1) == 0
&& (TREE_INT_CST_LOW (arg1)
== ((unsigned HOST_WIDE_INT) 1 << (width - 1)) - 1)
- && TREE_UNSIGNED (TREE_TYPE (arg1)))
+ && TREE_UNSIGNED (TREE_TYPE (arg1))
+ /* signed_type does not work on pointer types. */
+ && INTEGRAL_TYPE_P (TREE_TYPE (arg1)))
switch (TREE_CODE (t))
{