This is the mail archive of the gcc-patches@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: [PATCH] Get rid of awkward precision for bitsize types


On Mon, Apr 6, 2009 at 8:08 PM, Eric Botcazou <ebotcazou@adacore.com> wrote:
>> I know that sizetypes "do not overflow" (err, well ...) - but do you
>> realize that doing this makes overflow behavior different between
>> a computation in sizetype and one in bitsizetype with bit
>> quantities?
>
> Note that there is a precedent:
>
> 2006-11-18 ?John David Anglin ?<dave.anglin@nrc-cnrc.gc.ca>
>
> ? ? ? ?PR fortran/27885
> ? ? ? ?PR middle-end/28176
> ? ? ? ?* stor-layout.c (set_sizetype): Limit precision of *bitsizetypes types
> ? ? ? ?to MAX_FIXED_MODE_SIZE.
>
> After it, bitsizetypes overflow before sizetypes on x86-64 and this doesn't
> seem to have any practical consequences.

On a 64bit target I would guess so.  Limiting bitsizetype to SImode on
32bit targets would likely break existing applications.  Unfortunately
sizetype itself is now tied to this POINTER_PLUS_EXPR thing and
even (wrongly) expected to be of pointer mode precision - if that
were not the case simply using 64bits for sizetype and bitsizetype
would be likely ok ...

Richard.


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