[Bug c/12654] [3.3/3.4 regression] Incorrect comparison code generated for Alpha

falk dot hueffner at student dot uni-tuebingen dot de gcc-bugzilla@gcc.gnu.org
Fri Oct 17 15:58:00 GMT 2003


PLEASE REPLY TO gcc-bugzilla@gcc.gnu.org ONLY, *NOT* gcc-bugs@gcc.gnu.org.

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=12654



------- Additional Comments From falk dot hueffner at student dot uni-tuebingen dot de  2003-10-17 15:47 -------
Subject: Re:  [3.3/3.4 regression] Incorrect comparison code generated for Alpha

"tg at swox dot com" <gcc-bugzilla@gcc.gnu.org> writes:

> In order to drive that portably, a somewhat odd expression is
> needed.  Are you saying the ~0L is "technically invalid", since it
> contains an overflow of signed data?

No, it isn't, since it is an unsigned value. But passing this value to
a function taking a signed value is implementation defined.

> Is that relevant for the test case's validity?

I don't know. I tend to avoid implementation defined behaviour, and in
this case I think MIN_LONG is also a lot clearer.

>   The bogus variant is actually slightly better WRT register pressure, so we
>   might want to retain it for int arguments.
> 
> Huh?  Not sure what you are suggesting.  Adding and then comarping
> to 0 is *wrong* also for int arguments when since the add risks to
> overflow.

Not if you do a 64-bit add. But it's probably not worth bothering.



More information about the Gcc-bugs mailing list