On Wed, Feb 05, 2020 at 05:13:27PM +0000, Dave Love wrote:
GCC doesn't document the targets for which -fno-common produces
better
code. Can someone say for which of the Fedora ones it makes a
difference?
E.g. on any that is capable of vectorization.
Common vars can't have alignment increased, while normal .bss vars can,
because the common vars could be actually defined in some other TU e.g. with
a non-common var and the alignment of that definition would be what is then
used.
Similarly, on -fsection-anchors targets (e.g. aarch64, powerpc*, s390*) .bss
vars can be accessed using section anchors, while .common vars can't.
Or e.g. -fsanitize=address can't add red zone around .common vars and so
doesn't detect buffer overflows in them.
Jakub