diff options
author | Simon Baldwin <simonb@google.com> | 2009-03-14 19:07:06 +0000 |
---|---|---|
committer | Simon Baldwin <simonb@google.com> | 2009-03-14 19:07:06 +0000 |
commit | ac0d170e7e03fe4ec6e689d4f64b78674847ef6e (patch) | |
tree | 55b79128a967534d8c9b475207d8bce119186a30 /gcc | |
parent | 0e735e1a6cc62b245eb0a3326c175e487a549989 (diff) |
* lto-symtab.c (lto_symtab_merge_decl): Added assertion to check
assembler name is already set.
* (lto_symtab_prevailing_decl): Ditto.
* g++.dg/lto/20090313_0.C: New.
* g++.dg/lto/20090313_1.C: New.
git-svn-id: https://gcc.gnu.org/svn/gcc/branches/lto@144861 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/ChangeLog.lto | 6 | ||||
-rw-r--r-- | gcc/lto-symtab.c | 6 | ||||
-rw-r--r-- | gcc/testsuite/ChangeLog.lto | 5 | ||||
-rw-r--r-- | gcc/testsuite/g++.dg/lto/20090313_0.C | 5 | ||||
-rw-r--r-- | gcc/testsuite/g++.dg/lto/20090313_1.C | 12 |
5 files changed, 34 insertions, 0 deletions
diff --git a/gcc/ChangeLog.lto b/gcc/ChangeLog.lto index 0ead9681635..94e97f8425e 100644 --- a/gcc/ChangeLog.lto +++ b/gcc/ChangeLog.lto @@ -1,3 +1,9 @@ +2009-03-14 Simon Baldwin <simonb@google.com> + + * lto-symtab.c (lto_symtab_merge_decl): Added assertion to check + assembler name is already set. + * (lto_symtab_prevailing_decl): Ditto. + 2009-03-13 Rafael Avila de Espindola <espindola@google.com> * builtins.c (called_as_built_in): Make it non static. diff --git a/gcc/lto-symtab.c b/gcc/lto-symtab.c index e35d23d2e4d..6b447ec531e 100644 --- a/gcc/lto-symtab.c +++ b/gcc/lto-symtab.c @@ -557,6 +557,9 @@ lto_symtab_merge_decl (tree new_decl, /* Remember the resolution of this symbol. */ lto_symtab_set_resolution_and_file_data (new_decl, resolution, file_data); + /* Ensure DECL_ASSEMBLER_NAME will not set assembler name. */ + gcc_assert (DECL_ASSEMBLER_NAME_SET_P (new_decl)); + /* Retrieve the previous declaration. */ name = DECL_ASSEMBLER_NAME (new_decl); old_decl = lto_symtab_get_identifier_decl (name); @@ -648,6 +651,9 @@ lto_symtab_prevailing_decl (tree decl) if (TREE_CODE (decl) == FUNCTION_DECL && DECL_ABSTRACT (decl)) return decl; + /* Ensure DECL_ASSEMBLER_NAME will not set assembler name. */ + gcc_assert (DECL_ASSEMBLER_NAME_SET_P (decl)); + ret = lto_symtab_get_identifier_decl (DECL_ASSEMBLER_NAME (decl)); return ret; diff --git a/gcc/testsuite/ChangeLog.lto b/gcc/testsuite/ChangeLog.lto index 13ae9f5c30e..595bedeb394 100644 --- a/gcc/testsuite/ChangeLog.lto +++ b/gcc/testsuite/ChangeLog.lto @@ -1,3 +1,8 @@ +2009-03-14 Simon Baldwin <simonb@google.com> + + * g++.dg/lto/20090313_0.C: New. + * g++.dg/lto/20090313_1.C: New. + 2009-03-13 Rafael Avila de Espindola <espindola@google.com> * gcc.dg/lto/20090313_0.c: New. diff --git a/gcc/testsuite/g++.dg/lto/20090313_0.C b/gcc/testsuite/g++.dg/lto/20090313_0.C new file mode 100644 index 00000000000..ba0be83eef8 --- /dev/null +++ b/gcc/testsuite/g++.dg/lto/20090313_0.C @@ -0,0 +1,5 @@ +// { dg-do "link" } +// { dg-options "{-fwhopr}" } +// { dg-extra-ld-options "-fwhopr -shared" } + +int X; diff --git a/gcc/testsuite/g++.dg/lto/20090313_1.C b/gcc/testsuite/g++.dg/lto/20090313_1.C new file mode 100644 index 00000000000..088792b2dd3 --- /dev/null +++ b/gcc/testsuite/g++.dg/lto/20090313_1.C @@ -0,0 +1,12 @@ +struct Foo { + virtual void X(); + virtual void Y(); +}; +struct Bar: public Foo { + Bar(Foo *); + void Y(); +}; +void Baz() { + Foo f; + Bar b(&f); +} |