This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c/49535] __builtin_object_size incorrect for array arguments
- From: "jakub at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Mon, 27 Jun 2011 09:27:29 +0000
- Subject: [Bug c/49535] __builtin_object_size incorrect for array arguments
- Auto-submitted: auto-generated
- References: <bug-49535-4@http.gcc.gnu.org/bugzilla/>
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.