aboutsummaryrefslogtreecommitdiff
path: root/gcc/expr.c
diff options
context:
space:
mode:
authorJakub Jelinek <jakub@redhat.com>2011-08-22 17:00:06 +0200
committerJakub Jelinek <jakub@gcc.gnu.org>2011-08-22 17:00:06 +0200
commite4269c7843070aa3ebc7c9e2e81c2e8a8d941c50 (patch)
tree08080223cc398647487dd024de0b654081310a32 /gcc/expr.c
parent7d7212ec2b45c2829dba3bd3319fce109cbe7f01 (diff)
downloadgcc-e4269c7843070aa3ebc7c9e2e81c2e8a8d941c50.zip
gcc-e4269c7843070aa3ebc7c9e2e81c2e8a8d941c50.tar.gz
gcc-e4269c7843070aa3ebc7c9e2e81c2e8a8d941c50.tar.bz2
re PR middle-end/50141 (ICE: tree check: expected var_decl, have parm_decl in get_bit_range, at expr.c:4357 with --param allow-store-data-races=0 and bitfields)
PR middle-end/50141 * expr.c (get_bit_range): Only use DECL_THREAD_LOCAL_P if innerdecl is a VAR_DECL. * c-c++-common/cxxbitfields-6.c: New test. From-SVN: r177957
Diffstat (limited to 'gcc/expr.c')
-rw-r--r--gcc/expr.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/gcc/expr.c b/gcc/expr.c
index 82873eb..ee16b6a 100644
--- a/gcc/expr.c
+++ b/gcc/expr.c
@@ -4354,7 +4354,8 @@ get_bit_range (unsigned HOST_WIDE_INT *bitstart,
|| TREE_CODE (innerdecl) == TARGET_MEM_REF)
&& !ptr_deref_may_alias_global_p (TREE_OPERAND (innerdecl, 0)))
|| (DECL_P (innerdecl)
- && (DECL_THREAD_LOCAL_P (innerdecl)
+ && ((TREE_CODE (innerdecl) == VAR_DECL
+ && DECL_THREAD_LOCAL_P (innerdecl))
|| !TREE_STATIC (innerdecl))))
{
*bitstart = *bitend = 0;