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: [m32c] type precedence rules and pointer signs


> It's correct to always sign-extend the offset to the pointer mode
> width (or simply truncate it, if the offset width is larger than
> pointer mode width).

I'd argue against that if you're dereferencing a large structure
pointer.  P->foo would always be an unsigned offset.  Similarly for
arrays, although one could argue either way with that.

In the m32c case, though, the offset is a signed type, but an unsigned
extension was used.  The mismatch is the problem.

Either way, there's going to be a compromise.


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