aboutsummaryrefslogtreecommitdiff
path: root/gcc/stmt.c
diff options
context:
space:
mode:
authorRichard Sandiford <richard@codesourcery.com>2006-01-20 12:12:24 +0000
committerRichard Sandiford <rsandifo@gcc.gnu.org>2006-01-20 12:12:24 +0000
commit0174997a11503d665901689e11d2e88b5f27d552 (patch)
treec6941e9a720173d312f0a78a7d99f9ea725ce8ec /gcc/stmt.c
parentc11fd0b2064f7a896ed5e958712092ff83232086 (diff)
downloadgcc-0174997a11503d665901689e11d2e88b5f27d552.zip
gcc-0174997a11503d665901689e11d2e88b5f27d552.tar.gz
gcc-0174997a11503d665901689e11d2e88b5f27d552.tar.bz2
stmt.c (case_bit_test_cmp): Stabilize the sort using code label numbers.
* stmt.c (case_bit_test_cmp): Stabilize the sort using code label numbers. From-SVN: r110021
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