This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug c/31362] gcc should not inline functions with 'section' attribute



------- 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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]