diff options
author | davek <davek@138bc75d-0d04-0410-961f-82ee72b054a4> | 2010-11-11 13:29:46 +0000 |
---|---|---|
committer | davek <davek@138bc75d-0d04-0410-961f-82ee72b054a4> | 2010-11-11 13:29:46 +0000 |
commit | a31ae61056fd350819543a212716695045dae2fb (patch) | |
tree | c7e19d09bacfcc8a51c1aedc4a75683025f33c24 /gcc/lto-streamer-out.c | |
parent | 7719751deb0052656f422f3915478d84e4f7c7f3 (diff) | |
download | gcc-a31ae61056fd350819543a212716695045dae2fb.tar.gz |
* lto-streamer-out.c (write_symbol): Use int_size_in_bytes rather than
assembling high and low parts of size if not using 32-bit HWINT; else
use DECL_SIZE_UNITS, not DECL_SIZE.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@166600 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/lto-streamer-out.c')
-rw-r--r-- | gcc/lto-streamer-out.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/gcc/lto-streamer-out.c b/gcc/lto-streamer-out.c index 03150b7d50b..2a4d985c9b9 100644 --- a/gcc/lto-streamer-out.c +++ b/gcc/lto-streamer-out.c @@ -2435,8 +2435,12 @@ write_symbol (struct lto_streamer_cache_d *cache, if (kind == GCCPK_COMMON && DECL_SIZE (t) && TREE_CODE (DECL_SIZE (t)) == INTEGER_CST) - size = (((uint64_t) TREE_INT_CST_HIGH (DECL_SIZE (t))) << 32) - | TREE_INT_CST_LOW (DECL_SIZE (t)); + { + size = (HOST_BITS_PER_WIDE_INT >= 64) + ? (uint64_t) int_size_in_bytes (TREE_TYPE (t)) + : (((uint64_t) TREE_INT_CST_HIGH (DECL_SIZE_UNIT (t))) << 32) + | TREE_INT_CST_LOW (DECL_SIZE_UNIT (t)); + } else size = 0; |