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: broken arithmetic operations on vectors (c and c++)


On Tue, Jun 14, 2005 at 01:41:42PM -0700, Richard Henderson wrote:
> On Tue, Jun 14, 2005 at 03:01:30PM -0400, Aldy Hernandez wrote:
> > +   if (code0 == VECTOR_TYPE && code1 == VECTOR_TYPE)
> > +     {
> > +       if (!tree_int_cst_equal (TYPE_SIZE (type0), TYPE_SIZE (type1))
> > + 	  || !same_scalar_type_ignoring_signedness (TREE_TYPE (type0),
> > + 						    TREE_TYPE (type1)))
> > + 	{
> > + 	  binary_op_error (code);
> > + 	  return error_mark_node;
> > + 	}
> > +     }
> > + 
> 
> It looks like this should do down below the switch with the other
> special cases.  But otherwise ok.

The *_DIV_EXPR cases change code0/code1, which means we don't trigger
the error message anymore.  So we either have to put the error message
before the switch or move the complex and vector handling of *_DIV_EXPR
after the switch.

What is your preference?


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