This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
Re: failure to construct global object
Martin, et. al.
I have attached bzipped .ii and the .s for the following program:
#include "AsSystem.h"
cAsSystem offender;
main()
{
offender.delete_all();
}
which crashes when it tries to execute delete_all() for the
uncreated 'offender' object. I built the files with the following
Makefile:
CXX = g++
CPPFLAGS = -Dport2egcs -I../include -I../../3rdparty/include \
-I../../mdiToolKit/eventHandler/include \
-D_DEVELOPMENT_ENVIRONMENT_ONLY_ -DDEBUG
CXXFLAGS = -g
CiAsMain.ii: CiAsMain.cxx ../include/AsSystem.h
$(CXX) $(CPPFLAGS) $(CXXFLAGS) -E CiAsMain.cxx -o CiAsMain.ii
CiAsMain.s: CiAsMain.cxx ../include/AsSystem.h
$(CXX) $(CPPFLAGS) $(CXXFLAGS) -S CiAsMain.cxx -o CiAsMain.s
It occurred to me to send also .s and .ii for the pointer version of
the program (which would not fail), but that would have raised the
spam factor. This is available upon request.
The files follow. Thanks for the help.
Gisli
CiAsMain.s.bz2
CiAsMain.ii.bz2
>>>>> On Wed, 8 Mar 2000 07:04:19 +0100, you said:
>> Fair enough. Let me try to change your mind.
MvL> Thanks for the update. From all your explanations, it looks like a
MvL> bug. Unfortunately, I cannot do anything more but acknowledging: "It
MvL> looks like a bug", since you did not provide source code so far.
>> I have moved the global object into the object file which contains
>> the main(). The program still runs without visiting the constructor
>> for the class in question. I create another object of the same
>> class, this time inside to scope of main(). Now the constructor is
>> hit once.
MvL> Please perform the following steps: Compile the file containing main()
MvL> with 'g++ --save-temps -any-other-options-you-are-using
MvL> main.cpp'. Create a tar file containing main.ii and main.s, and
MvL> compress it appropriately. Send us the resulting tar file and the g++
MvL> command line you were using.
MvL> In case you have concerns sharing your code: I have no interest
MvL> whatsoever in misusing your code; I'm trying to track a bug in the
MvL> compiler. While sending the report to gcc-bugs (and hence to the
MvL> public) is in general preferred (and accepted by the majority of bug
MvL> reporters), sending it privately to me is also fine.
MvL> Regards,
MvL> Martin