diff options
author | segher <segher@138bc75d-0d04-0410-961f-82ee72b054a4> | 2010-06-06 11:38:46 +0000 |
---|---|---|
committer | segher <segher@138bc75d-0d04-0410-961f-82ee72b054a4> | 2010-06-06 11:38:46 +0000 |
commit | 0fd21c35f1bbe6014cd18dc187a9e8e135137ab2 (patch) | |
tree | 84cb7a59b5601c05888ee22f76caff55b40fef10 /gcc/genautomata.c | |
parent | 892e7b037a7ac749cd787f2a91bd9041cd221202 (diff) | |
download | gcc-0fd21c35f1bbe6014cd18dc187a9e8e135137ab2.tar.gz |
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.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@160338 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/genautomata.c')
-rw-r--r-- | gcc/genautomata.c | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/gcc/genautomata.c b/gcc/genautomata.c index ad7caa611b5..f7493c7071d 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) |