This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug tree-optimization/33763] [4.1/4.2/4.3 Regression] Bogus inlining failed in call to `xxx': redefined extern inline functions are not considered for inlining
- From: "hubicka at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 14 Oct 2007 12:50:01 -0000
- Subject: [Bug tree-optimization/33763] [4.1/4.2/4.3 Regression] Bogus inlining failed in call to `xxx': redefined extern inline functions are not considered for inlining
- References: <bug-33763-87@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Comment #3 from hubicka at gcc dot gnu dot org 2007-10-14 12:50 -------
This patch should disable the sorry message in this case, but I would argue
that outputting sorry here is right - we fail to inline alway_inline function
because of implementation limitation. So I would claim 3.2.0 being buggy rather
than mainline.
Honza
Index: tree-inline.c
===================================================================
*** tree-inline.c (revision 129072)
--- tree-inline.c (working copy)
*************** expand_call_inline (basic_block bb, tree
*** 2560,2565 ****
--- 2560,2571 ----
if (!cgraph_inline_p (cg_edge, &reason))
{
if (lookup_attribute ("always_inline", DECL_ATTRIBUTES (fn))
+ /* For extern inline functions that get redefined we always
+ silently ignored alway_inline flag. Better behaviour would
+ be to be able to keep both bodies and use extern inline body
+ for inlining, but we can't do that because frontends overwrite
+ the body. */
+ && !cg_edge->callee->local.redefined_extern_inline
/* Avoid warnings during early inline pass. */
&& (!flag_unit_at_a_time || cgraph_global_info_ready))
{
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=33763