postreload.c (reload_cse_simplify_operands): Fix bug in sorting algorithm so as to...
authorUlrich Weigand <uweigand@de.ibm.com>
Fri, 11 Nov 2005 09:38:52 +0000 (09:38 +0000)
committerUlrich Weigand <uweigand@gcc.gnu.org>
Fri, 11 Nov 2005 09:38:52 +0000 (09:38 +0000)
* postreload.c (reload_cse_simplify_operands): Fix bug in sorting
algorithm so as to choose the best, not the worst, alternative.
Reset accumulated register class before processing next alternative.

From-SVN: r106780

gcc/ChangeLog
gcc/postreload.c

index ec775d21c539d8fe5cf978aeb31f7ec2a933114b..0337eb217f03ecca86af7196a0aecb1cd177a9ad 100644 (file)
@@ -1,3 +1,9 @@
+2005-11-11  Ulrich Weigand  <uweigand@de.ibm.com>
+
+       * postreload.c (reload_cse_simplify_operands): Fix bug in sorting
+       algorithm so as to choose the best, not the worst, alternative.
+       Reset accumulated register class before processing next alternative.
+
 2005-11-11  Kaz Kojima  <kkojima@gcc.gnu.org>
 
        PR target/24445
index d164ae17f108c87aeea7843572fd53413ee7b671..76d54fa0fa4f9fc3561281ab779418a6d9f25354 100644 (file)
@@ -575,6 +575,7 @@ reload_cse_simplify_operands (rtx insn, rtx testreg)
                      op_alt_regno[i][j] = regno;
                    }
                  j++;
+                 class = (int) NO_REGS;
                  break;
                }
              p += CONSTRAINT_LEN (c, p);
@@ -607,7 +608,7 @@ reload_cse_simplify_operands (rtx insn, rtx testreg)
          int this_nregs = alternative_nregs[alternative_order[j]];
 
          if (this_reject < best_reject
-             || (this_reject == best_reject && this_nregs < best_nregs))
+             || (this_reject == best_reject && this_nregs > best_nregs))
            {
              best = j;
              best_reject = this_reject;