From patchwork Sun Nov 13 22:31:52 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Eric Botcazou X-Patchwork-Id: 81982 Delivered-To: patch@linaro.org Received: by 10.140.97.165 with SMTP id m34csp756037qge; Sun, 13 Nov 2016 14:32:26 -0800 (PST) X-Received: by 10.99.174.4 with SMTP id q4mr219327pgf.178.1479076346596; Sun, 13 Nov 2016 14:32:26 -0800 (PST) Return-Path: Received: from sourceware.org (server1.sourceware.org. [209.132.180.131]) by mx.google.com with ESMTPS id p26si19837356pfk.183.2016.11.13.14.32.26 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 13 Nov 2016 14:32:26 -0800 (PST) Received-SPF: pass (google.com: domain of gcc-patches-return-441270-patch=linaro.org@gcc.gnu.org designates 209.132.180.131 as permitted sender) client-ip=209.132.180.131; Authentication-Results: mx.google.com; dkim=pass header.i=@gcc.gnu.org; spf=pass (google.com: domain of gcc-patches-return-441270-patch=linaro.org@gcc.gnu.org designates 209.132.180.131 as permitted sender) smtp.mailfrom=gcc-patches-return-441270-patch=linaro.org@gcc.gnu.org DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:from :to:subject:date:message-id:mime-version:content-type :content-transfer-encoding; q=dns; s=default; b=a5KRnipjak2U59Go EAgYK7zwN7r7eiDaUbSMGGvcgy4Z+QHSf/M7GuSUArFM0tJwNOOBz0ABKkVLi5zP +mYONRyVa5WF/7Hv9mZ9wkCsXMCca9hFh2MTozH27g+YRcViO+XiyARcD+vP7Ol/ hlKOZ5Y3HUnKFwUYs5/MY1t6l5w= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:from :to:subject:date:message-id:mime-version:content-type :content-transfer-encoding; s=default; bh=pIh64ohScloqHNwOZfaZGb nIlMU=; b=xf/EEqd2kireQIIBbtF0tpjgtMy3mvNLJ1Nr+T9yzIkS14YW1wvTTq yfId15SLROHV4290JLLtXybMKXZjvY70fASFsbMYwgb6jUZUYPEG/MDitIC3VzWF OLmo13/DgOhvLlMXekvUXBZOk3v8xXQToU9Span63ZJzGJCH8lkB0= Received: (qmail 27681 invoked by alias); 13 Nov 2016 22:32:09 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Delivered-To: mailing list gcc-patches@gcc.gnu.org Received: (qmail 27652 invoked by uid 89); 13 Nov 2016 22:32:06 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.8 required=5.0 tests=AWL, BAYES_00, RCVD_IN_DNSWL_NONE, SPF_PASS autolearn=ham version=3.3.2 spammy=symtab_node X-HELO: smtp.eu.adacore.com Received: from mel.act-europe.fr (HELO smtp.eu.adacore.com) (194.98.77.210) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Sun, 13 Nov 2016 22:31:56 +0000 Received: from localhost (localhost [127.0.0.1]) by filtered-smtp.eu.adacore.com (Postfix) with ESMTP id 8DA5F812EB for ; Sun, 13 Nov 2016 23:31:54 +0100 (CET) Received: from smtp.eu.adacore.com ([127.0.0.1]) by localhost (smtp.eu.adacore.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id pkKubHc3IGXl for ; Sun, 13 Nov 2016 23:31:54 +0100 (CET) Received: from polaris.localnet (bon31-6-88-161-99-133.fbx.proxad.net [88.161.99.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.eu.adacore.com (Postfix) with ESMTPSA id 6384F812DD for ; Sun, 13 Nov 2016 23:31:54 +0100 (CET) From: Eric Botcazou To: gcc-patches@gcc.gnu.org Subject: [patch] Disable LTO note about strict aliasing Date: Sun, 13 Nov 2016 23:31:52 +0100 Message-ID: <2556813.xd8ElFlcmY@polaris> User-Agent: KMail/4.14.10 (Linux/3.16.7-48-desktop; KDE/4.14.9; x86_64; ; ) MIME-Version: 1.0 It's the note issued by the -Wlto-type-mismatch warning: q.ads:7:13: warning: type of 'q__proc' does not match original declaration [- Wlto-type-mismatch] procedure Proc (A : Arr); ^ q.adb:7:3: note: 'q__proc' was previously declared here procedure Proc (A : Arr) is begin null; end; ^ q.adb:7:3: note: code may be misoptimized unless -fno-strict-aliasing is used and it's a bit surprising that -fno-strict-aliasing cannot silence it. Tested on x86_64-suse-linux, OK for the mainline and 6 branch? 2016-11-13 Eric Botcazou lto/ * lto-symtab.c (lto_symtab_merge_decls_2): Only issue note on strict aliasing if -fstrict-aliasing is enabled. -- Eric Botcazou commit 934002ff6d710418af4b7f993f6216e9406d82c2 Author: Eric Botcazou Date: Sun Nov 13 11:36:32 2016 +0100 Fix for PB12-008 (disable LTO note on misoptimization with strict aliasing). diff --git a/gcc/lto/lto-symtab.c b/gcc/lto/lto-symtab.c index 94b919b..c8848a5 100644 --- a/gcc/lto/lto-symtab.c +++ b/gcc/lto/lto-symtab.c @@ -698,7 +698,7 @@ lto_symtab_merge_decls_2 (symtab_node *first, bool diagnosed_p) if (diagnosed_p) inform (DECL_SOURCE_LOCATION (prevailing->decl), "%qD was previously declared here", prevailing->decl); - if (tbaa_p) + if (tbaa_p && flag_strict_aliasing) inform (DECL_SOURCE_LOCATION (prevailing->decl), "code may be misoptimized unless " "-fno-strict-aliasing is used");