Re: Need some clarification about optimization flags, what "exactly" does -O1 do?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi,

> What does the declaration of IndexType look like?

nothing special:

       enum IndexType {
         IT_16BIT,
         IT_32BIT
       };

> The bug is probably in your app, not in gcc.
> I think you'd be much better off fixing the bug than trying to
> discover which optimization pass it breaks.

not quite my app just app I try to build, i.e. developer seems to not
have gcc 4.3 yet and I am just trying to get it on :) To be more
precise - the value that is defined as:

... ? HardwareIndexBuffer::IT_32BIT : HardwareIndexBuffer::IT_16BIT

is then checked with:

       switch (mIndexType)
       {
       case IT_16BIT:
           mIndexSize = sizeof(unsigned short);
           break;
       case IT_32BIT:
           mIndexSize = sizeof(unsigned int);
           break;
       }

but it don't trigger any of those in anything more than -O0 (if I add
default with cerr<< it is triggered) and works on -O0... I didn't
thought such funny thing can be caused by some bug where code is quite
easy, simple switch on enumerated value that is set to one of two and
not used/changed anywhere else...

cheers,
Andrzej.

[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux