public inbox for gcc-prs@sourceware.org
help / color / mirror / Atom feed
* c++/9143: 64BIT: Error in dump class hiearchy file generated for basic inheritance
@ 2003-01-02 19:46 lei
  0 siblings, 0 replies; 2+ messages in thread
From: lei @ 2003-01-02 19:46 UTC (permalink / raw)
  To: gcc-gnats; +Cc: michaelw


>Number:         9143
>Category:       c++
>Synopsis:       64BIT: Error in dump class hiearchy file generated for basic inheritance
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    unassigned
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Thu Jan 02 11:46:00 PST 2003
>Closed-Date:
>Last-Modified:
>Originator:     Lei Huang
>Release:        3.2.0
>Organization:
>Environment:
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.90.0.15 20020717 (SuSE)
>Description:
Error in dump class hiearchy file generated for basic inheritance in 64bit
compile.

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 --target=powerpc64-linux --enable-threads=posix --disable-nls --enable-shared --with-headers=/usr/src/packages/BUILD/cross-ppc64-gcc-3.2/include-ppc64-glibc-2.2.5
Thread model: posix
gcc version 3.2

Sourc code for a.cpp:
------------------------------------------------
struct A {
        int a;
        virtual void f(){};
} ;
struct B: virtual A {};

B d;
------------------------------------------------


Actual class hierarchy file (a.cpp.class):
------------------------------------------------
Vtable for A
A::_ZTV1A: 3 entries
0     0
8     &_ZTI1A
16    A::f()

Class A
   size=16 align=8
A (0x40066100) 0
    vptr=((&A::_ZTV1A) + 16)

Vtable for B
B::_ZTV1B: 7 entries
0     8
8     0
16    &_ZTI1B
24    0
32    000000000                 //ERR: expect this to be a none-zero offset
40    &_ZTI1B
48    A::f()

VTT for B
B::_ZTT1B: 2 entries
0     ((&B::_ZTV1B) + 24)
8     ((&B::_ZTV1B) + 48)

Class B
   size=24 align=8
B (0x40066680) 0 nearly-empty
    vptridx=0 vptr=((&B::_ZTV1B) + 24)
  A (0x400666c0) 8 virtual canonical
      vptridx=8 vbaseoffset=-24 vptr=((&B::_ZTV1B) + 48)
-----------------------------------------------------------


Expected Behaviour:
- see comment in dump file above


a.ii generated with -save-temps option
------------------------------------------------
# 1 "a.cpp"
# 1 "<built-in>"
# 1 "<command line>"
# 1 "a.cpp"
struct A {
        int a;
        virtual void f(){};
} ;
struct B: virtual A {};

B d;
------------------------------------------------
>How-To-Repeat:
1. g++ -fdump-class-hierarchy -c a.cpp
2. cat a.cpp.class
>Fix:

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


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

* Re: c++/9143: 64BIT: Error in dump class hiearchy file generated for basic inheritance
@ 2003-01-03 10:46 Christian Ehrhardt
  0 siblings, 0 replies; 2+ messages in thread
From: Christian Ehrhardt @ 2003-01-03 10:46 UTC (permalink / raw)
  To: nobody; +Cc: gcc-prs

The following reply was made to PR c++/9143; it has been noted by GNATS.

From: "Christian Ehrhardt" <ehrhardt@mathematik.uni-ulm.de>
To: michaelw@ca.ibm.com, lei@ca.ibm.com, gcc-gnats@gcc.gnu.org,
  gcc-prs@gcc.gnu.org, gcc-bugs@gcc.gnu.org, nobody@gcc.gnu.org
Cc:  
Subject: Re: c++/9143: 64BIT: Error in dump class hiearchy file generated for basic inheritance
Date: Fri, 3 Jan 2003 11:38:13 +0100

 http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view%20audit-trail&database=gcc&pr=9143
 
 The following mail form Janis about this PR got accidentally picked up
 by GNATS as a new PR. Let's hope that this mail makes it into the audit
 trail of the right PR.
 
                Is the generated code incorrect also, or just the dump
                output?
 
                GCC generates the same dump information as that reported in
                the PR for a powerpc64-linux cross compiler built from the
                current mainline and from the 3.3 branch.
 
                With a native powerpc64-linux compiler I get:
 
                       Vtable for B
                     B::_ZTV1B: 7 entries
                     0     8
                     8     0
                     16    &_ZTI1B
                     24    0
                     32    0fffffff8
                     40    &_ZTI1B
                     48    A::f()
 
                With a native 32-bit compiler on a powerpc64-linux system
                I get:
 
                     Vtable for B
                     B::_ZTV1B: 7 entries
                     0     4
                     4     0
                     8     &_ZTI1B
                     12    0
                     16    4294967292
                     20    &_ZTI1B
                     24    A::f()
 
                For comparison purposes I got the same dumps for two other
                targets.  With the mainline from 20021210 on ia64-linux:
 
                     9143.C:1: sorry, unimplemented: `fdesc_expr' not supported
                by dump_expr
                     9143.C:1: sorry, unimplemented: `fdesc_expr' not supported
                by dump_expr
                     9143.C:5: sorry, unimplemented: `fdesc_expr' not supported
                by dump_expr
                     9143.C:5: sorry, unimplemented: `fdesc_expr' not supported
                by dump_expr
 
                I didn't look into this, but it suggests that perhaps some
                of the dump functionality used by the cross compiler isn't
                supported.
 
                With the mainline from 20021220 on i686-linux:
 
                     Vtable for B
                     B::_ZTV1B: 7 entries
                     0     4
                     4     0
                     8     &_ZTI1B
                     12    0
                     16    0fffffffc
                     20    &_ZTI1B
                     24    A::f()
 
                This information might be useful for someone who understands
                vtable layout and the dump functions.
 
 


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

end of thread, other threads:[~2003-01-03 10:46 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-01-02 19:46 c++/9143: 64BIT: Error in dump class hiearchy file generated for basic inheritance lei
2003-01-03 10:46 Christian Ehrhardt

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).