This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug target/67310] New: [PATCH] gcc 4.8.4 fails to compile with -march=native on VIA nano CPU
- From: "jol_indien at yahoo dot fr" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Fri, 21 Aug 2015 16:40:52 +0000
- Subject: [Bug target/67310] New: [PATCH] gcc 4.8.4 fails to compile with -march=native on VIA nano CPU
- Auto-submitted: auto-generated
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.