aboutsummaryrefslogtreecommitdiff
path: root/gcc/tree.c
diff options
context:
space:
mode:
authorJakub Jelinek <jakub@redhat.com>2006-09-23 09:15:37 +0200
committerJakub Jelinek <jakub@gcc.gnu.org>2006-09-23 09:15:37 +0200
commitfcb99e7b22ce96bd71076e16bff502cedb310e55 (patch)
tree23d01a3bd7d49c49d7f4b60bd073b43567826b34 /gcc/tree.c
parent6a7c793f3ef153f68fec135b0f8bca78ec9da324 (diff)
downloadgcc-fcb99e7b22ce96bd71076e16bff502cedb310e55.zip
gcc-fcb99e7b22ce96bd71076e16bff502cedb310e55.tar.gz
gcc-fcb99e7b22ce96bd71076e16bff502cedb310e55.tar.bz2
re PR c/28706 (Compile failure with --combine and explicitly aligned structures)
PR c/28706 PR c/28712 * tree.c (merge_attributes, attribute_list_contained): If both TREE_VALUEs are TREE_LISTs, use simple_cst_list_equal instead of simple_cst_equal. * c-typeck.c (comptypes_internal): Don't consider aggregates in different TUs as compatible if there one set of attributes is not a subset of the other type's attributes. (composite_type): Try harder not to create a new aggregate type. * gcc.dg/pr28706.c: New test. * gcc.dg/pr28712.c: New test. From-SVN: r117167
Diffstat (limited to 'gcc/tree.c')
-rw-r--r--gcc/tree.c26
1 files changed, 21 insertions, 5 deletions
diff --git a/gcc/tree.c b/gcc/tree.c
index a58c327..cfbfe14 100644
--- a/gcc/tree.c
+++ b/gcc/tree.c
@@ -3554,7 +3554,17 @@ merge_attributes (tree a1, tree a2)
a = lookup_attribute (IDENTIFIER_POINTER (TREE_PURPOSE (a2)),
TREE_CHAIN (a)))
{
- if (simple_cst_equal (TREE_VALUE (a), TREE_VALUE (a2)) == 1)
+ if (TREE_VALUE (a) != NULL
+ && TREE_CODE (TREE_VALUE (a)) == TREE_LIST
+ && TREE_VALUE (a2) != NULL
+ && TREE_CODE (TREE_VALUE (a2)) == TREE_LIST)
+ {
+ if (simple_cst_list_equal (TREE_VALUE (a),
+ TREE_VALUE (a2)) == 1)
+ break;
+ }
+ else if (simple_cst_equal (TREE_VALUE (a),
+ TREE_VALUE (a2)) == 1)
break;
}
if (a == NULL_TREE)
@@ -4374,15 +4384,21 @@ attribute_list_contained (tree l1, tree l2)
attr = lookup_attribute (IDENTIFIER_POINTER (TREE_PURPOSE (t2)),
TREE_CHAIN (attr)))
{
- if (simple_cst_equal (TREE_VALUE (t2), TREE_VALUE (attr)) == 1)
+ if (TREE_VALUE (t2) != NULL
+ && TREE_CODE (TREE_VALUE (t2)) == TREE_LIST
+ && TREE_VALUE (attr) != NULL
+ && TREE_CODE (TREE_VALUE (attr)) == TREE_LIST)
+ {
+ if (simple_cst_list_equal (TREE_VALUE (t2),
+ TREE_VALUE (attr)) == 1)
+ break;
+ }
+ else if (simple_cst_equal (TREE_VALUE (t2), TREE_VALUE (attr)) == 1)
break;
}
if (attr == 0)
return 0;
-
- if (simple_cst_equal (TREE_VALUE (t2), TREE_VALUE (attr)) != 1)
- return 0;
}
return 1;