This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: PATCH for bogus loop optimization, part 2
- To: mark at markmitchell dot com
- Subject: Re: PATCH for bogus loop optimization, part 2
- From: Bill Currie <bcurrie at tssc dot co dot nz>
- Date: Fri, 17 Jul 1998 09:09:39 +1200
- CC: egcs-patches at cygnus dot com, Jeff Law <law at cygnus dot com>
- Organization: Telecommunication Systems Support Centre
- References: <199807161744.KAA02710@smtp.earthlink.net>
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