https://gcc.gnu.org/bugzilla/show_bug.cgi?id=31178

--- Comment #13 from Andrew Macleod <amacleod at redhat dot com> ---
huh, so even after fixing the testcase, ranger is still tripping over this test
case.

uv1ti ashl_v1ti (uv1ti x, unsigned int i)
{
  uv1ti _3;

  <bb 2> :
  _3 = x_1(D) << i_2(D);
  return _3;


we have an ssa_name for x_1 with a type of uvlti.

This passes the INTEGRAL_TYPE_P test and an ssa_name is created, but is it
actually a vector_type.  This seems to be OK, but being unaware of this, and
having a type which passes the INTEGRAL_TYPE_P (type),  I was using
TYPE_PRECISION (type) to find the upper bounds for i_2.

It appears that if VECTOR_TYPE_P (type) is true, then TYPE_PRECISION (type) is
not a valid request? but it silently returns 0 and happily moves on.

As near as I can tell, I am suppose to ask for:
TYPE_PRECISION (TREE_TYPE (type)) when its a VECTOR_TYPE?

IS there a good reason we don't fill in the TYPE_PRECISION field?   Or if its
not suppose to be used, then can we trap on it if its passed a vector type?  It
seems like the sort of thing that is easy to trip over.  Are their other bits
which make VECTOR_TYPE incompatible with scalar INTGERAL_TYPEs that should not
be queried?

Reply via email to