This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] Fix %K for LTO
- From: Richard Biener <rguenther at suse dot de>
- To: Jakub Jelinek <jakub at redhat dot com>
- Cc: gcc-patches at gcc dot gnu dot org
- Date: Tue, 25 Mar 2014 16:00:58 +0100 (CET)
- Subject: Re: [PATCH] Fix %K for LTO
- Authentication-results: sourceware.org; auth=none
- References: <alpine dot LSU dot 2 dot 11 dot 1403251518180 dot 26135 at zhemvz dot fhfr dot qr> <20140325144025 dot GR1817 at tucnak dot redhat dot com>
On Tue, 25 Mar 2014, Jakub Jelinek wrote:
> On Tue, Mar 25, 2014 at 03:35:29PM +0100, Richard Biener wrote:
> > The following implements a special-case for LTO when doing %K
> > formatting. LTO currently only keeps FUNCTION_DECL abstract
> > origins (for BLOCKs satisfying inlined_function_outer_scope_p)
> > which means the existing %K formatting usually bails out immediately.
> > This severely complicates the search for warnings like
> >
> > /usr/include/bits/stdio2.h: In function âmainâ:
> > /usr/include/bits/stdio2.h:293:2: warning: call to â__fread_chk_warnâ
> > declared with attribute warning: fread called with bigger size * nmemb
> > than length of destination buffer
> > return __fread_chk_warn (__ptr, __bos0 (__ptr), __size, __n, __stream);
> > ^
> >
> > because you only have an outermost function context to work on
> > and the inline stack can include functions from any translation
> > unit with LTO. The following patch improves this to
> >
> > In function 'fread',
> > inlined from 'main' at t.c:7:10:
> > /usr/include/bits/stdio2.h:293:2: warning: call to '__fread_chk_warn'
> > declared with attribute warning: fread called with bigger size * nmemb
> > than length of destination buffer
> > return __fread_chk_warn (__ptr, __bos0 (__ptr), __size, __n, __stream);
> > ^
> >
> > which matches non-LTO behavior.
> >
> > Bootstrap/regtest pending on x86_64-unknown-linux-gnu, ok for trunk?
>
> If it works, ok. I'd of course prefer if it preserved the abstract origins
> properly, otherwise it can't emit proper debug info. But for now it is fine
> I guess.
Yeah, but we'd ICE here because the abstract BLOCKs cannot be
partitioned, etc. properly. The debug info "works" at least
for the purpose of handling inlines.
Richard.