aboutsummaryrefslogtreecommitdiff
path: root/gcc/tree.h
diff options
context:
space:
mode:
authorRichard Guenther <rguenther@suse.de>2012-03-14 10:55:09 +0000
committerRichard Biener <rguenth@gcc.gnu.org>2012-03-14 10:55:09 +0000
commit26c71b9368c1ef1929205fe1aafab1748640596b (patch)
tree26fd822d80791483a72e46062854af7176b44033 /gcc/tree.h
parent1caf8dd66c44ca5e25574be4cde0fd1ed7581584 (diff)
downloadgcc-26c71b9368c1ef1929205fe1aafab1748640596b.zip
gcc-26c71b9368c1ef1929205fe1aafab1748640596b.tar.gz
gcc-26c71b9368c1ef1929205fe1aafab1748640596b.tar.bz2
re PR target/52080 (Stores to bitfields introduce a store-data-race on adjacent data)
2012-03-14 Richard Guenther <rguenther@suse.de> * tree.h (DECL_BIT_FIELD_REPRESENTATIVE): New define. * stor-layout.c (start_bitfield_representative): New function. (finish_bitfield_representative): Likewise. (finish_bitfield_layout): Likewise. (finish_record_layout): Call finish_bitfield_layout. * tree.c (free_lang_data_in_decl): Only free DECL_QUALIFIER for QUAL_UNION_TYPE fields. * tree-streamer-in.c (lto_input_ts_field_decl_tree_pointers): Stream DECL_BIT_FIELD_REPRESENTATIVE. * tree-streamer-out.c (write_ts_field_decl_tree_pointers): Likewise. PR middle-end/52080 PR middle-end/52097 PR middle-end/48124 * expr.c (get_bit_range): Unconditionally extract bitrange from DECL_BIT_FIELD_REPRESENTATIVE. (expand_assignment): Adjust call to get_bit_range. * gcc.dg/torture/pr48124-1.c: New testcase. * gcc.dg/torture/pr48124-2.c: Likewise. * gcc.dg/torture/pr48124-3.c: Likewise. * gcc.dg/torture/pr48124-4.c: Likewise. From-SVN: r185379
Diffstat (limited to 'gcc/tree.h')
-rw-r--r--gcc/tree.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/gcc/tree.h b/gcc/tree.h
index 0a2d619..d9e826b 100644
--- a/gcc/tree.h
+++ b/gcc/tree.h
@@ -3024,6 +3024,11 @@ struct GTY(()) tree_decl_with_rtl {
#define DECL_BIT_FIELD_TYPE(NODE) \
(FIELD_DECL_CHECK (NODE)->field_decl.bit_field_type)
+/* In a FIELD_DECL of a RECORD_TYPE, this is a pointer to the storage
+ representative FIELD_DECL. */
+#define DECL_BIT_FIELD_REPRESENTATIVE(NODE) \
+ (FIELD_DECL_CHECK (NODE)->field_decl.qualifier)
+
/* For a FIELD_DECL in a QUAL_UNION_TYPE, records the expression, which
if nonzero, indicates that the field occupies the type. */
#define DECL_QUALIFIER(NODE) (FIELD_DECL_CHECK (NODE)->field_decl.qualifier)