Re: [PATCH PR92926]Fix wrong code caused by ctor node translation unit wide sharing

2020-01-14 Thread Bin.Cheng
On Wed, Jan 15, 2020 at 5:04 AM Jeff Law wrote: > > On Thu, 2020-01-09 at 14:20 +0800, Bin.Cheng wrote: > > On Fri, Dec 20, 2019 at 3:10 PM Richard Biener > > wrote: > > > On December 20, 2019 2:13:47 AM GMT+01:00, "Bin.Cheng" > > > wrote: > > > > On Fri, Dec 13, 2019 at 11:26 AM bin.cheng > >

Re: [PATCH PR92926]Fix wrong code caused by ctor node translation unit wide sharing

2020-01-14 Thread Jeff Law
On Thu, 2020-01-09 at 14:20 +0800, Bin.Cheng wrote: > On Fri, Dec 20, 2019 at 3:10 PM Richard Biener > wrote: > > On December 20, 2019 2:13:47 AM GMT+01:00, "Bin.Cheng" > > wrote: > > > On Fri, Dec 13, 2019 at 11:26 AM bin.cheng > > > wrote: > > > > Hi, > > > > > > > > As reported in PR92926,

Re: [PATCH PR92926]Fix wrong code caused by ctor node translation unit wide sharing

2020-01-09 Thread Jason Merrill
On 1/9/20 4:37 PM, Jakub Jelinek wrote: On Thu, Jan 09, 2020 at 04:27:09PM -0500, Jason Merrill wrote: Isn't the right spot to fix this somewhere in cp_gimplify_expr? I mean, the way gimplification works, we unshare_body first and then gimplify, which is destructive for the GENERIC it is

Re: [PATCH PR92926]Fix wrong code caused by ctor node translation unit wide sharing

2020-01-09 Thread Jakub Jelinek
On Thu, Jan 09, 2020 at 04:27:09PM -0500, Jason Merrill wrote: > > Isn't the right spot to fix this somewhere in cp_gimplify_expr? > > I mean, the way gimplification works, we unshare_body first and then > > gimplify, which is destructive for the GENERIC it is gimplifying. The > > reason why this

Re: [PATCH PR92926]Fix wrong code caused by ctor node translation unit wide sharing

2020-01-09 Thread Jason Merrill
On 1/9/20 3:59 AM, Jakub Jelinek wrote: On Thu, Jan 09, 2020 at 02:20:23PM +0800, Bin.Cheng wrote: On December 20, 2019 2:13:47 AM GMT+01:00, "Bin.Cheng" wrote: On Fri, Dec 13, 2019 at 11:26 AM bin.cheng wrote: Hi, As reported in PR92926, constant ctor is shared translation unit wide

Re: [PATCH PR92926]Fix wrong code caused by ctor node translation unit wide sharing

2020-01-09 Thread Jakub Jelinek
On Thu, Jan 09, 2020 at 02:20:23PM +0800, Bin.Cheng wrote: > > On December 20, 2019 2:13:47 AM GMT+01:00, "Bin.Cheng" > > wrote: > > >On Fri, Dec 13, 2019 at 11:26 AM bin.cheng > > > wrote: > > >> > > >> Hi, > > >> > > >> As reported in PR92926, constant ctor is shared translation unit wide > >

Re: [PATCH PR92926]Fix wrong code caused by ctor node translation unit wide sharing

2020-01-08 Thread Bin.Cheng
On Fri, Dec 20, 2019 at 3:10 PM Richard Biener wrote: > > On December 20, 2019 2:13:47 AM GMT+01:00, "Bin.Cheng" > wrote: > >On Fri, Dec 13, 2019 at 11:26 AM bin.cheng > > wrote: > >> > >> Hi, > >> > >> As reported in PR92926, constant ctor is shared translation unit wide > >because of

Re: [PATCH PR92926]Fix wrong code caused by ctor node translation unit wide sharing

2019-12-19 Thread Richard Biener
On December 20, 2019 2:13:47 AM GMT+01:00, "Bin.Cheng" wrote: >On Fri, Dec 13, 2019 at 11:26 AM bin.cheng > wrote: >> >> Hi, >> >> As reported in PR92926, constant ctor is shared translation unit wide >because of constexpr_call_table, >> however, during gimplify, the shared ctor could be

Re: [PATCH PR92926]Fix wrong code caused by ctor node translation unit wide sharing

2019-12-19 Thread Bin.Cheng
On Fri, Dec 13, 2019 at 11:26 AM bin.cheng wrote: > > Hi, > > As reported in PR92926, constant ctor is shared translation unit wide because > of constexpr_call_table, > however, during gimplify, the shared ctor could be modified. This patch > fixes the issue by unsharing > it before

[PATCH PR92926]Fix wrong code caused by ctor node translation unit wide sharing

2019-12-12 Thread bin.cheng
Hi, As reported in PR92926, constant ctor is shared translation unit wide because of constexpr_call_table, however, during gimplify, the shared ctor could be modified. This patch fixes the issue by unsharing it before modification in gimplify. A test is reduced from cppcoro library and