Linux and Windows generate different binaries

Alexander Monakov amonakov@ispras.ru
Sun Jul 16 09:39:00 GMT 2017


On Sat, 15 Jul 2017, Segher Boessenkool wrote:
> Would it hurt us to use stable sorts *everywhere*?

Stability (using the usual definition: keeping the original order of
elements that compare equal) is not required to achieve reproducibility [*].
GCC could import or nih any non-randomized implementation of a [potentially
not stable, e.g. qsort] sorting routine, and that would be sufficient
to eliminate this source of codegen differences.

Alexander

[*] nor would it be sufficient, given our current practice of passing
    invalid comparators to libc sort, at which point anything can happen
    due to undefined behavior



More information about the Gcc mailing list