diff options
author | jakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4> | 2008-07-29 16:40:15 +0000 |
---|---|---|
committer | jakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4> | 2008-07-29 16:40:15 +0000 |
commit | 277f70f51683896364c0097f25976aba136e2126 (patch) | |
tree | d6823706621e4266183e90bfdd4a1b7bb1782caf | |
parent | d9b749af0bacad31574b453f7f3474f4bef614d9 (diff) |
PR c++/36852var-tracking-assignments-4_3-merge-138264-4_3
* tree.c (cplus_array_hash, build_cplus_array_type_1): Hash on
TYPE_UID instead of pointers.
* g++.dg/pch/array-1.C: New test.
* g++.dg/pch/array-1.Hs: New file.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/gcc-4_3-branch@138253 138bc75d-0d04-0410-961f-82ee72b054a4
-rw-r--r-- | gcc/cp/ChangeLog | 28 | ||||
-rw-r--r-- | gcc/cp/tree.c | 11 | ||||
-rw-r--r-- | gcc/testsuite/ChangeLog | 6 | ||||
-rw-r--r-- | gcc/testsuite/g++.dg/pch/array-1.C | 15 | ||||
-rw-r--r-- | gcc/testsuite/g++.dg/pch/array-1.Hs | 4 |
5 files changed, 48 insertions, 16 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index 951d38d2126..e3b6a17f1b3 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,8 +1,14 @@ +2008-07-29 Jakub Jelinek <jakub@redhat.com> + + PR c++/36852 + * tree.c (cplus_array_hash, build_cplus_array_type_1): Hash on + TYPE_UID instead of pointers. + 2008-07-18 Dodji Seketeli <dseketel@redhat.com> PR c++/36407 - * gcc/cp/call.c (convert_like_real): Don't take the error code path - when a rvalue or base conversion has the bad_p field set. + * call.c (convert_like_real): Don't take the error code path + when a rvalue or base conversion has the bad_p field set. 2008-07-07 Simon Martin <simartin@users.sourceforge.net> @@ -1871,7 +1877,7 @@ 2007-09-05 Jan Hubicka <jh@suse.cz> - * cp/sematics.c (expand_body): Remove unnecesary import_export_decl + * sematics.c (expand_body): Remove unnecesary import_export_decl call, DECL_EXTERNAL checks and current_function_decl saving. 2007-09-05 Paolo Carlini <pcarlini@suse.de> @@ -2298,7 +2304,7 @@ * cp-objcp-common.c (cxx_get_alias_set): Change return type to alias_set_type. - * cp/cp-tree.h (cxx_get_alias_set): Update declaration. + * cp-tree.h (cxx_get_alias_set): Update declaration. 2007-08-10 Ollie Wild <aaw@google.com> @@ -2971,7 +2977,7 @@ 2007-05-11 Silvius Rus <rus@google.com> - * cp/typeck.c (build_indirect_ref): Add call to + * typeck.c (build_indirect_ref): Add call to strict_aliasing_warning. (build_reinterpret_cast_1): Condition call to strict_aliasing_warning. @@ -3061,7 +3067,7 @@ 2007-04-23 Jan Hubicka <jh@suse.cz> - * cp/decl2.c (finish_objects): Do not call target constructor/destructor + * decl2.c (finish_objects): Do not call target constructor/destructor bits dirrectly. 2007-04-21 Andrew Pinski <andrew_pinski@playstation.sony.com> @@ -3083,7 +3089,7 @@ 2007-04-16 Seongbae Park <seongbae.park@gmail.com> PR c++/29365 - * cp/decl2.c (constrain_class_visibility): + * decl2.c (constrain_class_visibility): Do not warn about the use of anonymous namespace in the main input file. 2007-04-15 Mark Mitchell <mark@codesourcery.com> @@ -3102,7 +3108,7 @@ 2007-04-11 Jan Hubicka <jh@suse.cz> - * cp/class.c (convert_to_base_statically): Fold produced tree; verify + * class.c (convert_to_base_statically): Fold produced tree; verify that we are not processing template_decl. 2007-04-09 Mark Mitchell <mark@codesourcery.com> @@ -3357,7 +3363,7 @@ 2007-03-14 Dirk Mueller <dmueller@suse.de> - * cp/semantics.c (c_finish_if_stmt): Call empty_if_body_warning. + * semantics.c (c_finish_if_stmt): Call empty_if_body_warning. (finish_do_body): Warn about empty body in do/while statement. 2007-03-14 Manuel Lopez-Ibanez <manu@gcc.gnu.org> @@ -3372,7 +3378,7 @@ 2007-03-13 Alexandre Oliva <aoliva@redhat.com> - * cp/repo.c (init_repo): Initialize random_seed saved options. + * repo.c (init_repo): Initialize random_seed saved options. (finish_repo): Adjust. 2007-03-13 Mark Mitchell <mark@codesourcery.com> @@ -3626,7 +3632,7 @@ 2007-03-09 Dirk Mueller <dmueller@suse.de> - * cp/call.c (build_new_op): Call warn_logical_operator. + * call.c (build_new_op): Call warn_logical_operator. 2007-03-08 Volker Reichelt <reichelt@netcologne.de> diff --git a/gcc/cp/tree.c b/gcc/cp/tree.c index 6dde898325d..cb2e6084acc 100644 --- a/gcc/cp/tree.c +++ b/gcc/cp/tree.c @@ -504,9 +504,9 @@ cplus_array_hash (const void* k) hashval_t hash; const_tree const t = (const_tree) k; - hash = (htab_hash_pointer (TREE_TYPE (t)) - ^ htab_hash_pointer (TYPE_DOMAIN (t))); - + hash = TYPE_UID (TREE_TYPE (t)); + if (TYPE_DOMAIN (t)) + hash ^= TYPE_UID (TYPE_DOMAIN (t)); return hash; } @@ -553,8 +553,9 @@ build_cplus_array_type_1 (tree elt_type, tree index_type) cplus_array_htab = htab_create_ggc (61, &cplus_array_hash, &cplus_array_compare, NULL); - hash = (htab_hash_pointer (elt_type) - ^ htab_hash_pointer (index_type)); + hash = TYPE_UID (elt_type); + if (index_type) + hash ^= TYPE_UID (index_type); cai.type = elt_type; cai.domain = index_type; diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 924e6777ef5..96d83c30b72 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,9 @@ +2008-07-29 Jakub Jelinek <jakub@redhat.com> + + PR c++/36852 + * g++.dg/pch/array-1.C: New test. + * g++.dg/pch/array-1.Hs: New file. + 2008-07-27 Tobias Burnus <burnus@net-b.de> PR fortran/36132 diff --git a/gcc/testsuite/g++.dg/pch/array-1.C b/gcc/testsuite/g++.dg/pch/array-1.C new file mode 100644 index 00000000000..a8935ed2606 --- /dev/null +++ b/gcc/testsuite/g++.dg/pch/array-1.C @@ -0,0 +1,15 @@ +// PR c++/36852 + +#include "array-1.H" + +template <class T> +T +A::foo (T t[3][3]) +{ + return t[0][1]; +} + +int +main () +{ +} diff --git a/gcc/testsuite/g++.dg/pch/array-1.Hs b/gcc/testsuite/g++.dg/pch/array-1.Hs new file mode 100644 index 00000000000..fb44b675e3a --- /dev/null +++ b/gcc/testsuite/g++.dg/pch/array-1.Hs @@ -0,0 +1,4 @@ +struct A +{ + template <class T> static T foo (T[3][3]); +}; |