From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 29371 invoked by alias); 16 Oct 2002 17:16:03 -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 29311 invoked by uid 71); 16 Oct 2002 17:16:02 -0000 Resent-Date: 16 Oct 2002 17:16:02 -0000 Resent-Message-ID: <20021016171602.29310.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 Resent-Reply-To: gcc-gnats@gcc.gnu.org, forsmark@odense.kollegienet.dk Received: (qmail 27519 invoked by uid 61); 16 Oct 2002 17:11:12 -0000 Message-Id: <20021016171112.27518.qmail@sources.redhat.com> Date: Wed, 16 Oct 2002 10:16:00 -0000 From: forsmark@odense.kollegienet.dk Reply-To: forsmark@odense.kollegienet.dk To: gcc-gnats@gcc.gnu.org X-Send-Pr-Version: gnatsweb-2.9.3 (1.1.1.1.2.31) Subject: target/8243: GCC 3.2 does not check for CMOV instruction before generating code X-SW-Source: 2002-10/txt/msg00613.txt.bz2 List-Id: >Number: 8243 >Category: target >Synopsis: GCC 3.2 does not check for CMOV instruction before generating code >Confidential: no >Severity: serious >Priority: medium >Responsible: unassigned >State: open >Class: wrong-code >Submitter-Id: net >Arrival-Date: Wed Oct 16 10:16:02 PDT 2002 >Closed-Date: >Last-Modified: >Originator: forsmark@odense.kollegienet.dk >Release: GCC 3.2 (and all earlier versions) >Organization: >Environment: Linux kernel 2.4.19 VIA C3 processor GCC Version 3.2 >Description: When compiling any C code with GCC 3.2 (and all other versions) Configure finds out that the VIA C3 processor is a i686 processor. That’s ok, but the VIA C3 processor doesn’t have the CMOV instruction. When GCC generates code for the i686 processor it includes the use of the CMOV instruction and therefore the code will result in an "illegal instruction" error when executed on a VIA C3 processor. The VIA C3 is indeed a 'model 6' processor. The Pentium Pro manual states that this cmov (conditional move) instruction is optional and you are supposed to check for its present before using it. This means that GCC should check for this before generation code including this instruction. If CMOV is not present, the code should be generated without using this instruction. >How-To-Repeat: Use GCC to compile any program (ex XFREE 4.2) on a Linux PC with compiler option "-march=i686 -mcpu=i686". Then run the compiled program an see the "illegal instruction" error. >Fix: Use GCC with "-march=i586 -mcpu=i586" but then the code is not optimal for the processor. >Release-Note: >Audit-Trail: >Unformatted: