This is the mail archive of the gcc@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: Ada boolean type


On Thu, 14 Jul 2011, Eric Botcazou wrote:

> > and from looking at SET_TYPE_RM_VALUEs definition it doesn't
> > touch TYPE_MAX_VALUE.  So TYPE_MAX_VALUE is as set from
> > make_unsigned_type (8) which should set it to 255, not 1.
> >
> > So ... how can it be a no-op?
> 
> Look a few lines below. :-)  In gigi we manipulate both full-fledged Ada types 
> with RM bounds and GCC types without RM bounds so it's more convenient to have 
> a single accessor macro.

/* For numerical types, this is the upper bound of the type, i.e. the RM 
upper
   bound for language-defined types and the GCC upper bound for others.  
*/
#undef TYPE_MAX_VALUE
#define TYPE_MAX_VALUE(NODE) \
  (TYPE_RM_MAX_VALUE (NODE) \
   ? TYPE_RM_MAX_VALUE (NODE) : TYPE_GCC_MAX_VALUE (NODE))

Ick ;)

> > Heh ;)  At least Fortran doesn't play games with TYPE_PRECISION ;)
> 
> Right, but TYPE_PRECISION isn't prescribed by the C ABI, is it?  More seriously 
> I think that your suggestion is the way to go and I made the same when we were 
> fiddling with boolean_type_node in free_lang_data:
>   http://gcc.gnu.org/ml/gcc-patches/2009-10/msg00966.html
> 
> So fine with me, as long as all the languages play by the same rules.

Yeah, it'll be a (slow) migration process though.  I'll eventually
work on the Fortran parts.

Richard.


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