cross compiled output differs

Nathan Sidwell nathan@acm.org
Mon Mar 12 13:02:00 GMT 2018


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



More information about the Gcc mailing list