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] Integer repesentation in the Ada FE


On Wed, 26 Apr 2006, Robert Dewar wrote:

> Bernd Trog wrote:
>
> > I'm chasing a bug that only appeares when Standard.Integer'Size is 16:
> > http://gcc.gnu.org/bugzilla/show_bug.cgi?id=26849
>
> Trying to make the compiler work with standard integer size of
> 16 will be very difficult I fear.

Do you have an example where the compiler (not the runtime)
assumes a target Standard.Integer'Size >= 32?

Reading the comments in ttypes.ads suggests that there is at least a
clear distinction beteen host and target integer types.


> It really assumes an integer size of at least 32 I would guess, though
> of course type Uint does not depend on the format of Integer.

Hmm, it seems that Uint does depend on the target Integer size:

package i is
   subtype I32767 is Integer range -32767 .. 32767;
   --  Note: -32767 is in the Uint_Direct range!
end;

compiles OK.

While

package i is
   subtype I32768 is Integer range -32768 .. 32767;
   --  Note: -32768 is NOT in the Uint_Direct range!
end;

fails here: ada/trans.c:2588:
gcc_assert (!TREE_CONSTANT_OVERFLOW (gnu_result));

Both examples compile OK when the target Integer size is 32, of course.



> FOr a discussion of the representation of Uint, see the private
> part of Uintp.

Thanks for the pointer!






__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 


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