public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug other/26176]  New: -mtune=i686 builds code including CMOV
@ 2006-02-08 16:10 themgt at mail dot ru
  2006-02-08 16:16 ` [Bug other/26176] " rguenth at gcc dot gnu dot org
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: themgt at mail dot ru @ 2006-02-08 16:10 UTC (permalink / raw)
  To: gcc-bugs

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


^ permalink raw reply	[flat|nested] 6+ messages in thread

* [Bug other/26176] -mtune=i686 builds code including CMOV
  2006-02-08 16:10 [Bug other/26176] New: -mtune=i686 builds code including CMOV themgt at mail dot ru
@ 2006-02-08 16:16 ` rguenth at gcc dot gnu dot org
  2006-02-08 17:00 ` [Bug target/26176] " pinskia at gcc dot gnu dot org
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: rguenth at gcc dot gnu dot org @ 2006-02-08 16:16 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #1 from rguenth at gcc dot gnu dot org  2006-02-08 16:16 -------
Use -v on the compilation lines of affected files and see which -march is
really in effect, possibly filing a bug against Gentoo for them likely
defaulting to i686.


-- 


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


^ permalink raw reply	[flat|nested] 6+ messages in thread

* [Bug target/26176] -mtune=i686 builds code including CMOV
  2006-02-08 16:10 [Bug other/26176] New: -mtune=i686 builds code including CMOV themgt at mail dot ru
  2006-02-08 16:16 ` [Bug other/26176] " rguenth at gcc dot gnu dot org
@ 2006-02-08 17:00 ` pinskia at gcc dot gnu dot org
  2006-02-08 17:30 ` themgt at mail dot ru
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2006-02-08 17:00 UTC (permalink / raw)
  To: gcc-bugs



-- 

pinskia at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |WAITING


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


^ permalink raw reply	[flat|nested] 6+ messages in thread

* [Bug target/26176] -mtune=i686 builds code including CMOV
  2006-02-08 16:10 [Bug other/26176] New: -mtune=i686 builds code including CMOV themgt at mail dot ru
  2006-02-08 16:16 ` [Bug other/26176] " rguenth at gcc dot gnu dot org
  2006-02-08 17:00 ` [Bug target/26176] " pinskia at gcc dot gnu dot org
@ 2006-02-08 17:30 ` themgt at mail dot ru
  2006-02-09 10:06 ` rguenth at gcc dot gnu dot org
  2006-02-09 21:08 ` themgt at mail dot ru
  4 siblings, 0 replies; 6+ messages in thread
From: themgt at mail dot ru @ 2006-02-08 17:30 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #2 from themgt at mail dot ru  2006-02-08 17:29 -------
i586-pc-linux-gnu-gcc -c -Os -march=i586 -mtune=i686 -pipe -fomit-frame-pointer
-fno-strict-aliasing  -ansi -Wno-return-type -w    -I../..
-I../../exports/include   -Dlinux -D__i386__ -D_POSIX_C_SOURCE=199309L         
                   -D_POSIX_SOURCE -D_XOPEN_SOURCE               -D_BSD_SOURCE
-D_SVID_SOURCE                                 -D_LARGEFILE_SOURCE
-D_FILE_OFFSET_BITS=64                                  -D_GNU_SOURCE          
                 -DFUNCPROTO=15 -DNARROWPROTO   -DHASXDMAUTH   Wraphelp.c

What do you want to see? Something like this?
This is part of the output while emerging/compiling xorg.

"-Os -march=i586 -mtune=i686 -pipe -fomit-frame-pointer" is part of any compile
process, i can see that without the -v flag


-- 


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


^ permalink raw reply	[flat|nested] 6+ messages in thread

* [Bug target/26176] -mtune=i686 builds code including CMOV
  2006-02-08 16:10 [Bug other/26176] New: -mtune=i686 builds code including CMOV themgt at mail dot ru
                   ` (2 preceding siblings ...)
  2006-02-08 17:30 ` themgt at mail dot ru
@ 2006-02-09 10:06 ` rguenth at gcc dot gnu dot org
  2006-02-09 21:08 ` themgt at mail dot ru
  4 siblings, 0 replies; 6+ messages in thread
From: rguenth at gcc dot gnu dot org @ 2006-02-09 10:06 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #3 from rguenth at gcc dot gnu dot org  2006-02-09 10:06 -------
> and see which -march is really in effect
^^^! so please show output of '-v' added.  If that still doesn't show i686 or
up, please attach preprocessed source (-save-temps produces a Wraphelp.i for
you)


-- 


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


^ permalink raw reply	[flat|nested] 6+ messages in thread

* [Bug target/26176] -mtune=i686 builds code including CMOV
  2006-02-08 16:10 [Bug other/26176] New: -mtune=i686 builds code including CMOV themgt at mail dot ru
                   ` (3 preceding siblings ...)
  2006-02-09 10:06 ` rguenth at gcc dot gnu dot org
@ 2006-02-09 21:08 ` themgt at mail dot ru
  4 siblings, 0 replies; 6+ messages in thread
From: themgt at mail dot ru @ 2006-02-09 21:08 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #4 from themgt at mail dot ru  2006-02-09 21:08 -------
I have to excuse myself, this is not a gcc bug!

I found out, that the only cmov-"infected" binaries were those of xorg.
It is a problem of mmx/sse inlcudes in their files:
https://bugs.freedesktop.org/show_bug.cgi?id=5093

So it has nothing to do with an arch/mtune setting, but with inclusion of sse!
Sorry and thanks for your patience!


-- 

themgt at mail dot ru changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|WAITING                     |RESOLVED
         Resolution|                            |INVALID


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


^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2006-02-09 21:08 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-02-08 16:10 [Bug other/26176] New: -mtune=i686 builds code including CMOV themgt at mail dot ru
2006-02-08 16:16 ` [Bug other/26176] " rguenth at gcc dot gnu dot org
2006-02-08 17:00 ` [Bug target/26176] " pinskia at gcc dot gnu dot org
2006-02-08 17:30 ` themgt at mail dot ru
2006-02-09 10:06 ` rguenth at gcc dot gnu dot org
2006-02-09 21:08 ` themgt at mail dot ru

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).