public inbox for gcc-prs@sourceware.org help / color / mirror / Atom feed
From: jingye@ca.ibm.com To: gcc-gnats@gcc.gnu.org Subject: c++/10645: Incorrect 64bit double alignment in nested struct Date: Tue, 06 May 2003 19:16:00 -0000 [thread overview] Message-ID: <20030506191518.1894.qmail@sources.redhat.com> (raw) >Number: 10645 >Category: c++ >Synopsis: Incorrect 64bit double alignment in nested struct >Confidential: no >Severity: serious >Priority: medium >Responsible: unassigned >State: open >Class: sw-bug >Submitter-Id: net >Arrival-Date: Tue May 06 19:16:01 UTC 2003 >Closed-Date: >Last-Modified: >Originator: jingye@ca.ibm.com >Release: gcc version 3.2 >Organization: >Environment: System Type: Linux Version 2.4.19 SuSE SLES 8 (ppc) - Kernel 2.4.19-ul1-ppc64-SMP (36). GNU assembler version 2.12.90.0.15 (powerpc-suse-linux) using BFD version 2.12.9 0.0.15 20020717 (SuSE) Configured with: ../configure --enable-threads=posix --prefix=/usr --with-local- prefix=/usr/local --infodir=/usr/share/info --mandir=/usr/share/man --libdir=/us r/lib --enable-languages=c,c++,f77,objc,java,ada --enable-libgcj --with-gxx-incl ude-dir=/usr/include/g++ --with-slibdir=/lib --with-system-zlib --enable-shared --enable-__cxa_atexit powerpc-suse-linux Thread model: posix gcc version 3.2 >Description: in the example below, the struct A has only double as its member and is 8-byte aligned in 64bit. struct B has struct A as it's member, however, is only 4-byte aligned. When we add aother member after double in struct A, struct B becomes 8-byte aligned. /*test case t.c*/ struct A{ double a1; /*int a2;*/ }sa; struct B{ char b1; struct A b2; }sb; int main() { printf("alignof sa=%d\n",__alignof__(sa)); printf("sizeof sa=%d\n",sizeof(sa)); printf("alignof sb=%d\n",__alignof__(sb)); printf("sizeof sb=%d\n",sizeof(sb)); } >How-To-Repeat: /opt/cross/bin/powerpc64-linux-g++ t.c a.out >Fix: >Release-Note: >Audit-Trail: >Unformatted:
next reply other threads:[~2003-05-06 19:16 UTC|newest] Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top 2003-05-06 19:16 jingye [this message] 2003-05-07 5:06 Alan Modra
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=20030506191518.1894.qmail@sources.redhat.com \ --to=jingye@ca.ibm.com \ --cc=gcc-gnats@gcc.gnu.org \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
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).