On Wed, Mar 21, 2018 at 01:40:08PM +0100, Martin Liška wrote: > 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. > --- > gcc/config/i386/i386.c | 3 ++- > 1 file changed, 2 insertions(+), 1 deletion(-) > > diff --git a/gcc/config/i386/i386.c b/gcc/config/i386/i386.c > index 5b1e962dedb..0693f8fc451 100644 > --- 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 (type && POINTER_BOUNDS_TYPE_P (type)) > + cum->bnds_in_bt = chkp_type_bounds_count (type);
This is weird. POINTER_BOUNDS_TYPE_P (type) is TREE_CODE (type) == POINTER_BOUNDS_TYPE, and for POINTER_BOUNDS_TYPE chkp_type_bounds_count will just unconditionally return 0. Jakub