This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c/31362] gcc should not inline functions with 'section' attribute
- From: "rguenth at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 26 Mar 2007 14:47:14 -0000
- Subject: [Bug c/31362] gcc should not inline functions with 'section' attribute
- References: <bug-31362-1331@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Comment #6 from rguenth at gcc dot gnu dot org 2007-03-26 15:47 -------
<qoute>
In the actual implementation from which this test case was derived,
the function *must* reside at a specific location in memory, but due
to the inlining, it does not. This causes failures in the
application.
</quote>
You should tell the compiler this. This is exactly what we have the
noinline and the always_inline (for the opposite case) attributes for.
Note that 'inline' is a mere hint to the compiler, the compiler is free
to inline functions not marked as such if it is possible and looks profitable.
You could for example put a function in section .text.hot but of course still
want inlining if possible.
The behavior is not a regression really, as it is not documented that
the section attribute prevents inlining. Overloading the section attribute
with this additional restriction does not look right.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=31362