Commit 16e31964 by Danny Smith Committed by Danny Smith

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
parent 36f72608
2003-05-21 Danny Smith <dannysmith@users.sourceforge.net>
PR c++/9738
* config/i386/winnt.c (i386_pe_encode_section_info): Enable
even if not first.
2003-05-20 Kaveh R. Ghazi <ghazi@caip.rutgers.edu> 2003-05-20 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
* genautomata.c (output_description, output_automaton_units, * genautomata.c (output_description, output_automaton_units,
......
...@@ -427,9 +427,6 @@ i386_pe_encode_section_info (decl, rtl, first) ...@@ -427,9 +427,6 @@ i386_pe_encode_section_info (decl, rtl, first)
rtx rtl; rtx rtl;
int first; int first;
{ {
if (!first)
return;
default_encode_section_info (decl, rtl, first); default_encode_section_info (decl, rtl, first);
if (TREE_CODE (decl) == FUNCTION_DECL) if (TREE_CODE (decl) == FUNCTION_DECL)
...@@ -445,7 +442,8 @@ i386_pe_encode_section_info (decl, rtl, first) ...@@ -445,7 +442,8 @@ i386_pe_encode_section_info (decl, rtl, first)
} }
/* Mark the decl so we can tell from the rtl whether the object is /* Mark the decl so we can tell from the rtl whether the object is
dllexport'd or dllimport'd. */ dllexport'd or dllimport'd. This also handles dllexport/dllimport
override semantics. */
if (i386_pe_dllexport_p (decl)) if (i386_pe_dllexport_p (decl))
i386_pe_mark_dllexport (decl); i386_pe_mark_dllexport (decl);
......
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> 2003-05-19 Matt Austern <austern@apple.com>
* lang-options.h: Document -Wno-invalid-offsetof * lang-options.h: Document -Wno-invalid-offsetof
......
...@@ -3593,6 +3593,15 @@ duplicate_decls (tree newdecl, tree olddecl) ...@@ -3593,6 +3593,15 @@ duplicate_decls (tree newdecl, tree olddecl)
Update OLDDECL to be the same. */ Update OLDDECL to be the same. */
DECL_ATTRIBUTES (olddecl) = DECL_ATTRIBUTES (newdecl); 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; return 1;
} }
......
2003-05-21 Danny Smith <dannysmith@users.sourceforge.net>
PR c++/9738
* g++.dg/ext/dllimport2.C: New file.
* g++.dg/ext/dllimport3.C: New file.
2003-05-20 Janis Johnson <janis187@us.ibm.com> 2003-05-20 Janis Johnson <janis187@us.ibm.com>
* gcc.dg/compat/struct-by-value-3_x.c: Move common pieces to headers. * gcc.dg/compat/struct-by-value-3_x.c: Move common pieces to headers.
......
// { dg-do compile { target i?86-*-cygwin* i?86-*-mingw*} }
// PR 9738 Dllimport attribute is overriden by later definition
void __attribute__((dllimport)) Bar(void);
void Foo(void)
{
Bar();
}
void Bar(void)
{
}
// { dg-do compile { target i?86-*-cygwin* i?86-*-mingw*} }
// PR 10148 Dllimport attribute of object is overriden by later
// redefinition without attribute.
struct Foo
{
int a;
};
__attribute__((dllimport)) struct Foo f;
void Bar(void)
{
void* dummy = &f;
}
struct Foo f;
// Dllimport sets DECL_NON_ADDR_CONST_P to 1, so following
// assignment would require static_initialization_and_destruction
// if attribute is retained.
void* dummy = &f;
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment