Patchwork Fix init_sync_optabs iteration

login
register
mail settings
Submitter Richard Henderson
Date Nov. 27, 2011, 12:08 a.m.
Message ID <4ED17F8B.3060602@redhat.com>
Download mbox | patch
Permalink /patch/127824/
State New
Headers show

Comments

Richard Henderson - Nov. 27, 2011, 12:08 a.m.
Testing on m68k-linux -mcpu=5206 (aka coldfire, aka no cas insn) revealed that we hadn't properly registered __sync_val_compare_and_swap_4.  Oops.


r~
* optabs.c (init_sync_libfuncs_1): Include max in iteration.

Patch

diff --git a/gcc/optabs.c b/gcc/optabs.c
index 1aafd28..0ce21e9 100644
--- a/gcc/optabs.c
+++ b/gcc/optabs.c
@@ -6606,7 +6606,7 @@  init_sync_libfuncs_1 (optab tab, const char *base, int max)
   buf[len + 2] = '\0';
 
   mode = QImode;
-  for (i = 1; i < max; i *= 2)
+  for (i = 1; i <= max; i *= 2)
     {
       buf[len + 1] = '0' + i;
       set_optab_libfunc (tab, mode, buf);