public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/39106] [4.4 Regression] aliased to undefined symbol error with thunks
  2009-02-05 13:14 [Bug c++/39106] New: [4.4 Regression] aliased to undefined symbol error with thunks jakub at gcc dot gnu dot org
@ 2009-02-05 13:14 ` jakub at gcc dot gnu dot org
  2009-02-05 15:55 ` jakub at gcc dot gnu dot org
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 5+ messages in thread
From: jakub at gcc dot gnu dot org @ 2009-02-05 13:14 UTC (permalink / raw)
  To: gcc-bugs



-- 

jakub at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Priority|P3                          |P1
   Target Milestone|---                         |4.4.0


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


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

* [Bug c++/39106]  New: [4.4 Regression] aliased to undefined symbol error with thunks
@ 2009-02-05 13:14 jakub at gcc dot gnu dot org
  2009-02-05 13:14 ` [Bug c++/39106] " jakub at gcc dot gnu dot org
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: jakub at gcc dot gnu dot org @ 2009-02-05 13:14 UTC (permalink / raw)
  To: gcc-bugs

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain, Size: 1153 bytes --]

extern "C" void abort ();

struct A
{
  A (bool x = true);
};
class B
{
  virtual bool bar (A &, int) const =0;
};
class C : virtual public B
{
};
struct D : virtual public B
{
  bool bar (A &, int) const;
};
template <int N>
struct E : public D
{
  bool bar (A &x, int y) const
  {
    return baz().bar (x, y);
  }
  const D & baz () const;
};
extern template class E<0>;

void
foo ()
{
  try
  {
    A a;
    abort ();
  } catch (...)
  {
  }
  A b;
  E<0> c;
  c.bar (b, 3);
  E<0> d;
  d.bar (b, 3);
}

fails to compile at -O2 and above on x86_64-linux (both -m32 and -m64), with
error: ‘bool A::*.LTHUNK0(A&, int) const’ aliased to undefined symbol
‘_ZNK1EILi0EE3barER1Ai’


-- 
           Summary: [4.4 Regression] aliased to undefined symbol error with
                    thunks
           Product: gcc
           Version: 4.4.0
            Status: UNCONFIRMED
          Keywords: rejects-valid
          Severity: normal
          Priority: P3
         Component: c++
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: jakub at gcc dot gnu dot org


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


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

* [Bug c++/39106] [4.4 Regression] aliased to undefined symbol error with thunks
  2009-02-05 13:14 [Bug c++/39106] New: [4.4 Regression] aliased to undefined symbol error with thunks jakub at gcc dot gnu dot org
  2009-02-05 13:14 ` [Bug c++/39106] " jakub at gcc dot gnu dot org
@ 2009-02-05 15:55 ` jakub at gcc dot gnu dot org
  2009-02-05 21:54 ` jakub at gcc dot gnu dot org
  2009-02-05 22:18 ` jakub at gcc dot gnu dot org
  3 siblings, 0 replies; 5+ messages in thread
From: jakub at gcc dot gnu dot org @ 2009-02-05 15:55 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #1 from jakub at gcc dot gnu dot org  2009-02-05 15:55 -------
Created an attachment (id=17248)
 --> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=17248&action=view)
gcc44-pr39106.patch

Patch I'm going to bootstrap/regtest.  The problem is that
cgraph_function_versioning copies the whole FUNCTION_DECL node, including
DECL_LANG_SPECIFIC etc. and then the original bar function doesn't need to be
emitted (so emit_associated_thunks langhook isn't called for it), but when
it is called on the versioned bar function, it will emit thunks for
non-existing
function.  As emit_associated_thunks langhook does nothing if !DECL_VIRTUAL_P,
I think the easiest fix is to clear this bit.


-- 

jakub at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         AssignedTo|unassigned at gcc dot gnu   |jakub at gcc dot gnu dot org
                   |dot org                     |
             Status|UNCONFIRMED                 |ASSIGNED


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


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

* [Bug c++/39106] [4.4 Regression] aliased to undefined symbol error with thunks
  2009-02-05 13:14 [Bug c++/39106] New: [4.4 Regression] aliased to undefined symbol error with thunks jakub at gcc dot gnu dot org
  2009-02-05 13:14 ` [Bug c++/39106] " jakub at gcc dot gnu dot org
  2009-02-05 15:55 ` jakub at gcc dot gnu dot org
@ 2009-02-05 21:54 ` jakub at gcc dot gnu dot org
  2009-02-05 22:18 ` jakub at gcc dot gnu dot org
  3 siblings, 0 replies; 5+ messages in thread
From: jakub at gcc dot gnu dot org @ 2009-02-05 21:54 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #2 from jakub at gcc dot gnu dot org  2009-02-05 21:54 -------
Subject: Bug 39106

Author: jakub
Date: Thu Feb  5 21:54:06 2009
New Revision: 143973

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=143973
Log:
        PR c++/39106
        * cgraphunit.c (cgraph_function_versioning): Clear also DECL_VIRTUAL_P
        on the copied decl.

        * g++.dg/opt/thunk3.C: New test.

Added:
    trunk/gcc/testsuite/g++.dg/opt/thunk3.C
Modified:
    trunk/gcc/ChangeLog
    trunk/gcc/cgraphunit.c
    trunk/gcc/testsuite/ChangeLog


-- 


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


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

* [Bug c++/39106] [4.4 Regression] aliased to undefined symbol error with thunks
  2009-02-05 13:14 [Bug c++/39106] New: [4.4 Regression] aliased to undefined symbol error with thunks jakub at gcc dot gnu dot org
                   ` (2 preceding siblings ...)
  2009-02-05 21:54 ` jakub at gcc dot gnu dot org
@ 2009-02-05 22:18 ` jakub at gcc dot gnu dot org
  3 siblings, 0 replies; 5+ messages in thread
From: jakub at gcc dot gnu dot org @ 2009-02-05 22:18 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #3 from jakub at gcc dot gnu dot org  2009-02-05 22:17 -------
Fixed.


-- 

jakub at gcc dot gnu dot org changed:

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


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


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

end of thread, other threads:[~2009-02-05 22:18 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-02-05 13:14 [Bug c++/39106] New: [4.4 Regression] aliased to undefined symbol error with thunks jakub at gcc dot gnu dot org
2009-02-05 13:14 ` [Bug c++/39106] " jakub at gcc dot gnu dot org
2009-02-05 15:55 ` jakub at gcc dot gnu dot org
2009-02-05 21:54 ` jakub at gcc dot gnu dot org
2009-02-05 22:18 ` jakub 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).