From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 30862 invoked by alias); 13 Oct 2002 19:46:02 -0000 Mailing-List: contact gcc-prs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Archive: List-Post: List-Help: Sender: gcc-prs-owner@gcc.gnu.org Received: (qmail 30841 invoked by uid 71); 13 Oct 2002 19:46:01 -0000 Resent-Date: 13 Oct 2002 19:46:01 -0000 Resent-Message-ID: <20021013194601.30840.qmail@sources.redhat.com> Resent-From: gcc-gnats@gcc.gnu.org (GNATS Filer) Resent-Cc: gcc-prs@gcc.gnu.org, gcc-bugs@gcc.gnu.org, aj@suse.de, jh@suse.cz Resent-Reply-To: gcc-gnats@gcc.gnu.org, gbeauchesne@mandrakesoft.com Received: (qmail 30460 invoked by uid 61); 13 Oct 2002 19:43:17 -0000 Message-Id: <20021013194317.30459.qmail@sources.redhat.com> Date: Sun, 13 Oct 2002 12:46:00 -0000 From: gbeauchesne@mandrakesoft.com Reply-To: gbeauchesne@mandrakesoft.com To: gcc-gnats@gcc.gnu.org Cc: aj@suse.de, jh@suse.cz X-Send-Pr-Version: gnatsweb-2.9.3 (1.1.1.1.2.31) X-GNATS-Notify: aj@suse.de,jh@suse.cz Subject: target/8213: gmp 4.1 miscompilation on x86-64 X-SW-Source: 2002-10/txt/msg00530.txt.bz2 List-Id: >Number: 8213 >Category: target >Synopsis: gmp 4.1 miscompilation on x86-64 >Confidential: no >Severity: serious >Priority: medium >Responsible: unassigned >State: open >Class: wrong-code >Submitter-Id: net >Arrival-Date: Sun Oct 13 12:46:01 PDT 2002 >Closed-Date: >Last-Modified: >Originator: Gwenole Beauchesne >Release: GNU C version 3.3 20020916 (experimental) >Organization: >Environment: x86_64-mandrake-linux-gnu >Description: gcc-3.2 snapshots older than 2002-10-07 or earlier used to miscompile gmp 4.1 on x86-64. Reproduced with gcc3.3 2002-09-16, though it did not fully bootstrap (comparison failures in stage3) but that's not related. >How-To-Repeat: Compile the following testcase with -O2, extracted from /mpf/cmp_si.c: int f(long x, long y) { if ((x < 0) == (y < 0)) { if (x == 0) return -(y != 0); if (y == 0) return x != 0; } else { return x >= 0 ? 1 : -1; } } int main(void) { if (f(-1, 1) != -1) abort(); return 0; } >Fix: - Add -fno-cse-follow-jumps (Andreas' hint) or lower optimizations to -O1. - Note that s/long x/int x/ also workarounds the problem. Does someone know which patch fixed this problem? If so, would someone mind commit it to the regression testsuite? >Release-Note: >Audit-Trail: >Unformatted: