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


Hi Michael,

I probably would have written the code as, which saves an extra test in the
case where the comparison is not 0:

  if (result == 0)
    {
      result = (* pp2)->first_partition - (* pp1)->first_partition;
      if (result == 0)
        result = (* pp2)->first_partition - (* pp1)->first_partition;
    }

I can change the code to work that way, although I would assume that any good optimizer would effectively do this for you when it was compiling the routine.


gcc/ChangeLog
2007-08-20  Nick Clifton  <nickc@redhat.com>

	* tree-ssa-live.c (compare_pairs): Stabalize the comparison by
	checking the partition indicies if the costs are the same.

Just to note that I have not yet received official permission to check this in, so I am still waiting.


Cheers
  Nick


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