This is the mail archive of the gcc-patches@gcc.gnu.org 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: RFA: GCC 4.2.1: Stabalizing coalesce_list's qsort


> -----Original Message-----
> From: Andrew MacLeod [mailto:amacleod@redhat.com]
> Sent: Wednesday, August 22, 2007 10:08 AM
> To: Nick Clifton
> Cc: Meissner, Michael; gcc-patches@gcc.gnu.org
> Subject: Re: RFA: GCC 4.2.1: Stabalizing coalesce_list's qsort
> 
> On Wed, 2007-08-22 at 14:57 +0100, Nick Clifton wrote:
> > Hi Andrew,
> >
> > > There is no question that if the sort in unstable, we could end up
> > > coalescing pairs in different orders, which could then affect the
code
> > > generated. Does this currently affect your bootstrap?
> >
> > No.  The bug was only exhibited compiling a customer supplied test
> program with
> > a mips64vrel-elf cross compiler.  The compiled program ran if the
cross
> > compiler had been run under Linux, but failed if the cross compiler
was
> run
> > under Cygwin.  This is what lead me to track down the stable qsort
> issue.
> 
> I presume there was a legitimate bug under the covers tho?  the
unstable
> sort by itself should still result in correct code being generated...

Generally in these types of situations it will cause the compiler to
select different items that have the same weighting.  It can make
tracking down bugs much harder, because different people debugging it
will get different behaviors depending on what system they are using.
As I said, this has already come up in the past, and we fixed it in the
register allocation by making the sort stable by comparing the indices.

I would vote for having patches like Nick suggested applied to 4.2.x as
well as the mainline.



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