re PR debug/43370 (ICE gen_type_die_with_usage, at dwarf2out.c:14745)
authorJason Merrill <jason@redhat.com>
Wed, 5 May 2010 19:46:41 +0000 (15:46 -0400)
committerJason Merrill <jason@gcc.gnu.org>
Wed, 5 May 2010 19:46:41 +0000 (15:46 -0400)
PR debug/43370
* c-common.c (handle_aligned_attribute): Respect
ATTR_FLAG_TYPE_IN_PLACE.

From-SVN: r159081

gcc/ChangeLog
gcc/c-common.c
gcc/testsuite/ChangeLog
gcc/testsuite/g++.dg/ext/attrib39.C [new file with mode: 0644]

index 4c9263d793c60ac00f6eba142171cfa23d33616e..aef0c30782b13ead3fbdf57c5ca75d8ae9ebe3cf 100644 (file)
@@ -1,5 +1,9 @@
 2010-05-05  Jason Merrill  <jason@redhat.com>
 
+       PR debug/43370
+       * c-common.c (handle_aligned_attribute): Respect
+       ATTR_FLAG_TYPE_IN_PLACE.
+
        PR testsuite/43758
        * target.h (struct gcc_target): Add attribute_takes_identifier_p.
        * target_def.h (TARGET_ATTRIBUTE_TAKES_IDENTIFIER_P): Define.
index 6fa577c293af39940ceb7c58b40014e8472f4cc7..b3254b2386ed614f5dcb0488d770380f5d9b301b 100644 (file)
@@ -6695,10 +6695,12 @@ handle_aligned_attribute (tree *node, tree ARG_UNUSED (name), tree args,
     }
   else if (is_type)
     {
+      if ((flags & (int) ATTR_FLAG_TYPE_IN_PLACE))
+       /* OK, modify the type in place.  */;
       /* If we have a TYPE_DECL, then copy the type, so that we
         don't accidentally modify a builtin type.  See pushdecl.  */
-      if (decl && TREE_TYPE (decl) != error_mark_node
-         && DECL_ORIGINAL_TYPE (decl) == NULL_TREE)
+      else if (decl && TREE_TYPE (decl) != error_mark_node
+              && DECL_ORIGINAL_TYPE (decl) == NULL_TREE)
        {
          tree tt = TREE_TYPE (decl);
          *type = build_variant_type_copy (*type);
@@ -6707,7 +6709,7 @@ handle_aligned_attribute (tree *node, tree ARG_UNUSED (name), tree args,
          TREE_USED (*type) = TREE_USED (decl);
          TREE_TYPE (decl) = *type;
        }
-      else if (!(flags & (int) ATTR_FLAG_TYPE_IN_PLACE))
+      else
        *type = build_variant_type_copy (*type);
 
       TYPE_ALIGN (*type) = (1U << i) * BITS_PER_UNIT;
index 3ff322094b3107d773b4723b232b2ba002a75180..0bd021986aeaf40f60365a1dbb0b9c4168504a31 100644 (file)
@@ -1,3 +1,8 @@
+2010-05-05  Jason Merrill  <jason@redhat.com>
+
+       PR debug/43370
+       * g++.dg/ext/attrib39.C: New.
+
 2010-05-05  Daniel Franke  <franke.daniel@gmail.com>
 
        PR fortran/24978
diff --git a/gcc/testsuite/g++.dg/ext/attrib39.C b/gcc/testsuite/g++.dg/ext/attrib39.C
new file mode 100644 (file)
index 0000000..22a7429
--- /dev/null
@@ -0,0 +1,9 @@
+// PR debug/43370
+// { dg-options "-g" }
+
+int fragile_block(void) {
+  typedef __attribute__ ((aligned (16))) struct {
+    int i;
+  } XmmUint16;
+  return 0;
+}