gdc/gcc fails to inline bar in this example: > struct S > { > int bar(const S s) > { > return 0; > } > } > > int foo() > { > S s; > return s.bar(s); > } compile with -c -O3 -finline-functions -frelease When forcing inlining, this is the error message: error: inlining failed in call to always_inline ?main.Julia!(float).ComplexStruct.squarePlusMag?: mismatched arguments Reported by jerro in the gdc newsgroup.
When you say force inlining, I take it you mean you are doing some trickery in the debugger. :-)
No, that error message was also reported by jerro and he added some pragma(always_inline) implementation to his copy of gdc. The error is reported either from ipa-inline.c or from ipa-inline-analysis.c, grep for "CIF_MISMATCHED_ARGUMENTS". Both check for call_stmt_cannot_inline_p which is probably set in ipa-inline.c: if (edge->callee->symbol.decl && !gimple_check_call_matching_types (edge->call_stmt, edge->callee->symbol.decl)) edge->call_stmt_cannot_inline_p = true; gimple_check_call_matching_types is declared in gimple-low.c
That's lovely. always_inline attribute has been removed from the set of available pragmas. Actually I might remove all gcc-related pragmas in the near future and replace with @attributes instead. But that's open for discussion on how best to proceed.
Fixed https://github.com/D-Programming-GDC/GDC/commit/d7cb86d493ee1e85a3b55f73de55bb7f91d279cb