Re: [PATCH] x86: Insert ENDBR if function will be called indirectly

2020-04-17 Thread Jeff Law via Gcc-patches
On Fri, 2020-04-17 at 08:18 -0700, H.J. Lu wrote: > On Wed, Apr 8, 2020 at 9:41 AM Jeff Law wrote: > > On Wed, 2020-04-08 at 09:23 -0700, H.J. Lu wrote: > > > On Wed, Apr 8, 2020 at 9:16 AM Jeff Law wrote: > > > > On Tue, 2020-03-31 at 08:11 -0700, H.J. Lu via Gcc-patches wrote: > > > > > Since c

Re: [PATCH] x86: Insert ENDBR if function will be called indirectly

2020-04-17 Thread H.J. Lu via Gcc-patches
BOL_REF_DLLIMPORT_P > > (op) > > But I need to use DECL_DLLIMPORT_P (cfun->decl)). > Sigh. In that case I guess the patch is OK as-is. > I'd like to backport this wrong code fix to GCC 9/8 branches. Is it OK for GCC 9/8 branches? Thanks. -- H.J. From f86

Re: [PATCH] x86: Insert ENDBR if function will be called indirectly

2020-04-08 Thread Jeff Law via Gcc-patches
On Wed, 2020-04-08 at 09:23 -0700, H.J. Lu wrote: > On Wed, Apr 8, 2020 at 9:16 AM Jeff Law wrote: > > On Tue, 2020-03-31 at 08:11 -0700, H.J. Lu via Gcc-patches wrote: > > > Since constant_call_address_operand has > > > > > > ;; Test for a pc-relative call operand > > > (define_predicate "consta

Re: [PATCH] x86: Insert ENDBR if function will be called indirectly

2020-04-08 Thread H.J. Lu via Gcc-patches
On Wed, Apr 8, 2020 at 9:16 AM Jeff Law wrote: > > On Tue, 2020-03-31 at 08:11 -0700, H.J. Lu via Gcc-patches wrote: > > Since constant_call_address_operand has > > > > ;; Test for a pc-relative call operand > > (define_predicate "constant_call_address_operand" > > (match_code "symbol_ref") > >

Re: [PATCH] x86: Insert ENDBR if function will be called indirectly

2020-04-08 Thread Jeff Law via Gcc-patches
On Tue, 2020-03-31 at 08:11 -0700, H.J. Lu via Gcc-patches wrote: > Since constant_call_address_operand has > > ;; Test for a pc-relative call operand > (define_predicate "constant_call_address_operand" > (match_code "symbol_ref") > { > if (ix86_cmodel == CM_LARGE || ix86_cmodel == CM_LARGE_PI

[PATCH] x86: Insert ENDBR if function will be called indirectly

2020-03-31 Thread H.J. Lu via Gcc-patches
Since constant_call_address_operand has ;; Test for a pc-relative call operand (define_predicate "constant_call_address_operand" (match_code "symbol_ref") { if (ix86_cmodel == CM_LARGE || ix86_cmodel == CM_LARGE_PIC || flag_force_indirect_call) return false; if (TARGET_DLLIMPORT_DE