broken arithmetic operations on vectors (c and c++)

Aldy Hernandez aldyh@redhat.com
Tue Jun 14 21:26:00 GMT 2005


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?



More information about the Gcc-patches mailing list