This is the mail archive of the gcc-bugs@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]

[Bug optimization/11421] New: [3.4 regression] vtables are not emitted in unit-at-a-time mode


PLEASE REPLY TO gcc-bugzilla@gcc.gnu.org ONLY, *NOT* gcc-bugs@gcc.gnu.org.

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

           Summary: [3.4 regression] vtables are not emitted in unit-at-a-
                    time mode
           Product: gcc
           Version: 3.4
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: optimization
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: martin at mpa-garching dot mpg dot de
                CC: gcc-bugs at gcc dot gnu dot org,jh at suse dot cz
 GCC build triplet: i686-pc-linux-gnu
  GCC host triplet: i686-pc-linux-gnu
GCC target triplet: i686-pc-linux-gnu

Consider the following two files:

foo.cc:

struct foo {
  virtual void bar();
  };

void foo::bar() {}

>>>>>>>> end of foo.cc

main.cc

struct foo {
  virtual void bar();
  };

int main() {
  foo var1;
  }

>>>>>>>> end of main.cc

Compiling with
  g++ main.cc foo.cc
works, but
  g++ -funit-at-a-time main.cc foo.cc
results in
  /tmp/cc85sQ35.o: In function `foo::foo[in-charge]()':
  /tmp/cc85sQ35.o(.gnu.linkonce.t._ZN3fooC1Ev+0x8): undefined reference to
`vtable for foo'
  collect2: ld returned 1 exit status

Doing a "nm foo.o" shows that the vtable is not in the object file.

This test was done with gcc version 3.4 20030703 (experimental), with
the suggested fix for PR 11403 applied to gcc/cp/typeck.c


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