diff options
author | Jakub Jelinek <jakub@redhat.com> | 2010-11-26 10:38:54 +0100 |
---|---|---|
committer | Jakub Jelinek <jakub@gcc.gnu.org> | 2010-11-26 10:38:54 +0100 |
commit | f1b69188357a03dd7ffe398e0723f173552aacf8 (patch) | |
tree | 4b01402047c5fcad2cdf20c06ad29f8bbf3ecae3 /gcc/builtins.c | |
parent | fabd13b4a91487527ea8100d6a23f01b638135b4 (diff) | |
download | gcc-f1b69188357a03dd7ffe398e0723f173552aacf8.zip gcc-f1b69188357a03dd7ffe398e0723f173552aacf8.tar.gz gcc-f1b69188357a03dd7ffe398e0723f173552aacf8.tar.bz2 |
re PR middle-end/46647 (Can't inline memset with -1)
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.
From-SVN: r167170
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 a90bf2f..5cdf480 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; |