optimization/8525: cmov instruction used with i686

gcc@elektrono.com gcc@elektrono.com
Sun Nov 10 22:56:00 GMT 2002

>Number:         8525
>Category:       optimization
>Synopsis:       cmov instruction used with i686
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    unassigned
>State:          open
>Class:          change-request
>Submitter-Id:   net
>Arrival-Date:   Sun Nov 10 22:56:00 PST 2002
>Originator:     gcc@elektrono.com
>Release:        2.95.4
Debian GNU/Linux 3.0
Linux 2.4.19
Via C3 Processor
When gcc compiles code for i686's it utilizes the cmov instruction, which is not part of the required i686 instruction set according to intel's specification.  This causes headaches because a dynamic linker will try to use i686 optimized binaries with the i686 processor and they will generate "Illegal Instruction" errors.

Either the code detecting the processor in the dynamic linker needs to be hacked to report i686 processors without the cmov instruction as i586's or gcc needs to not use the cmov instruction when asked to produce i686 binaries.
In all seriousness, does the gcc group feel that the cpu detection code should follow gcc's broken implementation?

>From my perspective this is a big problem. I see it pop up in bugs, mailing list, and USENET posts far too often.  People are discouraged from combining Linux and Via C3 Processors. This bug also recently broke SSH on my server (See Debian Bug #164766).

This problem will only get worse as more i686-optimized binaries are produced.  There is no easy way to just use '-march=i586' when using a binary distribution like Debian or a commercial product with no source available.

I hope I didn't come off too demanding in this bug report. I really appreciate all the work you guys put into gcc.  It just seems this is only a case of purposely not following the specification that's breaking things and that is one of the worst kind of bugs.  I strongly believe in spec. compliance, because without it interoperability is twice as hard.  So please make the many C3-owner/Linux-users lives easier and at least by default don't use cmov.

When compiling code with -march=i686 do not use the cmov instruction by default.  The use of cmov could be requested with -fcmov or something similar.

More information about the Gcc-bugs mailing list