+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>
* genautomata.c (output_description, output_automaton_units,
rtx rtl;
int first;
{
- if (!first)
- return;
-
default_encode_section_info (decl, rtl, first);
if (TREE_CODE (decl) == FUNCTION_DECL)
}
/* 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))
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>
* lang-options.h: Document -Wno-invalid-offsetof
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;
}
+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>
* gcc.dg/compat/struct-by-value-3_x.c: Move common pieces to headers.
--- /dev/null
+// { 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)
+ {
+ }
+
--- /dev/null
+// { 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;
+