This is the mail archive of the gcc@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]

RE: Problems with egcs


On Sunday, April 05, 1998 8:38 PM, Edgar Villanueva 
[SMTP:edgarvil@ix.netcom.com] wrote:
> I am using a library that is compiled with egcs  -O3 and -O2 options.
>
> All my binarys dump.  If I compile the library and binaries without
> optimizations
> everything is ok.
>
> I would like to help to find the problems in egcs.  But I cannot debug
> because of time and
> lack of knowledge about the library code and egcs.

Why do you automatically assume that the problems are in the
compiler?

Have you considered that your own code may be broken?

Code which invokes undefined behaviors may produce different
results with the same compiler when it is optimized versus when it is
not optimized. A C compiler must only preserve the correctness
of correct programs, under optimization. There are no requirements
as to what should happen as a result of translating and executing
undefined programs.

For example,

	i = 3;
	i = i++;

could produce the value 4 when the compiler is invoked one
way, the value 3 when it is invoked a different way, and 42
in yet a third mode. Since there are no requirements as to
what the result should be, such code can't be used as a basis
for judging the correctness of the compiler.

I would urge you to debug your program as much as possible
to avoid submitting a bogus bug report.

> If anyone is interested in looking at the code I am willing to help.

You could help by creating the smallest example you can come up
with which triggers the problem and submitting it as part of
a bug report.

> The library is ACE.
> The platform is redhat 5.0 with libraries 2.0.7-6 egcs 1.02.  1.0.1 also
> fails.

If you could produce an example that doesn't need ACE or any
other additional library, that would be a bonus.




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