builtins.c (c_readstr): Fix byte order if BYTES_BIG_ENDIAN != WORDS_BIG_ENDIAN.

* builtins.c (c_readstr): Fix byte order if BYTES_BIG_ENDIAN !=
WORDS_BIG_ENDIAN.

From-SVN: r169174
This commit is contained in:
Paul Koning 2011-01-24 12:46:15 -05:00 committed by Paul Koning
parent a6c5070a12
commit e046112d14
2 changed files with 6 additions and 1 deletions

View File

@ -1,3 +1,8 @@
2011-101-24 Paul Koning <ni1d@arrl.net>
* builtins.c (c_readstr): Fix byte order if BYTES_BIG_ENDIAN !=
WORDS_BIG_ENDIAN.
2011-01-24 H.J. Lu <hongjiu.lu@intel.com>
PR target/46519

View File

@ -605,7 +605,7 @@ c_readstr (const char *str, enum machine_mode mode)
if (WORDS_BIG_ENDIAN)
j = GET_MODE_SIZE (mode) - i - 1;
if (BYTES_BIG_ENDIAN != WORDS_BIG_ENDIAN
&& GET_MODE_SIZE (mode) > UNITS_PER_WORD)
&& GET_MODE_SIZE (mode) >= UNITS_PER_WORD)
j = j + UNITS_PER_WORD - 2 * (j % UNITS_PER_WORD) - 1;
j *= BITS_PER_UNIT;
gcc_assert (j < 2 * HOST_BITS_PER_WIDE_INT);