This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c/12654] [3.3/3.4 regression] Incorrect comparison code generated for Alpha
- From: "falk at debian dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 17 Oct 2003 08:52:06 -0000
- Subject: [Bug c/12654] [3.3/3.4 regression] Incorrect comparison code generated for Alpha
- References: <20031017020801.12654.tg at swox dot com>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
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
falk at debian dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
Severity|normal |critical
Status|UNCONFIRMED |NEW
Ever Confirmed| |1
Keywords| |wrong-code
Summary|Incorrect comparison code |[3.3/3.4 regression]
|generated for Alpha |Incorrect comparison code
| |generated for Alpha
------- Additional Comments From falk at debian dot org 2003-10-17 08:52 -------
This boils down to
foo(MIN_LONG)
(the posted test case is technically invalid).
It is caused by gcc generating
lda v0,-1023(a0)
cmplt zero,v0,v0
instead of
lda v0,1024
cmple v0,a0,v0
Happens only in some contexts, e.g. for
int foo (long x) { if (x >= 1024) return 1; else return 0; }
but not for
int bar (long x) { return x >= 1024; }
gcc 2.95 got it right, 3.2 not. Probably target dependent, but I don't have
anything else to test currently.
The bogus variant is actually slightly better WRT register pressure, so we
might want to retain it for int arguments.