This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
Re: illegal instruction (CPU mismatch)
- From: Jonathan Wakely <jwakely dot gcc at gmail dot com>
- To: Mahmood Naderan <nt_mahmood at yahoo dot com>
- Cc: Markus Trippelsdorf <markus at trippelsdorf dot de>, "noloader at gmail dot com" <noloader at gmail dot com>, "gcc-help at gcc dot gnu dot org" <gcc-help at gcc dot gnu dot org>
- Date: Fri, 16 Sep 2016 14:37:20 +0100
- Subject: Re: illegal instruction (CPU mismatch)
- Authentication-results: sourceware.org; auth=none
- References: <2070054246.1500449.1474012574681.ref@mail.yahoo.com> <2070054246.1500449.1474012574681@mail.yahoo.com> <20160916083133.GA313@x4> <CAH8yC8nTUXTxaTv=LjVzO249dZn+StsC-eX1LVRUe9rt30jWpA@mail.gmail.com> <1018982682.1604601.1474029611458@mail.yahoo.com> <20160916124701.GE310@x4> <1324376358.1594841.1474030214311@mail.yahoo.com>
On 16 September 2016 at 13:50, Mahmood Naderan wrote:
>> -march=amdfam10
>
>
> Actually, I tried with march and got the same, dropping march (the default is native) also results the same. I will try with mtune.
The default should not be native, that compiles code that can only run
on a particular machine (or identical ones). That's a very bad
default.
Using a more generic instruction set would produce binaries that run
on all hardware, e.g. -march=x86-64