Re: [PATCH] RISC-V: Fix out of range memory access of machine mode table

2023-06-28 Thread Jeff Law via Gcc-patches
On 6/21/23 18:19, Li, Pan2 wrote: Hi there, I try to verify the offloading following below doc. https://gcc.gnu.org/wiki/Offloading#How_to_build_an_offloading-enabled_GCC with some steps: 1. Build nvptx-tools. 2. Symbol link nvptx-newlib to gcc source code. 3. Build the Nividia PTX accel

RE: [PATCH] RISC-V: Fix out of range memory access of machine mode table

2023-06-21 Thread Li, Pan2 via Gcc-patches
...@suse.de Subject: RE: [PATCH] RISC-V: Fix out of range memory access of machine mode table Thanks Jakub, will fix the format issue and send the V3 patch, as well as try to validate it for offloading. Pan -Original Message- From: Jakub Jelinek Sent: Wednesday, June 21, 2023 3:16 PM To: Li

RE: [PATCH] RISC-V: Fix out of range memory access of machine mode table

2023-06-21 Thread Li, Pan2 via Gcc-patches
; jeffreya...@gmail.com; Wang, Yanzhang ; kito.ch...@gmail.com; rguent...@suse.de Subject: Re: [PATCH] RISC-V: Fix out of range memory access of machine mode table On Wed, Jun 21, 2023 at 06:59:08AM +, Li, Pan2 wrote: > inline machine_mode > bp_unpack_machine_mode (struct bitpack

Re: [PATCH] RISC-V: Fix out of range memory access of machine mode table

2023-06-21 Thread Jakub Jelinek via Gcc-patches
On Wed, Jun 21, 2023 at 06:59:08AM +, Li, Pan2 wrote: > inline machine_mode > bp_unpack_machine_mode (struct bitpack_d *bp) > { > - return (machine_mode) > -((class lto_input_block *) > - bp->stream)->mode_table[bp_unpack_enum (bp, machine_mode, 1 << 8)]; > + int last = 1

RE: [PATCH] RISC-V: Fix out of range memory access of machine mode table

2023-06-21 Thread Li, Pan2 via Gcc-patches
Pan2 Cc: gcc-patches@gcc.gnu.org; juzhe.zh...@rivai.ai; rdapp@gmail.com; jeffreya...@gmail.com; Wang, Yanzhang ; kito.ch...@gmail.com; rguent...@suse.de Subject: Re: [PATCH] RISC-V: Fix out of range memory access of machine mode table On Tue, Jun 20, 2023 at 02:08:07PM +, Li, Pan2 via Gcc-p

Re: [PATCH] RISC-V: Fix out of range memory access of machine mode table

2023-06-20 Thread Jakub Jelinek via Gcc-patches
On Tue, Jun 20, 2023 at 02:08:07PM +, Li, Pan2 via Gcc-patches wrote: > Thanks Jakub for the explanation, I have a try like below patch but I am not > quite sure it is expected, and where should I put the assertion. > > > If yes, it needs to > > be unsigned short, if not, we should add an

RE: [PATCH] RISC-V: Fix out of range memory access of machine mode table

2023-06-20 Thread Li, Pan2 via Gcc-patches
elinek Sent: Tuesday, June 20, 2023 4:04 PM To: Li, Pan2 Cc: gcc-patches@gcc.gnu.org; juzhe.zh...@rivai.ai; rdapp@gmail.com; jeffreya...@gmail.com; Wang, Yanzhang ; kito.ch...@gmail.com; rguent...@suse.de Subject: Re: [PATCH] RISC-V: Fix out of range memory access of machine mode table On Tue,

Re: [PATCH] RISC-V: Fix out of range memory access of machine mode table

2023-06-20 Thread Jakub Jelinek via Gcc-patches
On Tue, Jun 20, 2023 at 07:50:00AM +, Li, Pan2 wrote: > Hi Jakub, > > Thanks for reviewing but I am not quite sure if I fully understand how to fix > this issue. Could you please help to enlighten me more about this ? > > Currently for RISC-V, the memset has touched out of range memory

RE: [PATCH] RISC-V: Fix out of range memory access of machine mode table

2023-06-20 Thread Li, Pan2 via Gcc-patches
; rguent...@suse.de Subject: RE: [PATCH] RISC-V: Fix out of range memory access of machine mode table Thanks Jakub for reviewing, sorry for misleading and will have a try for PATCH v3. Pan -Original Message- From: Jakub Jelinek Sent: Monday, June 19, 2023 5:17 PM To: Li, Pan2 Cc: gcc-

RE: [PATCH] RISC-V: Fix out of range memory access of machine mode table

2023-06-19 Thread Li, Pan2 via Gcc-patches
, Yanzhang ; kito.ch...@gmail.com; rguent...@suse.de Subject: Re: [PATCH] RISC-V: Fix out of range memory access of machine mode table On Mon, Jun 19, 2023 at 05:05:48PM +0800, pan2...@intel.com wrote: > --- a/gcc/lto-streamer-in.cc > +++ b/gcc/lto-streamer-in.cc > @@ -1985,

Re: [PATCH] RISC-V: Fix out of range memory access of machine mode table

2023-06-19 Thread Jakub Jelinek via Gcc-patches
On Mon, Jun 19, 2023 at 05:05:48PM +0800, pan2...@intel.com wrote: > --- a/gcc/lto-streamer-in.cc > +++ b/gcc/lto-streamer-in.cc > @@ -1985,7 +1985,8 @@ lto_input_mode_table (struct lto_file_decl_data > *file_data) > internal_error ("cannot read LTO mode table from %s", >

Re: [PATCH] RISC-V: Fix out of range memory access of machine mode table

2023-06-19 Thread Richard Biener via Gcc-patches
On Mon, 19 Jun 2023, pan2...@intel.com wrote: > From: Pan Li > > We extend the machine mode from 8 to 16 bits already. But there still > one placing missing from the tree-streamer. It has one hard coded array > for the machine code like size 256. > > In the lto pass, we memset the array by