aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--gcc/ChangeLog6
-rw-r--r--gcc/ira-costs.c16
2 files changed, 21 insertions, 1 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 2039670..95d1d0a 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,9 @@
+2017-01-13 Richard Sandiford <richard.sandiford@arm.com>
+
+ * ira-costs.c (record_reg_classes): Break from the inner loop
+ early once alt_fail is known to be true. Update outer loop
+ handling accordingly.
+
2017-01-13 Jeff Law <law@redhat.com>
* tree-ssa-dse.c (decrement_count): New function.
diff --git a/gcc/ira-costs.c b/gcc/ira-costs.c
index 50d0c04..c3bddb7 100644
--- a/gcc/ira-costs.c
+++ b/gcc/ira-costs.c
@@ -820,6 +820,9 @@ record_reg_classes (int n_alts, int n_ops, rtx *ops,
constraints[i] = p;
+ if (alt_fail)
+ break;
+
/* How we account for this operand now depends on whether it
is a pseudo register or not. If it is, we first check if
any register classes are valid. If not, we ignore this
@@ -999,10 +1002,21 @@ record_reg_classes (int n_alts, int n_ops, rtx *ops,
alt_cost += ira_memory_move_cost[mode][classes[i]][1];
else
alt_fail = 1;
+
+ if (alt_fail)
+ break;
}
if (alt_fail)
- continue;
+ {
+ /* The loop above might have exited early once the failure
+ was seen. Skip over the constraints for the remaining
+ operands. */
+ i += 1;
+ for (; i < n_ops; ++i)
+ constraints[i] = skip_alternative (constraints[i]);
+ continue;
+ }
op_cost_add = alt_cost * frequency;
/* Finally, update the costs with the information we've