diff options
author | jakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4> | 2010-11-26 09:38:54 +0000 |
---|---|---|
committer | jakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4> | 2010-11-26 09:38:54 +0000 |
commit | d5d2f74a7a1c6564e4b922f1a11e25c6dab8e072 (patch) | |
tree | 4b01402047c5fcad2cdf20c06ad29f8bbf3ecae3 /gcc/builtins.c | |
parent | 2284bb2d2ba48602ff0bcfd1cb482cfeb9c3cee9 (diff) | |
download | gcc-d5d2f74a7a1c6564e4b922f1a11e25c6dab8e072.tar.gz |
PR middle-end/46647
* builtins.c (fold_builtin_memset): Check c is INTEGER_CST instead
of host_integerp check. Use TREE_INT_CST_LOW instead of tree_low_cst.
* gcc.dg/pr46647.c: New test.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@167170 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/builtins.c')
-rw-r--r-- | gcc/builtins.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/gcc/builtins.c b/gcc/builtins.c index a90bf2fb8f5..5cdf480913c 100644 --- a/gcc/builtins.c +++ b/gcc/builtins.c @@ -8345,7 +8345,7 @@ fold_builtin_memset (location_t loc, tree dest, tree c, tree len, if (integer_zerop (len)) return omit_one_operand_loc (loc, type, dest, c); - if (! host_integerp (c, 1) || TREE_SIDE_EFFECTS (dest)) + if (TREE_CODE (c) != INTEGER_CST || TREE_SIDE_EFFECTS (dest)) return NULL_TREE; var = dest; @@ -8384,7 +8384,7 @@ fold_builtin_memset (location_t loc, tree dest, tree c, tree len, if (CHAR_BIT != 8 || BITS_PER_UNIT != 8 || HOST_BITS_PER_WIDE_INT > 64) return NULL_TREE; - cval = tree_low_cst (c, 1); + cval = TREE_INT_CST_LOW (c); cval &= 0xff; cval |= cval << 8; cval |= cval << 16; |