Re: g++ optimization bug version 4.2.3 and version 4.1.3

2008-08-22 Thread Niklaus
Hi , are you getting the bug with latest trunk on this code. If you can tell me , i'll forward it to debian/ubuntu mainters. On Sat, Aug 23, 2008 at 4:07 AM, Niklaus <[EMAIL PROTECTED]> wrote: > hi, > -O0 gives me correct output > but -O1 or -O2 gives me wrong output. i've attached .s files. > C

Re: g++ optimization bug version 4.2.3 and version 4.1.3

2008-08-22 Thread Niklaus
hi andrew, this is C code. I don't use the functions ispow2 etc. see the code below . [EMAIL PROTECTED]:/home/junk/prog/tju# gcc bug_short.c -lm -O2 [EMAIL PROTECTED]:/home/junk/prog/tju# ./a.out 2383,1 31727,1 132265613,1 3145439247023686464 [EMAIL PROTECTED]:/home/junk/prog/tju# gcc bug_short

Re: g++ optimization bug version 4.2.3 and version 4.1.3

2008-08-22 Thread Andrew Pinski
On Fri, Aug 22, 2008 at 3:14 PM, Andrew Pinski <[EMAIL PROTECTED]> wrote: > On Fri, Aug 22, 2008 at 2:47 PM, Niklaus <[EMAIL PROTECTED]> wrote: >> Hi, >> >> >> When i run with the options g++ prog.c -o prog and run the exectuable >> it gives me the correct output >> but when i do g++ prog.c -o prog

Re: g++ optimization bug version 4.2.3 and version 4.1.3

2008-08-22 Thread Andrew Pinski
On Fri, Aug 22, 2008 at 2:47 PM, Niklaus <[EMAIL PROTECTED]> wrote: > Hi, > > > When i run with the options g++ prog.c -o prog and run the exectuable > it gives me the correct output > but when i do g++ prog.c -o prog -O2 i get the wrong output > On the trunk with -O2 I get the same value as with

g++ optimization bug version 4.2.3 and version 4.1.3

2008-08-22 Thread Niklaus
Hi, When i run with the options g++ prog.c -o prog and run the exectuable it gives me the correct output but when i do g++ prog.c -o prog -O2 i get the wrong output The inputs are below [EMAIL PROTECTED]:/home/junk/prog# g++ bug_gccopt.cpp -O2 [EMAIL PROTECTED]:/home/junk/prog# ./a.out 1 1000