public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
From: Nathan Sidwell <nathan@acm.org>
To: Milan Ton <milan.ton@yandex.ru>, gcc@gcc.gnu.org
Subject: Re: cross compiled output differs
Date: Mon, 12 Mar 2018 13:02:00 -0000	[thread overview]
Message-ID: <30234898-b264-e407-ccf7-9a019b824907@acm.org> (raw)
In-Reply-To: <7518971520683086@web38g.yandex.ru>

On 03/10/2018 06:58 AM, Milan Ton wrote:

> run-time tests and visual inspection suggest that both variants of the
> compiled function are correct. I looked at the output of the switch
> `-fdump-tree-all' and realized that the path `ivopts' makes this difference.
> Once `-fno-ivopts' applied, the two compilations are binary equivalent.
> 
> Shouldn't I expect in general same output of such cross compilers ?
> What could be reasons of such differences ? and options to fix it ?

Yes, that's a reasonable expectation.  The usually discovered cause of 
such differences is the host system's qsort function coupled with a 
comparison function that can return 0.  When that happens things can be 
differently ordered, essentially at the whim of the host.  And that can 
affet code generation.  It sounds like you've tied that down to ivops -- 
great!

If you could find a selfcontained testcase, that'd make a great bug 
report.  (Sadly, 'ivopts can cause code differences' is probably too vague.)


nathan

-- 
Nathan Sidwell

  reply	other threads:[~2018-03-12 13:02 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-03-10 11:58 Milan Ton
2018-03-12 13:02 ` Nathan Sidwell [this message]
2018-03-12 13:24 ` Richard Biener
2018-03-12 13:45   ` Nathan Sidwell
2018-03-12 16:30     ` Milan Ton
     [not found]     ` <2560201520871091@web16g.yandex.ru>
2018-03-12 18:21       ` Richard Biener

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=30234898-b264-e407-ccf7-9a019b824907@acm.org \
    --to=nathan@acm.org \
    --cc=gcc@gcc.gnu.org \
    --cc=milan.ton@yandex.ru \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).