Message ID | 20230627061148.24656-1-xuli1@eswincomputing.com |
---|---|
State | Accepted |
Headers |
Return-Path: <gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:994d:0:b0:3d9:f83d:47d9 with SMTP id k13csp7979371vqr; Mon, 26 Jun 2023 23:13:17 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ6smG6jKitGd5wZ/RUO8PsI6AwbpckYqUsgb4fqfa6jL8jHUykLsPP6P7G+87Welq+92Zbt X-Received: by 2002:a17:907:928b:b0:973:71c3:8b21 with SMTP id bw11-20020a170907928b00b0097371c38b21mr28186363ejc.72.1687846396754; Mon, 26 Jun 2023 23:13:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1687846396; cv=none; d=google.com; s=arc-20160816; b=uF8R3Vo9YupluTzS54RRHDk8biPaEsrETQ1Q6zNAL74moZupzXPvPJXPcUwEe7T+1g iTHV9EnXCUTMldyXEXF+KRKznb2qSho208h5tLQAxU2Gi8QN0sPQHwFWqTLLa4O5UJmv wqRKjbpwqKVRHhf3MaKxme0uy9z0yGXzjinjIcufns+z1x0i7gl6rilg2KbV4thpUETY bCOvgI5r4dBeiFuLJrsprx+N9RzW531mAUMljJKPU8ku+cJtBvMiwyBVDBY7oDGbO2Bi Vi3R5SKRcrVk0nuxbS5XM2X9R2F22tjGKXszqtQ7VAgkgtxNaOIy2Tw5OltikxtOVgQL fUQg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:message-id:date:subject:cc:to :from:dmarc-filter:delivered-to; bh=afh9hsF6cbWYZ7A3usKI+H/slKI03V788G+KmbzqZmI=; fh=hxDxQAHj70Gp8lCYpVa+fwnWM+ZTBb7+8/soL180oGs=; b=hAoiI22EITu4cjN9XxqYdGpscFmwcA/gDBjBVxnhLeWOA0IDlgO/q9ed6VnNkje9dC EWkumpTccqc9+/b/phVm+3xY4YwAymxANCHmwDL9iIGU+p7A8EWuLNFi8qRYwEQhLNeB Az7ukWUpTYeNu87e3IafTFLPPfIsHlbfNg71s7XHcYY//DlJM3cFNYQEbD0xnb4sKFhq j0D3diVjMnp8BKqao81YaJlOEhigRSvoZvzltFRuBA3UdzujUWp8z/mR+z/eqduGSaCj 0iq4f4taHyBYx42XFF4NBZeLN9Fq1Ro12Ix0KogjaE/XQ9emendBgkrWOeOwIC9V4JVx wFuw== ARC-Authentication-Results: i=1; mx.google.com; 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 sourceware.org (ip-8-43-85-97.sourceware.org. [8.43.85.97]) by mx.google.com with ESMTPS id l15-20020a170906230f00b009871db5ca3bsi3703310eja.866.2023.06.26.23.13.16 for <ouuuleilei@gmail.com> (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 26 Jun 2023 23:13:16 -0700 (PDT) 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; 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 B7D153858C52 for <ouuuleilei@gmail.com>; Tue, 27 Jun 2023 06:13:09 +0000 (GMT) X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from zg8tndyumtaxlji0oc4xnzya.icoremail.net (zg8tndyumtaxlji0oc4xnzya.icoremail.net [46.101.248.176]) by sourceware.org (Postfix) with ESMTP id 557163858422 for <gcc-patches@gcc.gnu.org>; Tue, 27 Jun 2023 06:11:55 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 557163858422 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=eswincomputing.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=eswincomputing.com Received: from host014-ubuntu-1804.lxd (unknown [10.12.130.31]) by app2 (Coremail) with SMTP id EggMCgB3vpSlfZpkMe4qAA--.56170S4; Tue, 27 Jun 2023 14:11:49 +0800 (CST) From: Li Xu <xuli1@eswincomputing.com> To: gcc-patches@gcc.gnu.org Cc: kito.cheng@gmail.com, palmer@dabbelt.com, juzhe.zhong@rivai.ai, zhengyu@eswincomputing.com, pan2.li@intel.com, Li Xu <xuli1@eswincomputing.com> Subject: [PATCH] Extend streamer_mode_table size to MACHINE_MODE_BITSIZE. Date: Tue, 27 Jun 2023 06:11:48 +0000 Message-Id: <20230627061148.24656-1-xuli1@eswincomputing.com> X-Mailer: git-send-email 2.17.1 X-CM-TRANSID: EggMCgB3vpSlfZpkMe4qAA--.56170S4 X-Coremail-Antispam: 1UD129KBjvJXoW7Cr4DtrykKr4kKw4kZFW5Wrg_yoW8Cry3pw 48Gw1Fk34xJFyfCFyktwnYqry3XFs5Ja4vgF18Ja42yr4DKF1SqF1jyFWrWFyxJw40qr1a vFn0q347AF4fXw7anT9S1TB71UUUUUUqnTZGkaVYY2UrUUUUjbIjqfuFe4nvWSU5nxnvy2 9KBjDU0xBIdaVrnRJUUUkF14x267AKxVW8JVW5JwAFc2x0x2IEx4CE42xK8VAvwI8IcIk0 rVWrJVCq3wAFIxvE14AKwVWUJVWUGwA2ocxC64kIII0Yj41l84x0c7CEw4AK67xGY2AK02 1l84ACjcxK6xIIjxv20xvE14v26w1j6s0DM28EF7xvwVC0I7IYx2IY6xkF7I0E14v26F4U JVW0owA2z4x0Y4vEx4A2jsIE14v26rxl6s0DM28EF7xvwVC2z280aVCY1x0267AKxVW0oV Cq3wAS0I0E0xvYzxvE52x082IY62kv0487Mc02F40EFcxC0VAKzVAqx4xG6I80ewAv7VC0 I7IYx2IY67AKxVWUJVWUGwAv7VC2z280aVAFwI0_Jr0_Gr1lOx8S6xCaFVCjc4AY6r1j6r 4UM4x0Y48IcxkI7VAKI48JM4x0x7Aq67IIx4CEVc8vx2IErcIFxwCY02Avz4vE-syl42xK 82IYc2Ij64vIr41l4I8I3I0E4IkC6x0Yz7v_Jr0_Gr1lx2IqxVAqx4xG67AKxVWUJVWUGw C20s026x8GjcxK67AKxVWUGVWUWwC2zVAF1VAY17CE14v26r126r1DMIIYrxkI7VAKI48J MIIF0xvE2Ix0cI8IcVAFwI0_Jr0_JF4lIxAIcVC0I7IYx2IY6xkF7I0E14v26r1j6r4UMI IF0xvE42xK8VAvwI8IcIk0rVWUJVWUCwCI42IY6I8E87Iv67AKxVWUJVW8JwCI42IY6I8E 87Iv6xkF7I0E14v26r1j6r4UYxBIdaVFxhVjvjDU0xZFpf9x0JUdHUDUUUUU= X-CM-SenderInfo: 50xoxi46hv4xpqfrz1xxwl0woofrz/ X-Spam-Status: No, score=-12.4 required=5.0 tests=BAYES_00, GIT_PATCH_0, KAM_DMARC_STATUS, 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.29 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 Sender: "Gcc-patches" <gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org> X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1769835222989040383?= X-GMAIL-MSGID: =?utf-8?q?1769835222989040383?= |
Series |
Extend streamer_mode_table size to MACHINE_MODE_BITSIZE.
|
|
Checks
Context | Check | Description |
---|---|---|
snail/gcc-patch-check | success | Github commit url |
Commit Message
Li Xu
June 27, 2023, 6:11 a.m. UTC
If MAX_MACHINE_MODE exceeds 8bits, a warning will appear in the following code. waring: writing 293 bytes into a region of size 256 overflows the destination gcc/lto-streamer-out.cc void lto_output_init_mode_table (void) { memset (streamer_mode_table, '\0', MAX_MACHINE_MODE); } gcc/ChangeLog: * tree-streamer.cc: Extend streamer_mode_table size to MACHINE_MODE_BITSIZE. * tree-streamer.h: Ditto. --- gcc/tree-streamer.cc | 2 +- gcc/tree-streamer.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-)
Comments
Thanks Xu for locating this, we have one similar PATCH under reviewing/testing as below.
https://gcc.gnu.org/pipermail/gcc-patches/2023-June/622440.html
Pan
-----Original Message-----
From: Li Xu <xuli1@eswincomputing.com>
Sent: Tuesday, June 27, 2023 2:12 PM
To: gcc-patches@gcc.gnu.org
Cc: kito.cheng@gmail.com; palmer@dabbelt.com; juzhe.zhong@rivai.ai; zhengyu@eswincomputing.com; Li, Pan2 <pan2.li@intel.com>; Li Xu <xuli1@eswincomputing.com>
Subject: [PATCH] Extend streamer_mode_table size to MACHINE_MODE_BITSIZE.
If MAX_MACHINE_MODE exceeds 8bits, a warning will appear in the following code.
waring: writing 293 bytes into a region of size 256 overflows the destination
gcc/lto-streamer-out.cc
void
lto_output_init_mode_table (void)
{
memset (streamer_mode_table, '\0', MAX_MACHINE_MODE);
}
gcc/ChangeLog:
* tree-streamer.cc: Extend streamer_mode_table size to MACHINE_MODE_BITSIZE.
* tree-streamer.h: Ditto.
---
gcc/tree-streamer.cc | 2 +-
gcc/tree-streamer.h | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/gcc/tree-streamer.cc b/gcc/tree-streamer.cc
index ed65a7692e3..14c222698bf 100644
--- a/gcc/tree-streamer.cc
+++ b/gcc/tree-streamer.cc
@@ -35,7 +35,7 @@ along with GCC; see the file COPYING3. If not see
During streaming in, we translate the on the disk mode using this
table. For normal LTO it is set to identity, for ACCEL_COMPILER
depending on the mode_table content. */
-unsigned char streamer_mode_table[1 << 8];
+unsigned char streamer_mode_table[1 << MACHINE_MODE_BITSIZE];
/* Check that all the TS_* structures handled by the streamer_write_* and
streamer_read_* routines are exactly ALL the structures defined in
diff --git a/gcc/tree-streamer.h b/gcc/tree-streamer.h
index 170d61cf20b..8bc757be189 100644
--- a/gcc/tree-streamer.h
+++ b/gcc/tree-streamer.h
@@ -75,7 +75,7 @@ void streamer_write_tree_body (struct output_block *, tree);
void streamer_write_integer_cst (struct output_block *, tree);
/* In tree-streamer.cc. */
-extern unsigned char streamer_mode_table[1 << 8];
+extern unsigned char streamer_mode_table[1 << MACHINE_MODE_BITSIZE];
void streamer_check_handled_ts_structures (void);
bool streamer_tree_cache_insert (struct streamer_tree_cache_d *, tree,
hashval_t, unsigned *);
Yes, we have a fix patch (which has been reviewed by jakub) already but missing testing. And we are finding a nvdia GPU to test offload of that patch. We will land it after we finished the test. Thanks. juzhe.zhong@rivai.ai From: Li, Pan2 Date: 2023-06-27 14:15 To: Li Xu; gcc-patches@gcc.gnu.org CC: kito.cheng@gmail.com; palmer@dabbelt.com; juzhe.zhong@rivai.ai; zhengyu@eswincomputing.com Subject: RE: [PATCH] Extend streamer_mode_table size to MACHINE_MODE_BITSIZE. Thanks Xu for locating this, we have one similar PATCH under reviewing/testing as below. https://gcc.gnu.org/pipermail/gcc-patches/2023-June/622440.html Pan -----Original Message----- From: Li Xu <xuli1@eswincomputing.com> Sent: Tuesday, June 27, 2023 2:12 PM To: gcc-patches@gcc.gnu.org Cc: kito.cheng@gmail.com; palmer@dabbelt.com; juzhe.zhong@rivai.ai; zhengyu@eswincomputing.com; Li, Pan2 <pan2.li@intel.com>; Li Xu <xuli1@eswincomputing.com> Subject: [PATCH] Extend streamer_mode_table size to MACHINE_MODE_BITSIZE. If MAX_MACHINE_MODE exceeds 8bits, a warning will appear in the following code. waring: writing 293 bytes into a region of size 256 overflows the destination gcc/lto-streamer-out.cc void lto_output_init_mode_table (void) { memset (streamer_mode_table, '\0', MAX_MACHINE_MODE); } gcc/ChangeLog: * tree-streamer.cc: Extend streamer_mode_table size to MACHINE_MODE_BITSIZE. * tree-streamer.h: Ditto. --- gcc/tree-streamer.cc | 2 +- gcc/tree-streamer.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/gcc/tree-streamer.cc b/gcc/tree-streamer.cc index ed65a7692e3..14c222698bf 100644 --- a/gcc/tree-streamer.cc +++ b/gcc/tree-streamer.cc @@ -35,7 +35,7 @@ along with GCC; see the file COPYING3. If not see During streaming in, we translate the on the disk mode using this table. For normal LTO it is set to identity, for ACCEL_COMPILER depending on the mode_table content. */ -unsigned char streamer_mode_table[1 << 8]; +unsigned char streamer_mode_table[1 << MACHINE_MODE_BITSIZE]; /* Check that all the TS_* structures handled by the streamer_write_* and streamer_read_* routines are exactly ALL the structures defined in diff --git a/gcc/tree-streamer.h b/gcc/tree-streamer.h index 170d61cf20b..8bc757be189 100644 --- a/gcc/tree-streamer.h +++ b/gcc/tree-streamer.h @@ -75,7 +75,7 @@ void streamer_write_tree_body (struct output_block *, tree); void streamer_write_integer_cst (struct output_block *, tree); /* In tree-streamer.cc. */ -extern unsigned char streamer_mode_table[1 << 8]; +extern unsigned char streamer_mode_table[1 << MACHINE_MODE_BITSIZE]; void streamer_check_handled_ts_structures (void); bool streamer_tree_cache_insert (struct streamer_tree_cache_d *, tree, hashval_t, unsigned *); -- 2.17.1
diff --git a/gcc/tree-streamer.cc b/gcc/tree-streamer.cc index ed65a7692e3..14c222698bf 100644 --- a/gcc/tree-streamer.cc +++ b/gcc/tree-streamer.cc @@ -35,7 +35,7 @@ along with GCC; see the file COPYING3. If not see During streaming in, we translate the on the disk mode using this table. For normal LTO it is set to identity, for ACCEL_COMPILER depending on the mode_table content. */ -unsigned char streamer_mode_table[1 << 8]; +unsigned char streamer_mode_table[1 << MACHINE_MODE_BITSIZE]; /* Check that all the TS_* structures handled by the streamer_write_* and streamer_read_* routines are exactly ALL the structures defined in diff --git a/gcc/tree-streamer.h b/gcc/tree-streamer.h index 170d61cf20b..8bc757be189 100644 --- a/gcc/tree-streamer.h +++ b/gcc/tree-streamer.h @@ -75,7 +75,7 @@ void streamer_write_tree_body (struct output_block *, tree); void streamer_write_integer_cst (struct output_block *, tree); /* In tree-streamer.cc. */ -extern unsigned char streamer_mode_table[1 << 8]; +extern unsigned char streamer_mode_table[1 << MACHINE_MODE_BITSIZE]; void streamer_check_handled_ts_structures (void); bool streamer_tree_cache_insert (struct streamer_tree_cache_d *, tree, hashval_t, unsigned *);