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]

egcs bug?


System:   SunOS bluemoon 5.6 Generic_105181-04 sun4u sparc SUNW,Ultra-1
Compiler: gcc version egcs-2.92.11 19980921 (gcc2 ss-980609 experimental)
Options:  -g -Wall -W -ansi -pedantic 
          -Wtraditional -Wcast-qual -Wwrite-strings 
          -Wstrict-prototypes -Wmissing-prototypes 
          -Wmissing-declarations -Winline

I have some code that is running fine an GCC 2.7.2 and 2.8.1 that is
failing on egcs. I tried egcs release 1.1 and the September 21 snapshot.
It also works on the Sun CC compiler.

I have enclosed an example program with a Makefile, a source file
(test.cc) and three Solaris 2.6 executable. One compile with 2.7.2, one
with 2.8.1 and one with egcs.

I have also seen this problem on Linux. The test is a simple program that
demonstates the problem. 

The "Test" class has an array of pointers to the "SensorBase" class. The
"Test" constructor creates a class of type "Sensor<Test>" and add it the
pointer to it's list of pointers. This is done like:

    datasensor[count++] = new Sensor<Test> ();

The new sensor is created and added to the list OK, but count is not being
incremented.

The expected output is:
%Success: test.cc: 84: ./test2.8.1 worked

The following is the output I got with the different compilers:
./testCC
%Success: test.cc: 84: ./testCC worked
./test2.7.2
%Success: test.cc: 84: ./test2.7.2 worked
./test2.8.1
%Success: test.cc: 84: ./test2.8.1 worked
./test2.92.11
!ERROR: test.cc: 54: count!=1, count = 0
!ERROR: test.cc: 60: count!=2, count = 1
!ERROR: test.cc: 87: ./test2.92.11 had errors
gnumake: *** [run] Error 2

I would appreciate if you let me know when a path is available.

If you have any questions, call me (512)895-3483 or email me.

--
Bryan Weston

test.tar.gz


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