This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] adding missing LTO to some warning options (PR 78606)
- From: Tom de Vries <Tom_deVries at mentor dot com>
- To: Martin Sebor <msebor at gmail dot com>, Gcc Patch List <gcc-patches at gcc dot gnu dot org>, Richard Biener <rguenther at suse dot de>
- Date: Sun, 30 Apr 2017 22:02:03 +0200
- Subject: Re: [PATCH] adding missing LTO to some warning options (PR 78606)
- Authentication-results: sourceware.org; auth=none
- References: <06c24069-90af-5778-52a2-c9167eb109ab@gmail.com>
On 01/10/2017 11:16 PM, Martin Sebor wrote:
+ __builtin_sprintf (d, "%32s", "x"); /* { dg-warning "directive writing 32 bytes into a region of size 12" "-Wformat-length" { xfail *-*-* } } */
This xpasses for me on an older system:
...
XPASS: gcc.dg/pr78768.c -Wformat-overflow (test for warnings, line 11)
...
The mechanism is as follows:
- the system doesn't have linker plugin support, and sets
HAVE_LTO_PLUGIN to 0
- consequently, opts.c:finish_options() sets x_flag_fat_lto_objects to 1
in cc1
- cgraphunit.c:symbol_table::compile() does not return
here:
...
/* Do nothing else if any IPA pass found errors or if we are just
streaming LTO. */
if (seen_error ()
|| (!in_lto_p && flag_lto && !flag_fat_lto_objects))
{
timevar_pop (TV_CGRAPHOPT);
return;
}
...
and ends up calling expand_all_functions, which calls
pass_sprintf_length
- the warning is generated by cc1
Maybe the test needs:
...
/* { dg-require-linker-plugin "" } */
...
?
Thanks,
- Tom