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]

Re: PATCH for bogus loop optimization, part 2


Mark Mitchell wrote:
>   o Any comparison between pointers should be unsigned.

Definitely.  This sort of thing killed the djgpp version of GNU Pascal
running under windows (due to interaction between djgpp and window WRT
memory management: a freshly allocated memory could be `below' the text
segmen (in linear memory) thus having an address of (say) 0xff000000). 
The problem reared it's ugly head when subtacting two pointers and using
the result as a hash value (ie index into an array...boom).

I'm not saying pointer subtraction should be signed or unsigned, but I
agree that pointer comparison should be unsigned.

Bill
-- 
Leave others their otherness


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