* [PATCH] Extend streamer_mode_table size to MACHINE_MODE_BITSIZE.
@ 2023-06-27 6:11 Li Xu
2023-06-27 6:15 ` Li, Pan2
0 siblings, 1 reply; 3+ messages in thread
From: Li Xu @ 2023-06-27 6:11 UTC (permalink / raw)
To: gcc-patches; +Cc: kito.cheng, palmer, juzhe.zhong, zhengyu, pan2.li, Li Xu
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
^ permalink raw reply [flat|nested] 3+ messages in thread
* RE: [PATCH] Extend streamer_mode_table size to MACHINE_MODE_BITSIZE.
2023-06-27 6:11 [PATCH] Extend streamer_mode_table size to MACHINE_MODE_BITSIZE Li Xu
@ 2023-06-27 6:15 ` Li, Pan2
2023-06-27 6:20 ` juzhe.zhong
0 siblings, 1 reply; 3+ messages in thread
From: Li, Pan2 @ 2023-06-27 6:15 UTC (permalink / raw)
To: Li Xu, gcc-patches; +Cc: kito.cheng, palmer, juzhe.zhong, zhengyu
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
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: RE: [PATCH] Extend streamer_mode_table size to MACHINE_MODE_BITSIZE.
2023-06-27 6:15 ` Li, Pan2
@ 2023-06-27 6:20 ` juzhe.zhong
0 siblings, 0 replies; 3+ messages in thread
From: juzhe.zhong @ 2023-06-27 6:20 UTC (permalink / raw)
To: pan2.li, Li Xu, gcc-patches
Cc: kito.cheng, palmer, zhengyu, jeffreyalaw, jakub
[-- Attachment #1: Type: text/plain, Size: 2862 bytes --]
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
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2023-06-27 6:20 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-06-27 6:11 [PATCH] Extend streamer_mode_table size to MACHINE_MODE_BITSIZE Li Xu
2023-06-27 6:15 ` Li, Pan2
2023-06-27 6:20 ` juzhe.zhong
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).