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] Fix PR32628, bogus overflow flag on sizetype consts


> Right.  It gets used here because we represent (char *)0 + ~0UL as
> POINTER_PLUS_EXPR internally ...

It seems wrong, however, to have sizetype be that user-visible.

> ... which has its offset operand constrained to be compatible with
> sizetype.

Seems like that's wrong and ssizetype would be correct.  Can't a
pointer offset be negative?

> Right.  The problem all but the Ada frontends face is that sizetype
> is unsigned but sign-extended,

What does it mean for a type to be "sign-extended"?  Note that
sizetype should NOT be visible to user code.

> > But how is this defined in C?  What type is that "+" coerced to?  Should
> > that have been written as "-1"?
> 
> As written, (char *)0 + ~0ULL is the address of the last byte of the
> virtual address space.

And the C standard defines it this way?


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