diff options
author | Andrew Pinski <apinski@apple.com> | 2004-06-23 17:05:45 +0000 |
---|---|---|
committer | Andrew Pinski <pinskia@gcc.gnu.org> | 2004-06-23 10:05:45 -0700 |
commit | fe7080d2c8aab8425f987c9b168f4ed42ad680cd (patch) | |
tree | 81de925d99dd8d6aac449de7f291d5528e894bd8 /gcc | |
parent | 701b17c2dc9a6d35097455e6fd410d4dabce29e7 (diff) | |
download | gcc-fe7080d2c8aab8425f987c9b168f4ed42ad680cd.zip gcc-fe7080d2c8aab8425f987c9b168f4ed42ad680cd.tar.gz gcc-fe7080d2c8aab8425f987c9b168f4ed42ad680cd.tar.bz2 |
[multiple changes]
2004-06-23 Andrew Pinski <apinski@apple.com>
* c-typeck.c (composite_type):
<case POINTER_TYPE>: Build a qualified type of
the new type.
<case ARRAY_TYPE>: Likewise.
<case FUNCTION_TYPE>: Likewise.
2006-06-23 Andrew Pinski <apinski@apple.com>
* gcc.dg/c90-array-quals.c: New test.
From-SVN: r83557
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/ChangeLog | 8 | ||||
-rw-r--r-- | gcc/c-typeck.c | 15 | ||||
-rw-r--r-- | gcc/testsuite/ChangeLog | 4 | ||||
-rw-r--r-- | gcc/testsuite/gcc.dg/c90-array-quals.c | 3 |
4 files changed, 25 insertions, 5 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index b907be9..e2ca751 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,11 @@ +2004-06-23 Andrew Pinski <apinski@apple.com> + + * c-typeck.c (composite_type): + <case POINTER_TYPE>: Build a qualified type of + the new type. + <case ARRAY_TYPE>: Likewise. + <case FUNCTION_TYPE>: Likewise. + 2004-06-23 Pat Haugen <pthaugen@us.ibm.com> PR optimization/15633 diff --git a/gcc/c-typeck.c b/gcc/c-typeck.c index a2daf32..6a4e1db 100644 --- a/gcc/c-typeck.c +++ b/gcc/c-typeck.c @@ -253,7 +253,8 @@ composite_type (tree t1, tree t2) tree pointed_to_2 = TREE_TYPE (t2); tree target = composite_type (pointed_to_1, pointed_to_2); t1 = build_pointer_type (target); - return build_type_attribute_variant (t1, attributes); + t1 = build_type_attribute_variant (t1, attributes); + return qualify_type (t1, t2); } case ARRAY_TYPE: @@ -266,7 +267,8 @@ composite_type (tree t1, tree t2) return build_type_attribute_variant (t2, attributes); /* Merge the element types, and have a size if either arg has one. */ t1 = build_array_type (elt, TYPE_DOMAIN (TYPE_DOMAIN (t1) ? t1 : t2)); - return build_type_attribute_variant (t1, attributes); + t1 = build_type_attribute_variant (t1, attributes); + return qualify_type (t1, t2); } case FUNCTION_TYPE: @@ -289,13 +291,15 @@ composite_type (tree t1, tree t2) /* Simple way if one arg fails to specify argument types. */ if (TYPE_ARG_TYPES (t1) == 0) { - t1 = build_function_type (valtype, TYPE_ARG_TYPES (t2)); - return build_type_attribute_variant (t1, attributes); + t1 = build_function_type (valtype, TYPE_ARG_TYPES (t2)); + t1 = build_type_attribute_variant (t1, attributes); + return qualify_type (t1, t2); } if (TYPE_ARG_TYPES (t2) == 0) { t1 = build_function_type (valtype, TYPE_ARG_TYPES (t1)); - return build_type_attribute_variant (t1, attributes); + t1 = build_type_attribute_variant (t1, attributes); + return qualify_type (t1, t2); } /* If both args specify argument types, we must merge the two @@ -365,6 +369,7 @@ composite_type (tree t1, tree t2) c_override_global_bindings_to_false = false; t1 = build_function_type (valtype, newargs); + t1 = qualify_type (t1, t2); /* ... falls through ... */ } diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index b57899d..2afaf6e 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,7 @@ +2006-06-23 Andrew Pinski <apinski@apple.com> + + * gcc.dg/c90-array-quals.c: New test. + 2006-06-22 Richard Henderson <rth@redhat.com> * gcc.dg/noreturn-1.c (foo5): Update function does return lineno. diff --git a/gcc/testsuite/gcc.dg/c90-array-quals.c b/gcc/testsuite/gcc.dg/c90-array-quals.c new file mode 100644 index 0000000..228e79f --- /dev/null +++ b/gcc/testsuite/gcc.dg/c90-array-quals.c @@ -0,0 +1,3 @@ +extern int (*const a)[]; +extern int (*const a)[10]; +extern int (*const a)[]; |