diff options
author | pkoning <pkoning@138bc75d-0d04-0410-961f-82ee72b054a4> | 2011-01-24 17:46:15 +0000 |
---|---|---|
committer | pkoning <pkoning@138bc75d-0d04-0410-961f-82ee72b054a4> | 2011-01-24 17:46:15 +0000 |
commit | ad8f8e521f512346e6c87aae2cfa22373d95f17e (patch) | |
tree | 7ce3c5b84df986d5791187d594d7a2efbcfd557d | |
parent | bc189236e9f9069c8ba2cde685a5360bbd498fd0 (diff) | |
download | gcc-ad8f8e521f512346e6c87aae2cfa22373d95f17e.tar.gz |
* builtins.c (c_readstr): Fix byte order if BYTES_BIG_ENDIAN !=
WORDS_BIG_ENDIAN.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@169174 138bc75d-0d04-0410-961f-82ee72b054a4
-rw-r--r-- | gcc/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/builtins.c | 2 |
2 files changed, 6 insertions, 1 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index c181a54de8e..f2df6f65525 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -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 diff --git a/gcc/builtins.c b/gcc/builtins.c index ec0aecf98ea..5b7b673f90e 100644 --- a/gcc/builtins.c +++ b/gcc/builtins.c @@ -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); |