[Bug c/49535] __builtin_object_size incorrect for array arguments
jakub at gcc dot gnu.org
gcc-bugzilla@gcc.gnu.org
Mon Jun 27 09:27:00 GMT 2011
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49535
Jakub Jelinek <jakub at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |RESOLVED
CC| |jakub at gcc dot gnu.org
Resolution| |INVALID
--- Comment #1 from Jakub Jelinek <jakub at gcc dot gnu.org> 2011-06-27 09:26:54 UTC ---
That's just a bogus expectation.
If you want to see 800 800 800 800 in all 4 cases, that assumes that all the
functions have been inlined. But you don't tell the compiler that it is
essential to inline them (we have always_inline attribute for such purposes),
so it is just on gcc's decision whether it is profitable to inline them or not.
Starting with http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=158732
gcc doesn't inline them, because main (except for inner loops in it) is
optimized for size, being called just once. They weren't inlined before
either, just only with -Os.
More information about the Gcc-bugs
mailing list