diff options
author | Eric Botcazou <ebotcazou@adacore.com> | 2009-10-20 09:19:17 +0000 |
---|---|---|
committer | Eric Botcazou <ebotcazou@gcc.gnu.org> | 2009-10-20 09:19:17 +0000 |
commit | a1aa17011f52bffc0f3022bc32d87222270dfb8b (patch) | |
tree | b9e333e8cefe1df8d54ec2d92ed5e2045172910b /gcc/tree-sra.c | |
parent | 717f4048cd7e5d2ff7beb9276c0e09b4cb4d2faa (diff) | |
download | gcc-a1aa17011f52bffc0f3022bc32d87222270dfb8b.tar.gz |
tree-sra.c (build_ref_for_offset_1): Skip fields without size or with size that can't be represented as a host integer.
* tree-sra.c (build_ref_for_offset_1) <RECORD_TYPE>: Skip fields
without size or with size that can't be represented as a host integer.
From-SVN: r153008
Diffstat (limited to 'gcc/tree-sra.c')
-rw-r--r-- | gcc/tree-sra.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/gcc/tree-sra.c b/gcc/tree-sra.c index dd3f6807b83..86246688680 100644 --- a/gcc/tree-sra.c +++ b/gcc/tree-sra.c @@ -1243,7 +1243,10 @@ build_ref_for_offset_1 (tree *res, tree type, HOST_WIDE_INT offset, pos = int_bit_position (fld); gcc_assert (TREE_CODE (type) == RECORD_TYPE || pos == 0); - size = tree_low_cst (DECL_SIZE (fld), 1); + tr_size = DECL_SIZE (fld); + if (!tr_size || !host_integerp (tr_size, 1)) + continue; + size = tree_low_cst (tr_size, 1); if (pos > offset || (pos + size) <= offset) continue; |