gcc AIX problem

Pierre MARC pmarc@wanadoo.fr
Fri Mar 10 23:34:00 GMT 2000


It seems that I have a serious exception management problem with gcc 2.95.2
under AIX 4.2.

I made a very small program showing this problem. This program creates a
second thread that throws an exception. Both main and second threads are
catching the exception. In normal case, only the thread that caused the
exception should catch it. It works like this when I compile with IBM xlC_r
compiler.
When I compile with g++, the exception produced in the second thread is not
caught by the second thread but by the main thread!!!
I tried the same program under Solaris and Linux and everything is OK. The
problem only occurs with AIX. It seems that the exception catching is not
thread safe with g++ under AIX.

Is it a known problem? Is there any special options I should use? Are you
able to reproduce the problem?

I'm running an AIX 4.2.0. For sure, I compiled gcc with the --enable-threads
option.


Thank you if you can help me or if you know somebody that can help me on
this problem.
I really need to compile my AIX programs with g++ because the IBM xlC
compiler cannot work with the STL and I use the STL in my programs.

Pierre MARC
COMINFORMATIC
Switzerland
-------------- next part --------------
MAKE = make

TARGET = AIX
PROJECT_DIR = /home/pierre/dev/testex
COMPILE_FLAGS = -c -O -mthreads -D_REENTRANT -D_GNU_SOURCE -D$(TARGET)
LINK_FLAGS = -O -mthreads

DEPEND_INCLUDES = $(PROJECT_DIR)/*.h
PATH_INCLUDES = -I- -I./ -Iinclude -I$(PROJECT_DIR)
PATH_LIBS = -L./ -L$(PROJECT_DIR)
COMPILER = g++



testex ::	testex.o
	$(COMPILER) $(PATH_LIBS) $(LINK_FLAGS) -o $@ $^
	strip $@

testex.o : testex.cpp
	    $(COMPILER) $(PATH_INCLUDES) $(COMPILE_FLAGS) -o $*.o $*.cpp


-------------- next part --------------
A non-text attachment was scrubbed...
Name: testex.cpp
Type: text/x-c
Size: 1701 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/gcc-bugs/attachments/20000310/279d06d7/attachment.bin>


More information about the Gcc-bugs mailing list