public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c/49128] New: gcc -mtune=native generates unsoported instructions
@ 2011-05-23 16:47 nathanael.schaeffer+ml at gmail dot com
  2011-05-23 17:32 ` [Bug c/49128] gcc -mtune=native generates unsuported instructions redi at gcc dot gnu.org
                   ` (11 more replies)
  0 siblings, 12 replies; 13+ messages in thread
From: nathanael.schaeffer+ml at gmail dot com @ 2011-05-23 16:47 UTC (permalink / raw)
  To: gcc-bugs

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

           Summary: gcc -mtune=native generates unsoported instructions
           Product: gcc
           Version: 4.6.0
            Status: UNCONFIRMED
          Severity: critical
          Priority: P3
         Component: c
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: nathanael.schaeffer+ml@gmail.com


With gcc (GCC) 4.6.0 20110513 (prerelease)
I compile on my laptop : 
----
Intel(R) Pentium(R) CPU        U5400  @ 1.20GHz
flags           : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov
pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm 
pbe syscall nx rdtscp lm constant_tsc arch_perfmon pebs bts rep_good nopl
xtopology nonstop_tsc aperfmperf pni dtes64 monitor ds_cpl e
st tm2 ssse3 cx16 xtpr pdcm popcnt lahf_lm arat dts
----

then "gcc -mtune=native" generates unsuported instructions like PINSRD (which
is part of SSE4.1 according to wikipedia, not supported by this CPU)
I guess -mtune=native uncorrectly detects this CPU in version 4.6.0
Version 4.5.x did work correctly.

WORKAROUND: use -mtune=core2


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

* [Bug c/49128] gcc -mtune=native generates unsuported instructions
  2011-05-23 16:47 [Bug c/49128] New: gcc -mtune=native generates unsoported instructions nathanael.schaeffer+ml at gmail dot com
@ 2011-05-23 17:32 ` redi at gcc dot gnu.org
  2011-05-23 18:55 ` [Bug c/49128] -mtune=native generates unsupported instructions hjl.tools at gmail dot com
                   ` (10 subsequent siblings)
  11 siblings, 0 replies; 13+ messages in thread
From: redi at gcc dot gnu.org @ 2011-05-23 17:32 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #1 from Jonathan Wakely <redi at gcc dot gnu.org> 2011-05-23 16:53:00 UTC ---
you haven't provided the necessary information requested at
http://gcc.gnu.org/bugs/

Specifically you need to say how your gcc was configured (because -mtune should
not affect the instructions gcc thinks are supported, that's set by -march) and
provide your full compilation command and example code which reproduces the
problem


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

* [Bug c/49128] -mtune=native generates unsupported instructions
  2011-05-23 16:47 [Bug c/49128] New: gcc -mtune=native generates unsoported instructions nathanael.schaeffer+ml at gmail dot com
  2011-05-23 17:32 ` [Bug c/49128] gcc -mtune=native generates unsuported instructions redi at gcc dot gnu.org
@ 2011-05-23 18:55 ` hjl.tools at gmail dot com
  2011-05-23 21:08 ` nathanael.schaeffer+ml at gmail dot com
                   ` (9 subsequent siblings)
  11 siblings, 0 replies; 13+ messages in thread
From: hjl.tools at gmail dot com @ 2011-05-23 18:55 UTC (permalink / raw)
  To: gcc-bugs

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

H.J. Lu <hjl.tools at gmail dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                URL|                            |http://gcc.gnu.org/ml/gcc-p
                   |                            |atches/2011-05/msg01664.htm
                   |                            |l

--- Comment #2 from H.J. Lu <hjl.tools at gmail dot com> 2011-05-23 18:11:35 UTC ---
A patch is posted at

http://gcc.gnu.org/ml/gcc-patches/2011-05/msg01664.html


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

* [Bug c/49128] -mtune=native generates unsupported instructions
  2011-05-23 16:47 [Bug c/49128] New: gcc -mtune=native generates unsoported instructions nathanael.schaeffer+ml at gmail dot com
  2011-05-23 17:32 ` [Bug c/49128] gcc -mtune=native generates unsuported instructions redi at gcc dot gnu.org
  2011-05-23 18:55 ` [Bug c/49128] -mtune=native generates unsupported instructions hjl.tools at gmail dot com
@ 2011-05-23 21:08 ` nathanael.schaeffer+ml at gmail dot com
  2011-05-23 21:11 ` nathanael.schaeffer+ml at gmail dot com
                   ` (8 subsequent siblings)
  11 siblings, 0 replies; 13+ messages in thread
From: nathanael.schaeffer+ml at gmail dot com @ 2011-05-23 21:08 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #3 from natchouf <nathanael.schaeffer+ml at gmail dot com> 2011-05-23 20:32:14 UTC ---
Oups, I'm sorry. -mtune should be replaced by -march everywhere in my report...

Thanks for the patch.


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

* [Bug c/49128] -mtune=native generates unsupported instructions
  2011-05-23 16:47 [Bug c/49128] New: gcc -mtune=native generates unsoported instructions nathanael.schaeffer+ml at gmail dot com
                   ` (2 preceding siblings ...)
  2011-05-23 21:08 ` nathanael.schaeffer+ml at gmail dot com
@ 2011-05-23 21:11 ` nathanael.schaeffer+ml at gmail dot com
  2011-05-24 17:59 ` [Bug c/49128] -march=native " hjl at gcc dot gnu.org
                   ` (7 subsequent siblings)
  11 siblings, 0 replies; 13+ messages in thread
From: nathanael.schaeffer+ml at gmail dot com @ 2011-05-23 21:11 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #4 from natchouf <nathanael.schaeffer+ml at gmail dot com> 2011-05-23 20:36:15 UTC ---
(In reply to comment #2)
> A patch is posted at
> 
> http://gcc.gnu.org/ml/gcc-patches/2011-05/msg01664.html

in the patch you linked to, I think there is a mistake in these lines :

+      const char *sse4_2 = has_sse4_2 ? " -msse4.2" : " -msse4.2";
+      const char *sse4_1 = has_sse4_1 ? " -msse4.1" : " -msse4.1";


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

* [Bug c/49128] -march=native generates unsupported instructions
  2011-05-23 16:47 [Bug c/49128] New: gcc -mtune=native generates unsoported instructions nathanael.schaeffer+ml at gmail dot com
                   ` (3 preceding siblings ...)
  2011-05-23 21:11 ` nathanael.schaeffer+ml at gmail dot com
@ 2011-05-24 17:59 ` hjl at gcc dot gnu.org
  2011-05-24 18:11 ` hjl at gcc dot gnu.org
                   ` (6 subsequent siblings)
  11 siblings, 0 replies; 13+ messages in thread
From: hjl at gcc dot gnu.org @ 2011-05-24 17:59 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #5 from hjl at gcc dot gnu.org <hjl at gcc dot gnu.org> 2011-05-24 17:38:38 UTC ---
Author: hjl
Date: Tue May 24 17:38:34 2011
New Revision: 174126

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=174126
Log:
Always add -mno-XXX for -march=native.

2011-05-24  H.J. Lu  <hongjiu.lu@intel.com>

    PR target/49128
    * config/i386/driver-i386.c (host_detect_local_cpu): Always
    add -mno-XXX.  Handle FMA.

Modified:
    trunk/gcc/ChangeLog
    trunk/gcc/config/i386/driver-i386.c


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

* [Bug c/49128] -march=native generates unsupported instructions
  2011-05-23 16:47 [Bug c/49128] New: gcc -mtune=native generates unsoported instructions nathanael.schaeffer+ml at gmail dot com
                   ` (4 preceding siblings ...)
  2011-05-24 17:59 ` [Bug c/49128] -march=native " hjl at gcc dot gnu.org
@ 2011-05-24 18:11 ` hjl at gcc dot gnu.org
  2011-05-24 18:16 ` hjl.tools at gmail dot com
                   ` (5 subsequent siblings)
  11 siblings, 0 replies; 13+ messages in thread
From: hjl at gcc dot gnu.org @ 2011-05-24 18:11 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #6 from hjl at gcc dot gnu.org <hjl at gcc dot gnu.org> 2011-05-24 17:41:54 UTC ---
Author: hjl
Date: Tue May 24 17:41:51 2011
New Revision: 174127

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=174127
Log:
Always add -mno-XXX for -march=native.

2011-05-24  H.J. Lu  <hongjiu.lu@intel.com>

    Backport from mainline
    2011-05-24  H.J. Lu  <hongjiu.lu@intel.com>

    PR target/49128
    * config/i386/driver-i386.c (host_detect_local_cpu): Always
    add -mno-XXX.  Handle FMA.

Modified:
    branches/gcc-4_6-branch/gcc/ChangeLog
    branches/gcc-4_6-branch/gcc/config/i386/driver-i386.c


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

* [Bug c/49128] -march=native generates unsupported instructions
  2011-05-23 16:47 [Bug c/49128] New: gcc -mtune=native generates unsoported instructions nathanael.schaeffer+ml at gmail dot com
                   ` (5 preceding siblings ...)
  2011-05-24 18:11 ` hjl at gcc dot gnu.org
@ 2011-05-24 18:16 ` hjl.tools at gmail dot com
  2011-05-25  6:53 ` Joost.VandeVondele at pci dot uzh.ch
                   ` (4 subsequent siblings)
  11 siblings, 0 replies; 13+ messages in thread
From: hjl.tools at gmail dot com @ 2011-05-24 18:16 UTC (permalink / raw)
  To: gcc-bugs

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

H.J. Lu <hjl.tools at gmail dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |RESOLVED
                 CC|                            |hjl.tools at gmail dot com
         Resolution|                            |FIXED
   Target Milestone|---                         |4.6.1

--- Comment #7 from H.J. Lu <hjl.tools at gmail dot com> 2011-05-24 17:55:21 UTC ---
Fixed.


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

* [Bug c/49128] -march=native generates unsupported instructions
  2011-05-23 16:47 [Bug c/49128] New: gcc -mtune=native generates unsoported instructions nathanael.schaeffer+ml at gmail dot com
                   ` (6 preceding siblings ...)
  2011-05-24 18:16 ` hjl.tools at gmail dot com
@ 2011-05-25  6:53 ` Joost.VandeVondele at pci dot uzh.ch
  2011-05-25  7:33 ` jakub at gcc dot gnu.org
                   ` (3 subsequent siblings)
  11 siblings, 0 replies; 13+ messages in thread
From: Joost.VandeVondele at pci dot uzh.ch @ 2011-05-25  6:53 UTC (permalink / raw)
  To: gcc-bugs

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

Joost VandeVondele <Joost.VandeVondele at pci dot uzh.ch> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|RESOLVED                    |REOPENED
   Last reconfirmed|                            |2011.05.25 06:23:13
         Resolution|FIXED                       |
     Ever Confirmed|0                           |1

--- Comment #8 from Joost VandeVondele <Joost.VandeVondele at pci dot uzh.ch> 2011-05-25 06:23:13 UTC ---
This patch causes for me:

> gfortran-trunk -march=native test.f90
f951: error: unrecognized command line option ‘-mno-msse4.2’

in full:

> gfortran-trunk -v -march=native test.f90
Driving: gfortran-trunk -v -march=native test.f90 -l gfortran -l m
-shared-libgcc
Using built-in specs.
COLLECT_GCC=gfortran-trunk
COLLECT_LTO_WRAPPER=/data/vondele/gcc_bench/gcc_trunk/build/libexec/gcc/x86_64-unknown-linux-gnu/4.7.0/lto-wrapper
Target: x86_64-unknown-linux-gnu
Configured with: /data/vondele/gcc_bench/gcc_trunk/gcc/configure
--prefix=/data/vondele/gcc_bench/gcc_trunk/build
--enable-languages=c,c++,fortran --program-suffix=-trunk --disable-multilib
--disable-bootstrap --with-gmp=/data/vondele/gcc_bench/libs/
--with-mpfr=/data/vondele/gcc_bench/libs/
--with-mpc=/data/vondele/gcc_bench/libs/
Thread model: posix
gcc version 4.7.0 20110524 (experimental) (GCC)
COLLECT_GCC_OPTIONS='-v' '-march=native' '-shared-libgcc'

/data/vondele/gcc_bench/gcc_trunk/build/libexec/gcc/x86_64-unknown-linux-gnu/4.7.0/f951
test.f90 -march=core2 -mcx16 -msahf -mno-movbe -mno-aes -mno-pclmul -mno-popcnt
-mno-abm -mno-lwp -mno-fma -mno-fma4 -mno-xop -mno-bmi -mno-tbm -mno-avx
-mno-msse4.2 -mno-sse4.1 --param l1-cache-size=32 --param l1-cache-line-size=64
--param l2-cache-size=4096 -mtune=core2 -quiet -dumpbase test.f90 -auxbase test
-version -fintrinsic-modules-path
/data/vondele/gcc_bench/gcc_trunk/build/lib/gcc/x86_64-unknown-linux-gnu/4.7.0/finclude
-o /dev/shm/vondele/ccQUXDFx.s
f951: error: unrecognized command line option ‘-mno-msse4.2’


/proc/cpuinfo has:

flags           : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov
pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe syscall nx lm
constant_tsc arch_perfmon pebs bts rep_good nopl pni monitor ds_cpl vmx est tm2
ssse3 cx16 xtpr lahf_lm
vendor_id       : GenuineIntel
cpu family      : 6
model           : 15
model name      : Intel(R) Core(TM)2 CPU          6600  @ 2.40GHz
stepping        : 6


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

* [Bug c/49128] -march=native generates unsupported instructions
  2011-05-23 16:47 [Bug c/49128] New: gcc -mtune=native generates unsoported instructions nathanael.schaeffer+ml at gmail dot com
                   ` (7 preceding siblings ...)
  2011-05-25  6:53 ` Joost.VandeVondele at pci dot uzh.ch
@ 2011-05-25  7:33 ` jakub at gcc dot gnu.org
  2011-05-25 11:57 ` Joost.VandeVondele at pci dot uzh.ch
                   ` (2 subsequent siblings)
  11 siblings, 0 replies; 13+ messages in thread
From: jakub at gcc dot gnu.org @ 2011-05-25  7:33 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #9 from Jakub Jelinek <jakub at gcc dot gnu.org> 2011-05-25 07:12:21 UTC ---
Author: jakub
Date: Wed May 25 07:12:17 2011
New Revision: 174171

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=174171
Log:
    PR target/49128
    * config/i386/driver-i386.c (host_detect_local_cpu): Fix a typo.

Modified:
    trunk/gcc/ChangeLog
    trunk/gcc/config/i386/driver-i386.c


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

* [Bug c/49128] -march=native generates unsupported instructions
  2011-05-23 16:47 [Bug c/49128] New: gcc -mtune=native generates unsoported instructions nathanael.schaeffer+ml at gmail dot com
                   ` (8 preceding siblings ...)
  2011-05-25  7:33 ` jakub at gcc dot gnu.org
@ 2011-05-25 11:57 ` Joost.VandeVondele at pci dot uzh.ch
  2011-05-25 12:44 ` jakub at gcc dot gnu.org
  2011-05-25 13:31 ` Joost.VandeVondele at pci dot uzh.ch
  11 siblings, 0 replies; 13+ messages in thread
From: Joost.VandeVondele at pci dot uzh.ch @ 2011-05-25 11:57 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #10 from Joost VandeVondele <Joost.VandeVondele at pci dot uzh.ch> 2011-05-25 11:34:48 UTC ---
(In reply to comment #9)
> Author: jakub
> Date: Wed May 25 07:12:17 2011
> New Revision: 174171
> 
> URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=174171
> Log:
>     PR target/49128
>     * config/i386/driver-i386.c (host_detect_local_cpu): Fix a typo.
> 
> Modified:
>     trunk/gcc/ChangeLog
>     trunk/gcc/config/i386/driver-i386.c

FYI, the same bug made it to the 4.6 branch.


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

* [Bug c/49128] -march=native generates unsupported instructions
  2011-05-23 16:47 [Bug c/49128] New: gcc -mtune=native generates unsoported instructions nathanael.schaeffer+ml at gmail dot com
                   ` (9 preceding siblings ...)
  2011-05-25 11:57 ` Joost.VandeVondele at pci dot uzh.ch
@ 2011-05-25 12:44 ` jakub at gcc dot gnu.org
  2011-05-25 13:31 ` Joost.VandeVondele at pci dot uzh.ch
  11 siblings, 0 replies; 13+ messages in thread
From: jakub at gcc dot gnu.org @ 2011-05-25 12:44 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #11 from Jakub Jelinek <jakub at gcc dot gnu.org> 2011-05-25 11:54:01 UTC ---
Author: jakub
Date: Wed May 25 11:53:58 2011
New Revision: 174184

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=174184
Log:
    PR target/49128
    * config/i386/driver-i386.c (host_detect_local_cpu): Fix a typo.

Modified:
    branches/gcc-4_6-branch/gcc/ChangeLog
    branches/gcc-4_6-branch/gcc/config/i386/driver-i386.c


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

* [Bug c/49128] -march=native generates unsupported instructions
  2011-05-23 16:47 [Bug c/49128] New: gcc -mtune=native generates unsoported instructions nathanael.schaeffer+ml at gmail dot com
                   ` (10 preceding siblings ...)
  2011-05-25 12:44 ` jakub at gcc dot gnu.org
@ 2011-05-25 13:31 ` Joost.VandeVondele at pci dot uzh.ch
  11 siblings, 0 replies; 13+ messages in thread
From: Joost.VandeVondele at pci dot uzh.ch @ 2011-05-25 13:31 UTC (permalink / raw)
  To: gcc-bugs

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

Joost VandeVondele <Joost.VandeVondele at pci dot uzh.ch> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|REOPENED                    |RESOLVED
         Resolution|                            |FIXED

--- Comment #12 from Joost VandeVondele <Joost.VandeVondele at pci dot uzh.ch> 2011-05-25 13:08:53 UTC ---
fixed


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

end of thread, other threads:[~2011-05-25 13:22 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-05-23 16:47 [Bug c/49128] New: gcc -mtune=native generates unsoported instructions nathanael.schaeffer+ml at gmail dot com
2011-05-23 17:32 ` [Bug c/49128] gcc -mtune=native generates unsuported instructions redi at gcc dot gnu.org
2011-05-23 18:55 ` [Bug c/49128] -mtune=native generates unsupported instructions hjl.tools at gmail dot com
2011-05-23 21:08 ` nathanael.schaeffer+ml at gmail dot com
2011-05-23 21:11 ` nathanael.schaeffer+ml at gmail dot com
2011-05-24 17:59 ` [Bug c/49128] -march=native " hjl at gcc dot gnu.org
2011-05-24 18:11 ` hjl at gcc dot gnu.org
2011-05-24 18:16 ` hjl.tools at gmail dot com
2011-05-25  6:53 ` Joost.VandeVondele at pci dot uzh.ch
2011-05-25  7:33 ` jakub at gcc dot gnu.org
2011-05-25 11:57 ` Joost.VandeVondele at pci dot uzh.ch
2011-05-25 12:44 ` jakub at gcc dot gnu.org
2011-05-25 13:31 ` Joost.VandeVondele at pci dot uzh.ch

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).