]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
re PR c++/7910 ([cygwin] Seg fault when compiling OpenSceneGraph 0.9.1)
authorMark Mitchell <mark@codesourcery.com>
Sat, 12 Apr 2003 20:01:29 +0000 (20:01 +0000)
committerMark Mitchell <mmitchel@gcc.gnu.org>
Sat, 12 Apr 2003 20:01:29 +0000 (20:01 +0000)
PR c++/7910
* config/i386/winnt.c (i386_pe_mark_dllimport): Fix thinko.

PR c++/7910
* g++.dg/ext/dllimport1.C: New test.

From-SVN: r65519

gcc/ChangeLog
gcc/config/i386/winnt.c
gcc/testsuite/ChangeLog
gcc/testsuite/g++.dg/ext/dllimport1.C [new file with mode: 0644]

index ee654718d632278a89878db288c6e15a0cfa9a19..0e9f49dccf25dd1612c87b30aa9a294a003cf72c 100644 (file)
@@ -1,3 +1,8 @@
+2003-04-12  Mark Mitchell  <mark@codesourcery.com>
+
+       PR c++/7910
+       * config/i386/winnt.c (i386_pe_mark_dllimport): Fix thinko.
+
 2003-04-12  Zack Weinberg  <zack@codesourcery.com>
 
        * configure.in: Check for wchar.h, mbstowcs, and wcswidth.
index 0751c7f888eaec07bcb2df2b30c207e555fcae00..98e579220578a1c9e6a7925ff2e123de4fb342f5 100644 (file)
@@ -273,7 +273,7 @@ i386_pe_mark_dllimport (decl)
   const char *oldname;
   char  *newname;
   tree idp;
-  rtx rtlname, newrtl;
+  rtx rtlname;
 
   rtlname = XEXP (DECL_RTL (decl), 0);
   if (GET_CODE (rtlname) == SYMBOL_REF)
@@ -335,10 +335,8 @@ i386_pe_mark_dllimport (decl)
      identical.  */
   idp = get_identifier (newname);
 
-  newrtl = gen_rtx (MEM, Pmode,
-                   gen_rtx (SYMBOL_REF, Pmode,
-                            IDENTIFIER_POINTER (idp)));
-  XEXP (DECL_RTL (decl), 0) = newrtl;
+  XEXP (DECL_RTL (decl), 0) 
+    = gen_rtx_SYMBOL_REF (Pmode, IDENTIFIER_POINTER (idp));
 
   /* Can't treat a pointer to this as a constant address */
   DECL_NON_ADDR_CONST_P (decl) = 1;
index fa8f2b83aa1947b598c14a197604a69733a63008..c7cae0a18180febb1e73487613d47215e83a9964 100644 (file)
@@ -1,3 +1,8 @@
+2003-04-12  Mark Mitchell  <mark@codesourcery.com>
+
+       PR c++/7910
+       * g++.dg/ext/dllimport1.C: New test.
+
 2003-04-12  Eric Botcazou  <ebotcazou@libertysurf.fr>
 
        * gcc.dg/ultrasp8.c: Fix for 32-bit Sparc.
diff --git a/gcc/testsuite/g++.dg/ext/dllimport1.C b/gcc/testsuite/g++.dg/ext/dllimport1.C
new file mode 100644 (file)
index 0000000..a93fb19
--- /dev/null
@@ -0,0 +1,21 @@
+// { dg-do compile { target i?86-*-cygwin* } }
+
+class __attribute__((dllimport)) Foo
+{
+ public:
+  virtual void dummy_foo_func(void)
+    {}
+};
+
+class Bar : public Foo
+{
+public:
+  ~Bar();
+  void dummy_bar_func();
+};
+
+Bar::~Bar()
+{}
+
+void Bar::dummy_bar_func()
+{}