Marin D wrote:

> After turning -O3 on a program it started to gave strange results...
> 
> I have heard of -O3 breaking code but it was broken even with -O1 level of
> optimization.
> 
> The broken passage is
> 
>   sscanf(PQgetvalue(pResTemp,0,1),"%ld",&lTotalInc);
> 
> where PQgetvalue() returns a number as string.
> 
> For example while debugging PQgetvalue() returns "0" but lTotalInc is not
> assigned 0 and stays unitialized.  
> 
> From the gcc info files I see that O1 turns on 
> 
> fdefer-pop,fthread-jmp,fdelayed-branch,fomit-frame-pointer but I couldn't
> understand which exactly could be the problem.
> 
> Any ideas?

Try using `gcc -S' to compile to assembler, both with and without
optimisation, then compare the results.

-- 
Glynn Clements <[EMAIL PROTECTED]>

Reply via email to