diff options
author | ebotcazou <ebotcazou@138bc75d-0d04-0410-961f-82ee72b054a4> | 2009-10-20 09:19:17 +0000 |
---|---|---|
committer | ebotcazou <ebotcazou@138bc75d-0d04-0410-961f-82ee72b054a4> | 2009-10-20 09:19:17 +0000 |
commit | c3b8ca0cc88289149fc2d4d5a72f19d5e8849620 (patch) | |
tree | b9e333e8cefe1df8d54ec2d92ed5e2045172910b /gcc/tree-sra.c | |
parent | da44a6ca723de5f329f948fa9dde352e580482ea (diff) | |
download | gcc-c3b8ca0cc88289149fc2d4d5a72f19d5e8849620.tar.gz |
* 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.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@153008 138bc75d-0d04-0410-961f-82ee72b054a4
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; |