diff options
author | Hartmut Penner <hpenner@de.ibm.com> | 2002-09-12 06:49:26 +0000 |
---|---|---|
committer | Richard Henderson <rth@gcc.gnu.org> | 2002-09-11 23:49:26 -0700 |
commit | 4f968d9388efc8dfec39cf0ec0dbb38378fdb6f8 (patch) | |
tree | ef4d7df0ac902cd3344cc6163ebed2ebb2fd927e /gcc/fold-const.c | |
parent | d0c97db6b3b562dfdd2be66bd36d4626e05b68da (diff) | |
download | gcc-4f968d9388efc8dfec39cf0ec0dbb38378fdb6f8.zip gcc-4f968d9388efc8dfec39cf0ec0dbb38378fdb6f8.tar.gz gcc-4f968d9388efc8dfec39cf0ec0dbb38378fdb6f8.tar.bz2 |
fold-const.c (make_range): Only narrow to signed range if the signed range is smaller than the unsigned range.
* fold-const.c (make_range): Only narrow to signed range if
the signed range is smaller than the unsigned range.
* gcc.c-torture/execute/20020911-1.c: New.
From-SVN: r57050
Diffstat (limited to 'gcc/fold-const.c')
-rw-r--r-- | gcc/fold-const.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/gcc/fold-const.c b/gcc/fold-const.c index b8da1a7..1b2124a 100644 --- a/gcc/fold-const.c +++ b/gcc/fold-const.c @@ -3089,9 +3089,10 @@ make_range (exp, pin_p, plow, phigh) = TYPE_MAX_VALUE (equiv_type) ? TYPE_MAX_VALUE (equiv_type) : TYPE_MAX_VALUE (type); - high_positive = fold (build (RSHIFT_EXPR, type, - convert (type, high_positive), - convert (type, integer_one_node))); + if (TYPE_PRECISION (type) == TYPE_PRECISION (TREE_TYPE (exp))) + high_positive = fold (build (RSHIFT_EXPR, type, + convert (type, high_positive), + convert (type, integer_one_node))); /* If the low bound is specified, "and" the range with the range for which the original unsigned value will be |