problem with -funit-at-a-time

Ian Lance Taylor iant@google.com
Sat Mar 8 02:10:00 GMT 2008


"Aparna Jain (apjain)" <apjain@cisco.com> writes:

> The code generated by 3.4.5 is no more assumes the first function of a C
> file  as the starting Address of the compiled code. I think this is
> because of -funit-at-a-time which is enabled by default by O2 option.

...

> I used -fno-unit-at-a-time , and it was fine. But just concerned about
> the throughput of the code generated. Is there any other way to deal
> with this problem ?

If you need the output to be in the same order as the input, then in
gcc 3.4.5 -fno-unit-at-a-time is the right approach.  In gcc 4.2 and
later, you can instead use -fno-toplevel-reorder, which retains the
ordering while also giving you the performance benefits of
-funit-at-a-time.

Ian



More information about the Gcc-help mailing list