[Subject Prev][Subject Next][Thread Prev][Thread Next][Subject Index][Thread Index]

gcc optimization



Hi,

I am using gcc-2.96-54 that comes with the RH 7.0 distribution. This is
giving me some rather funny problems.

At first, I compiled my code with the -O2 option for optimization.
Compilation went through successfully, but at the run time, it used to come
out with a Segmentation fault.  I traced this back to 2 pointers in my
code, that used to get initialized to the same value. I suppose the values
for these were taken from the same register and hence whenever the value of
one of the pointers was changed, the other one would pick up the same value
and screw up things.

Now for the funny part of it !! I recompiled the code without the
optimization and this time it failed during the linking stage itself. It
said some thing about an "undefined reference to LC41". Please note that
this same code compiled with optimization on. 

This has kind of left me clueless. So any kind of help to get around this
will be appreciated. 

TIA,

Regards,

Sandeep Sundaram

Smoking helps you lose weight .... one lung at a time !!


_____________________________________________
Free email with personality! Over 200 domains!
http://www.MyOwnEmail.com