re PR debug/43370 (ICE gen_type_die_with_usage, at dwarf2out.c:14745)

PR debug/43370
	* c-common.c (handle_aligned_attribute): Respect
	ATTR_FLAG_TYPE_IN_PLACE.

From-SVN: r159084
This commit is contained in:
Jason Merrill 2010-05-05 16:31:53 -04:00 committed by Jason Merrill
parent 56eec111d7
commit f7d83e2af2
4 changed files with 25 additions and 3 deletions

View File

@ -1,3 +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.
2010-05-04 H.J. Lu <hongjiu.lu@intel.com>
Backport from mainline

View File

@ -5957,10 +5957,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);
@ -5969,7 +5971,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) = (1 << i) * BITS_PER_UNIT;

View File

@ -1,3 +1,8 @@
2010-05-05 Jason Merrill <jason@redhat.com>
PR debug/43370
* g++.dg/ext/attrib39.C: New.
2010-05-04 H.J. Lu <hongjiu.lu@intel.com>
Backport from mainline

View File

@ -0,0 +1,9 @@
// PR debug/43370
// { dg-options "-g" }
int fragile_block(void) {
typedef __attribute__ ((aligned (16))) struct {
int i;
} XmmUint16;
return 0;
}