aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEric Botcazou <ebotcazou@adacore.com>2012-04-30 08:11:42 +0000
committerEric Botcazou <ebotcazou@gcc.gnu.org>2012-04-30 08:11:42 +0000
commitbb358f1cd9fbf80190bfcc77fea21237d6f5a44d (patch)
treecc1f10d4695dbe5e903294475a85da745e09e326
parente6c69da096bf607239e04f97ad2a402bcac924c0 (diff)
downloadgcc-bb358f1cd9fbf80190bfcc77fea21237d6f5a44d.zip
gcc-bb358f1cd9fbf80190bfcc77fea21237d6f5a44d.tar.gz
gcc-bb358f1cd9fbf80190bfcc77fea21237d6f5a44d.tar.bz2
i386.c (ix86_handle_struct_attribute): Use the proper predicate to discriminate types.
* config/i386/i386.c (ix86_handle_struct_attribute): Use the proper predicate to discriminate types. ada/ * gcc-interface/utils.c (finish_record_type): Force the traditional GCC layout for bitfields on the type if it is packed or has a representation clause and an alternate layout is available. From-SVN: r186958
-rw-r--r--gcc/ChangeLog5
-rw-r--r--gcc/ada/ChangeLog6
-rw-r--r--gcc/ada/gcc-interface/utils.c13
-rw-r--r--gcc/config/i386/i386.c3
4 files changed, 25 insertions, 2 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 5d5149e..86a2f2d 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,8 @@
+2012-04-30 Eric Botcazou <ebotcazou@adacore.com>
+
+ * config/i386/i386.c (ix86_handle_struct_attribute): Use the proper
+ predicate to discriminate types.
+
2012-04-30 Manuel López-Ibáñez <manu@gcc.gnu.org>
* doc/invoke.texi (Wmissing-format-attribute): Document as an
diff --git a/gcc/ada/ChangeLog b/gcc/ada/ChangeLog
index e842139..838e4d0 100644
--- a/gcc/ada/ChangeLog
+++ b/gcc/ada/ChangeLog
@@ -1,5 +1,11 @@
2012-04-30 Eric Botcazou <ebotcazou@adacore.com>
+ * gcc-interface/utils.c (finish_record_type): Force the traditional GCC
+ layout for bitfields on the type if it is packed or has a representation
+ clause and an alternate layout is available.
+
+2012-04-30 Eric Botcazou <ebotcazou@adacore.com>
+
* gcc-interface/gigi.h (mark_out_of_scope): Delete.
(destroy_gnat_to_gnu): Declare.
(destroy_dummy_type): Likewise.
diff --git a/gcc/ada/gcc-interface/utils.c b/gcc/ada/gcc-interface/utils.c
index 123c3a5..03d7cb0 100644
--- a/gcc/ada/gcc-interface/utils.c
+++ b/gcc/ada/gcc-interface/utils.c
@@ -721,6 +721,19 @@ finish_record_type (tree record_type, tree field_list, int rep_level,
case where there is a rep clause but all fields have errors and
no longer have a position. */
TYPE_SIZE (record_type) = 0;
+
+ /* Ensure we use the traditional GCC layout for bitfields when we need
+ to pack the record type or have a representation clause. The other
+ possible layout (Microsoft C compiler), if available, would prevent
+ efficient packing in almost all cases. */
+#ifdef TARGET_MS_BITFIELD_LAYOUT
+ if (TARGET_MS_BITFIELD_LAYOUT && TYPE_PACKED (record_type))
+ decl_attributes (&record_type,
+ tree_cons (get_identifier ("gcc_struct"),
+ NULL_TREE, NULL_TREE),
+ ATTR_FLAG_TYPE_IN_PLACE);
+#endif
+
layout_type (record_type);
}
diff --git a/gcc/config/i386/i386.c b/gcc/config/i386/i386.c
index a34c68c..903683e 100644
--- a/gcc/config/i386/i386.c
+++ b/gcc/config/i386/i386.c
@@ -32465,8 +32465,7 @@ ix86_handle_struct_attribute (tree *node, tree name,
else
type = node;
- if (!(type && (TREE_CODE (*type) == RECORD_TYPE
- || TREE_CODE (*type) == UNION_TYPE)))
+ if (!(type && RECORD_OR_UNION_TYPE_P (*type)))
{
warning (OPT_Wattributes, "%qE attribute ignored",
name);