This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: When is it legal to compare any pair of pointers?
On Sep 14, 2005, Joe Buck <Joe.Buck@synopsys.COM> wrote:
> On Wed, Sep 14, 2005 at 02:15:43PM -0300, Alexandre Oliva wrote:
>> Yep, it was pointer subtraction, and GCC actually optimized the
>> division, that could in theory be assumed to be exact, into a
>> multiplication by a large constant (aah, the wonders of modulo
>> arithmetics :-)
> People that don't like the GCC optimization
It's not entirely clear that you got the impression I didn't like it.
I have no objection at all, I was just providing the additional
details as to the bug we'd run into because of unspecified uses of
pointer subtraction, as requested by DanJ.
--
Alexandre Oliva http://www.lsd.ic.unicamp.br/~oliva/
Red Hat Compiler Engineer aoliva@{redhat.com, gcc.gnu.org}
Free Software Evangelist oliva@{lsd.ic.unicamp.br, gnu.org}