summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorrsandifo <rsandifo@138bc75d-0d04-0410-961f-82ee72b054a4>2006-01-20 12:12:24 +0000
committerrsandifo <rsandifo@138bc75d-0d04-0410-961f-82ee72b054a4>2006-01-20 12:12:24 +0000
commitd2f7f511e3ff9a2bb2755efe9025bdcd6f5d33b2 (patch)
treec6941e9a720173d312f0a78a7d99f9ea725ce8ec
parent8345ac1a0c768dd932f2f48e15352859b1264e93 (diff)
downloadgcc-d2f7f511e3ff9a2bb2755efe9025bdcd6f5d33b2.tar.gz
* stmt.c (case_bit_test_cmp): Stabilize the sort using code
label numbers. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@110021 138bc75d-0d04-0410-961f-82ee72b054a4
-rw-r--r--gcc/ChangeLog5
-rw-r--r--gcc/stmt.c6
2 files changed, 10 insertions, 1 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index cf2a597d4a1..a59ac958ab3 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,8 @@
+2006-01-20 Richard Sandiford <richard@codesourcery.com>
+
+ * stmt.c (case_bit_test_cmp): Stabilize the sort using code
+ label numbers.
+
2006-01-20 Richard Guenther <rguenther@suse.de>
Steven Bosscher <stevenb.gcc@gmail.com>
diff --git a/gcc/stmt.c b/gcc/stmt.c
index 02ec490d928..e2ceaf578c5 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