This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] Fix for the bootstrap break I caused
On Sun, Jun 6, 2010 at 12:27 AM, Segher Boessenkool
<segher@kernel.crashing.org> wrote:
> My "trivial" patch (r160307) caused breakage on all big-endian
> hosts. ?Ouch. ?This fixes it.
Ok.
(this really asks to use sbitmaps ...)
Thanks,
Richard.
> gcc/ChangeLog
> 2010-06-06 ?Segher Boessenkool ?<segher@kernel.crashing.org>
>
> ? ? ? ?PR bootstrap/44427
> ? ? ? ?PR bootstrap/44428
> ? ? ? ?genautomata.c (SET_BIT, CLEAR_BIT, TEST_BIT): Make these macros
> ? ? ? ?endianness-independent.
>
> ---
> ?gcc/genautomata.c | ? 11 +++++++----
> ?1 files changed, 7 insertions(+), 4 deletions(-)
>
> diff --git a/gcc/genautomata.c b/gcc/genautomata.c
> index ad7caa6..f7493c7 100644
> --- a/gcc/genautomata.c
> +++ b/gcc/genautomata.c
> @@ -3314,15 +3314,18 @@ finish_alt_states (void)
> ?/* Set bit number bitno in the bit string. ?The macro is not side
> ? ?effect proof. ?*/
> ?#define SET_BIT(bitstring, bitno) ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?\
> - ?(((char *) (bitstring)) [(bitno) / CHAR_BIT] |= 1 << (bitno) % CHAR_BIT)
> + ?((bitstring)[(bitno) / (sizeof (*(bitstring)) * CHAR_BIT)] |= ? ? ? ? ? ? ? ? ?\
> + ? ? ? (HOST_WIDE_INT)1 << (bitno) % (sizeof (*(bitstring)) * CHAR_BIT))
>
> ?#define CLEAR_BIT(bitstring, bitno) ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?\
> - ?(((char *) (bitstring)) [(bitno) / CHAR_BIT] &= ~(1 << (bitno) % CHAR_BIT))
> + ?((bitstring)[(bitno) / (sizeof (*(bitstring)) * CHAR_BIT)] &= ? ? ? ? ? ? ? ? ?\
> + ? ? ? ~((HOST_WIDE_INT)1 << (bitno) % (sizeof (*(bitstring)) * CHAR_BIT)))
>
> ?/* Test if bit number bitno in the bitstring is set. ?The macro is not
> ? ?side effect proof. ?*/
> -#define TEST_BIT(bitstring, bitno) ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?\
> - ?(((char *) (bitstring)) [(bitno) / CHAR_BIT] >> (bitno) % CHAR_BIT & 1)
> +#define TEST_BIT(bitstring, bitno) ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? \
> + ?((bitstring)[(bitno) / (sizeof (*(bitstring)) * CHAR_BIT)] >> ? ? ? ? ? ? ? ? ?\
> + ? ? ? (bitno) % (sizeof (*(bitstring)) * CHAR_BIT) & 1)
>
>
>
> --
> 1.7.0.2.183.g14cec
>
>