Message ID | 20240226-gdb-compile-align-v1-1-0f95d6435299@tromey.com |
---|---|
State | Unresolved |
Headers |
Return-Path: <gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:a81b:b0:108:e6aa:91d0 with SMTP id bq27csp2464668dyb; Mon, 26 Feb 2024 19:13:54 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCWYMCqf1up8bz0oy9EGwxhyVUMh7eOqnH1hHtCYcha/u84Yw10jMc5o6ZGHprZBxC/wQQOmd0hGIcsvL77Y4TDk0hEN6w== X-Google-Smtp-Source: AGHT+IHUogSkEPEd9lHS9Gwjfs2C+cA1ImNmdSXi+Ua6ypy7vXN306yTIy39K5jg3gI2p5Ys6Mj6 X-Received: by 2002:a05:620a:4f2:b0:785:bd25:e5f7 with SMTP id b18-20020a05620a04f200b00785bd25e5f7mr1040956qkh.40.1709003633904; Mon, 26 Feb 2024 19:13:53 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1709003633; cv=pass; d=google.com; s=arc-20160816; b=pasRjBniFrPBNV0THc75TMO+67Em5WX1MHrpCqzz6fCL4yxwk2FrSQXMvUiNWz99qO pGKQvLBHZD994oWZDcJge03nzPiZl3VDm4b43V0GZD2T5OmYfLkwjtgYsUwaKIPOBb71 P0U3GrBCQRCn8gBUGrr8Jhbx+xBOfj9xr5YcUNz3DXTXwcDEK0TlDgCHqLNTYQrwPQLF JVYZYbNMC+GJPbpb+nbmSxa8Jahn4JhktaGopcrsLGcpIxQaXtM/NrmdbHK+XrMz9EGh 7laFGcpgXVLcYkwDZLbDNBgxBayNrTOJoc6nhboPR+kSD7K/TFuhQ8GgswvvIySKsZAl swiQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:to:in-reply-to:references :message-id:content-transfer-encoding:mime-version:subject:date:from :dkim-signature:arc-filter:dmarc-filter:delivered-to; bh=HJP6g1mfg2FLkKj6IQSXqOzbN5iLPCRrxXDWcqBQvVg=; fh=hPrbWPhweUx4V0GV9uXJqbyAzg2ABmTz7kczrAQqMmM=; b=hugjfp8fu1SWJtizHTd8xAAizNBYglBzY40u5fdHte34oMyKiCVL8tEGrdRISZpqNp fBxeLmnrjwXqJ4P05D8tHsnHjbbwjEtNHL+8Ox70u6R0yCSzbgAnJnQDgGUlhluHxTDG 9dp6QqmKDFhI+YijxK/RRVUoi+EJTtYDGBxYU3bZeFOq1sK1pguXku+ZdAioRIwv3Qiy VjCfUYKCRtI5ZaM1nSa/wD0XzIklXPD/4CfMb9MTmylHTYjhcBAflAcZTQgNfuoRX6xD U0Vm4J8zRTZ0e/EtgeV4RGiYq/fNvWOfDRgXG8qbpRRGhAf/O8/x6Kzek9lwXUa8IrMh ABsQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=fail header.i=@tromey.com header.s=default header.b=r7OySzon; arc=pass (i=1); spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 8.43.85.97 as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org" Received: from server2.sourceware.org (server2.sourceware.org. [8.43.85.97]) by mx.google.com with ESMTPS id vu28-20020a05620a561c00b00787b866301bsi6792483qkn.378.2024.02.26.19.13.53 for <ouuuleilei@gmail.com> (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 26 Feb 2024 19:13:53 -0800 (PST) Received-SPF: pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 8.43.85.97 as permitted sender) client-ip=8.43.85.97; Authentication-Results: mx.google.com; dkim=fail header.i=@tromey.com header.s=default header.b=r7OySzon; arc=pass (i=1); spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 8.43.85.97 as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org" Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 9731C385840A for <ouuuleilei@gmail.com>; Tue, 27 Feb 2024 03:13:53 +0000 (GMT) X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from omta036.useast.a.cloudfilter.net (omta036.useast.a.cloudfilter.net [44.202.169.35]) by sourceware.org (Postfix) with ESMTPS id BAF1A3858C50 for <gcc-patches@gcc.gnu.org>; Tue, 27 Feb 2024 03:13:02 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org BAF1A3858C50 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=tromey.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=tromey.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org BAF1A3858C50 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=44.202.169.35 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1709003585; cv=none; b=HProJJdQGvhSJ2pHTXrA9UMEAOqSFEk74XV/pYhHrRhT8h2KsPz4Zrh0/L9UcdM6kVTyVEbjyAx5CbwmfvN2I9xxudNJMbCdn5jHWnioAyEGoMdoF86vaCyegJFmSaKLfVPJiEl6lnE7hWNifTUSoBvmp9IeTUDngqR10GcPRng= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1709003585; c=relaxed/simple; bh=22kj/qdLwf+zUiZCEKeD1LqhoCtiPVJCD/p1w2g3IvY=; h=DKIM-Signature:From:Date:Subject:MIME-Version:Message-Id:To; b=cxt30HrzHlPcyidJqo/8JFXyEZyYaFYTEB5uaEZgBb2BkGlgVrmDlT9BoKPC1ePzhw4iERyRs3vMeYNVBwBH4hPG4jgsnjf1xpwfrmjwjVi6KOvBF8aLnXoTwk0qVTG4Y7et0QpGZWIAGottm26GXHe9EyM4gwg3M1qt6uA3Azs= ARC-Authentication-Results: i=1; server2.sourceware.org Received: from eig-obgw-5009a.ext.cloudfilter.net ([10.0.29.176]) by cmsmtp with ESMTPS id en7krYldquh6sentur6yGU; Tue, 27 Feb 2024 03:13:02 +0000 Received: from box5379.bluehost.com ([162.241.216.53]) by cmsmtp with ESMTPS id enttr8E7Kk4fsenttrq2p7; Tue, 27 Feb 2024 03:13:02 +0000 X-Authority-Analysis: v=2.4 cv=eZw7faEH c=1 sm=1 tr=0 ts=65dd533e a=ApxJNpeYhEAb1aAlGBBbmA==:117 a=ApxJNpeYhEAb1aAlGBBbmA==:17 a=IkcTkHD0fZMA:10 a=k7vzHIieQBIA:10 a=Qbun_eYptAEA:10 a=zstS-IiYAAAA:8 a=20KFwNOVAAAA:8 a=aafxSZypWaQ67KQJpqUA:9 a=QEXdDO2ut3YA:10 a=4G6NA9xxw8l3yy4pmD5M:22 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=tromey.com; s=default; h=To:In-Reply-To:References:Message-Id:Content-Transfer-Encoding: Content-Type:MIME-Version:Subject:Date:From:Sender:Reply-To:Cc:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=HJP6g1mfg2FLkKj6IQSXqOzbN5iLPCRrxXDWcqBQvVg=; b=r7OySzonsCIaR7ZzMFdwAdnN8V mXodrS6Rf75/CRLuPU3nMncoCwR6yQUb9dJhli79bXhycA9dagsanZcpjk/QkX7rhtIVkGAH8OX5r DYw5M/CcUUvBKKc0zM3GkSXAF; Received: from 71-211-170-195.hlrn.qwest.net ([71.211.170.195]:51654 helo=[192.168.0.21]) by box5379.bluehost.com with esmtpsa (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96.2) (envelope-from <tom@tromey.com>) id 1rentt-004JgU-12 for gcc-patches@gcc.gnu.org; Mon, 26 Feb 2024 20:13:01 -0700 From: Tom Tromey <tom@tromey.com> Date: Mon, 26 Feb 2024 20:12:54 -0700 Subject: [PATCH 1/3] Change 'v1' float and int code to fall back to v0 MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Message-Id: <20240226-gdb-compile-align-v1-1-0f95d6435299@tromey.com> References: <20240226-gdb-compile-align-v1-0-0f95d6435299@tromey.com> In-Reply-To: <20240226-gdb-compile-align-v1-0-0f95d6435299@tromey.com> To: gcc-patches@gcc.gnu.org X-Mailer: b4 0.12.4 X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - box5379.bluehost.com X-AntiAbuse: Original Domain - gcc.gnu.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - tromey.com X-BWhitelist: no X-Source-IP: 71.211.170.195 X-Source-L: No X-Exim-ID: 1rentt-004JgU-12 X-Source: X-Source-Args: X-Source-Dir: X-Source-Sender: 71-211-170-195.hlrn.qwest.net ([192.168.0.21]) [71.211.170.195]:51654 X-Source-Auth: tom+tromey.com X-Email-Count: 2 X-Org: HG=bhshared;ORG=bluehost; X-Source-Cap: ZWx5bnJvYmk7ZWx5bnJvYmk7Ym94NTM3OS5ibHVlaG9zdC5jb20= X-Local-Domain: yes X-CMAE-Envelope: MS4xfHEhSEEPMJQIKAbhNu2AlY3S2szMue1AhozhcV9NOSydgphTENY4yDYI3McC7sCzRzPOaNZsm1vJ8jxyVu6OaZ3wOBrw3OAVqt7WMWvGIP+wq9TB3Ig/ kBZPBCY5RIPOSsGHdcP6jHiaAZtqGGoU3Vcrq8Ku2CfR8dPjjlMx3/kFaEnGhSaxTPvtQKx/pNoXl6o0cPwBnNlYgbJ0nzyRFes= X-Spam-Status: No, score=-3022.0 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, GIT_PATCH_0, JMQ_SPF_NEUTRAL, KAM_NUMSUBJECT, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2, 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.30 Precedence: list List-Id: Gcc-patches mailing list <gcc-patches.gcc.gnu.org> List-Unsubscribe: <https://gcc.gnu.org/mailman/options/gcc-patches>, <mailto:gcc-patches-request@gcc.gnu.org?subject=unsubscribe> List-Archive: <https://gcc.gnu.org/pipermail/gcc-patches/> List-Post: <mailto:gcc-patches@gcc.gnu.org> List-Help: <mailto:gcc-patches-request@gcc.gnu.org?subject=help> List-Subscribe: <https://gcc.gnu.org/mailman/listinfo/gcc-patches>, <mailto:gcc-patches-request@gcc.gnu.org?subject=subscribe> Errors-To: gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1792020194196190973 X-GMAIL-MSGID: 1792020194196190973 |
Series |
Fix libcc1 failure
|
|
Checks
Context | Check | Description |
---|---|---|
snail/gcc-patch-check | warning | Git am fail log |
Commit Message
Tom Tromey
Feb. 27, 2024, 3:12 a.m. UTC
While working on another patch, I discovered that the libcc1 plugin code never did version negotiation correctly. So, the patches to introduce v1 never did anything -- the new code, as far as I know, has never been run. Making version negotiation work shows that the existing code causes crashes. For example, safe_lookup_builtin_type might return error_mark_node in some cases, which the callers aren't prepared to accept. Looking into it some more, I couldn't find any justification for this v1 code for the C compiler plugin. Since it's not run at all, it's also clear that removing it doesn't cause any regressions in gdb. However, rather than remove it, this patch changes it to handle ERROR_MARK better, and then to fall back to the v0 code if the new code fails to find the type it's looking for. 2024-02-26 Tom Tromey <tom@tromey.com> * libcc1plugin.cc (safe_lookup_builtin_type): Handle ERROR_MARK. (plugin_int_type): Fall back to plugin_int_type_v0. (plugin_float_type): Fall back to plugin_float_type_v0. --- libcc1/ChangeLog | 6 ++++++ libcc1/libcc1plugin.cc | 19 ++++++++++--------- 2 files changed, 16 insertions(+), 9 deletions(-)
Comments
On 2/26/24 20:12, Tom Tromey wrote: > While working on another patch, I discovered that the libcc1 plugin > code never did version negotiation correctly. So, the patches to > introduce v1 never did anything -- the new code, as far as I know, has > never been run. > > Making version negotiation work shows that the existing code causes > crashes. For example, safe_lookup_builtin_type might return > error_mark_node in some cases, which the callers aren't prepared to > accept. > > Looking into it some more, I couldn't find any justification for this > v1 code for the C compiler plugin. Since it's not run at all, it's > also clear that removing it doesn't cause any regressions in gdb. > > However, rather than remove it, this patch changes it to handle > ERROR_MARK better, and then to fall back to the v0 code if the new > code fails to find the type it's looking for. > > 2024-02-26 Tom Tromey <tom@tromey.com> > > * libcc1plugin.cc (safe_lookup_builtin_type): Handle ERROR_MARK. > (plugin_int_type): Fall back to plugin_int_type_v0. > (plugin_float_type): Fall back to plugin_float_type_v0. Given this is all libcc1 related and thus primarily of interest to gdb, if you're happy with it, then it's OK for the trunk. jeff
>>>>> "Jeff" == Jeff Law <jeffreyalaw@gmail.com> writes:
Jeff> Given this is all libcc1 related and thus primarily of interest to
Jeff> gdb, if you're happy with it, then it's OK for the trunk.
Thank you.
I could not push this because:
remote: *** ChangeLog format failed:
remote: *** ERR: invalid PR component in subject: "Fix PR libcc1/113977"
I guess this script isn't in sync with the components in bugzilla.
I don't know how to fix this.
Tom
On 2/28/24 15:57, Tom Tromey wrote: >>>>>> "Jeff" == Jeff Law <jeffreyalaw@gmail.com> writes: > I could not push this because: > > remote: *** ChangeLog format failed: > remote: *** ERR: invalid PR component in subject: "Fix PR libcc1/113977" > > I guess this script isn't in sync with the components in bugzilla. > > I don't know how to fix this. Me neither, but I can suggest a hacky workaround. Change the component in bugzilla to something the pre-commit hooks understand, push the fix, then change the component back a little while later and adjust the ChangeLog after it gets generated overnight. Ugly as sin. jeff
On Wed, Feb 28, 2024 at 3:26 PM Jeff Law <jeffreyalaw@gmail.com> wrote: > > > > On 2/28/24 15:57, Tom Tromey wrote: > >>>>>> "Jeff" == Jeff Law <jeffreyalaw@gmail.com> writes: > > > I could not push this because: > > > > remote: *** ChangeLog format failed: > > remote: *** ERR: invalid PR component in subject: "Fix PR libcc1/113977" > > > > I guess this script isn't in sync with the components in bugzilla. > > > > I don't know how to fix this. > Me neither, but I can suggest a hacky workaround. Change the component > in bugzilla to something the pre-commit hooks understand, push the fix, > then change the component back a little while later and adjust the > ChangeLog after it gets generated overnight. Ugly as sin. I don't know how to update the script server side after it is committed in git. the checker script is located in git though: ``` [apinski@xeond2 contrib]$ git diff gcc-changelog/git_commit.py diff --git a/contrib/gcc-changelog/git_commit.py b/contrib/gcc-changelog/git_commit.py index 87bec4e00f5..4a3720de7fb 100755 --- a/contrib/gcc-changelog/git_commit.py +++ b/contrib/gcc-changelog/git_commit.py @@ -109,6 +109,7 @@ bug_components = { 'libffi', 'libfortran', 'libgcc', + 'libcc1', 'libgcj', 'libgomp', 'libitm', ``` Thanks, Andrew Pinski > > jeff
>>>>> "Andrew" == Andrew Pinski <pinskia@gmail.com> writes:
Andrew> I don't know how to update the script server side after it is
Andrew> committed in git. the checker script is located in git though:
Thanks, I didn't realize it was there.
Could you check in your patch?
IMO it seems obvious.
Tom
On Wed, Feb 28, 2024 at 5:35 PM Tom Tromey <tom@tromey.com> wrote: > > >>>>> "Andrew" == Andrew Pinski <pinskia@gmail.com> writes: > > Andrew> I don't know how to update the script server side after it is > Andrew> committed in git. the checker script is located in git though: > > Thanks, I didn't realize it was there. > > Could you check in your patch? > IMO it seems obvious. Pushed as r14-9230-g5ff49272bf4eb6 (https://gcc.gnu.org/pipermail/gcc-patches/2024-February/646819.html). I noticed there should be other cleanup of the bug components there too but I will leave that for another time. Thanks, Andrew Pinski > > Tom
>>>>> "Jeff" == Jeff Law <jeffreyalaw@gmail.com> writes: >> I don't know how to fix this. Jeff> Me neither, but I can suggest a hacky workaround. FTR, I asked Jakub on irc and he fixed it, so thankfully I didn't have to resort to the hack :-) thanks, Tom
diff --git a/libcc1/ChangeLog b/libcc1/ChangeLog index f81fe389e71..b0b31ee6586 100644 --- a/libcc1/ChangeLog +++ b/libcc1/ChangeLog @@ -1,3 +1,9 @@ +2024-02-26 Tom Tromey <tom@tromey.com> + + * libcc1plugin.cc (safe_lookup_builtin_type): Handle ERROR_MARK. + (plugin_int_type): Fall back to plugin_int_type_v0. + (plugin_float_type): Fall back to plugin_float_type_v0. + 2024-02-09 Marek Polacek <polacek@redhat.com> PR c++/98388 diff --git a/libcc1/libcc1plugin.cc b/libcc1/libcc1plugin.cc index 00d3963029d..f1082d8e9d3 100644 --- a/libcc1/libcc1plugin.cc +++ b/libcc1/libcc1plugin.cc @@ -555,7 +555,7 @@ safe_lookup_builtin_type (const char *builtin_name) gcc_assert (TREE_CODE (result) == TYPE_DECL); result = TREE_TYPE (result); - return result; + return TREE_CODE (result) == ERROR_MARK ? nullptr : result; } static gcc_type @@ -592,13 +592,14 @@ plugin_int_type (cc1_plugin::connection *self, int is_unsigned, unsigned long size_in_bytes, const char *builtin_name) { - if (!builtin_name) - return plugin_int_type_v0 (self, is_unsigned, size_in_bytes); - - tree result = safe_lookup_builtin_type (builtin_name); - gcc_assert (!result || TREE_CODE (result) == INTEGER_TYPE); - - return plugin_int_check (self, is_unsigned, size_in_bytes, result); + if (builtin_name != nullptr) + { + tree result = safe_lookup_builtin_type (builtin_name); + gcc_assert (!result || TREE_CODE (result) == INTEGER_TYPE); + if (result != nullptr) + return plugin_int_check (self, is_unsigned, size_in_bytes, result); + } + return plugin_int_type_v0 (self, is_unsigned, size_in_bytes); } gcc_type @@ -631,7 +632,7 @@ plugin_float_type (cc1_plugin::connection *self, tree result = safe_lookup_builtin_type (builtin_name); if (!result) - return convert_out (error_mark_node); + return plugin_float_type_v0 (self, size_in_bytes); gcc_assert (SCALAR_FLOAT_TYPE_P (result)); gcc_assert (BITS_PER_UNIT * size_in_bytes == TYPE_PRECISION (result));