This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

libgo patch committed: Fix search for next prime


This patch to libgo fixes the search for the next prime to use for the
number of buckets.  Bootstrapped and ran Go testsuite on
x86_64-unknown-linux-gnu.  Committed to mainline.

The problem was reported in PR 47910, which this fixes.

Ian

diff -r 87faad0d0c52 libgo/runtime/go-new-map.c
--- a/libgo/runtime/go-new-map.c	Mon Mar 07 15:35:24 2011 -0800
+++ b/libgo/runtime/go-new-map.c	Tue Mar 08 21:27:32 2011 -0800
@@ -85,7 +85,7 @@
     {
       size_t mid;
 
-      mid = (low + high / 2);
+      mid = (low + high) / 2;
 
       /* Here LOW <= MID < HIGH.  */
 

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]