summaryrefslogtreecommitdiff
path: root/gcc/c-common.c
diff options
context:
space:
mode:
authorwilson <wilson@138bc75d-0d04-0410-961f-82ee72b054a4>2000-08-24 23:48:25 +0000
committerwilson <wilson@138bc75d-0d04-0410-961f-82ee72b054a4>2000-08-24 23:48:25 +0000
commit3f50b833663d3662f69fdd7b2b047bff47f23b83 (patch)
tree70d3c839eb90150ba7ddac50375f76c2c2778b2e /gcc/c-common.c
parent326f388bfb314136fef4ce7b499f0f38e135a0ee (diff)
downloadgcc-3f50b833663d3662f69fdd7b2b047bff47f23b83.tar.gz
Fix ia64-linux setjmp failures due to attribute aligned on typedef bug.
* c-common.c (decl_attributes, case A_ALIGN): Revert last change. Copy type in a TYPE_DECL, just like pushdecl does. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@35966 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/c-common.c')
-rw-r--r--gcc/c-common.c22
1 files changed, 14 insertions, 8 deletions
diff --git a/gcc/c-common.c b/gcc/c-common.c
index 9af892a1bef..e2e57c58113 100644
--- a/gcc/c-common.c
+++ b/gcc/c-common.c
@@ -788,16 +788,22 @@ decl_attributes (node, attributes, prefix_attributes)
error ("requested alignment is too large");
else if (is_type)
{
- if (decl)
+ /* 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)
{
- DECL_ALIGN (decl) = (1 << i) * BITS_PER_UNIT;
- DECL_USER_ALIGN (decl) = 1;
- }
- else
- {
- TYPE_ALIGN (type) = (1 << i) * BITS_PER_UNIT;
- TYPE_USER_ALIGN (type) = 1;
+ tree tt = TREE_TYPE (decl);
+ DECL_ORIGINAL_TYPE (decl) = tt;
+ tt = build_type_copy (tt);
+ TYPE_NAME (tt) = decl;
+ TREE_USED (tt) = TREE_USED (decl);
+ TREE_TYPE (decl) = tt;
+ type = tt;
}
+
+ TYPE_ALIGN (type) = (1 << i) * BITS_PER_UNIT;
+ TYPE_USER_ALIGN (type) = 1;
}
else if (TREE_CODE (decl) != VAR_DECL
&& TREE_CODE (decl) != FIELD_DECL)