This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [patch, fortran] Handle missing optional MASK for intrinsics


On Sun, Dec 30, 2018 at 09:37:20AM -0800, Steve Kargl wrote:
> On Sun, Dec 30, 2018 at 06:10:14PM +0100, Thomas Koenig wrote:
> 
> > +	{
> > +	  tree present;
> > +	  tree type;
> > +
> > +	  type = TREE_TYPE (maskse.expr);
> > +	  present = gfc_conv_expr_present (maskexpr->symtree->n.sym);
> > +	  present = convert (type, present);
> > +	  present = fold_build1_loc (input_location, TRUTH_NOT_EXPR, type,
> > +				     present);
> > +	  ifmask = fold_build2_loc (input_location, TRUTH_ORIF_EXPR,
> > +				    type, present, maskse.expr);
> > +	}
> > +      else
> > +	ifmask = maskse.expr;
> > +
> 
> This block of code appears multiple time in the patch.
> I wonder if you should split it out into its own function.
> 
> static tree
> generate_mask (gfc_expr *mask)   /* Choose whatever name you like.

I suppose that should be s/gfc_expr/tree.

-- 
Steve


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]