This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug middle-end/51893] Wrong subword index computation in store_bit_field_1 on BIG_ENDIAN targets
- From: "aurelien.buhrig.gcc at gmail dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Mon, 23 Jan 2012 08:27:22 +0000
- Subject: [Bug middle-end/51893] Wrong subword index computation in store_bit_field_1 on BIG_ENDIAN targets
- Auto-submitted: auto-generated
- References: <bug-51893-4@http.gcc.gnu.org/bugzilla/>
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=51893
--- Comment #8 from Aurelien Buhrig <aurelien.buhrig.gcc at gmail dot com> 2012-01-23 08:27:22 UTC ---
It seems the problem occurs with big endian targets when value is at least 4
times bigger than a word.
Example:
bitsize=40, value = reg:DI sub words-->HI. So wordnum = 3.
The for loop should start from LSWord to bitsize MSWord (wordnum).
So:
subword 3 from value, and calls store_bit_fields_1 with bitsize <=
BITS_PER_WORD
then subword 2,
then subword 1
And subword 0 from value should be ignored.
Currently, the loop does not begins with subword 3, but with subword
"wordnum-1" which is 2. It is not the LSword of value, and the value stored in
the bitfield is (value << BITS_PER_WORD).