diff options
author | Alexandre Oliva <aoliva@redhat.com> | 2006-08-13 20:16:46 +0000 |
---|---|---|
committer | Andrew Pinski <pinskia@gcc.gnu.org> | 2006-08-13 13:16:46 -0700 |
commit | 8d9f82d59362f88ccf848a76285ae44024981ac0 (patch) | |
tree | 872017de3d83c2f55ee00df495e2809bd786b19c /gcc/tree.c | |
parent | 0bff60e5b729caa36d6669be4a964b87a9b6081b (diff) | |
download | gcc-8d9f82d59362f88ccf848a76285ae44024981ac0.zip gcc-8d9f82d59362f88ccf848a76285ae44024981ac0.tar.gz gcc-8d9f82d59362f88ccf848a76285ae44024981ac0.tar.bz2 |
re PR c/27184 (Wrong code with pointers to arrays and types and strict aliasing)
2006-08-13 Alexandre Oliva <aoliva@redhat.com>
Andrew Pinski <pinskia@physics.uc.edu>
PR c/27184
* tree.c (build_array_type): Unify array types with
unspecified index_type.
* c-decl.c (grokdeclarator): Make sure we do not modify a
unified incomplete array type.
* c-typeck.c (store_init_value): Create distinct type before
filling in the index type in an initializer from a compound
literal.
* c-decl.c (grokdeclarator): Remove code where we copy the
array type over.
2006-08-13 Alexandre Oliva <aoliva@redhat.com>
PR c/27184
* gcc.dg/torture/pr27184.c: New test
Co-Authored-By: Andrew Pinski <pinskia@physics.uc.edu>
From-SVN: r116116
Diffstat (limited to 'gcc/tree.c')
-rw-r--r-- | gcc/tree.c | 6 |
1 files changed, 5 insertions, 1 deletions
@@ -5158,7 +5158,11 @@ build_array_type (tree elt_type, tree index_type) if (index_type == 0) { - layout_type (t); + tree save = t; + hashcode = iterative_hash_object (TYPE_HASH (elt_type), hashcode); + t = type_hash_canon (hashcode, t); + if (save == t) + layout_type (t); return t; } |