public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Martin Sebor <msebor@gmail.com>
To: Tom de Vries <Tom_deVries@mentor.com>,
	Gcc Patch List <gcc-patches@gcc.gnu.org>,
	Richard Biener <rguenther@suse.de>
Subject: Re: [PATCH] adding missing LTO to some warning options (PR 78606)
Date: Mon, 01 May 2017 18:05:00 -0000	[thread overview]
Message-ID: <8b597659-d03e-840d-271e-65fa77415090@gmail.com> (raw)
In-Reply-To: <568de1cb-21ed-26ea-8a80-f177f189f293@mentor.com>

On 04/30/2017 02:02 PM, Tom de Vries wrote:
> 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 "" } */
> ...
> ?

That seems possible.  IIUC, without linker plugin support the
pass will run when the ordinary object file is created during
the first stage of compilation.  I don't have a system to confirm
it on but if pr78768.c xfails when you add the directive I'd say
go ahead and commit the fix as obvious.

Thanks
Martin

  reply	other threads:[~2017-05-01 18:05 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-01-10 22:16 Martin Sebor
2017-01-11  8:21 ` Richard Biener
2017-01-13 18:49 ` Andreas Schwab
2017-01-17 12:04 ` Kyrill Tkachov
2017-01-17 16:45   ` Martin Sebor
2017-04-30 23:39 ` Tom de Vries
2017-05-01 18:05   ` Martin Sebor [this message]
2017-05-02 10:22     ` Tom de Vries

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=8b597659-d03e-840d-271e-65fa77415090@gmail.com \
    --to=msebor@gmail.com \
    --cc=Tom_deVries@mentor.com \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=rguenther@suse.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).