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]

Re: [patch] Iterator-style EXECUTE_IF_SET_IN_BITMAP macros


Hi,

On Sun, 26 Sep 2004, Zdenek Dvorak wrote:

> Zdenek
> 
> 	* bitmap.h (EXECUTE_IF_SET_IN_BITMAP, EXECUTE_IF_AND_COMPL_IN_BITMAP,
> 	EXECUTE_IF_AND_IN_BITMAP): Changed to iterator style.

This patch breaks bootstrap on platforms which don't mask the shift value,
in particular ppc(64).  The problem is the too large shift value used in
some right shifts.  The patch below cures this problem (the runtime libs
can be compiled on ppc64 at least, which is where the breakage happens.

The patch is in testing on amd64 right now (it seems my binutils are too
old to bootstrap gcc on the ppc machine, at least I get those strange dot 
symbols, and segfaults of ld and mixed 32 and 64 bit objects).

I don't expect testing to finish during my waking hours today.


Ciao,
Michael.
-- 
	* bitmap.h (bmp_iter_single_init, bmp_iter_and_not_init,
	bmp_iter_and_init): Shift by bit_in_word.

Index: bitmap.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/bitmap.h,v
retrieving revision 1.34
diff -u -p -r1.34 bitmap.h
--- bitmap.h	26 Sep 2004 19:53:09 -0000	1.34
+++ bitmap.h	27 Sep 2004 19:21:52 -0000
@@ -269,7 +269,7 @@ bmp_iter_single_init (bitmap_iterator *b
       bi->word = word_in_elt;
       bi->word_bit = min - bit_in_word;
       bi->bit = min;
-      bi->actual = bi->ptr1->bits[word_in_elt] >> bit_in_elt;
+      bi->actual = bi->ptr1->bits[word_in_elt] >> bit_in_word;
     }
   else
     {
@@ -400,9 +400,9 @@ bmp_iter_and_not_init (bitmap_iterator *
 
       if (bi->ptr2 && bi->ptr2->indx == indx)
 	bi->actual = (bi->ptr1->bits[word_in_elt]
-		      & ~bi->ptr2->bits[word_in_elt]) >> bit_in_elt;
+		      & ~bi->ptr2->bits[word_in_elt]) >> bit_in_word;
       else
-	bi->actual = bi->ptr1->bits[word_in_elt] >> bit_in_elt;
+	bi->actual = bi->ptr1->bits[word_in_elt] >> bit_in_word;
     }
   else
     {
@@ -539,7 +539,7 @@ bmp_iter_and_init (bitmap_iterator *bi, 
       bi->bit = min;
 
       bi->actual = (bi->ptr1->bits[word_in_elt]
-		    & bi->ptr2->bits[word_in_elt]) >> bit_in_elt;
+		    & bi->ptr2->bits[word_in_elt]) >> bit_in_word;
     }
   else
     {


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