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]
Other format: [Raw text]

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


On Fri, Aug 22, 2008 at 3:14 PM, Andrew Pinski <pinskia@gmail.com> wrote:
> On Fri, Aug 22, 2008 at 2:47 PM, Niklaus <niklaus@gmail.com> 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
>>

Note by the way I think your ispow2 is incorrect.  It is doing a "a ==
1 & a != 0" and not ((a-1)&a) == 0.  We do warn about this too:
t.c:189: warning: suggest parentheses around comparison in operand of &


-- Pinski


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