On Fri, Sep 18, 2015 at 8:47 PM, Manuel López-Ibáñez <lopeziba...@gmail.com> wrote: > And now with the patch. > > On 18 September 2015 at 20:40, Manuel López-Ibáñez > <lopeziba...@gmail.com> wrote: >> In https://sourceware.org/ml/libc-alpha/2014-12/msg00300.html, we give a >> "called from here" note without actually having a location, which looks >> strange. I haven't been able to generate such a testcase. In this patch, we >> assert this cannot happen when checking and simply skip the extra note in >> release mode. >> >> Boot&tested on x86_64-linux-gnu >> >> OK?
Hmm. input_location is set from the call stmt: /* FIXME: instantiate_decl isn't called by inlinable_function_p. */ saved_location = input_location; input_location = gimple_location (stmt); it would be nice to get rid of that. If the call is artificially generated it might have no location so I think the assert is bogus. Also in the case of UNKNOWN_LOCATION it would be nice to at least note the function we are failing to inline to (thus, use DECL_SOURCE_LOCATION of cfun->decl). So better add a diag_location and compute that upfront to avoid repeating the check. Did you investigate the glibc case on whether caller or callee are artificial? Richard. >> >> gcc/testsuite/ChangeLog: >> >> 2015-09-18 Manuel López-Ibáñez <m...@gcc.gnu.org> >> >> * gcc.target/i386/inline_error.c (int bar): Use dg-message for note. >> * gcc.target/i386/pr57756.c (static __inline int caller): Likewise. >> * gcc.target/i386/pr59789.c (f1): Likewise. >> * gcc.target/i386/intrinsics_5.c (__m128i foo): Likewise. >> * gcc.target/i386/intrinsics_6.c: Likewise. >> * gcc.dg/winline-5.c (int t): Likewise. >> * gcc.dg/winline-9.c (t): Likewise. >> * gcc.dg/always_inline2.c (q): Likewise. >> * gcc.dg/winline-2.c (inline int t): Likewise. >> * gcc.dg/winline-6.c: Likewise. >> * gcc.dg/winline-10.c (void g): Likewise. >> * gcc.dg/pr49243.c (void parse): Likewise. >> * gcc.dg/always_inline3.c (q2): Likewise. >> * gcc.dg/winline-3.c: Likewise. >> * gcc.dg/winline-7.c (inline void *t): Likewise. >> >> gcc/ChangeLog: >> >> 2015-09-18 Manuel López-Ibáñez <m...@gcc.gnu.org> >> >> * tree-inline.c (expand_call_inline): Use inform for extra note. >> Do not give "called from here" with UNKNOWN_LOCATION.