public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug target/67310] New: [PATCH] gcc 4.8.4 fails to compile with -march=native on VIA nano CPU
@ 2015-08-21 16:40 jol_indien at yahoo dot fr
2015-08-22 7:20 ` [Bug target/67310] " jol_indien at yahoo dot fr
` (5 more replies)
0 siblings, 6 replies; 7+ messages in thread
From: jol_indien at yahoo dot fr @ 2015-08-21 16:40 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67310
Bug ID: 67310
Summary: [PATCH] gcc 4.8.4 fails to compile with -march=native
on VIA nano CPU
Product: gcc
Version: 4.8.4
Status: UNCONFIRMED
Severity: enhancement
Priority: P3
Component: target
Assignee: unassigned at gcc dot gnu.org
Reporter: jol_indien at yahoo dot fr
Target Milestone: ---
Created attachment 36234
--> https://gcc.gnu.org/bugzilla/attachment.cgi?id=36234&action=edit
patch to properly detect VIA nano CPU
GCC 4.8.4 detects VIA nano CPU as a "core2" one and thus fails to compile any
executable when called with "-march=native":
echo 'int main(){return 0;}' > test.c && gcc -march=native -O2 test.c -o
test && rm test.c test
test.c:1:0: error: CPU you selected does not support x86-64 instruction set
int main(){return 0;}
^
The attached patch properly detects the VIA nano CPU and sets up the proper
compile flags, ie:
-march=x86-64 -mcx16 -msahf -mno-movbe -mno-aes
-mno-pclmul -mno-popcnt -mno-abm -mno-lwp -mno-fma -mno-fma4 -mno-xop
-mno-bmi -mno-bmi2 -mno-tbm -mno-avx -mno-avx2 -msse3 -mssse3 -mno-sse4.2
-mno-sse4.1 -mno-lzcnt -mno-rtm -mno-hle -mno-rdrnd -mno-f16c
-mno-fsgsbase -mno-rdseed -mno-prfchw -mno-adx -mfxsr -mno-xsave
-mno-xsaveopt --param l1-cache-size=64 --param l1-cache-line-size=64
--param l2-cache-size=1024 -mtune=generic
which enables: -mcx16 -mfxsr -mmmx -msahf -msse -msse2 -msse3 -mssse3
Of course, this does not give a full support of this CPU family but allows to
compile properly for it.
Tested with:
vendor_id : CentaurHauls
cpu family : 6
model : 15
model name : VIA Nano processor U2250 (1.6GHz Capable)
stepping : 3
Please consider to apply this patch.
^ permalink raw reply [flat|nested] 7+ messages in thread
* [Bug target/67310] [PATCH] gcc 4.8.4 fails to compile with -march=native on VIA nano CPU
2015-08-21 16:40 [Bug target/67310] New: [PATCH] gcc 4.8.4 fails to compile with -march=native on VIA nano CPU jol_indien at yahoo dot fr
@ 2015-08-22 7:20 ` jol_indien at yahoo dot fr
2015-08-22 7:22 ` jol_indien at yahoo dot fr
` (4 subsequent siblings)
5 siblings, 0 replies; 7+ messages in thread
From: jol_indien at yahoo dot fr @ 2015-08-22 7:20 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67310
jol_indien at yahoo dot fr changed:
What |Removed |Added
----------------------------------------------------------------------------
Attachment #36234|0 |1
is obsolete| |
--- Comment #1 from jol_indien at yahoo dot fr ---
Created attachment 36239
--> https://gcc.gnu.org/bugzilla/attachment.cgi?id=36239&action=edit
Minimal patch to properly compile on VIA nano CPU with "-march=native"
^ permalink raw reply [flat|nested] 7+ messages in thread
* [Bug target/67310] [PATCH] gcc 4.8.4 fails to compile with -march=native on VIA nano CPU
2015-08-21 16:40 [Bug target/67310] New: [PATCH] gcc 4.8.4 fails to compile with -march=native on VIA nano CPU jol_indien at yahoo dot fr
2015-08-22 7:20 ` [Bug target/67310] " jol_indien at yahoo dot fr
@ 2015-08-22 7:22 ` jol_indien at yahoo dot fr
2015-08-23 7:09 ` jol_indien at yahoo dot fr
` (3 subsequent siblings)
5 siblings, 0 replies; 7+ messages in thread
From: jol_indien at yahoo dot fr @ 2015-08-22 7:22 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67310
--- Comment #2 from jol_indien at yahoo dot fr ---
This new version of the patch is:
* an optimisation, avoiding modifying code that does not need to be
* a bugfix, fixing "nocona" architecture detection
Please consider applying in recent gcc versions.
^ permalink raw reply [flat|nested] 7+ messages in thread
* [Bug target/67310] [PATCH] gcc 4.8.4 fails to compile with -march=native on VIA nano CPU
2015-08-21 16:40 [Bug target/67310] New: [PATCH] gcc 4.8.4 fails to compile with -march=native on VIA nano CPU jol_indien at yahoo dot fr
2015-08-22 7:20 ` [Bug target/67310] " jol_indien at yahoo dot fr
2015-08-22 7:22 ` jol_indien at yahoo dot fr
@ 2015-08-23 7:09 ` jol_indien at yahoo dot fr
2015-08-23 7:10 ` jol_indien at yahoo dot fr
` (2 subsequent siblings)
5 siblings, 0 replies; 7+ messages in thread
From: jol_indien at yahoo dot fr @ 2015-08-23 7:09 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67310
--- Comment #3 from jol_indien at yahoo dot fr ---
Here are two new patches, one for gcc 4.8.x versions (tested with 4.8.4 &
4.8.5), one for 4.9+ versions (tested with 4.9.3).
This patch is safer, support of VIA Nano based on CPU vendor name instead of
"has_longmode" in the previous one.
The 4.9+ patch also applies for gcc 5.x; unfortunately, for any reason, I
cannot get the "host_detect_local_cpu" function being called with gcc 5.2 as if
-march=native, -mcpu=native and -mtune=native options were ignored by the
compiler.
^ permalink raw reply [flat|nested] 7+ messages in thread
* [Bug target/67310] [PATCH] gcc 4.8.4 fails to compile with -march=native on VIA nano CPU
2015-08-21 16:40 [Bug target/67310] New: [PATCH] gcc 4.8.4 fails to compile with -march=native on VIA nano CPU jol_indien at yahoo dot fr
` (2 preceding siblings ...)
2015-08-23 7:09 ` jol_indien at yahoo dot fr
@ 2015-08-23 7:10 ` jol_indien at yahoo dot fr
2015-08-23 7:11 ` jol_indien at yahoo dot fr
2015-08-26 16:55 ` vapier at gentoo dot org
5 siblings, 0 replies; 7+ messages in thread
From: jol_indien at yahoo dot fr @ 2015-08-23 7:10 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67310
jol_indien at yahoo dot fr changed:
What |Removed |Added
----------------------------------------------------------------------------
Attachment #36239|0 |1
is obsolete| |
--- Comment #4 from jol_indien at yahoo dot fr ---
Created attachment 36244
--> https://gcc.gnu.org/bugzilla/attachment.cgi?id=36244&action=edit
patch to properly detect VIA nano CPU for gcc 4.8.x versions
^ permalink raw reply [flat|nested] 7+ messages in thread
* [Bug target/67310] [PATCH] gcc 4.8.4 fails to compile with -march=native on VIA nano CPU
2015-08-21 16:40 [Bug target/67310] New: [PATCH] gcc 4.8.4 fails to compile with -march=native on VIA nano CPU jol_indien at yahoo dot fr
` (3 preceding siblings ...)
2015-08-23 7:10 ` jol_indien at yahoo dot fr
@ 2015-08-23 7:11 ` jol_indien at yahoo dot fr
2015-08-26 16:55 ` vapier at gentoo dot org
5 siblings, 0 replies; 7+ messages in thread
From: jol_indien at yahoo dot fr @ 2015-08-23 7:11 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67310
--- Comment #5 from jol_indien at yahoo dot fr ---
Created attachment 36245
--> https://gcc.gnu.org/bugzilla/attachment.cgi?id=36245&action=edit
patch to properly detect VIA nano CPU for gcc 4.9+ versions
^ permalink raw reply [flat|nested] 7+ messages in thread
* [Bug target/67310] [PATCH] gcc 4.8.4 fails to compile with -march=native on VIA nano CPU
2015-08-21 16:40 [Bug target/67310] New: [PATCH] gcc 4.8.4 fails to compile with -march=native on VIA nano CPU jol_indien at yahoo dot fr
` (4 preceding siblings ...)
2015-08-23 7:11 ` jol_indien at yahoo dot fr
@ 2015-08-26 16:55 ` vapier at gentoo dot org
5 siblings, 0 replies; 7+ messages in thread
From: vapier at gentoo dot org @ 2015-08-26 16:55 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67310
--- Comment #6 from Mike Frysinger <vapier at gentoo dot org> ---
normally the gcc devs want patches posted to the gcc-patches@gcc.gnu.org
mailing list. they don't review/comment on patches in bugs.
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2015-08-26 16:55 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-08-21 16:40 [Bug target/67310] New: [PATCH] gcc 4.8.4 fails to compile with -march=native on VIA nano CPU jol_indien at yahoo dot fr
2015-08-22 7:20 ` [Bug target/67310] " jol_indien at yahoo dot fr
2015-08-22 7:22 ` jol_indien at yahoo dot fr
2015-08-23 7:09 ` jol_indien at yahoo dot fr
2015-08-23 7:10 ` jol_indien at yahoo dot fr
2015-08-23 7:11 ` jol_indien at yahoo dot fr
2015-08-26 16:55 ` vapier at gentoo dot org
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).