This is the mail archive of the mailing list for the GCC project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Linux and Windows generate different binaries

On Sun, Jul 16, 2017 at 11:54:43PM +0300, Alexander Monakov wrote:
> On Sun, 16 Jul 2017, Segher Boessenkool wrote:
> > I am well aware, and that is not what I asked.  If we would use stable
> > sorts everywhere
> How? There's no stable sort in libc and switching over to std::stable_sort
> would be problematic.


> The obvious approach is adding an implementation of
> a stable sort in GCC, but at that point it doesn't matter if it's stable,
> the fact it's deterministic is sufficient for reproducibility.

Sure.  Some of our sorts in fact require stable sort though, so if we
do not use that everywhere people will still have to decide whether it
is required in a specific case or not.

> > we would not have to think about whether some sorting routine has to be
> > stable or if we can get away with a (slightly slower) non-stable sort.
> I think you mean '(slightly faster)'.

Yes I do, whoops :-)

> > That is just a plain bug, undefined behaviour even (C11 7.22.5/4).
> > Of course it needs to be fixed.
> I've posted patches towards this goal.



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]