[Bug target/27067] Compile errors with multiple inheritance where the stdcall attribute is applied to virtual functions.

2006-04-17 Thread wszafran at users dot sourceforge dot net


--- Comment #2 from wszafran at users dot sourceforge dot net  2006-04-18 
03:10 ---
Yes, it works like a charm now.  I only built the CygWin-hosted,
MinGW-targetting compiler with your patch applied, but I suppose a similar
result would be achieved with a compiler bootstrapped on CygWin.

I understand the patch you posted is your private copy, not applied to the
official source tree yet.  Do you think it'll make it for the next snapshot, so
that others who are affected could use this fix?

Thank you very much for your work on this, it's appreciated.


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=27067



[Bug target/27067] Compile errors with multiple inheritance where the stdcall attribute is applied to virtual functions.

2006-04-19 Thread wszafran at users dot sourceforge dot net


--- Comment #3 from wszafran at users dot sourceforge dot net  2006-04-20 
01:59 ---
Just confirmed that the fix works with the patched CygWin-bootstrapped compiler
as well.

Thanks again.


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=27067



[Bug target/27636] Bad thunk alias to stdcall method

2006-05-16 Thread wszafran at users dot sourceforge dot net


--- Comment #4 from wszafran at users dot sourceforge dot net  2006-05-17 
01:15 ---
(In reply to comment #2)
> This looks related to Bug 27067.

Not only related but pretty much the same thing.  And Ross' example program
compiles cleanly using the latest 4.1.1 (20060512) snapshot with Danny's patch
for 27067 applied.  I don't have the 4.2.0 available but I imagine the same
patch can be used to mend it as well.


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=27636



[Bug c++/27067] New: Compile errors with multiple inheritance where the stdcall attribute is applied to virtual functions.

2006-04-06 Thread wszafran at users dot sourceforge dot net
When the sample code snippet (below) is compiled, errors (below) occur.  This
issue breaks the compilation of wxWidgets' Media Library.  The same problem
occurs with the latest snapshot (20060331, used in the example below) of GCC
4.1.1, on both CygWin and MinGW.

The sample code (virt-test.ii):

# 1 "virt-test.cpp"
# 1 ""
# 1 ""
# 1 "virt-test.cpp"
struct top
{
  virtual ~top() {}
  virtual int __attribute__((__stdcall__)) fun1() = 0;
  virtual char __attribute__((__stdcall__)) fun2() = 0;
  virtual double __attribute__((__stdcall__)) fun3() = 0;
};

struct mid1 : public top
{
  virtual int __attribute__((__stdcall__)) fun1() = 0;
  virtual char __attribute__((__stdcall__)) fun2() = 0;
  virtual double __attribute__((__stdcall__)) fun3() = 0;
  virtual long __attribute__((__stdcall__)) fun4() = 0;
};

struct mid2 : public top
{
  virtual int __attribute__((__stdcall__)) fun1() = 0;
  virtual char __attribute__((__stdcall__)) fun2() = 0;
  virtual double __attribute__((__stdcall__)) fun3() = 0;
  virtual long __attribute__((__stdcall__)) fun5() = 0;
};

struct mid3 : public top
{
  virtual int __attribute__((__stdcall__)) fun1() = 0;
  virtual char __attribute__((__stdcall__)) fun2() = 0;
  virtual double __attribute__((__stdcall__)) fun3() = 0;
  virtual long __attribute__((__stdcall__)) fun6() = 0;
};

struct bottom : public mid1, public mid2, public mid3
{
  int __attribute__((__stdcall__)) fun1();
  char __attribute__((__stdcall__)) fun2();
  double __attribute__((__stdcall__)) fun3();

  long __attribute__((__stdcall__)) fun4()
  { return 345L; }

  long __attribute__((__stdcall__)) fun5()
  { return 456L; }

  long __attribute__((__stdcall__)) fun6()
  { return 567L; }
};

int __attribute__((__stdcall__)) bottom::fun1()
{ return 123; }

char __attribute__((__stdcall__)) bottom::fun2()
{ return 'a'; }

double __attribute__((__stdcall__)) bottom::fun3()
{ return 123.45; }

int main()
{
  bottom b;
  b.fun1();
  b.fun2();
  b.fun3();
  b.fun4();
  b.fun5();
  b.fun6();
}

The command line to compile:

mingw32-g++ -v -save-temps -Wall -Wextra -pedantic -o virt-test.exe virt-test
.cpp

And compiler output:

Using built-in specs.
Target: mingw32
Configured with:
/usr/local/src/gcc/build-cross/source/gcc-4.1-20060331//configure -v
--prefix=/usr/local/cross-mingw-4.1 --target=mingw32
--with-headers=/usr/local/cross-mingw-4.1/mingw32/include --with-gcc
--with-gnu-ld --with-gnu-as --enable-threads=win32 --disable-nls
--enable-languages=c,c++ --disable-win32-registry --disable-shared
--enable-sjlj-exceptions --enable-libstdcxx-allocator=pool --without-newlib
Thread model: win32
gcc version 4.1.1 20060331 (prerelease)
 /usr/local/cross-mingw-4.1/libexec/gcc/mingw32/4.1.1/cc1plus.exe -E -quiet -v
virt-test.cpp -Wall -Wextra -pedantic -fpch-preprocess -o virt-test.ii
ignoring nonexistent directory
"/usr/local/cross-mingw-4.1/lib/gcc/mingw32/4.1.1/../../../../mingw32/sys-include"
#include "..." search starts here:
#include <...> search starts here:
 /usr/local/cross-mingw-4.1/lib/gcc/mingw32/4.1.1/../../../../include/c++/4.1.1

/usr/local/cross-mingw-4.1/lib/gcc/mingw32/4.1.1/../../../../include/c++/4.1.1/mingw32

/usr/local/cross-mingw-4.1/lib/gcc/mingw32/4.1.1/../../../../include/c++/4.1.1/backward
 /usr/local/cross-mingw-4.1/lib/gcc/mingw32/4.1.1/include
 /usr/local/cross-mingw-4.1/lib/gcc/mingw32/4.1.1/../../../../mingw32/include
End of search list.
 /usr/local/cross-mingw-4.1/libexec/gcc/mingw32/4.1.1/cc1plus.exe
-fpreprocessed virt-test.ii -quiet -dumpbase virt-test.cpp -auxbase virt-test
-Wall -Wextra -pedantic -version -o virt-test.s
GNU C++ version 4.1.1 20060331 (prerelease) (mingw32)
compiled by GNU C version 3.4.4 (cygming special) (gdc 0.12, using dmd
0.125).
GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072
Compiler executable checksum: ce3135ac5ab9fb49e72d849828fbe7dc
virt-test.cpp:66: error: 'char *LTHUNK2()' aliased to undefined symbol
'_ZN6bottom4fun2Ev'
virt-test.cpp:66: error: 'char *LTHUNK3()' aliased to undefined symbol
'_ZN6bottom4fun2Ev'
virt-test.cpp:66: error: 'double *LTHUNK4()' aliased to undefined symbol
'_ZN6bottom4fun3Ev'
virt-test.cpp:66: error: 'double *LTHUNK5()' aliased to undefined symbol
'_ZN6bottom4fun3Ev'


-- 
   Summary: Compile errors with multiple inheritance where the
stdcall attribute is applied to virtual functions.
   Product: gcc
   Version: 4.1.0
Status: UNCONFIRMED
      Severity: normal
  Priority: P3
 Component: c++
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: wszafran at users dot sourceforge dot net
 GCC build triplet: i686-pc-cygwin
  GCC host triplet: i686-pc-cygwin
GCC target triplet: mingw32


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=27067