If this is your first visit, be sure to
check out the FAQ by clicking the
link above. You may have to register
before you can post: click the register link above to proceed. To start viewing messages,
select the forum that you want to visit from the selection below.
Phoronix, Linux Hardware Reviews, Linux hardware benchmarks, Linux server benchmarks, Linux benchmarking, Desktop Linux, Linux performance, Open Source graphics, Linux How To, Ubuntu benchmarks, Ubuntu hardware, Phoronix Test Suite
Actually -O is a flag that shouldn't exist at all (it means "optimize what you want --I don't care", which in the end means "I don't care about the object code quality"). On the other hand, flags that do have a meaning are -O0 (don't optimize), -O1 (light optimization for speed), -O2 (moderate optimization for speed) -O3 (aggressive optimization for speed, that can have undesired results in some cases), and -Os (optimize for size). Apart from these, you also have more detailed flags for fine-tuning how to optimize.
So, basically, you use -O when you should actually be using the -O1/2/3/s flag appropriate for what you really want.
Actually -O is a flag that shouldn't exist at all (it means "optimize what you want --I don't care", which in the end means "I don't care about the object code quality"). On the other hand, flags that do have a meaning are -O0 (don't optimize), -O1 (light optimization for speed), -O2 (moderate optimization for speed) -O3 (aggressive optimization for speed, that can have undesired results in some cases), and -Os (optimize for size). Apart from these, you also have more detailed flags for fine-tuning how to optimize.
Actually -O is a flag that shouldn't exist at all (it means "optimize what you want --I don't care", which in the end means "I don't care about the object code quality"). On the other hand, flags that do have a meaning are -O0 (don't optimize), -O1 (light optimization for speed), -O2 (moderate optimization for speed) -O3 (aggressive optimization for speed, that can have undesired results in some cases), and -Os (optimize for size). Apart from these, you also have more detailed flags for fine-tuning how to optimize.
So, basically, you use -O when you should actually be using the -O1/2/3/s flag appropriate for what you really want.
Since the programmer has no idea what O1 or O2 will actually do using just O makes as much sense.
If they cared they'd specify each optimization specifically on the command line.
Since the programmer has no idea what O1 or O2 will actually do using just O makes as much sense.
If they cared they'd specify each optimization specifically on the command line.
They don't have to, but the maintainer of the project's build system should. Sometimes those are the same person, sometimes not. In any case, using a specific level makes a lot of sense.
Comment