This is the mail archive of the gcc-prs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

c++/9731: 64bit:err in alignment of classes in dump file


>Number:         9731
>Category:       c++
>Synopsis:       64bit:err in alignment of classes in dump file
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    unassigned
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Mon Feb 17 21:06:00 UTC 2003
>Closed-Date:
>Last-Modified:
>Originator:     Lei Huang
>Release:        GCC Version: 3.2.0
>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)


Options given when GCC was configured/built:
Configured with: /usr/src/packages/BUILD/cross-ppc64-gcc-3.2/gcc-3.2/configure -
-enable-languages=c,c++,f77 --prefix=/opt/cross --host=powerpc-suse-linux --targ
et=powerpc64-linux --enable-threads=posix --disable-nls --enable-shared --with-h
eaders=/usr/src/packages/BUILD/cross-ppc64-gcc-3.2/include-ppc64-glibc-2.2.5
Thread model: posix
gcc version 3.2
>Description:
In 32bit, the alignment for class B is 8, but 4 with 64bit.

a.cpp 
----------------------------------------------------------------------------
struct A {};

struct B {
        static A b_static_a;
        long double b_ld ;
} ;

A B::b_static_a ;

B b;
----------------------------------------------------------------------------

Actual class hierarchy file (a.cpp.class):
------------------------------------------------
Class A
   size=1 align=1
A (0x40066100) 0 empty

Class B
   size=8 align=4
B (0x40066440) 0
------------------------------------------------


Expected class hierarchy fie:
---------------------------------------------------
Class A
   size=1 align=1
A (0x00000000) 0 empty

Class B
   size=8 align=8
B (0x00000000) 0

---------------------------------------------------
>How-To-Repeat:
// g++ must be the 64bit compiler 
g++ -fdump-class-hierarchy -c a.cpp
>Fix:

>Release-Note:
>Audit-Trail:
>Unformatted:


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]