]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
stmt.c (case_bit_test_cmp): Stabilize the sort using code label numbers.
authorRichard Sandiford <richard@codesourcery.com>
Fri, 20 Jan 2006 12:12:24 +0000 (12:12 +0000)
committerRichard Sandiford <rsandifo@gcc.gnu.org>
Fri, 20 Jan 2006 12:12:24 +0000 (12:12 +0000)
* stmt.c (case_bit_test_cmp): Stabilize the sort using code
label numbers.

From-SVN: r110021

gcc/ChangeLog
gcc/stmt.c

index cf2a597d4a13225fd6844294510a5730efe7ffed..a59ac958ab3525bcfe0b7091c25bf61f14a54d52 100644 (file)
@@ -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>
 
index 02ec490d9280758e1672f56101fc5c18f95e6b44..e2ceaf578c555cfcd8c3d0e1f40542656ca5392e 100644 (file)
@@ -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