From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-qk1-x730.google.com (mail-qk1-x730.google.com [IPv6:2607:f8b0:4864:20::730]) by sourceware.org (Postfix) with ESMTPS id 6E5EC385043E for ; Mon, 13 Jun 2022 11:15:50 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 6E5EC385043E Received: by mail-qk1-x730.google.com with SMTP id 15so3741560qki.6 for ; Mon, 13 Jun 2022 04:15:50 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=MHn0l7w60hLqGmM3hZuo1ZXTCxc80ACdOGx7kbJmkvM=; b=iSveOok/5amgY+PwQF9NaFXkp4I1d1/svndzWfT7AtZoNybvJq7x7uNIKT365mtL02 Jq2KdTYX6j70xXuZXN/z4L0qy+aMuimlwweuVbJHupv8XhCDpaQwOhnwQ0i1VNTay+gf d4qn72FWw96OgCXMaCsBbzFdm1H//Xm/a6qCbYAnE3N0V5hyJwvZhtZd5CKXbUxY9WH+ S9MfiFOZj/u+hPhmsSBdtHExmOEddA+8Sv+y/VuJJqa7Q+xY8YdiJKIxjAuvQSBKmQAN dtBSFAh+JSHHSJcMsbmyqESMss0RkN/8Z7zcMl0558KI3ytx3u/3eYCQMXPcupZ9gG8C NvBA== X-Gm-Message-State: AOAM531HUvF2zh6MrfW927xDFM5+ivvaSNsD/0BQ34UriwvLEJd/9oT6 ikl8iiscX0Vbgr31jZMjA5ngR9IGyXfGXy1qU98= X-Google-Smtp-Source: ABdhPJzdfSGAIAgjT1kIHJ5S5+ot8a46FBdPisAP8PVjndw77agJe+bbR7WFqNPu+fj2Ks+nyUzqvEEb1g53PiPOMAc= X-Received: by 2002:a05:620a:16d4:b0:6a6:b1cd:4f71 with SMTP id a20-20020a05620a16d400b006a6b1cd4f71mr28762479qkn.581.1655118949723; Mon, 13 Jun 2022 04:15:49 -0700 (PDT) MIME-Version: 1.0 References: <7390933.EvYhyI6sBW@fomalhaut> In-Reply-To: <7390933.EvYhyI6sBW@fomalhaut> From: Richard Biener Date: Mon, 13 Jun 2022 13:15:38 +0200 Message-ID: Subject: Re: [PATCH] Do not erase warning data in gimple_set_location To: Eric Botcazou , Martin Sebor Cc: GCC Patches Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-2.2 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FREEMAIL_FROM, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 13 Jun 2022 11:15:52 -0000 On Fri, Jun 10, 2022 at 12:58 PM Eric Botcazou via Gcc-patches wrote: > > Hi, > > gimple_set_location is mostly invoked on newly built GIMPLE statements, so > their location is UNKNOWN_LOCATION and setting it will clobber the warning > data of the passed location, if any. Hmm, I think instead of special-casing UNKNOWN_LOCATION what gimple_set_location should probably do is either not copy warnings at all or union them. Btw, gimple_set_location also removes a previously set BLOCK (but gimple_set_block preserves the location locus and diagnostic override). So I'd be tempted to axe the copy_warning () completely here. Martin, there were probably cases that warranted it - do you remember anything specific here? Thanks, Richard. > Tested on x86-64/Linux, OK for mainline and 12 branch? > > > 2022-06-10 Eric Botcazou > > * gimple.h (gimple_set_location): Do not copy warning data from > the previous location when it is UNKNOWN_LOCATION. > > > 2022-06-10 Eric Botcazou > > testsuite/ > * c-c++-common/nonnull-1.c: Remove XFAIL for C++. > > -- > Eric Botcazou