diff options
author | hjl <hjl@138bc75d-0d04-0410-961f-82ee72b054a4> | 2010-11-25 13:47:42 +0000 |
---|---|---|
committer | hjl <hjl@138bc75d-0d04-0410-961f-82ee72b054a4> | 2010-11-25 13:47:42 +0000 |
commit | c19686c50de99298ba2bd77ce18581f606aae6d1 (patch) | |
tree | 699bfbb54b2d8698c6ae57973538cf901d351754 /gcc/builtins.c | |
parent | b213bf24db8517136eb1553c43b9f7784d50be0d (diff) | |
download | gcc-c19686c50de99298ba2bd77ce18581f606aae6d1.tar.gz |
Properly cast integer constant char.
gcc/
2010-11-25 H.J. Lu <hongjiu.lu@intel.com>
PR middle-end/46647
* builtins.c (target_char_cast): Check INTEGER_CST instead of
host_integerp. Replace tree_low_cst with TREE_INT_CST_LOW.
gcc/testsuite/
2010-11-25 H.J. Lu <hongjiu.lu@intel.com>
PR middle-end/46647
* gcc.target/i386/pr46647.c: New.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@167146 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 c9e8e684fc8..a90bf2fb8f5 100644 --- a/gcc/builtins.c +++ b/gcc/builtins.c @@ -630,11 +630,11 @@ target_char_cast (tree cst, char *p) { unsigned HOST_WIDE_INT val, hostval; - if (!host_integerp (cst, 1) + if (TREE_CODE (cst) != INTEGER_CST || CHAR_TYPE_SIZE > HOST_BITS_PER_WIDE_INT) return 1; - val = tree_low_cst (cst, 1); + val = TREE_INT_CST_LOW (cst); if (CHAR_TYPE_SIZE < HOST_BITS_PER_WIDE_INT) val &= (((unsigned HOST_WIDE_INT) 1) << CHAR_TYPE_SIZE) - 1; |