From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 85087 invoked by alias); 30 Apr 2017 20:02:15 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Received: (qmail 85073 invoked by uid 89); 30 Apr 2017 20:02:14 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.9 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_NONE,SPF_PASS autolearn=ham version=3.3.2 spammy=streaming X-HELO: relay1.mentorg.com Received: from relay1.mentorg.com (HELO relay1.mentorg.com) (192.94.38.131) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Sun, 30 Apr 2017 20:02:13 +0000 Received: from nat-ies.mentorg.com ([192.94.31.2] helo=SVR-IES-MBX-04.mgc.mentorg.com) by relay1.mentorg.com with esmtp id 1d4v2q-0001Lf-AK from Tom_deVries@mentor.com ; Sun, 30 Apr 2017 13:02:12 -0700 Received: from [127.0.0.1] (137.202.0.87) by SVR-IES-MBX-04.mgc.mentorg.com (139.181.222.4) with Microsoft SMTP Server (TLS) id 15.0.1210.3; Sun, 30 Apr 2017 21:02:07 +0100 Subject: Re: [PATCH] adding missing LTO to some warning options (PR 78606) To: Martin Sebor , Gcc Patch List , Richard Biener References: <06c24069-90af-5778-52a2-c9167eb109ab@gmail.com> From: Tom de Vries Message-ID: <568de1cb-21ed-26ea-8a80-f177f189f293@mentor.com> Date: Sun, 30 Apr 2017 23:39:00 -0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.8.0 MIME-Version: 1.0 In-Reply-To: <06c24069-90af-5778-52a2-c9167eb109ab@gmail.com> Content-Type: text/plain; charset="utf-8"; format=flowed Content-Transfer-Encoding: 7bit X-ClientProxiedBy: svr-ies-mbx-01.mgc.mentorg.com (139.181.222.1) To SVR-IES-MBX-04.mgc.mentorg.com (139.181.222.4) X-SW-Source: 2017-04/txt/msg01585.txt.bz2 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