diff options
author | nathan <nathan@138bc75d-0d04-0410-961f-82ee72b054a4> | 2005-06-16 08:21:00 +0000 |
---|---|---|
committer | nathan <nathan@138bc75d-0d04-0410-961f-82ee72b054a4> | 2005-06-16 08:21:00 +0000 |
commit | 70b44d38dd0003b4cd7bc87bf4a79e1ab830dce5 (patch) | |
tree | 45ac8abe456ab808e94f317301eb28db35d93232 | |
parent | 7c2893853f4e7ef99fae25e43a555a4b6cc8cf96 (diff) | |
download | gcc-70b44d38dd0003b4cd7bc87bf4a79e1ab830dce5.tar.gz |
cp:
* rtti.c (get_tinfo_decl): Avoid caching tinfo_descs when it might
change.
(create_pseudo_type_info): First parameter is an int.
testsuite:
* g++.dg/rtti/crash2.C: New.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@101011 138bc75d-0d04-0410-961f-82ee72b054a4
-rw-r--r-- | gcc/cp/ChangeLog | 6 | ||||
-rw-r--r-- | gcc/cp/rtti.c | 8 | ||||
-rw-r--r-- | gcc/testsuite/ChangeLog | 4 | ||||
-rw-r--r-- | gcc/testsuite/g++.dg/rtti/crash2.C | 9 |
4 files changed, 23 insertions, 4 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index 996664a19c1..af04741fc44 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,3 +1,9 @@ +2005-06-16 Nathan Sidwell <nathan@codesourcery.com> + + * rtti.c (get_tinfo_decl): Avoid caching tinfo_descs when it might + change. + (create_pseudo_type_info): First parameter is an int. + 2005-06-15 Aldy Hernandez <aldyh@redhat.com> * typeck.c (build_binary_op): Same. diff --git a/gcc/cp/rtti.c b/gcc/cp/rtti.c index 317068e5c6e..c9f3d38f6c8 100644 --- a/gcc/cp/rtti.c +++ b/gcc/cp/rtti.c @@ -117,7 +117,7 @@ static tree generic_initializer (tinfo_s *, tree); static tree ptr_initializer (tinfo_s *, tree); static tree ptm_initializer (tinfo_s *, tree); static tree class_initializer (tinfo_s *, tree, tree); -static void create_pseudo_type_info (tinfo_kind, const char *, ...); +static void create_pseudo_type_info (int, const char *, ...); static tree get_pseudo_ti_init (tree, unsigned); static unsigned get_pseudo_ti_index (tree); static void create_tinfo_types (void); @@ -369,8 +369,8 @@ get_tinfo_decl (tree type) d = IDENTIFIER_GLOBAL_VALUE (name); if (!d) { - tinfo_s *ti = VEC_index (tinfo_s, tinfo_descs, - get_pseudo_ti_index (type)); + int ix = get_pseudo_ti_index (type); + tinfo_s *ti = VEC_index (tinfo_s, tinfo_descs, ix); d = build_lang_decl (VAR_DECL, name, ti->type); SET_DECL_ASSEMBLER_NAME (d, name); @@ -1100,7 +1100,7 @@ get_pseudo_ti_init (tree type, unsigned tk_index) NULL. */ static void -create_pseudo_type_info (tinfo_kind tk, const char *real_name, ...) +create_pseudo_type_info (int tk, const char *real_name, ...) { tinfo_s *ti; tree pseudo_type; diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index adcfe2dd5ad..34f4fe50d37 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,7 @@ +2005-06-16 Nathan Sidwell <nathan@codesourcery.com> + + * g++.dg/rtti/crash2.C: New. + 2005-06-15 Joseph S. Myers <joseph@codesourcery.com> * gcc.dg/noncompile/20040203-3.c: Update expected message. diff --git a/gcc/testsuite/g++.dg/rtti/crash2.C b/gcc/testsuite/g++.dg/rtti/crash2.C new file mode 100644 index 00000000000..9646dfdc1c9 --- /dev/null +++ b/gcc/testsuite/g++.dg/rtti/crash2.C @@ -0,0 +1,9 @@ +// Copyright (C) 2005 Free Software Foundation, Inc. +// Contributed by Nathan Sidwell 16 Jun 2005 <nathan@codesourcery.com> + +// Crash when compiler is optimized +// Origin: Andrew Pinski pinskia@gcc.gnu.org + +struct facet { virtual ~facet(); }; +struct ctype_base {}; +struct ctype : facet, ctype_base {}; |