Bug 86357 - -falign-{functions,loops,jumps} incorrectly reported as disabled by -Q --help=optimizers
Summary: -falign-{functions,loops,jumps} incorrectly reported as disabled by -Q --help...
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: driver (show other bugs)
Version: 9.0
: P3 normal
Target Milestone: ---
Assignee: Martin Liška
URL:
Keywords: diagnostic
Depends on:
Blocks:
 
Reported: 2018-06-29 04:39 UTC by sumnon
Modified: 2018-07-09 08:25 UTC (History)
0 users

See Also:
Host:
Target:
Build:
Known to work:
Known to fail:
Last reconfirmed: 2018-06-29 00:00:00


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description sumnon 2018-06-29 04:39:50 UTC
The options appear to be working correctly, based on the generated code/asm; they just aren't reported correctly by -Q. -falign-labels appears to be working and reported correctly.

There are a few related bugs (bug 45996, bug 61588, and bug 43861); they appear independent/out-of-date but there's a chance fixing them will fix this too.

For example:

$ gcc -Os -Q --help=optimizers | grep align-
  -falign-functions           		[disabled]
  -falign-functions=          		16
  -falign-jumps               		[disabled]
  -falign-jumps=              		16
  -falign-labels              		[enabled]
  -falign-labels=             		0
  -falign-loops               		[disabled]
  -falign-loops=              		16

$ gcc -O3 -Q --help=optimizers | grep align-
  -falign-functions           		[disabled]
  -falign-functions=          		16
  -falign-jumps               		[disabled]
  -falign-jumps=              		16
  -falign-labels              		[enabled]
  -falign-labels=             		0
  -falign-loops               		[disabled]
  -falign-loops=              		16

$ gcc -O3 -fno-align-loops -fno-align-functions -Q --help=optimizers | grep align-
  -falign-functions           		[disabled]
  -falign-functions=          		1
  -falign-jumps               		[disabled]
  -falign-jumps=              		16
  -falign-labels              		[enabled]
  -falign-labels=             		0
  -falign-loops               		[disabled]
  -falign-loops=              		1

$ gcc -O3 -falign-loops=32 -Q --help=optimizers | grep align-
  -falign-functions           		[disabled]
  -falign-functions=          		16
  -falign-jumps               		[disabled]
  -falign-jumps=              		16
  -falign-labels              		[enabled]
  -falign-labels=             		0
  -falign-loops               		[disabled]
  -falign-loops=              		32

All of these generate the expected asm, with alignment for -O3 (except when explicitly turned off) and no alignment for -Os.

gcc -v:

Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/usr/lib/gcc/x86_64-pc-linux-gnu/8.1.1/lto-wrapper
Target: x86_64-pc-linux-gnu
Configured with: /build/gcc/src/gcc/configure --prefix=/usr --libdir=/usr/lib --libexecdir=/usr/lib --mandir=/usr/share/man --infodir=/usr/share/info --with-bugurl=https://bugs.archlinux.org/ --enable-languages=c,c++,ada,fortran,go,lto,objc,obj-c++ --enable-shared --enable-threads=posix --enable-libmpx --with-system-zlib --with-isl --enable-__cxa_atexit --disable-libunwind-exceptions --enable-clocale=gnu --disable-libstdcxx-pch --disable-libssp --enable-gnu-unique-object --enable-linker-build-id --enable-lto --enable-plugin --enable-install-libiberty --with-linker-hash-style=gnu --enable-gnu-indirect-function --enable-multilib --disable-werror --enable-checking=release --enable-default-pie --enable-default-ssp
Thread model: posix
gcc version 8.1.1 20180531 (GCC)
Comment 1 Richard Biener 2018-06-29 07:48:26 UTC
Probably the option machinery / help code doesn't properly associate FOO and FOO=
option variants like

falign-loops
Common Report Var(align_loops,0) Optimization UInteger
Align the start of loops.

falign-loops=
Common RejectNegative Joined UInteger Var(align_loops) Optimization
Comment 2 Martin Liška 2018-06-29 10:47:10 UTC
Let me take a look.
Comment 3 Martin Liška 2018-07-09 08:25:19 UTC
Fixed in r262513.