http://gcc.gnu.org/bugzilla/show_bug.cgi?id=50294

--- Comment #9 from Eric Botcazou <ebotcazou at gcc dot gnu.org> 2011-11-19 
21:35:48 UTC ---
> Thus the question - what should stor-layout do with domain types
> that wrap the wrong way around (i.e. are of wrong type because Ada
> turns everything into sizetype instead of [s]sizetype dependent on
> the Ada type "signedness")?

What do you mean by "Ada turns everything into sizetype" here?  AFAIK the Ada
compiler behaves like the other compilers, i.e. domain types are built with

/* Create a type of integers to be the TYPE_DOMAIN of an ARRAY_TYPE.
   MAXVAL should be the maximum value in the domain
   (one less than the length of the array).

   The maximum value that MAXVAL can have is INT_MAX for a HOST_WIDE_INT.
   We don't enforce this limit, that is up to caller (e.g. language front end).
   The limit exists because the result is a signed type and we don't handle
   sizes that use more than one HOST_WIDE_INT.  */

tree
build_index_type (tree maxval)
{
  return build_range_type (sizetype, size_zero_node, maxval);
}

so are all subtypes of sizetype (gigi has create_index_type instead because it
needs to have non-shared range types and lower bounds, but it's equivalent).

Reply via email to