This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug other/26176] New: -mtune=i686 builds code including CMOV


I use a VIA Samuel 2 processor, which is a i686, but does not have the cmov
capability. Therefore i used -march=i586 -mtune=i686 on my machine, because i
thought mtune would tune for that architecture but leaves it compatibile to
lower archs. 

But  objdump -d /usr/lib/modules/libfb.so | grep cmov shows this:
   16cb7:       0f 4c e8                cmovl  %eax,%ebp
   16cc0:       0f 4f f0                cmovg  %eax,%esi
   16ccb:       0f 4d 44 24 10          cmovge 0x10(%esp),%eax
   16ce2:       0f 4f f8                cmovg  %eax,%edi
   16eb5:       0f 45 83 e4 fd ff ff    cmovne 0xfffffde4(%ebx),%eax
   179ba:       0f 4c 74 24 28          cmovl  0x28(%esp),%esi
   179c3:       0f 4f 54 24 30          cmovg  0x30(%esp),%edx
   179d8:       0f 4c 4c 24 2c          cmovl  0x2c(%esp),%ecx
   179e1:       0f 4f 44 24 34          cmovg  0x34(%esp),%eax

So it is defenitly not downward compatible.
According to my information, this is a bug and leads to unusable binaries on my
system.

My /proc/cpuinfo:
processor       : 0
vendor_id       : CentaurHauls
cpu family      : 6
model           : 7
model name      : VIA Samuel 2
stepping        : 3
cpu MHz         : 599.899
cache size      : 64 KB
fdiv_bug        : no
hlt_bug         : no
f00f_bug        : no
coma_bug        : no
fpu             : yes
fpu_exception   : yes
cpuid level     : 1
wp              : yes
flags           : fpu de tsc msr cx8 mtrr pge mmx 3dnow
bogomips        : 1183.74

i686 works fine as long as it does not contain cmov operations.
I am using gentoo and this was part of the make.cong file which produced the
bug:
CFLAGS="-Os -march=i586 -mtune=i686 -mmmx -m3dnow -pipe -fomit-frame-pointer"
CHOST="i586-pc-linux-gnu"

This is my first bug here, so have merci ;) I wasn't sure which in which
component this belongs, so i filed it to other. 
Is it a problem to check the cpu flags, and if they don't contain cmov, then
cmov should not be used?


-- 
           Summary: -mtune=i686 builds code including CMOV
           Product: gcc
           Version: 3.4.5
            Status: UNCONFIRMED
          Severity: major
          Priority: P3
         Component: other
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: themgt at mail dot ru


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=26176


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]