public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c/18671] New: Structure with bit-field offset is wrong.
@ 2004-11-25  7:52 nitins2 at kpitcummins dot com
  2004-11-25 14:37 ` [Bug target/18671] " pinskia at gcc dot gnu dot org
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: nitins2 at kpitcummins dot com @ 2004-11-25  7:52 UTC (permalink / raw)
  To: gcc-bugs

Hi,
I am using tool chain built with gcc-3.4-20040813 snapshot.
The structure offset byte is wrong for the following C-source code with "-
mrenesas" option.
Without "-mrenesas" option it gives correct offset that is 4.

The data "b2" of structure "bbb" offset is comming 8 which is wrong, it should 
be 4.

******************************test.c***************************
struct aaa{
    int a1;
}*zzz;

struct bbb {
     int b1:1;
     int b2;
};

test(){
    ((struct bbb*)zzz)->b2 = 0x12345678;
}

************************Command line **************************
sh-elf-gcc -mrenesas  -S test.c

***********************test.s**********************************
_test:
        mov.l   r14,@-r15
        mov     r15,r14
        mov.l   .L2,r1
        mov.l   @r1,r2
        mov.l   .L3,r1
        mov.l   r1,@(8,r2)  <-WRONG OFFSET 
        mov     r14,r15
        mov.l   @r15+,r14
        rts
        nop
***************************************************************

Kindly suggest how to solve this bug.

Thanks in advance.

Nitin Shah,
KPIT Cummins InfoSystems Ltd.
Pune, India

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Free download of GNU based tool-chains for Renesas' SH and H8 Series.
The following site also offers free technical support to its users. 
Visit http://www.kpitgnutools.com for details. 
Latest versions of KPIT GNU tools are released on October 1, 2004.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

-- 
           Summary: Structure with bit-field offset is wrong.
           Product: gcc
           Version: 3.4.2
            Status: UNCONFIRMED
          Severity: critical
          Priority: P1
         Component: c
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: nitins2 at kpitcummins dot com
                CC: gcc-bugs at gcc dot gnu dot org
 GCC build triplet: i686-pc-linux-gnu
  GCC host triplet: i686-pc-linux-gnu
GCC target triplet: sh-unknown-elf/sh-unknown-coff


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


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

* [Bug target/18671] Structure with bit-field offset is wrong.
  2004-11-25  7:52 [Bug c/18671] New: Structure with bit-field offset is wrong nitins2 at kpitcummins dot com
@ 2004-11-25 14:37 ` pinskia at gcc dot gnu dot org
  2004-11-29 14:30 ` pinskia at gcc dot gnu dot org
  2005-07-02  1:43 ` pinskia at gcc dot gnu dot org
  2 siblings, 0 replies; 4+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2004-11-25 14:37 UTC (permalink / raw)
  To: gcc-bugs



-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
           Severity|critical                    |normal
          Component|c                           |target


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


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

* [Bug target/18671] Structure with bit-field offset is wrong.
  2004-11-25  7:52 [Bug c/18671] New: Structure with bit-field offset is wrong nitins2 at kpitcummins dot com
  2004-11-25 14:37 ` [Bug target/18671] " pinskia at gcc dot gnu dot org
@ 2004-11-29 14:30 ` pinskia at gcc dot gnu dot org
  2005-07-02  1:43 ` pinskia at gcc dot gnu dot org
  2 siblings, 0 replies; 4+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2004-11-29 14:30 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From pinskia at gcc dot gnu dot org  2004-11-29 14:29 -------
This seems like an alignment issue.

-- 


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


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

* [Bug target/18671] Structure with bit-field offset is wrong.
  2004-11-25  7:52 [Bug c/18671] New: Structure with bit-field offset is wrong nitins2 at kpitcummins dot com
  2004-11-25 14:37 ` [Bug target/18671] " pinskia at gcc dot gnu dot org
  2004-11-29 14:30 ` pinskia at gcc dot gnu dot org
@ 2005-07-02  1:43 ` pinskia at gcc dot gnu dot org
  2 siblings, 0 replies; 4+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2005-07-02  1:43 UTC (permalink / raw)
  To: gcc-bugs



-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
  GCC build triplet|i686-pc-linux-gnu           |
   GCC host triplet|i686-pc-linux-gnu           |
 GCC target triplet|sh-unknown-elf/sh-unknown-  |sh-elf/sh-coff
                   |coff                        |


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


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

end of thread, other threads:[~2005-07-02  1:43 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-11-25  7:52 [Bug c/18671] New: Structure with bit-field offset is wrong nitins2 at kpitcummins dot com
2004-11-25 14:37 ` [Bug target/18671] " pinskia at gcc dot gnu dot org
2004-11-29 14:30 ` pinskia at gcc dot gnu dot org
2005-07-02  1:43 ` pinskia at gcc dot gnu dot 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).