From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 115312 invoked by alias); 13 Sep 2017 17:08:06 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Received: (qmail 115303 invoked by uid 89); 13 Sep 2017 17:08:05 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-6.8 required=5.0 tests=AWL,BAYES_00,GIT_PATCH_2,RP_MATCHES_RCVD,SPF_PASS autolearn=ham version=3.3.2 spammy= X-HELO: mga05.intel.com Received: from mga05.intel.com (HELO mga05.intel.com) (192.55.52.43) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Wed, 13 Sep 2017 17:08:03 +0000 Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by fmsmga105.fm.intel.com with ESMTP; 13 Sep 2017 10:08:01 -0700 X-ExtLoop1: 1 Received: from irsmsx107.ger.corp.intel.com ([163.33.3.99]) by fmsmga001.fm.intel.com with ESMTP; 13 Sep 2017 10:07:30 -0700 Received: from irsmsx102.ger.corp.intel.com ([169.254.2.59]) by IRSMSX107.ger.corp.intel.com ([169.254.10.65]) with mapi id 14.03.0319.002; Wed, 13 Sep 2017 18:07:29 +0100 From: "Tsimbalist, Igor V" To: Jeff Law , "'gcc-patches@gcc.gnu.org'" CC: "Tsimbalist, Igor V" Subject: RE: 0001-Part-1.-Add-generic-part-for-Intel-CET-enabling Date: Wed, 13 Sep 2017 17:08:00 -0000 Message-ID: References: Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-IsSubscribed: yes X-SW-Source: 2017-09/txt/msg00822.txt.bz2 > -----Original Message----- > From: Tsimbalist, Igor V > Sent: Tuesday, September 12, 2017 5:59 PM > To: 'Jeff Law' ; 'gcc-patches@gcc.gnu.org' patches@gcc.gnu.org> > Cc: Tsimbalist, Igor V > Subject: RE: 0001-Part-1.-Add-generic-part-for-Intel-CET-enabling >=20 >=20 > > -----Original Message----- > > From: Jeff Law [mailto:law@redhat.com] > > Sent: Friday, August 25, 2017 10:50 PM > > To: Tsimbalist, Igor V ; 'gcc- > > patches@gcc.gnu.org' > > Subject: Re: 0001-Part-1.-Add-generic-part-for-Intel-CET-enabling > > > > On 08/01/2017 02:56 AM, Tsimbalist, Igor V wrote: > > > Part#1. Add generic part for Intel CET enabling. > > > > > > Q. Do we need to do anything with ICF (identical code folding) and CFE? > > Given two functions which have the same implementation in gimple, > > except that one has a notrack indirect call and the other has a > > tracked indirect call, what is proper behavior? I think we'd keep > > them separate which implies we need to make sure the notrack attribute > > is part of the ICF hashing implementation. It'd probably even be > > worth building a test for this :-) > Are you talking about a case when such two functions are inlined? Or ther= e is > a possibility to merge function bodies if they are identical? >=20 > I agree with you that the functions should be kept separate. I haven't lo= oked > into such optimization in gcc so I need to learn it. I thought over this case and my conclusion is that nothing has to be done r= egarding ICF. First of all let's sync on a case we are talking about. A code template cou= ld look like fn1 definition { } fn2 definition with notrack attribute { } func definition { ... } Is it the case you are talking about? Let's consider different scenarios: 1) calls to fn1 and fn2 are direct calls. In that case 'notrack' has no eff= ect on direct calls as they are assumed to be save (it applies to indirect calls only). ICF can be done her= e; 2) one of calls is an indirect call or both calls are indirect calls. If co= mpiler can prove what exact functions are called then indirect call(s) can be replaced by direct call(s) and that= gives us the case 1); 3) if compiler cannot prove what function is called it will keep the indire= ct call and so there is nothing to do for ICF here.=20 Thanks, Igor >=20 > > > } > > > > > > > > > +/* Return true if call GS is marked as no-track. */ > > > + > > > +static inline bool > > > +gimple_call_with_notrack_p (const gcall *gs) { > > > + return (gs->subcode & GF_CALL_WITH_NOTRACK) !=3D 0; } > > > + > > > +static inline bool > > > +gimple_call_with_notrack_p (const gimple *gs) { > > > + const gcall *gc =3D GIMPLE_CHECK2 (gs); > > > + return gimple_call_with_notrack_p (gc); } > > Agree with Richi WRT avoiding gimple * overloads. > Fixed. >=20 > Thanks, > Igor >=20 > > > > > > Jeff