This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

I386-Linux / C++: Problem with member function pointers initialized in non-static structure variable inside a function


Hey,

Apologies if the mailer makes a mess of this.

Using gcc from Debian potato as at 16 May.

g++ -v --save-temps -c test.cpp

Reading specs from /usr/lib/gcc-lib/i386-linux/2.95.2/specs
gcc version 2.95.2 20000313 (Debian GNU/Linux)
 /usr/lib/gcc-lib/i386-linux/2.95.2/cpp -lang-c++ -v -D__GNUC__=2
-D__GNUG__=2 -D__GNUC_MINOR__=95 -D__cplusplus -D__ELF__ -Dunix -D__i386__
-Dlinux -D__ELF__ -D__unix__ -D__i386__ -D__linux__ -D__unix -D__linux
-Asystem(posix) -D__EXCEPTIONS -Acpu(i386) -Amachine(i386) -Di386 -D__i386
-D__i386__ test.cpp test.ii
GNU CPP version 2.95.2 20000313 (Debian GNU/Linux) (i386 Linux/ELF)
#include "..." search starts here:
#include <...> search starts here:
 /usr/lib/gcc-lib/i386-linux/2.95.2/../../../../include/g++-3
 /usr/local/include
 /usr/lib/gcc-lib/i386-linux/2.95.2/include
 /usr/include
End of search list.
The following default directories have been omitted from the search path:
 /usr/lib/gcc-lib/i386-linux/2.95.2/../../../../i386-linux/include
End of omitted list.
 /usr/lib/gcc-lib/i386-linux/2.95.2/cc1plus test.ii -quiet -dumpbase test.cc
-version -o test.s
GNU C++ version 2.95.2 20000313 (Debian GNU/Linux) (i386-linux) compiled by
GNU C version 2.95.2 20000313 (Debian GNU/Linux).
test.cpp: In method `int ACSConnection::ProcessMessage(int *)':
test.cpp:38: Internal compiler error in `const_hash', at varasm.c:2372
Please submit a full bug report.
See <URL:http://www.gnu.org/software/gcc/bugs.html> for instructions.


The same code compiles fine on Solaris/Sparc (with Suns' compiler) and under
Windows with MSVC.

It works if you change the structure variable (line 525 in .ii) to static. 
In this context, it should really have been a static from the start, but I
can think of other cases where I might want to do a similar thing
non-static.

It also compiles if you strip out the classes and have straight function
pointers.

Machine is a Pentium 133 with 32meg ram if thats of any relevance.

Thanks,
Andrew Dixie





The information transmitted is intended only for the person or entity to 
which it is addressed and may contain confidential and/or privileged 
material. Any review, retransmission, dissemination or other use of, or 
taking of any action in reliance upon, this information by persons or 
entities other than the intended recipient is prohibited. If you 
received this in error, please contact the sender and delete the material 
from any computer. Opinions expressed in this transmission are not necessarily 
those of Sanderson Computers Limited. For further clarification, please 
contact postmaster@sanderson.co.nz 

test.ii.gz


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]