On Wed, Mar 28, 2018 at 08:31:38AM +0200, Martin Liška wrote:
> Ok, so should we make the set of cum->bnds_in_bt based on 
> flag_check_pointer_bounds flag?
> 
> If so, I've got patch that I've tested on my x86_64-linux-gnu machin.
> 
> Martin

> >From 7b5978e61305c5098a084c2352fcbacb4c347158 Mon Sep 17 00:00:00 2001
> From: marxin <mli...@suse.cz>
> Date: Wed, 21 Mar 2018 10:51:32 +0100
> Subject: [PATCH] Do not call chkp_type_bounds_count if MPX is not enabled (PR
>  target/84988).
> 
> gcc/ChangeLog:
> 
> 2018-03-21  Martin Liska  <mli...@suse.cz>
> 
>       PR target/84988
>       * config/i386/i386.c (ix86_function_arg_advance): Do not call
>       chkp_type_bounds_count if MPX is not enabled.

LGTM.

> --- a/gcc/config/i386/i386.c
> +++ b/gcc/config/i386/i386.c
> @@ -8618,7 +8618,8 @@ ix86_function_arg_advance (cumulative_args_t cum_v, 
> machine_mode mode,
>        if (cum->caller)
>       cfun->machine->outgoing_args_on_stack = true;
>  
> -      cum->bnds_in_bt = chkp_type_bounds_count (type);
> +      if (flag_check_pointer_bounds)
> +     cum->bnds_in_bt = chkp_type_bounds_count (type);
>      }
>  }
>  
> -- 
> 2.16.2
> 


        Jakub

Reply via email to