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] |
Kenneth Hoste <kenneth.hoste@elis.ugent.be> writes:
* When using -falign-loops or -fno-align-loops the corresponding internal variable 'align-loops' should be set to 0 (= use default setting) or 1 (= no aligning) resp. When parsing the various flags, a variable 'value' is used to set (value=1) or unset (value=0) the corresponding flag. Unfortunately, these values should be reversed for the -falign-X flags, which isn't done, and thus using -falign- loops causes no aligning, while -fno-align-loops causes aligning with the default setting for the arch you're compiling for. Same problem for -falign-jumps, -falign-labels and -falign-functions.
Ouch. Thanks for noticing.
Also, while trying to identify the flags enabled in the various -On flags, I've run into incomplete or even wrong documentation regarding the optimization passes. Some examples:
- the -fipa-X flags are not mentioned in the 4.1.2 documentation
Looks like a bug.
- funit-at-a-time is still being reported as enabled in -O2 and above, while it is already active in -O1 (this seems to fixed in the 4.3.0 docs though)
This would be a bug but it looks OK to me in 4.1.
- the documentation for fmove-loop-invariants and ftree-loop-optimize mentions they are enabled at -O1 when they are not
Actually I think they are enabled at -O1. This is done in a slightly tricky way: they default to being on, but they have no effect unless the other loop optimization passes are run. I think it would be appropriate to clean this up to make the code more obvious.
- finline-functions is enabled at -Os, but isn't listed so
Yes, this should be documented better. The general -finline-functions is not enabled at -Os. Only inlining of small functions is enabled. This is done by setting parameters.
- Some flags are enabled by other flags (for example, fschedule-insns enables fsched-interblock and fsched-spec according to the docs). I was unable to find where in the source code this is done... And because I want to incorporate as much active On-flags as possible, I'd like to track down for which flags this is really true, and for which the docs are out-of-date.
-fsched-interblock and -fsched-spec default to 1 in common.opt. But they have no effect unless you enable a scheduling pass.
- When new optimization passes are completed, how is decided where they go to (-O1, -O2, -O3, -Os, none)? For example, why did funit-at- a-time switch from -O2 to -O1 a while ago? And, as I noticed from the 4.3.0 docs, why is fsplit-wide-types enabled at -O1, and not -O2? Is there some testing done, or is it just people saying "I think X belongs there"?
Where to put optimizations is a trade-off between the amount of time they take and the amount of good they do. The testing which is done is compilation time testing.
Kenneth Hoste ELIS - Ghent University kenneth.hoste@elis.ugent.be http://www.elis.ugent.be/~kehoste
Index Nav: | [Date Index] [Subject Index] [Author Index] [Thread Index] | |
---|---|---|
Message Nav: | [Date Prev] [Date Next] | [Thread Prev] [Thread Next] |