public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/11247] New: -frepo fails to instantiate typeinfo
@ 2003-06-18 23:44 bgreen at nas dot nasa dot gov
  2003-06-19 13:47 ` [Bug c++/11247] " bangerth at dealii dot org
                   ` (6 more replies)
  0 siblings, 7 replies; 8+ messages in thread
From: bgreen at nas dot nasa dot gov @ 2003-06-18 23:44 UTC (permalink / raw)
  To: gcc-bugs

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

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

           Summary: -frepo fails to instantiate typeinfo
           Product: gcc
           Version: 3.3.1
            Status: UNCONFIRMED
          Severity: minor
          Priority: P3
         Component: c++
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: bgreen@nas.nasa.gov
                CC: gcc-bugs@gcc.gnu.org
 GCC build triplet: i686-pc-linux-gnu
  GCC host triplet: i686-pc-linux-gnu
GCC target triplet: i686-pc-linux-gnu

The code presented does not link successfully when using the -frepo option.
The compiler fails to instantiate a typeinfo object in order to perform a
dynamic cast operation.  Failure of the code to link successfully inhibits
library design.
The code builds successfully when not using '-frepo'.

[bgreen@ece06 ~/test]$ g++ -v
Reading specs from /home/bgreen/local/gcc/lib/gcc-lib/i686-pc-linux-gnu/3.3.1/specs
Configured with: ../gcc/configure --prefix=/home/bgreen/local/gcc
--enable-__cxa_atexit --enable-languages=c,c++,f77
Thread model: posix
gcc version 3.3.1 20030616 (prerelease)

[bgreen@ece06 ~/test]$ make
g++ -g -Wall -frepo   -c -o test.o test.C
g++ -g -Wall -frepo -o test test.o
test.o(.text+0x28): In function `main':
/home/bgreen/test/test.C:18: undefined reference to `typeinfo for IType<int>'
collect2: ld returned 1 exit status
make: *** [test] Error 1

[bgreen@ece06 ~/test]$ cat test.C
 
class IBase
{
public:
    virtual ~IBase() {}
};
 
template <typename T>
class IType : public IBase
{
public:
    IType() {}
};
 
int main()
{
    IBase *p = 0;
    dynamic_cast<IType<int>*>(p);
}


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

* [Bug c++/11247] -frepo fails to instantiate typeinfo
  2003-06-18 23:44 [Bug c++/11247] New: -frepo fails to instantiate typeinfo bgreen at nas dot nasa dot gov
@ 2003-06-19 13:47 ` bangerth at dealii dot org
  2003-07-29 16:33 ` pinskia at physics dot uc dot edu
                   ` (5 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: bangerth at dealii dot org @ 2003-06-19 13:47 UTC (permalink / raw)
  To: gcc-bugs

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

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


bangerth at dealii dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
     Ever Confirmed|                            |1
   Last reconfirmed|0000-00-00 00:00:00         |2003-06-19 13:47:41
               date|                            |


------- Additional Comments From bangerth at dealii dot org  2003-06-19 13:47 -------
Confirmed up to present mainline. Never worked since at least 2.95.
W.


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

* [Bug c++/11247] -frepo fails to instantiate typeinfo
  2003-06-18 23:44 [Bug c++/11247] New: -frepo fails to instantiate typeinfo bgreen at nas dot nasa dot gov
  2003-06-19 13:47 ` [Bug c++/11247] " bangerth at dealii dot org
@ 2003-07-29 16:33 ` pinskia at physics dot uc dot edu
  2003-09-02 20:14 ` bgreen at nas dot nasa dot gov
                   ` (4 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: pinskia at physics dot uc dot edu @ 2003-07-29 16:33 UTC (permalink / raw)
  To: gcc-bugs

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

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


pinskia at physics dot uc dot edu changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|3.4                         |---


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

* [Bug c++/11247] -frepo fails to instantiate typeinfo
  2003-06-18 23:44 [Bug c++/11247] New: -frepo fails to instantiate typeinfo bgreen at nas dot nasa dot gov
  2003-06-19 13:47 ` [Bug c++/11247] " bangerth at dealii dot org
  2003-07-29 16:33 ` pinskia at physics dot uc dot edu
@ 2003-09-02 20:14 ` bgreen at nas dot nasa dot gov
  2004-08-16 18:25 ` bangerth at dealii dot org
                   ` (3 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: bgreen at nas dot nasa dot gov @ 2003-09-02 20:14 UTC (permalink / raw)
  To: gcc-bugs

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

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



------- Additional Comments From bgreen at nas dot nasa dot gov  2003-09-02 20:14 -------
I have uncovered what appears to be the cause for this bug.  I hope this is
helpful in some way.

When the compiler processes the dynamic_cast, the repo code emits the following
into the .rpo file:

O _ZTV5ITypeIiE

running c++filt on this shows that this refers to the class's vtable:

O vtable for IType<int>

However, the linker (run via collect2) produces an error indicating a missing
'typeinfo', but not a missing 'vtable':

GNU ld version 2.14 20030612
test.o(.text+0x32): In function `main':
/home/bgreen/code/tests/comcasts/tex3/test.C:23: undefined reference to
`typeinfo for IType<int>'

collect2 is then unable to match the unresolved typeinfo to the uninstantiated
vtable.
It seems that the problem boils down to the compiler repo code emitting a
'vtable' where it should emit a 'typeinfo' in response to a dynamic cast.


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

* [Bug c++/11247] -frepo fails to instantiate typeinfo
  2003-06-18 23:44 [Bug c++/11247] New: -frepo fails to instantiate typeinfo bgreen at nas dot nasa dot gov
                   ` (2 preceding siblings ...)
  2003-09-02 20:14 ` bgreen at nas dot nasa dot gov
@ 2004-08-16 18:25 ` bangerth at dealii dot org
  2004-08-25 17:02 ` pinskia at gcc dot gnu dot org
                   ` (2 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: bangerth at dealii dot org @ 2004-08-16 18:25 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From bangerth at dealii dot org  2004-08-16 18:25 -------
This is fixed in 3.4.x and mainline. I could imagine that the  
unit-at-a-time things did it, but who knows. And who cares, it is 
fixed :-) 
 
W. 

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
      Known to fail|                            |3.3.4
      Known to work|                            |3.4.1 3.5.0
         Resolution|                            |FIXED


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


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

* [Bug c++/11247] -frepo fails to instantiate typeinfo
  2003-06-18 23:44 [Bug c++/11247] New: -frepo fails to instantiate typeinfo bgreen at nas dot nasa dot gov
                   ` (3 preceding siblings ...)
  2004-08-16 18:25 ` bangerth at dealii dot org
@ 2004-08-25 17:02 ` pinskia at gcc dot gnu dot org
  2004-12-31  0:14 ` bgreen at nas dot nasa dot gov
  2005-01-31  6:57 ` pinskia at gcc dot gnu dot org
  6 siblings, 0 replies; 8+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2004-08-25 17:02 UTC (permalink / raw)
  To: gcc-bugs



-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|---                         |3.5.0


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


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

* [Bug c++/11247] -frepo fails to instantiate typeinfo
  2003-06-18 23:44 [Bug c++/11247] New: -frepo fails to instantiate typeinfo bgreen at nas dot nasa dot gov
                   ` (4 preceding siblings ...)
  2004-08-25 17:02 ` pinskia at gcc dot gnu dot org
@ 2004-12-31  0:14 ` bgreen at nas dot nasa dot gov
  2005-01-31  6:57 ` pinskia at gcc dot gnu dot org
  6 siblings, 0 replies; 8+ messages in thread
From: bgreen at nas dot nasa dot gov @ 2004-12-31  0:14 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From bgreen at nas dot nasa dot gov  2004-12-31 00:14 -------
I just discovered this bug still exists, in a slightly changed guise.
The previously submitted code now compiles, but a minor change brings the bug
right back.
Attached is the new version of the code that produces the bug.
The diff is essentially this:

< dynamic_cast<IType<int>*>(p);
> IType<int> *p2 = dynamic_cast<IType<int>*>(p);

I'm currently using Gentoo's g++ version 3.4.3.

g++ (GCC) 3.4.3 20041125 (Gentoo Linux 3.4.3-r1, ssp-3.4.3-0, pie-8.7.7)



-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|RESOLVED                    |REOPENED
         Resolution|FIXED                       |


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


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

* [Bug c++/11247] -frepo fails to instantiate typeinfo
  2003-06-18 23:44 [Bug c++/11247] New: -frepo fails to instantiate typeinfo bgreen at nas dot nasa dot gov
                   ` (5 preceding siblings ...)
  2004-12-31  0:14 ` bgreen at nas dot nasa dot gov
@ 2005-01-31  6:57 ` pinskia at gcc dot gnu dot org
  6 siblings, 0 replies; 8+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2005-01-31  6:57 UTC (permalink / raw)
  To: gcc-bugs



-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|4.0.0                       |---


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


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

end of thread, other threads:[~2005-01-31  6:55 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-06-18 23:44 [Bug c++/11247] New: -frepo fails to instantiate typeinfo bgreen at nas dot nasa dot gov
2003-06-19 13:47 ` [Bug c++/11247] " bangerth at dealii dot org
2003-07-29 16:33 ` pinskia at physics dot uc dot edu
2003-09-02 20:14 ` bgreen at nas dot nasa dot gov
2004-08-16 18:25 ` bangerth at dealii dot org
2004-08-25 17:02 ` pinskia at gcc dot gnu dot org
2004-12-31  0:14 ` bgreen at nas dot nasa dot gov
2005-01-31  6:57 ` pinskia at gcc dot gnu dot 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).