public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/62224] New: Possible regression in gcc-4.9-20140820
@ 2014-08-22  7:46 chris2553 at googlemail dot com
  2014-08-22  7:50 ` [Bug c++/62224] " chris2553 at googlemail dot com
                   ` (15 more replies)
  0 siblings, 16 replies; 17+ messages in thread
From: chris2553 at googlemail dot com @ 2014-08-22  7:46 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=62224

            Bug ID: 62224
           Summary: Possible regression in gcc-4.9-20140820
           Product: gcc
           Version: 4.9.2
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: chris2553 at googlemail dot com

Building qt-creator-3.2.0 with this week's 4.9.2 (21040820) snapshot fails.
Building it with last week's 4.9.2 (20140813) snapshot succeeds.

My system is a 32 bit user space running on a 64 bit 3.16.1 kernel built from
source. The hardware is a Fujitsu Lifebook AH531 laptop with 8GB RAM.

The gcc build is configured with:

--prefix=/usr --build=i386-pc-linux-gnu --host=i386-pc-linux-gnu
--target=i386-pc-linux-gnu --infodir=/usr/info --mandir=/usr/man
--enable-shared --disable-static --with-system-zlib --enable-threads=posix
--enable-haifa --enable-languages=c,c++ --enable-long-long --enable-namespaces
--enable-multilib --with-gnu-as --with-gnu-ld --with-system-zlib --without-x
--disable-werror --disable-checking --enable-__cxa_atexit --disable-nls
--without-included-gettext i386-pc-linux

The compiler output is:

cd cppeditor/ && make -f Makefile
make[3]: Entering directory
'/home/chris/rpm/BUILD/qt-creator-opensource-src-3.2.0/qt-creator-3.2.0-build/src/plugins/cppeditor'
rm -f libCppEditor.so
g++ -Wl,-z,origin '-Wl,-rpath,$ORIGIN:$ORIGIN/..' -Wl,--no-undefined -Wl,-O1
-shared -Wl,-soname,libCppEditor.so -o libCppEditor.so
.obj/release-shared/cppautocompleter.o .obj/release-shared/cppcanonicalsymbol.o
.obj/release-shared/cppclasswizard.o
.obj/release-shared/cppcodemodelinspectordialog.o
.obj/release-shared/cppdocumentationcommenthelper.o
.obj/release-shared/cppeditor.o .obj/release-shared/cppeditordocument.o
.obj/release-shared/cppeditoroutline.o .obj/release-shared/cppeditorplugin.o
.obj/release-shared/cppelementevaluator.o .obj/release-shared/cppfilewizard.o
.obj/release-shared/cppfollowsymbolundercursor.o
.obj/release-shared/cppfunctiondecldeflink.o
.obj/release-shared/cpphighlighter.o .obj/release-shared/cpphoverhandler.o
.obj/release-shared/cppincludehierarchy.o
.obj/release-shared/cppincludehierarchyitem.o
.obj/release-shared/cppincludehierarchymodel.o
.obj/release-shared/cppincludehierarchytreeview.o
.obj/release-shared/cppinsertvirtualmethods.o
.obj/release-shared/cpplocalrenaming.o .obj/release-shared/cppoutline.o
.obj/release-shared/cpppreprocessordialog.o .obj/release-shared/cppquickfix.o
.obj/release-shared/cppquickfixassistant.o .obj/release-shared/cppquickfixes.o
.obj/release-shared/cppsnippetprovider.o .obj/release-shared/cpptypehierarchy.o
.obj/release-shared/cppvirtualfunctionassistprovider.o
.obj/release-shared/cppvirtualfunctionproposalitem.o
.obj/release-shared/moc_cppclasswizard.o
.obj/release-shared/moc_cppcodemodelinspectordialog.o
.obj/release-shared/moc_cppdocumentationcommenthelper.o
.obj/release-shared/moc_cppeditor.o .obj/release-shared/moc_cppeditordocument.o
.obj/release-shared/moc_cppeditoroutline.o
.obj/release-shared/moc_cppeditorplugin.o
.obj/release-shared/moc_cppfilewizard.o
.obj/release-shared/moc_cppfunctiondecldeflink.o
.obj/release-shared/moc_cpphighlighter.o
.obj/release-shared/moc_cpphoverhandler.o
.obj/release-shared/moc_cppincludehierarchy.o
.obj/release-shared/moc_cppincludehierarchymodel.o
.obj/release-shared/moc_cppinsertvirtualmethods.o
.obj/release-shared/moc_cpplocalrenaming.o .obj/release-shared/moc_cppoutline.o
.obj/release-shared/moc_cpppreprocessordialog.o
.obj/release-shared/moc_cppquickfix.o
.obj/release-shared/moc_cpptypehierarchy.o .obj/release-shared/qrc_cppeditor.o 
 
-L/home/chris/rpm/BUILD/qt-creator-opensource-src-3.2.0/qt-creator-3.2.0-build/lib/qtcreator
-L/home/chris/rpm/BUILD/qt-creator-opensource-src-3.2.0/qt-creator-3.2.0-build/lib/qtcreator/plugins
-lTextEditor -lCore -lCppTools -lProjectExplorer -lCPlusPlus -lAggregation
-lExtensionSystem -lQtcSsh -lUtils -lLanguageUtils -lQtGui -lQtNetwork -lQtCore
-lpthread
.obj/release-shared/cppcodemodelinspectordialog.o: In function
`CppEditor::Internal::CppCodeModelInspectorDialog::refresh()':
cppcodemodelinspectordialog.cpp:(.text+0x79bd): undefined reference to
`CppTools::Internal::CppModelManager::ensureUpdated()'
cppcodemodelinspectordialog.cpp:(.text+0x79fc): undefined reference to
`CppTools::Internal::CppModelManager::ensureUpdated()'
.obj/release-shared/cppcodemodelinspectordialog.o: In function
`CppTools::Internal::CppModelManager::definedMacros()':
cppcodemodelinspectordialog.cpp:(.text._ZN8CppTools8Internal15CppModelManager13definedMacrosEv[_ZN8CppTools8Internal15CppModelManager13definedMacrosEv]+0x26):
undefined reference to `CppTools::Internal::CppModelManager::ensureUpdated()'
.obj/release-shared/cppcodemodelinspectordialog.o: In function
`CppTools::Internal::CppModelManager::headerPaths()':
cppcodemodelinspectordialog.cpp:(.text._ZN8CppTools8Internal15CppModelManager11headerPathsEv[_ZN8CppTools8Internal15CppModelManager11headerPathsEv]+0x26):
undefined reference to `CppTools::Internal::CppModelManager::ensureUpdated()'
collect2: error: ld returned 1 exit status
Makefile:216: recipe for target
'../../../lib/qtcreator/plugins/libCppEditor.so' failed
make[3]: *** [../../../lib/qtcreator/plugins/libCppEditor.so] Error 1
make[3]: Leaving directory
'/home/chris/rpm/BUILD/qt-creator-opensource-src-3.2.0/qt-creator-3.2.0-build/src/plugins/cppeditor'
Makefile:134: recipe for target 'sub-cppeditor-make_default' failed
make[2]: *** [sub-cppeditor-make_default] Error 2
make[2]: Leaving directory
'/home/chris/rpm/BUILD/qt-creator-opensource-src-3.2.0/qt-creator-3.2.0-build/src/plugins'
Makefile:114: recipe for target 'sub-plugins-make_default-ordered' failed
make[1]: *** [sub-plugins-make_default-ordered] Error 2
make[1]: Leaving directory
'/home/chris/rpm/BUILD/qt-creator-opensource-src-3.2.0/qt-creator-3.2.0-build/src'
Makefile:41: recipe for target 'sub-src-make_default-ordered' failed
make: *** [sub-src-make_default-ordered] Error 2

The undefined CppTools::Internal::CppModelManager::ensureUpdated() is defined
in src/plugins/cpptools/cppmodelmanager.cpp and I attach the prepocessed file.


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

* [Bug c++/62224] Possible regression in gcc-4.9-20140820
  2014-08-22  7:46 [Bug c++/62224] New: Possible regression in gcc-4.9-20140820 chris2553 at googlemail dot com
@ 2014-08-22  7:50 ` chris2553 at googlemail dot com
  2014-08-26 10:58 ` [Bug c++/62224] [4.9 Regression] " rguenth at gcc dot gnu.org
                   ` (14 subsequent siblings)
  15 siblings, 0 replies; 17+ messages in thread
From: chris2553 at googlemail dot com @ 2014-08-22  7:50 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=62224

--- Comment #1 from Chris Clayton <chris2553 at googlemail dot com> ---
Created attachment 33377
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=33377&action=edit
Preprocessed source file

ETOOBIG on uncompressed attachment. Now compressed with xz.


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

* [Bug c++/62224] [4.9 Regression] Possible regression in gcc-4.9-20140820
  2014-08-22  7:46 [Bug c++/62224] New: Possible regression in gcc-4.9-20140820 chris2553 at googlemail dot com
  2014-08-22  7:50 ` [Bug c++/62224] " chris2553 at googlemail dot com
@ 2014-08-26 10:58 ` rguenth at gcc dot gnu.org
  2014-08-28  7:55 ` chris2553 at googlemail dot com
                   ` (13 subsequent siblings)
  15 siblings, 0 replies; 17+ messages in thread
From: rguenth at gcc dot gnu.org @ 2014-08-26 10:58 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=62224

Richard Biener <rguenth at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Priority|P3                          |P1
   Target Milestone|---                         |4.9.2
            Summary|Possible regression in      |[4.9 Regression] Possible
                   |gcc-4.9-20140820            |regression in
                   |                            |gcc-4.9-20140820

--- Comment #2 from Richard Biener <rguenth at gcc dot gnu.org> ---
Raising to P1 to be on the radar for the 4.9.2 release.  _Not_ confirmed yet.

I hope the preprocessed source file is that providing the functions the
unresolved references look for.


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

* [Bug c++/62224] [4.9 Regression] Possible regression in gcc-4.9-20140820
  2014-08-22  7:46 [Bug c++/62224] New: Possible regression in gcc-4.9-20140820 chris2553 at googlemail dot com
  2014-08-22  7:50 ` [Bug c++/62224] " chris2553 at googlemail dot com
  2014-08-26 10:58 ` [Bug c++/62224] [4.9 Regression] " rguenth at gcc dot gnu.org
@ 2014-08-28  7:55 ` chris2553 at googlemail dot com
  2014-09-01  9:23 ` jakub at gcc dot gnu.org
                   ` (12 subsequent siblings)
  15 siblings, 0 replies; 17+ messages in thread
From: chris2553 at googlemail dot com @ 2014-08-28  7:55 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=62224

--- Comment #3 from Chris Clayton <chris2553 at googlemail dot com> ---
Yes, the preprocessed file is the one providing the unresolved references.

It surely won't be a surprise to anyone to here that the same failure occurs
when building with yesterday's 4.9 snapshot 4.9-20140827.


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

* [Bug c++/62224] [4.9 Regression] Possible regression in gcc-4.9-20140820
  2014-08-22  7:46 [Bug c++/62224] New: Possible regression in gcc-4.9-20140820 chris2553 at googlemail dot com
                   ` (2 preceding siblings ...)
  2014-08-28  7:55 ` chris2553 at googlemail dot com
@ 2014-09-01  9:23 ` jakub at gcc dot gnu.org
  2014-09-01 21:32 ` chris2553 at googlemail dot com
                   ` (11 subsequent siblings)
  15 siblings, 0 replies; 17+ messages in thread
From: jakub at gcc dot gnu.org @ 2014-09-01  9:23 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=62224

Jakub Jelinek <jakub at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |jakub at gcc dot gnu.org,
                   |                            |jason at gcc dot gnu.org

--- Comment #4 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
So perhaps the r214208 change?  Can you try to back that out and retry?


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

* [Bug c++/62224] [4.9 Regression] Possible regression in gcc-4.9-20140820
  2014-08-22  7:46 [Bug c++/62224] New: Possible regression in gcc-4.9-20140820 chris2553 at googlemail dot com
                   ` (3 preceding siblings ...)
  2014-09-01  9:23 ` jakub at gcc dot gnu.org
@ 2014-09-01 21:32 ` chris2553 at googlemail dot com
  2014-09-02 17:57 ` jason at gcc dot gnu.org
                   ` (10 subsequent siblings)
  15 siblings, 0 replies; 17+ messages in thread
From: chris2553 at googlemail dot com @ 2014-09-01 21:32 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=62224

--- Comment #5 from Chris Clayton <chris2553 at googlemail dot com> ---
I reverted the code change from r214208 with the following patch:

--- gcc-4.9-20140827-orig/gcc/cp/decl2.c        2014-08-20 02:54:40.000000000
+0100
+++ gcc-4.9-20140827/gcc/cp/decl2.c     2014-09-01 21:07:29.799905722 +0100
@@ -1934,11 +1934,6 @@ decl_needed_p (tree decl)
   if (flag_keep_inline_dllexport
       && lookup_attribute ("dllexport", DECL_ATTRIBUTES (decl)))
     return true;
-  /* Virtual functions might be needed for devirtualization.  */
-  if (flag_devirtualize
-      && TREE_CODE (decl) == FUNCTION_DECL
-      && DECL_VIRTUAL_P (decl))
-    return true;
   /* Otherwise, DECL does not need to be emitted -- yet.  A subsequent
      reference to DECL might cause it to be emitted later.  */
   return false;

With this patch applied to gcc-4.9-20140827, I can now build qt-creator-3.2.0
successfully.


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

* [Bug c++/62224] [4.9 Regression] Possible regression in gcc-4.9-20140820
  2014-08-22  7:46 [Bug c++/62224] New: Possible regression in gcc-4.9-20140820 chris2553 at googlemail dot com
                   ` (4 preceding siblings ...)
  2014-09-01 21:32 ` chris2553 at googlemail dot com
@ 2014-09-02 17:57 ` jason at gcc dot gnu.org
  2014-09-02 19:09 ` chris2553 at googlemail dot com
                   ` (9 subsequent siblings)
  15 siblings, 0 replies; 17+ messages in thread
From: jason at gcc dot gnu.org @ 2014-09-02 17:57 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=62224

--- Comment #6 from Jason Merrill <jason at gcc dot gnu.org> ---
I don't see cppmodelmanager in that link command, so I'm guessing ensureUpdated
is hidden in a different .so?  Certainly compiling the preprocessed file you
attached provides a definition of the symbol.  Can you also attach a
preprocessed cppcodemodelinspectordialog?


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

* [Bug c++/62224] [4.9 Regression] Possible regression in gcc-4.9-20140820
  2014-08-22  7:46 [Bug c++/62224] New: Possible regression in gcc-4.9-20140820 chris2553 at googlemail dot com
                   ` (5 preceding siblings ...)
  2014-09-02 17:57 ` jason at gcc dot gnu.org
@ 2014-09-02 19:09 ` chris2553 at googlemail dot com
  2014-09-02 20:20 ` trippels at gcc dot gnu.org
                   ` (8 subsequent siblings)
  15 siblings, 0 replies; 17+ messages in thread
From: chris2553 at googlemail dot com @ 2014-09-02 19:09 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=62224

--- Comment #7 from Chris Clayton <chris2553 at googlemail dot com> ---
Created attachment 33439
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=33439&action=edit
Pre-processed cppcodemodelinspectordialog

cppcodemodelinspectordialog.ii compressed with xz.


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

* [Bug c++/62224] [4.9 Regression] Possible regression in gcc-4.9-20140820
  2014-08-22  7:46 [Bug c++/62224] New: Possible regression in gcc-4.9-20140820 chris2553 at googlemail dot com
                   ` (6 preceding siblings ...)
  2014-09-02 19:09 ` chris2553 at googlemail dot com
@ 2014-09-02 20:20 ` trippels at gcc dot gnu.org
  2014-09-02 20:55 ` chris2553 at googlemail dot com
                   ` (7 subsequent siblings)
  15 siblings, 0 replies; 17+ messages in thread
From: trippels at gcc dot gnu.org @ 2014-09-02 20:20 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=62224

--- Comment #8 from Markus Trippelsdorf <trippels at gcc dot gnu.org> ---
I don't think this is a compiler bug.
cppmodelmanager.o is simply missing in the object file list of the
libCppEditor.so link command. 

And the undefined symbol from cppcodemodelinspectordialog.ii is also correct,
because "void ensureUpdated()" is declared, but not defined in that file.


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

* [Bug c++/62224] [4.9 Regression] Possible regression in gcc-4.9-20140820
  2014-08-22  7:46 [Bug c++/62224] New: Possible regression in gcc-4.9-20140820 chris2553 at googlemail dot com
                   ` (7 preceding siblings ...)
  2014-09-02 20:20 ` trippels at gcc dot gnu.org
@ 2014-09-02 20:55 ` chris2553 at googlemail dot com
  2014-09-02 21:22 ` trippels at gcc dot gnu.org
                   ` (6 subsequent siblings)
  15 siblings, 0 replies; 17+ messages in thread
From: chris2553 at googlemail dot com @ 2014-09-02 20:55 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=62224

--- Comment #9 from Chris Clayton <chris2553 at googlemail dot com> ---
That seems odd to me, although I'm happy to be told I'm wrong. I base this on
the fact that reverting the code change from r214208 permits a successful
build. MoreOver, in both the failed and sucessful builds, ensureUpdated is
present in cppmodelmanager.o and that is linked into libCppTools.so as can be
seen by:

[chris:~/rpm/build/qt-creator-opensource-src-3.2.0-fail/qt-creator-3.2.0-build]$
nm lib/qtcreator/plugins/libCppTools.so | grep ensureUpdated
000af430 t _ZN8CppTools8Internal15CppModelManager13ensureUpdatedEv
[chris:~/rpm/build/qt-creator-opensource-src-3.2.0-fail/qt-creator-3.2.0-build]$
cd ~/rpm/build/qt-creator-opensource-src-3.2.0/qt-creator-3.2.0-build
[chris:~/rpm/build/qt-creator-opensource-src-3.2.0/qt-creator-3.2.0-build]$ nm
lib/qtcreator/plugins/libCppTools.so | grep ensureUpdated
000af640 t _ZN8CppTools8Internal15CppModelManager13ensureUpdatedEv

cppmodelmanager.0 is listed (in Makefile) as an object to be included in the
link of libCppTools.so in both builds.

I don't know whether it will be of any help, but I've diffed cppmodelmanager.ii
produced in the two builds and the output is:

--- cppmodelmanager.ii.good     2014-09-02 21:25:02.559799184 +0100
+++ cppmodelmanager.ii.fail     2014-08-22 08:27:06.000000000 +0100
@@ -18581,23 +18581,7 @@ namespace std __attribute__ ((__visibili
     inline basic_istream<_CharT, _Traits>&
     getline(basic_istream<_CharT, _Traits>& __is,
      basic_string<_CharT, _Traits, _Alloc>& __str)
-    { return std::getline(__is, __str, __is.widen('\n')); }
-
-
-
-  template<typename _CharT, typename _Traits, typename _Alloc>
-    inline basic_istream<_CharT, _Traits>&
-    getline(basic_istream<_CharT, _Traits>&& __is,
-     basic_string<_CharT, _Traits, _Alloc>& __str, _CharT __delim)
-    { return std::getline(__is, __str, __delim); }
-
-
-  template<typename _CharT, typename _Traits, typename _Alloc>
-    inline basic_istream<_CharT, _Traits>&
-    getline(basic_istream<_CharT, _Traits>&& __is,
-     basic_string<_CharT, _Traits, _Alloc>& __str)
-    { return std::getline(__is, __str); }
-
+    { return getline(__is, __str, __is.widen('\n')); }

   template<>
     basic_istream<char>&
@@ -19695,7 +19679,7 @@ namespace __gnu_cxx __attribute__ ((__vi


 }
-# 2851 "/usr/include/c++/4.9.2/bits/basic_string.h" 2 3
+# 2835 "/usr/include/c++/4.9.2/bits/basic_string.h" 2 3

 namespace std __attribute__ ((__visibility__ ("default")))
 {
@@ -20103,7 +20087,7 @@ namespace std __attribute__ ((__visibili


 }
-# 3069 "/usr/include/c++/4.9.2/bits/basic_string.h" 2 3
+# 3053 "/usr/include/c++/4.9.2/bits/basic_string.h" 2 3

 namespace std __attribute__ ((__visibility__ ("default")))
 {
@@ -20174,7 +20158,7 @@ namespace std __attribute__ ((__visibili
   template<>
     struct __is_fast_hash<hash<u32string>> : std::false_type
     { };
-# 3173 "/usr/include/c++/4.9.2/bits/basic_string.h" 3
+# 3157 "/usr/include/c++/4.9.2/bits/basic_string.h" 3

 }
 # 53 "/usr/include/c++/4.9.2/string" 2 3


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

* [Bug c++/62224] [4.9 Regression] Possible regression in gcc-4.9-20140820
  2014-08-22  7:46 [Bug c++/62224] New: Possible regression in gcc-4.9-20140820 chris2553 at googlemail dot com
                   ` (8 preceding siblings ...)
  2014-09-02 20:55 ` chris2553 at googlemail dot com
@ 2014-09-02 21:22 ` trippels at gcc dot gnu.org
  2014-09-03  6:57 ` trippels at gcc dot gnu.org
                   ` (5 subsequent siblings)
  15 siblings, 0 replies; 17+ messages in thread
From: trippels at gcc dot gnu.org @ 2014-09-02 21:22 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=62224

--- Comment #10 from Markus Trippelsdorf <trippels at gcc dot gnu.org> ---
(In reply to Chris Clayton from comment #9)
> That seems odd to me, although I'm happy to be told I'm wrong. I base this
> on the fact that reverting the code change from r214208 permits a successful
> build. MoreOver, in both the failed and sucessful builds, ensureUpdated is
> present in cppmodelmanager.o and that is linked into libCppTools.so.

Before r214208 the body of "virtual QByteArray
CppTools::Internal::CppModelManager::definedMacros()" (and the other two
virtual functions) that call ensureUpdated() were removed:

_ZN8CppTools8Internal15CppModelManager13definedMacrosEv/6495 (virtual
QByteArray CppTools::Internal::CppModelManager::definedMacros())
@0x7f601c207520
Type: function
Body removed by symtab_remove_unreachable_nodes
Visibility: external public weak comdat
comdat_group:_ZN8CppTools8Internal15CppModelManager13definedMacrosEv one_only
virtual

Now these virtual function bodies are kept:

_ZN8CppTools8Internal15CppModelManager13definedMacrosEv/6495 (virtual
QByteArray CppTools::Internal::CppModelManager::definedMacros())
@0x7f67c0347520                        
  Type: function definition analyzed
  Visibility: externally_visible public weak comdat
comdat_group:_ZN8CppTools8Internal15CppModelManager13definedMacrosEv one_only
virtual
  previous sharing asm name: 12475
  Address is taken.
  References:
  Referring: _ZN9CppEditor8Internal27CppCodeModelInspectorDialog7refreshEv/6819
(addr) (speculative)
  Availability: available
  First run: 0
  Function flags: body
  Called by:
  Calls: _ZN8CppTools8Internal15CppModelManager13ensureUpdatedEv/10759 (1.00
per call) (can throw external)

And there is nothing wrong with that AFAICS.


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

* [Bug c++/62224] [4.9 Regression] Possible regression in gcc-4.9-20140820
  2014-08-22  7:46 [Bug c++/62224] New: Possible regression in gcc-4.9-20140820 chris2553 at googlemail dot com
                   ` (9 preceding siblings ...)
  2014-09-02 21:22 ` trippels at gcc dot gnu.org
@ 2014-09-03  6:57 ` trippels at gcc dot gnu.org
  2014-09-03  7:33 ` chris2553 at googlemail dot com
                   ` (4 subsequent siblings)
  15 siblings, 0 replies; 17+ messages in thread
From: trippels at gcc dot gnu.org @ 2014-09-03  6:57 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=62224

Markus Trippelsdorf <trippels at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |RESOLVED
         Resolution|---                         |INVALID

--- Comment #11 from Markus Trippelsdorf <trippels at gcc dot gnu.org> ---
Here's a small testcase:

markus@x4 tmp % cat cppcodemodelinspectordialog.ii
namespace CppTools
{
class A
{
public:
  virtual void headerPaths () = 0;
};
namespace Internal
{
class CppModelManager : CppTools::A
{
  void
  headerPaths ()
  {
    ensureUpdated ();
  }
  void ensureUpdated ();
};
}
}
CppTools::A *a;
void
fn1 ()
{
  a->headerPaths ();
}

(before r214208)
markus@x4 tmp % g++ -Wl,--no-undefined -shared -fPIC -O2
cppcodemodelinspectordialog.ii
markus@x4 tmp %

(after r214208)
markus@x4 tmp % g++ -Wl,--no-undefined -shared -fPIC -O2
cppcodemodelinspectordialog.ii
/tmp/ccMZQE0g.o:cppcodemodelinspectordialog.ii:function fn1(): error: undefined
reference to 'CppTools::Internal::CppModelManager::ensureUpdated()'
/tmp/ccMZQE0g.o:cppcodemodelinspectordialog.ii:function
CppTools::Internal::CppModelManager::headerPaths(): error: undefined reference
to 'CppTools::Internal::CppModelManager::ensureUpdated()'
collect2: error: ld returned 1 exit status

(one can use -fno-devirtualize-speculatively as a workaround)
markus@x4 tmp % g++ -Wl,--no-undefined -fno-devirtualize-speculatively -shared
-fPIC -O2 cppcodemodelinspectordialog.ii
markus@x4 tmp %


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

* [Bug c++/62224] [4.9 Regression] Possible regression in gcc-4.9-20140820
  2014-08-22  7:46 [Bug c++/62224] New: Possible regression in gcc-4.9-20140820 chris2553 at googlemail dot com
                   ` (10 preceding siblings ...)
  2014-09-03  6:57 ` trippels at gcc dot gnu.org
@ 2014-09-03  7:33 ` chris2553 at googlemail dot com
  2014-09-03  7:44 ` trippels at gcc dot gnu.org
                   ` (3 subsequent siblings)
  15 siblings, 0 replies; 17+ messages in thread
From: chris2553 at googlemail dot com @ 2014-09-03  7:33 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=62224

--- Comment #12 from Chris Clayton <chris2553 at googlemail dot com> ---
Sorry, you'll have to stick with me here while a figure out what that means.

I think you are saying that prior to r214208, the symbols definedMacros() and
headerPaths() were present but effectively no-ops. Post r214208 they now
"contain" operations including calls to ensureUpdated().

Given that the symbol for ensureUpdated() appears to be present in
libCppTools.so (along with the symbols for its two post-r214208 callers), does
that suggest a problem with the linker, which is /usr/bin/ld from the latest
version (2.24) of binutils?

Or could it be anything to do with my system being a 32bit userspace on a 64bit
kernel? I usually build packages as rpms and have the rpm binary wrapped in a
script which uses prefixes the call to the actual rpm binary with "setarch
i386". I've been careful whilst investigated this problem to make sure that I
prefix calls to qmake and make with "setarch i386". I've built loads and loads
of packages with this setup (including gcc).

I'm just trying to figure out the next port of call with this problem. I note
that the Debian folks have a bug logged but seem to be waiting on resolution
via this bug report - https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=759862.


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

* [Bug c++/62224] [4.9 Regression] Possible regression in gcc-4.9-20140820
  2014-08-22  7:46 [Bug c++/62224] New: Possible regression in gcc-4.9-20140820 chris2553 at googlemail dot com
                   ` (11 preceding siblings ...)
  2014-09-03  7:33 ` chris2553 at googlemail dot com
@ 2014-09-03  7:44 ` trippels at gcc dot gnu.org
  2014-09-03  9:26 ` trippels at gcc dot gnu.org
                   ` (2 subsequent siblings)
  15 siblings, 0 replies; 17+ messages in thread
From: trippels at gcc dot gnu.org @ 2014-09-03  7:44 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=62224

--- Comment #13 from Markus Trippelsdorf <trippels at gcc dot gnu.org> ---
(In reply to Chris Clayton from comment #12)
> Sorry, you'll have to stick with me here while a figure out what that means.
> 
> I think you are saying that prior to r214208, the symbols definedMacros()
> and headerPaths() were present but effectively no-ops. Post r214208 they now
> "contain" operations including calls to ensureUpdated().
> 
> Given that the symbol for ensureUpdated() appears to be present in
> libCppTools.so (along with the symbols for its two post-r214208 callers),
> does that suggest a problem with the linker, which is /usr/bin/ld from the
> latest version (2.24) of binutils?

No. This has nothing to do with libCppTools.so. As I wrote before the 
build system of qt-creator must be changed to provide the missing symbol
by simply adding cppmodelmanager.o to the libCppEditor.so link command.


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

* [Bug c++/62224] [4.9 Regression] Possible regression in gcc-4.9-20140820
  2014-08-22  7:46 [Bug c++/62224] New: Possible regression in gcc-4.9-20140820 chris2553 at googlemail dot com
                   ` (12 preceding siblings ...)
  2014-09-03  7:44 ` trippels at gcc dot gnu.org
@ 2014-09-03  9:26 ` trippels at gcc dot gnu.org
  2014-09-09 11:58 ` jason at gcc dot gnu.org
  2014-09-09 12:13 ` trippels at gcc dot gnu.org
  15 siblings, 0 replies; 17+ messages in thread
From: trippels at gcc dot gnu.org @ 2014-09-03  9:26 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=62224

--- Comment #14 from Markus Trippelsdorf <trippels at gcc dot gnu.org> ---
(In reply to Markus Trippelsdorf from comment #13)
> (In reply to Chris Clayton from comment #12)
> > Sorry, you'll have to stick with me here while a figure out what that means.
> > 
> > I think you are saying that prior to r214208, the symbols definedMacros()
> > and headerPaths() were present but effectively no-ops. Post r214208 they now
> > "contain" operations including calls to ensureUpdated().
> > 
> > Given that the symbol for ensureUpdated() appears to be present in
> > libCppTools.so (along with the symbols for its two post-r214208 callers),
> > does that suggest a problem with the linker, which is /usr/bin/ld from the
> > latest version (2.24) of binutils?
> 
> No. This has nothing to do with libCppTools.so. As I wrote before the 
> build system of qt-creator must be changed to provide the missing symbol
> by simply adding cppmodelmanager.o to the libCppEditor.so link command.

Out of curiosity, I have downloaded and tried to build qt-creator-3.2.0.
The build failed exactly as you described in commment 0.

The fix is simple, just add  __attribute__ ((visibility ("default"))) to
CppModelManager::ensureUpdated() in src/plugins/cpptools/cppmodelmanager.cpp:

294  __attribute__ ((visibility ("default")))
295 void CppModelManager::ensureUpdated()
296 {

This will make _ZN8CppTools8Internal15CppModelManager13ensureUpdatedEv external
for libCppTools.so and everything is fine.


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

* [Bug c++/62224] [4.9 Regression] Possible regression in gcc-4.9-20140820
  2014-08-22  7:46 [Bug c++/62224] New: Possible regression in gcc-4.9-20140820 chris2553 at googlemail dot com
                   ` (13 preceding siblings ...)
  2014-09-03  9:26 ` trippels at gcc dot gnu.org
@ 2014-09-09 11:58 ` jason at gcc dot gnu.org
  2014-09-09 12:13 ` trippels at gcc dot gnu.org
  15 siblings, 0 replies; 17+ messages in thread
From: jason at gcc dot gnu.org @ 2014-09-09 11:58 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=62224

--- Comment #15 from Jason Merrill <jason at gcc dot gnu.org> ---
Author: jason
Date: Tue Sep  9 11:57:25 2014
New Revision: 215061

URL: https://gcc.gnu.org/viewcvs?rev=215061&root=gcc&view=rev
Log:
    PR c++/61214
    PR c++/62224
gcc/
    * gimple-fold.c (can_refer_decl_in_current_unit_p): Don't allow
    reference to a DECL_EXTERNAL COMDAT.
gcc/cp/
    * decl2.c (decl_needed_p): Revert virtual functions change.

Added:
    branches/gcc-4_9-branch/gcc/testsuite/g++.dg/ipa/devirt-40.C
Modified:
    branches/gcc-4_9-branch/gcc/ChangeLog
    branches/gcc-4_9-branch/gcc/cp/ChangeLog
    branches/gcc-4_9-branch/gcc/cp/decl2.c
    branches/gcc-4_9-branch/gcc/gimple-fold.c
    branches/gcc-4_9-branch/gcc/testsuite/g++.dg/ipa/devirt-39.C


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

* [Bug c++/62224] [4.9 Regression] Possible regression in gcc-4.9-20140820
  2014-08-22  7:46 [Bug c++/62224] New: Possible regression in gcc-4.9-20140820 chris2553 at googlemail dot com
                   ` (14 preceding siblings ...)
  2014-09-09 11:58 ` jason at gcc dot gnu.org
@ 2014-09-09 12:13 ` trippels at gcc dot gnu.org
  15 siblings, 0 replies; 17+ messages in thread
From: trippels at gcc dot gnu.org @ 2014-09-09 12:13 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=62224

Markus Trippelsdorf <trippels at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         Resolution|INVALID                     |FIXED

--- Comment #16 from Markus Trippelsdorf <trippels at gcc dot gnu.org> ---
Changing resolution. Fixed.


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

end of thread, other threads:[~2014-09-09 12:13 UTC | newest]

Thread overview: 17+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-08-22  7:46 [Bug c++/62224] New: Possible regression in gcc-4.9-20140820 chris2553 at googlemail dot com
2014-08-22  7:50 ` [Bug c++/62224] " chris2553 at googlemail dot com
2014-08-26 10:58 ` [Bug c++/62224] [4.9 Regression] " rguenth at gcc dot gnu.org
2014-08-28  7:55 ` chris2553 at googlemail dot com
2014-09-01  9:23 ` jakub at gcc dot gnu.org
2014-09-01 21:32 ` chris2553 at googlemail dot com
2014-09-02 17:57 ` jason at gcc dot gnu.org
2014-09-02 19:09 ` chris2553 at googlemail dot com
2014-09-02 20:20 ` trippels at gcc dot gnu.org
2014-09-02 20:55 ` chris2553 at googlemail dot com
2014-09-02 21:22 ` trippels at gcc dot gnu.org
2014-09-03  6:57 ` trippels at gcc dot gnu.org
2014-09-03  7:33 ` chris2553 at googlemail dot com
2014-09-03  7:44 ` trippels at gcc dot gnu.org
2014-09-03  9:26 ` trippels at gcc dot gnu.org
2014-09-09 11:58 ` jason at gcc dot gnu.org
2014-09-09 12:13 ` trippels at gcc dot gnu.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).