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, rs6000] More diagnostic cleanup, addressing PR79845


On Fri, Aug 11, 2017 at 02:21:17PM -0500, Bill Schmidt wrote:
> >>       if (nargs == 0)
> >> 	{
> >> -	  error ("%s only accepts %d arguments", name, (fcode == ALTIVEC_BUILTIN_VEC_PROMOTE)+1 );
> >> +	  error ("builtin %qs only accepts %d arguments", name,
> >> +		 (fcode == ALTIVEC_BUILTIN_VEC_PROMOTE)+1 );
> >> 	  return error_mark_node;
> >> 	}
> >>       if (fcode == ALTIVEC_BUILTIN_VEC_SPLATS && nargs != 1)
> >> 	{
> >> -	  error ("%s only accepts 1 argument", name);
> >> +	  error ("builtin %qs only accepts 1 argument", name);
> >> 	  return error_mark_node;
> >> 	}
> >>       if (fcode == ALTIVEC_BUILTIN_VEC_PROMOTE && nargs != 2)
> >> 	{
> >> -	  error ("%s only accepts 2 arguments", name);
> >> +	  error ("builtin %qs only accepts 2 arguments", name);
> >> 	  return error_mark_node;
> >> 	}
> > 
> > This last "if" is redundant with the handling of VEC_PROMOTE about ten
> > lines up.  Maybe the "if (nargs == 0)" should be ordered later and things
> > simplified?
> 
> Looks to me like it's equivalent to remove the whole "if (nargs == 0) {...}" clause.

Ah, right, there is an if() around this allowing only these two fcodes.

> I'll regstrap that and commit if it's clean.  Thanks again!

No, thank you, this wasn't the most fun work to do ;-)


Segher


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