On Wed, Nov 13, 2024 at 10:50:38PM +0100, Patrick Dupre via users wrote:
> >
> > > On 13 Nov 2024, at 18:33, Patrick Dupre via users 
> > > <users@lists.fedoraproject.org> wrote:
> > >
> > > Why this behavior?
> >
> > Do both versions produce the same results when copied to the other machine?
> The results depends on the machine which has compiled the code, not on the 
> machine
> where the code is run.
> 
> Is there a way to specify the architecture i7 or i5 ?

i7 vs. i5 don't mean anything for the compiler, the set of ISAs those CPUs
support and their generation is what matters.
Though, unless you compile with -march=native or -mcpu=native (or unless the
build system of the projects injects compiler flags depending on the current
CPU), the CPU on which you compile it shouldn't affect the flags with which
the code is compiled and same compiler + same source + same command line
flags should result in identical assembly.
If you are using -march=native or -mcpu=native, you've asked for it, you can
then use
gcc -march=native -v -S -xc /dev/null -o /dev/null 2>&1 | grep cc1
to print what exact flags does that turn.

        Jakub

-- 
_______________________________________________
users mailing list -- users@lists.fedoraproject.org
To unsubscribe send an email to users-le...@lists.fedoraproject.org
Fedora Code of Conduct: 
https://docs.fedoraproject.org/en-US/project/code-of-conduct/
List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines
List Archives: 
https://lists.fedoraproject.org/archives/list/users@lists.fedoraproject.org
Do not reply to spam, report it: 
https://pagure.io/fedora-infrastructure/new_issue

Reply via email to