public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug middle-end/51893] New: Wrong subword index computation in store_bit_field_1 on BIG_ENDIAN targets
@ 2012-01-18 17:24 aurelien.buhrig.gcc at gmail dot com
  2012-01-18 18:14 ` [Bug middle-end/51893] " aurelien.buhrig.gcc at gmail dot com
                   ` (14 more replies)
  0 siblings, 15 replies; 16+ messages in thread
From: aurelien.buhrig.gcc at gmail dot com @ 2012-01-18 17:24 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=51893

             Bug #: 51893
           Summary: Wrong subword index computation in store_bit_field_1
                    on BIG_ENDIAN targets
    Classification: Unclassified
           Product: gcc
           Version: 4.6.1
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: middle-end
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: aurelien.buhrig.gcc@gmail.com


Created attachment 26369
  --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=26369
Patch

The subword index (wordnum) passed to operand_subword_force in
store_bit_field_1 is incorrect for BIG_ENDIAN targets when bitsize >
BITS_PER_WORD.

wordnum, which is used to get the subword of value, is
computed wrt the number of words needed by bitsize instead of the number of
words needed by the integer mode of the field, which is the mode used to
compute subwords.

For instance, for a 40bit field to be set by a DI reg (with HI words),
the offset of the LSWord of the DI reg should be 3, not 2 as currently
computed.

The attached patch seems to solve the issue. Tested on the C testsuite
without any regression (for my target only).

Note that this problem occurs on a "private" target (hardly reproducible).


^ permalink raw reply	[flat|nested] 16+ messages in thread

end of thread, other threads:[~2012-03-28  9:11 UTC | newest]

Thread overview: 16+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-01-18 17:24 [Bug middle-end/51893] New: Wrong subword index computation in store_bit_field_1 on BIG_ENDIAN targets aurelien.buhrig.gcc at gmail dot com
2012-01-18 18:14 ` [Bug middle-end/51893] " aurelien.buhrig.gcc at gmail dot com
2012-01-19  0:26 ` pinskia at gcc dot gnu.org
2012-01-19  0:57 ` pinskia at gcc dot gnu.org
2012-01-19 10:45 ` rguenth at gcc dot gnu.org
2012-01-19 10:52 ` ebotcazou at gcc dot gnu.org
2012-01-20  9:36 ` aurelien.buhrig.gcc at gmail dot com
2012-01-20 10:16 ` ebotcazou at gcc dot gnu.org
2012-01-20 10:46 ` aurelien.buhrig.gcc at gmail dot com
2012-01-20 11:33 ` ebotcazou at gcc dot gnu.org
2012-01-23  9:28 ` aurelien.buhrig.gcc at gmail dot com
2012-03-20 16:26 ` aurelien.buhrig.gcc at gmail dot com
2012-03-20 23:00 ` ebotcazou at gcc dot gnu.org
2012-03-27 20:58 ` ebotcazou at gcc dot gnu.org
2012-03-28  9:11 ` ebotcazou at gcc dot gnu.org
2012-03-28  9:14 ` ebotcazou at gcc dot gnu.org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).