From patchwork Thu Nov 7 19:00:23 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paolo Carlini X-Patchwork-Id: 289458 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 161382C0099 for ; Fri, 8 Nov 2013 06:00:47 +1100 (EST) DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender :message-id:date:from:mime-version:to:cc:subject:content-type; q=dns; s=default; b=EuqS4C4WZ9tavNx0jwoM1udP+tUGbhjCgHBKJ8tZ5Rg sPP0dXZFcXatw1o/rLWKtQv96avrHGj65IlbWwF5/6E0jFp/Iy8PeCf9i0MjTChU 56PBsv6fgyNTWvuDyPtma47k5PIlCbKSDRdRvf/oC1n4YP0p8qMxt66yA/SbjgrQ = 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 :message-id:date:from:mime-version:to:cc:subject:content-type; s=default; bh=FVM2V8rINfzfJ85GQ604LHXlXDQ=; b=Mn1nBb3YERCkpbR/M Ke2NHUWTcjmvVnnuYtfhWKRWNhz4qn9n7YxHQWunSyo+wQ2Q+MnQtxqUsEfeZ38V j4boDCeyzmTJ04vWve44rqC3ltCNAyEnluKw21lZxBYfRQEUaE5B5rrsEUDp4WTU JZ5PsK4Ysw0Neiav8z72aqGGU0= Received: (qmail 15933 invoked by alias); 7 Nov 2013 19:00:36 -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 15919 invoked by uid 89); 7 Nov 2013 19:00:36 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=0.5 required=5.0 tests=AWL, BAYES_20, RDNS_NONE, SPAM_SUBJECT, SPF_PASS, UNPARSEABLE_RELAY, URIBL_BLOCKED autolearn=no version=3.3.2 X-HELO: aserp1040.oracle.com Received: from Unknown (HELO aserp1040.oracle.com) (141.146.126.69) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-SHA encrypted) ESMTPS; Thu, 07 Nov 2013 19:00:35 +0000 Received: from acsinet22.oracle.com (acsinet22.oracle.com [141.146.126.238]) by aserp1040.oracle.com (Sentrion-MTA-4.3.1/Sentrion-MTA-4.3.1) with ESMTP id rA7J0QmL013163 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Thu, 7 Nov 2013 19:00:27 GMT Received: from userz7021.oracle.com (userz7021.oracle.com [156.151.31.85]) by acsinet22.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id rA7J0PeT007438 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Thu, 7 Nov 2013 19:00:26 GMT Received: from abhmt113.oracle.com (abhmt113.oracle.com [141.146.116.65]) by userz7021.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id rA7J0Pal029254; Thu, 7 Nov 2013 19:00:25 GMT Received: from poldo4.casa (/79.45.212.108) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Thu, 07 Nov 2013 11:00:25 -0800 Message-ID: <527BE347.5090307@oracle.com> Date: Thu, 07 Nov 2013 20:00:23 +0100 From: Paolo Carlini User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.0 MIME-Version: 1.0 To: "gcc-patches@gcc.gnu.org" CC: Jason Merrill Subject: [C++ Patch / RFC] Fixing a diagnostic regression caused by the fix for c++/56930 X-IsSubscribed: yes Hi all, Jason, in mainline, this commit: http://gcc.gnu.org/viewcvs/gcc?view=revision&revision=199232 appear to have caused a diagnostic regression for the following (from c++/43906): extern void z(); void f() { if ( z ) z(); } that is, with -Waddress we warn twice, because in cp_convert_and_check we call cp_convert twice with the same arguments. How shall we deal with this? Something like the attached, or you have in mind something more neat, I don't know?!? Thanks! Paolo. /////////////////// Index: cvt.c =================================================================== --- cvt.c (revision 204536) +++ cvt.c (working copy) @@ -629,7 +629,8 @@ cp_convert_and_check (tree type, tree expr, tsubst { tree folded = maybe_constant_value (expr); tree stripped = folded; - tree folded_result = cp_convert (type, folded, complain); + tree folded_result + = folded != expr ? cp_convert (type, folded, complain) : result; /* maybe_constant_value wraps an INTEGER_CST with TREE_OVERFLOW in a NOP_EXPR so that it isn't TREE_CONSTANT anymore. */