https://gcc.gnu.org/bugzilla/show_bug.cgi?id=88345

--- Comment #4 from Martin Sebor <msebor at gcc dot gnu.org> ---
Yes, I do mean -falign-functions, sorry.  I both misread and mistyped -finline-
as -falign-.

I do think that when a user specifies -falign-functions=N on the command line
with any optimization option it's likely because they want functions aligned on
the specified boundary, with all the other benefits of -Os.  That's the effect
they get with -O2, and I think it should work the same at all optimization
levels, except perhaps -O0 where users usually have minimal expectations about
the efficiency of the executable. 

Otherwise, when GCC makes the decision to disregard an option specified on the
command line that it could otherwise honor, especially one that affects code
generation, I would expect it to print a warning to let the user know.  (I
realize there are cases where it's not possible, but this one doesn't seem like
one of them -- its should be easy to honor the option.)

However it works, though, the manual should make it clear.  Saying that "-Os
enables optimizations other than -falign-functions" doesn't tell the reader how
functions are actually aligned.  The documentation of -falign-functions should
also mention which of the forms of the option is enabled at -O2 and -O3 (i.e.,
make it clear it's -falign-functions with no argument).  Neither users nor GCC
developers should have to reverse-engineer GCC to know what effect to expect.

Reply via email to