diff options
author | jakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4> | 2002-02-20 22:54:35 +0000 |
---|---|---|
committer | jakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4> | 2002-02-20 22:54:35 +0000 |
commit | c53485bbb81a5ddaeeceb228bb0ed1328b5c2e0e (patch) | |
tree | 92091a1ae9884506ec5a5bd1f121978289726ebf /gcc/tree.c | |
parent | 00c7100f102b06d2844bffb7bbf69c78f1bd5d55 (diff) | |
download | gcc-c53485bbb81a5ddaeeceb228bb0ed1328b5c2e0e.tar.gz |
PR c/4389
* tree.c (host_integerp): Ensure that the constant integer is
representable in a HOST_WIDE_INT or an unsigned HOST_WIDE_INT
when pos is zero or non-zero respectively. Clarify comment.
* c-format.c (check_format_info_recurse): Fix host_integerp
usage; the pos argument should be zero when assigning to a
signed HOST_WIDE_INT.
* gcc.dg/20020219-1.c: New test.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@49914 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/tree.c')
-rw-r--r-- | gcc/tree.c | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/gcc/tree.c b/gcc/tree.c index 764aa798ed8..5e0210b7676 100644 --- a/gcc/tree.c +++ b/gcc/tree.c @@ -3436,8 +3436,10 @@ tree_int_cst_compare (t1, t2) return 0; } -/* Return 1 if T is an INTEGER_CST that can be represented in a single - HOST_WIDE_INT value. If POS is nonzero, the result must be positive. */ +/* Return 1 if T is an INTEGER_CST that can be manipulated efficiently on + the host. If POS is zero, the value can be represented in a single + HOST_WIDE_INT. If POS is nonzero, the value must be positive and can + be represented in a single unsigned HOST_WIDE_INT. */ int host_integerp (t, pos) @@ -3449,9 +3451,9 @@ host_integerp (t, pos) && ((TREE_INT_CST_HIGH (t) == 0 && (HOST_WIDE_INT) TREE_INT_CST_LOW (t) >= 0) || (! pos && TREE_INT_CST_HIGH (t) == -1 - && (HOST_WIDE_INT) TREE_INT_CST_LOW (t) < 0) - || (! pos && TREE_INT_CST_HIGH (t) == 0 - && TREE_UNSIGNED (TREE_TYPE (t))))); + && (HOST_WIDE_INT) TREE_INT_CST_LOW (t) < 0 + && ! TREE_UNSIGNED (TREE_TYPE (t))) + || (pos && TREE_INT_CST_HIGH (t) == 0))); } /* Return the HOST_WIDE_INT least significant bits of T if it is an |