public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c/52991] New: attribute packed broken on mingw32?
@ 2012-04-15  4:21 sherpya at netfarm dot it
  2012-08-18  3:37 ` [Bug c/52991] " daniel.c.klauer at web dot de
                   ` (20 more replies)
  0 siblings, 21 replies; 22+ messages in thread
From: sherpya at netfarm dot it @ 2012-04-15  4:21 UTC (permalink / raw)
  To: gcc-bugs

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

             Bug #: 52991
           Summary: attribute packed broken on mingw32?
    Classification: Unclassified
           Product: gcc
           Version: 4.7.0
            Status: UNCONFIRMED
          Severity: major
          Priority: P3
         Component: c
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: sherpya@netfarm.it


I've switched form mingw gcc 4.6.2 to 4.7.0 and I've noticed that attribute
packed does not work anymore as expected, simple testcase:

#include <stdio.h>
#include <stdlib.h>
#include <inttypes.h>

typedef struct st_tag
{
    uint16_t head __attribute__ ((packed));
    uint8_t type;
    uint16_t flags __attribute__ ((packed));
} st;

int main(void)
{
    st x;
    printf("Structure packing got %u offset, expected 3\n",
(unsigned)((char*)&x.flags - (char*)&x));
    return 0;
}

the generated asm is:
        movl    $4, 4(%esp)
        movl    $LC0, (%esp)
        call    _printf

the value is 3 in gcc 4.6.2

Using built-in specs.
COLLECT_GCC=c:\mingw\bin\gcc-4.7.exe
COLLECT_LTO_WRAPPER=c:/mingw/bin/../libexec/gcc/i686-pc-mingw32/4.7.0/lto-wrapper.exe
Target: i686-pc-mingw32
Configured with: ../gcc-4.7.0/configure --prefix=/mingw --disable-bootstrap
--enable-lto --with-pkgversion=Sherpya --with-bugurl=http://oss.netfarm.it/
--target=i686-pc-mingw32 --enable-targets=i686-pc-mingw32 --with-tune=generic
--with-cpu=i686 --disable-win32-registry --disable-shared --program-suffix=-4.7
--enable-version-specific-runtime-libs --enable-languages=c,c++
--disable-werror --enable-threads=win32 --with-dwarf2 --disable-nls
Thread model: win32
gcc version 4.7.0 (Sherpya)

I don't think save-temps output may be relevant


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

end of thread, other threads:[~2022-01-10  8:16 UTC | newest]

Thread overview: 22+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-04-15  4:21 [Bug c/52991] New: attribute packed broken on mingw32? sherpya at netfarm dot it
2012-08-18  3:37 ` [Bug c/52991] " daniel.c.klauer at web dot de
2012-08-18  4:01 ` daniel.c.klauer at web dot de
2012-08-18 10:13 ` mikpe at it dot uu.se
2012-08-19 20:56 ` mikpe at it dot uu.se
2012-08-22  8:35 ` mikpe at it dot uu.se
2012-10-06 23:02 ` daniel.c.klauer at web dot de
2012-10-06 23:08 ` paolo.carlini at oracle dot com
2012-12-10 15:14 ` ktietz at gcc dot gnu.org
2012-12-18 17:15 ` rth at gcc dot gnu.org
2012-12-18 21:36 ` ktietz at gcc dot gnu.org
2013-01-09 12:31 ` ktietz at gcc dot gnu.org
2013-01-09 13:34 ` ktietz at gcc dot gnu.org
2013-01-09 13:37 ` ktietz at gcc dot gnu.org
2013-10-05 14:26 ` mikpelinux at gmail dot com
2013-12-12 15:33 ` rogerdpack at gmail dot com
2013-12-12 15:48 ` ktietz at gcc dot gnu.org
2014-01-17 10:09 ` kugel at rockbox dot org
2014-02-16 10:03 ` jackie.rosen at hushmail dot com
2015-07-14  9:08 ` [Bug target/52991] " ossman at cendio dot se
2022-01-10  8:16 ` [Bug target/52991] [6/7/8 Regression] " pinskia at gcc dot gnu.org
2022-01-10  8:16 ` pinskia 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).