From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pl1-x636.google.com (mail-pl1-x636.google.com [IPv6:2607:f8b0:4864:20::636]) by sourceware.org (Postfix) with ESMTPS id 96F013858D39 for ; Sun, 30 Apr 2023 23:14:53 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 96F013858D39 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-pl1-x636.google.com with SMTP id d9443c01a7336-1aad6f2be8eso13939735ad.3 for ; Sun, 30 Apr 2023 16:14:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1682896492; x=1685488492; h=content-transfer-encoding:in-reply-to:references:cc:to:from :content-language:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=iQ7qYSiPp3S16lXvKWwtOlaAeIiJ3NYcOx4BYx52A3w=; b=GsTlXnuJajhKJNuuxKpXK4yeq1xNQQFQsS2B8SmbA8aJh7suaBMtYYHe7baiL2qfCg Xio6Xt80Ch1B+bnEwR7h3gTrlNbvdRNFAt5TrsW76NkHP7sq5Pn0MU+SIMmct3qXxW1l cissofW4d3o8AnHxdXH+MJRe1F1fP8OBE4l1uJlcnxA/SGQDQNZ/ZeXl7fyoQcY/niLN GvfMTDo/bWNUD3CYN2kvzvmNjZAhAulHsIEhAWL5l2xr8hu+j+uMJWHfMj7ar5xolXsL 88GT1MmCkaPojfXT8g21bnRWZVd1mKBF02nvrS4hPV1K60c3Q/o3bYTpVudkO4SfkUY1 tAAg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1682896492; x=1685488492; h=content-transfer-encoding:in-reply-to:references:cc:to:from :content-language:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=iQ7qYSiPp3S16lXvKWwtOlaAeIiJ3NYcOx4BYx52A3w=; b=iCYlwEICQ41Xgmwc89PlLpTgFNhswtIeuykmTcakLymyCoBn/X4Kr7qC1So0zidZmE hOeLsq/ewINjiABGSAPyVnAmuBwl+dOMFYBn4qL7ycT03k2oeuNunxs2NM4k65gEUrJc x4Eq6yGfJ31KEuKkrVMzt7l9T+cEmaV4kr5yAtlXX6GDVjgjDqnKECNvsp7BMp+L5rwD 7oOp4MKuzb+xaTOqlEANM0uf/0X45Zl9uIpuGQXv+SWW/+a1aPSSTGLk2m1tAHgG220m ECwui+NQDrQLa5AUeWK9iWWANL9Vdk0Bqe8Kv6o/DaHebr7kXeu6Qa70QHOsEb2CQ7M7 TsfQ== X-Gm-Message-State: AC+VfDyQRtBsRgGf73RnJJX7RtNlkivM2GtZiAdsdyJcceb+YWAeKMhO T2EN5Lm1hdj34fMWmRpOIS0= X-Google-Smtp-Source: ACHHUZ4UytTAqRsxhBbclCI5D7TOWNbhyhIwXyXobdKXgp+ahjkm10MHll+iIk5RIdoAHKnVCeyizQ== X-Received: by 2002:a17:902:e5c5:b0:1a9:8ba4:d0e3 with SMTP id u5-20020a170902e5c500b001a98ba4d0e3mr15398464plf.59.1682896492213; Sun, 30 Apr 2023 16:14:52 -0700 (PDT) Received: from ?IPV6:2601:681:8600:13d0::99f? ([2601:681:8600:13d0::99f]) by smtp.gmail.com with ESMTPSA id ix3-20020a170902f80300b0019a96a6543esm16684227plb.184.2023.04.30.16.14.51 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sun, 30 Apr 2023 16:14:51 -0700 (PDT) Message-ID: <60cbe8fc-31b2-c8d7-4ea7-3a629cc5b6e0@gmail.com> Date: Sun, 30 Apr 2023 17:14:50 -0600 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.9.1 Subject: Re: [PATCH] libcpp: suppress builtin macro redefined warnings for __LINE__ Content-Language: en-US From: Jeff Law To: Longjun Luo , Joseph Myers Cc: gcc-patches@gcc.gnu.org, sangyan@huawei.com References: <20221201043155.9369-1-luolongjuna@gmail.com> <8767c6bc-5b37-ca10-1176-e341081c555f@gmail.com> <587de9c9-e46f-b69e-84d8-7356a19db74@codesourcery.com> <6ac6c8e6-d18a-8aae-2ae3-ecdfed291755@codesourcery.com> <86625ca4-6ef5-4010-e452-aa2e1149215f@gmail.com> In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-1.8 required=5.0 tests=BAYES_00,BODY_8BITS,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM,KAM_SHORT,NICE_REPLY_A,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 List-Id: On 4/30/23 12:30, Jeff Law wrote: > > > On 1/12/23 09:02, Longjun Luo via Gcc-patches wrote: >>  From 0821df518b264e754d698d399f98be1a62945e32 Mon Sep 17 00:00:00 2001 >> From: Longjun Luo >> Date: Thu, 12 Jan 2023 23:59:54 +0800 >> Subject: [PATCH] libcpp: suppress builtin macro redefined warnings for >>   __LINE__ >> >> As implied in >> gcc.gnu.org/legacy-ml/gcc-patches/2008-09/msg00076.html, >> gcc provides -Wno-builtin-macro-redefined to suppress warning when >> redefining builtin macro. However, at that time, there was no >> scenario for __LINE__ macro. >> >> But, when we try to build a live-patch, we compare sections by using >> -ffunction-sections. Some same functions are considered changed because >> of __LINE__ macro. >> >> At present, to detect such a changed caused by __LINE__ macro, we >> have to analyse code and maintain a function list. For example, >> in kpatch, check this commit >> github.com/dynup/kpatch/commit/0e1b95edeafa36edb7bcf11da6d1c00f76d7e03d. >> >> So, in this scenario, when we try to compared sections, it would >> be better to support suppress builtin macro redefined warnings for >> __LINE__ macro. >> >> Signed-off-by: Longjun Luo >> --- >>   gcc/testsuite/gcc.dg/builtin-redefine-1.c | 49 +++++++++++++++++++++++ >>   gcc/testsuite/gcc.dg/builtin-redefine.c   | 24 +++++++++-- >>   libcpp/init.cc                            |  2 +- >>   3 files changed, 70 insertions(+), 5 deletions(-) >>   create mode 100755 gcc/testsuite/gcc.dg/builtin-redefine-1.c > Thanks.  I added a suitable ChangeLog and pushed this to the trunk. This is causing regressions on various targets for a few tests: lm32-sim: c-c++-common/cpp/pr92296-2.c -Wc++-compat (test for warnings, line 41) lm32-sim: gcc.dg/cpp/undef2.c (test for warnings, line 9) lm32-sim: gcc.dg/cpp/undef2.c (test for excess errors) I have reverted this patch from the trunk. Please address the regressions and resubmit. Thanks, Jeff