aboutsummaryrefslogtreecommitdiff
path: root/gcc/tree-chkp.c
diff options
context:
space:
mode:
authorIlya Enkovich <enkovich.gnu@gmail.com>2015-09-01 14:38:42 +0000
committerIlya Enkovich <ienkovich@gcc.gnu.org>2015-09-01 14:38:42 +0000
commit53f303165e21a7e87de1346929e82c0626600e61 (patch)
treebcae91c3473ab9cbb76496b079e9c8f079e343c4 /gcc/tree-chkp.c
parentd4c6109400c8224338916b65c7693547a798f81e (diff)
downloadgcc-53f303165e21a7e87de1346929e82c0626600e61.zip
gcc-53f303165e21a7e87de1346929e82c0626600e61.tar.gz
gcc-53f303165e21a7e87de1346929e82c0626600e61.tar.bz2
re PR target/67405 (ICE on invalid use of struct on x86_64-linux-gnu)
gcc/ PR target/67405 * tree-chkp.c (chkp_find_bound_slots_1): Add NULL check. gcc/testsuite/ PR target/67405 * g++.dg/pr67405.C: New test. From-SVN: r227373
Diffstat (limited to 'gcc/tree-chkp.c')
-rw-r--r--gcc/tree-chkp.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/gcc/tree-chkp.c b/gcc/tree-chkp.c
index 8c1b48c..2489abb 100644
--- a/gcc/tree-chkp.c
+++ b/gcc/tree-chkp.c
@@ -1667,8 +1667,9 @@ chkp_find_bound_slots_1 (const_tree type, bitmap have_bound,
for (field = TYPE_FIELDS (type); field; field = DECL_CHAIN (field))
if (TREE_CODE (field) == FIELD_DECL)
{
- HOST_WIDE_INT field_offs
- = TREE_INT_CST_LOW (DECL_FIELD_BIT_OFFSET (field));
+ HOST_WIDE_INT field_offs = 0;
+ if (DECL_FIELD_BIT_OFFSET (field))
+ field_offs += TREE_INT_CST_LOW (DECL_FIELD_BIT_OFFSET (field));
if (DECL_FIELD_OFFSET (field))
field_offs += TREE_INT_CST_LOW (DECL_FIELD_OFFSET (field)) * 8;
chkp_find_bound_slots_1 (TREE_TYPE (field), have_bound,