aboutsummaryrefslogtreecommitdiff
path: root/gcc/cp
diff options
context:
space:
mode:
authorDanny Smith <dannysmith@users.sourceforge.net>2003-05-21 00:33:27 +0000
committerDanny Smith <dannysmith@gcc.gnu.org>2003-05-21 00:33:27 +0000
commit16e31964115f929a2f68fbce36cff148849b52bd (patch)
treea66c513063ee090ac05335ce24377f1f8af6a567 /gcc/cp
parent36f72608a3270bef01a188cde1da10e6a98651e3 (diff)
downloadgcc-16e31964115f929a2f68fbce36cff148849b52bd.zip
gcc-16e31964115f929a2f68fbce36cff148849b52bd.tar.gz
gcc-16e31964115f929a2f68fbce36cff148849b52bd.tar.bz2
re PR c++/9738 ([mingw] Internal compiler error in rest_of_compilation, at toplev.c: 3491)
PR c++/9738 * config/i386/winnt.c (i386_pe_encode_section_info): Enable even if not first. * cp/decl.c (duplicate_decls): Re-invoke make_decl_rtl if the old decl had instantiated DECL_RTL. (Base on Richard Henderson 2003-05-13 patch to c-decl.c). * testsuite/g++.dg/ext/dllimport2.C: New file. * testsuite/g++.dg/ext/dllimport3.C: New file. From-SVN: r67049
Diffstat (limited to 'gcc/cp')
-rw-r--r--gcc/cp/ChangeLog7
-rw-r--r--gcc/cp/decl.c9
2 files changed, 16 insertions, 0 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog
index 15a0eb6..7ea230f 100644
--- a/gcc/cp/ChangeLog
+++ b/gcc/cp/ChangeLog
@@ -1,3 +1,10 @@
+2003-05-21 Danny Smith <dannysmith@users.sourceforge.net>
+
+ PR c++/9738
+ * decl.c (duplicate_decls): Re-invoke make_decl_rtl
+ if the old decl had instantiated DECL_RTL.
+ (Base on Richard Henderson 2003-05-13 patch to c-decl.c).
+
2003-05-19 Matt Austern <austern@apple.com>
* lang-options.h: Document -Wno-invalid-offsetof
diff --git a/gcc/cp/decl.c b/gcc/cp/decl.c
index 48f4a8c..71a5822 100644
--- a/gcc/cp/decl.c
+++ b/gcc/cp/decl.c
@@ -3593,6 +3593,15 @@ duplicate_decls (tree newdecl, tree olddecl)
Update OLDDECL to be the same. */
DECL_ATTRIBUTES (olddecl) = DECL_ATTRIBUTES (newdecl);
+ /* If OLDDECL had its DECL_RTL instantiated, re-invoke make_decl_rtl
+ so that encode_section_info has a chance to look at the new decl
+ flags and attributes. */
+ if (DECL_RTL_SET_P (olddecl)
+ && (TREE_CODE (olddecl) == FUNCTION_DECL
+ || (TREE_CODE (olddecl) == VAR_DECL
+ && TREE_STATIC (olddecl))))
+ make_decl_rtl (olddecl, NULL);
+
return 1;
}