>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: