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

--- Comment #3 from Pascal Cuoq <pascal_cuoq at hotmail dot com> ---
@Andrew Pinski

You don't even need to invoke the fact that this is an extension. GCC could
reserve 17 bytes for each variable i of type “int”, and as long as “sizeof i”
continued to evaluate to 4 (4 being the value of “sizeof(int)” for x86), no-one
would be able to claim that GCC is not generating “correct” assembly code.

This ticket is pointing out that the current behavior for initialized FAMs is
suboptimal for programs that rely on the GCC extension, just like it would be
suboptimal to reserve 17 bytes for each “int” variable for standard C programs
(and I would open a ticket for it if I noticed such a behavior).

It's not breaking anything and it may be inconvenient to change, and as a
ticket that does not affect correctness, it can be ignored indefinitely. It's
just a suggestion for smaller binaries that might also end up marginally faster
as a result.

@Martin Uecker

Considering how casually phrased the description of FAMs was in C99 and
remained in later standards (see https://stackoverflow.com/q/73497572/139746
for me trying to make sense of some of the relevant words), I doubt that the
standard has anything to say about the compiler extension being discussed. But
if you have convincing arguments, you could spend a few minutes filing a bug
against Clang to tell them that they are making the binaries they generate too
small and efficient.

Reply via email to