From: Richard Sandiford Date: Fri, 20 Jan 2006 12:12:24 +0000 (+0000) Subject: stmt.c (case_bit_test_cmp): Stabilize the sort using code label numbers. X-Git-Tag: releases/gcc-4.2.0~4715 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=0174997a11503d665901689e11d2e88b5f27d552;p=thirdparty%2Fgcc.git 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 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index cf2a597d4a13..a59ac958ab35 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,8 @@ +2006-01-20 Richard Sandiford + + * stmt.c (case_bit_test_cmp): Stabilize the sort using code + label numbers. + 2006-01-20 Richard Guenther Steven Bosscher diff --git a/gcc/stmt.c b/gcc/stmt.c index 02ec490d9280..e2ceaf578c55 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