gcc compiler -O flags

Sergei Organov osv at javad.com
Fri May 25 15:45:19 UTC 2007

Kate Feng <feng1 at bnl.gov> writes:
> For this particular  case that Till mentioned,  the result is inversed
> between -O,  and -O2 (-O4,  too).   I think -fschedule-insns is tuned
> on by default for the -O2 and -O4..  It's possible that there is some
> sort of optimization logic flow that needs to be followed for this
> case.  Some how -fschedule-insns  inverses that schedule flow.
> I did not study the gcc compiler enough.  The above statement is
> only based on my tests.  Anyway, we can still call it a bug.
> I think the price to pay for optimization is the risk. No one pointed
> out I have a different gcc4.1.1 from everyone else yet.
> Heap_Block_remove is the one case I found for this case.
> More findings needs to be explored.

Once again, _Heap_Block_remove is not a problem as heap management code
doesn't use tricks that would lead to overlapping Heap_Block objects,
and when objects don't overlap, the GCC generated code will work just
fine no matter if GCC swaps instructions or not.

-- Sergei.

More information about the users mailing list