From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 26588 invoked by alias); 17 Oct 2003 08:52:07 -0000 Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org Received: (qmail 26581 invoked by uid 48); 17 Oct 2003 08:52:06 -0000 Date: Fri, 17 Oct 2003 09:52:00 -0000 Message-ID: <20031017085206.26580.qmail@sources.redhat.com> From: "falk at debian dot org" To: gcc-bugs@gcc.gnu.org In-Reply-To: <20031017020801.12654.tg@swox.com> References: <20031017020801.12654.tg@swox.com> Reply-To: gcc-bugzilla@gcc.gnu.org Subject: [Bug c/12654] [3.3/3.4 regression] Incorrect comparison code generated for Alpha X-Bugzilla-Reason: CC X-SW-Source: 2003-10/txt/msg01308.txt.bz2 List-Id: 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.