public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c/45483]  New: gcc-4.4.3: probably wrong optimization options chosen by "-march=native"
@ 2010-09-01 15:04 pacho at condmat1 dot ciencias dot uniovi dot es
  2010-09-01 15:40 ` [Bug c/45483] " hjl dot tools at gmail dot com
                   ` (6 more replies)
  0 siblings, 7 replies; 8+ messages in thread
From: pacho at condmat1 dot ciencias dot uniovi dot es @ 2010-09-01 15:04 UTC (permalink / raw)
  To: gcc-bugs

I checked what options are being chosen on one of my laptops following the
following instructions:
http://en.chys.info/2010/04/what-exactly-marchnative-means/

But,  when reviewing used options I got:

$ ps af | grep cc1
18118 pts/1    S+     0:00  \_ grep --colour=auto cc1
18116 pts/0    S+     0:00      \_ /usr/libexec/gcc/i686-pc-linux-gnu/4.4.3/cc1
-quiet - -D_FORTIFY_SOURCE=2 -march=prescott --param l1-cache-size=32 --param
l1-cache-line-size=64 --param l2-cache-size=2048 -mtune=generic -quiet
-dumpbase - -auxbase-strip /dev/null -o /tmp/ccLS5xw5.s
13580 tty3     S+     0:00          \_
/usr/libexec/gcc/i686-pc-linux-gnu/4.4.3/cc1 -quiet - -D_FORTIFY_SOURCE=2
-march=prescott --param l1-cache-size=32 --param l1-cache-line-size=64 --param
l2-cache-size=2048 -mtune=generic -quiet -dumpbase - -auxbase-strip /dev/null
-o /tmp/ccSnTxP2.s

My /proc/cpuinfo is the following:

$ cat /proc/cpuinfo 
processor       : 0
vendor_id       : GenuineIntel
cpu family      : 6
model           : 14
model name      : Genuine Intel(R) CPU           T2300  @ 1.66GHz
stepping        : 8
cpu MHz         : 996.000
cache size      : 2048 KB
physical id     : 0
siblings        : 2
core id         : 0
cpu cores       : 2
apicid          : 0
initial apicid  : 0
fdiv_bug        : no
hlt_bug         : no
f00f_bug        : no
coma_bug        : no
fpu             : yes
fpu_exception   : yes
cpuid level     : 10
wp              : yes
flags           : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov
clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe nx constant_tsc arch_perfmon
bts aperfmperf pni monitor vmx est tm2 xtpr pdcm
bogomips        : 3324.55
clflush size    : 64
cache_alignment : 64
address sizes   : 32 bits physical, 32 bits virtual
power management:

processor       : 1
vendor_id       : GenuineIntel
cpu family      : 6
model           : 14
model name      : Genuine Intel(R) CPU           T2300  @ 1.66GHz
stepping        : 8
cpu MHz         : 996.000
cache size      : 2048 KB
physical id     : 0
siblings        : 2
core id         : 1
cpu cores       : 2
apicid          : 1
initial apicid  : 1
fdiv_bug        : no
hlt_bug         : no
f00f_bug        : no
coma_bug        : no
fpu             : yes
fpu_exception   : yes
cpuid level     : 10
wp              : yes
flags           : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov
clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe nx constant_tsc arch_perfmon
bts aperfmperf pni monitor vmx est tm2 xtpr pdcm
bogomips        : 3324.56
clflush size    : 64
cache_alignment : 64
address sizes   : 32 bits physical, 32 bits virtual
power management:

And, then, I see two problems:
1. -mtune=generic is being passed instead of, for example, -mtune="specific
option"

As I can read in "man gcc", looks like code is really being compiled for a
generic set of CPUs instead of specific one:

           generic
               Produce code optimized for the most common IA32/AMD64/EM64T
processors.  If you know the CPU on which your code will run, then
               you should use the corresponding -mtune option instead of
-mtune=generic.  But, if you do not know exactly what CPU users of
               your application will have, then you should use this option.

               As new processors are deployed in the marketplace, the behavior
of this option will change.  Therefore, if you upgrade to a
               newer version of GCC, the code generated option will change to
reflect the processors that were most common when that version
               of GCC was released.

               There is no -march=generic option because -march indicates the
instruction set the compiler can use, and there is no generic
               instruction set applicable to all processors.  In contrast,
-mtune indicates the processor (or, in this case, collection of
               processors) for which the code is optimized.

2. -march=prescott 

I am unsure about my processor is really a prescott one, even supporting sse3
it's listed as a Pentium-M based processor in the following links:
http://en.wikipedia.org/wiki/List_of_Intel_microprocessors#Intel_Core
http://en.wikipedia.org/wiki/Yonah_(microprocessor)
http://en.wikipedia.org/wiki/List_of_Intel_Core_microprocessors#Core_Duo

Then, I would pass "-march=pentium-m -msse3" instead.

Thanks a lot for your help


-- 
           Summary: gcc-4.4.3: probably wrong optimization options chosen by
                    "-march=native"
           Product: gcc
           Version: 4.4.3
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: pacho at condmat1 dot ciencias dot uniovi dot es


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


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

end of thread, other threads:[~2010-09-06 15:09 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-09-01 15:04 [Bug c/45483] New: gcc-4.4.3: probably wrong optimization options chosen by "-march=native" pacho at condmat1 dot ciencias dot uniovi dot es
2010-09-01 15:40 ` [Bug c/45483] " hjl dot tools at gmail dot com
2010-09-01 15:51 ` pacho at condmat1 dot ciencias dot uniovi dot es
2010-09-01 15:56 ` [Bug target/45483] " hjl dot tools at gmail dot com
2010-09-01 16:06 ` pacho at condmat1 dot ciencias dot uniovi dot es
2010-09-01 16:37 ` hjl dot tools at gmail dot com
2010-09-06 10:45 ` pacho at condmat1 dot ciencias dot uniovi dot es
2010-09-06 15:09 ` hjl dot tools at gmail dot com

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