From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 6076 invoked by alias); 4 Dec 2014 19:33:29 -0000 Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org Received: (qmail 5993 invoked by uid 48); 4 Dec 2014 19:33:25 -0000 From: "hjl.tools at gmail dot com" To: gcc-bugs@gcc.gnu.org Subject: [Bug ipa/64163] [5 Regression] r218024 causes qt5 build failure Date: Thu, 04 Dec 2014 19:33:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: ipa X-Bugzilla-Version: 5.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: hjl.tools at gmail dot com X-Bugzilla-Status: NEW X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: 5.0 X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: bug_status cf_reconfirmed_on everconfirmed Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-SW-Source: 2014-12/txt/msg00493.txt.bz2 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64163 H.J. Lu changed: What |Removed |Added ---------------------------------------------------------------------------- Status|UNCONFIRMED |NEW Last reconfirmed| |2014-12-04 Ever confirmed|0 |1 --- Comment #8 from H.J. Lu --- (In reply to Markus Trippelsdorf from comment #7) > Here is another reduced testcase. This time hopefully without and ODR issues. > > % cat qmimeglobpattern.ii > class A > { > public: > bool deref (); > }; > class QString; > struct B > { > A ref; > }; > template class QList > { > B d; > public: > ~QList (); > class const_iterator > { > }; > const_iterator constBegin (); > void clear (); > void dealloc (); > }; > template QList::~QList () > { > if (d.ref.deref ()) > dealloc (); > } > template > void > QList::clear () > { > QList (); > } > class A1 : public QList > { > }; > class B1 > { > public: > B1 (A1); > }; > struct F > { > void addMatch (const QString &&); > A1 m_matchingMimeTypes; > }; > class G > { > A1 matchingGlobs (const QString &) const; > }; > void > F::addMatch (const QString &&) > { > m_matchingMimeTypes.clear (); > } > A1 > G::matchingGlobs (const QString &) const > { > A1 a; > for (B1 b (a);;) > ; > } > > % cat qmimeprovider.ii > class A > { > public: > bool deref (); > }; > class QString; > struct B > { > A ref; > }; > template class QList > { > B d; > public: > ~QList (); > class const_iterator > { > }; > const_iterator constBegin (); > void clear (); > void dealloc (); > }; > > class C > { > QList c; > QList::const_iterator i; > > public: > C (QList) : i (c.constBegin ()) {} > }; > template QList::~QList () > { > if (d.ref.deref ()) > dealloc (); > } > > void > fn1 () > { > QList a; > C b (a); > } > > % g++ -fuse-ld=bfd -shared -fPIC -O3 -fvisibility=hidden -std=c++0x > qmimeglobpattern.ii qmimeprovider.ii > % g++ -fuse-ld=gold -shared -fPIC -O3 -fvisibility=hidden -std=c++0x > qmimeglobpattern.ii qmimeprovider.ii > /usr/bin/ld.gold: error: /tmp/ccRfiSrB.o: requires dynamic R_X86_64_PC32 > reloc against '_ZN5QListI7QStringED1Ev' which may overflow at runtime; > recompile with -fPIC > /tmp/ccRfiSrB.o:qmimeprovider.ii:function fn1(): warning: relocation refers > to discarded section > /tmp/ccRfiSrB.o:qmimeprovider.ii:function fn1(): warning: relocation refers > to discarded section > /tmp/ccRfiSrB.o:qmimeprovider.ii:function fn1(): warning: relocation refers > to discarded section > collect2: error: ld returned 1 exit status This is caused by r218024.