OSDN Git Service

PR debug/43370
authorjason <jason@138bc75d-0d04-0410-961f-82ee72b054a4>
Wed, 5 May 2010 19:46:41 +0000 (19:46 +0000)
committerMasaki Muranaka <monaka@monami-software.com>
Sun, 23 May 2010 04:59:59 +0000 (13:59 +0900)
* c-common.c (handle_aligned_attribute): Respect
ATTR_FLAG_TYPE_IN_PLACE.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@159081 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/ChangeLog
gcc/c-common.c
gcc/testsuite/ChangeLog

index 4c9263d..aef0c30 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 6fa577c..b3254b2 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 3ff3220..0bd0219 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