aboutsummaryrefslogtreecommitdiff
path: root/gcc/stmt.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/stmt.c')
-rw-r--r--gcc/stmt.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/gcc/stmt.c b/gcc/stmt.c
index 02ec490..e2ceaf5 100644
--- a/gcc/stmt.c
+++ b/gcc/stmt.c
@@ -2170,7 +2170,11 @@ case_bit_test_cmp (const void *p1, const void *p2)
const struct case_bit_test *d1 = p1;
const struct case_bit_test *d2 = p2;
- return d2->bits - d1->bits;
+ if (d2->bits != d1->bits)
+ return d2->bits - d1->bits;
+
+ /* Stabilize the sort. */
+ return CODE_LABEL_NUMBER (d2->label) - CODE_LABEL_NUMBER (d1->label);
}
/* Expand a switch statement by a short sequence of bit-wise