* [Bug c++/61214] [4.9/4.10 regression] Weird interaction between -fvisibility-inlines-hidden, inline virtuals and devirtualization
2014-05-18 2:46 [Bug c++/61214] New: [4.9 regression] Weird interaction between -fvisibility-inlines-hidden, inline virtuals and devirtualization delroth@dolphin-emu.org
@ 2014-05-19 10:39 ` rguenth at gcc dot gnu.org
2014-06-03 4:14 ` jason at gcc dot gnu.org
` (9 subsequent siblings)
10 siblings, 0 replies; 12+ messages in thread
From: rguenth at gcc dot gnu.org @ 2014-05-19 10:39 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61214
Richard Biener <rguenth at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |hubicka at gcc dot gnu.org,
| |jason at gcc dot gnu.org
Target Milestone|--- |4.9.1
Summary|[4.9 regression] Weird |[4.9/4.10 regression] Weird
|interaction between |interaction between
|-fvisibility-inlines-hidden |-fvisibility-inlines-hidden
|, inline virtuals and |, inline virtuals and
|devirtualization |devirtualization
>From gcc-bugs-return-451892-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org Mon May 19 10:39:46 2014
Return-Path: <gcc-bugs-return-451892-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org>
Delivered-To: listarch-gcc-bugs@gcc.gnu.org
Received: (qmail 2388 invoked by alias); 19 May 2014 10:39:46 -0000
Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm
Precedence: bulk
List-Id: <gcc-bugs.gcc.gnu.org>
List-Archive: <http://gcc.gnu.org/ml/gcc-bugs/>
List-Post: <mailto:gcc-bugs@gcc.gnu.org>
List-Help: <mailto:gcc-bugs-help@gcc.gnu.org>
Sender: gcc-bugs-owner@gcc.gnu.org
Delivered-To: mailing list gcc-bugs@gcc.gnu.org
Received: (qmail 2329 invoked by uid 48); 19 May 2014 10:39:42 -0000
From: "rguenth at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug ipa/61211] [4.9/4.10 Regression] ICE: verify_cgraph_node failed: edge points to wrong declaration with -O3 -fno-inline
Date: Mon, 19 May 2014 10:39: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: 4.10.0
X-Bugzilla-Keywords: ice-on-valid-code
X-Bugzilla-Severity: normal
X-Bugzilla-Who: rguenth at gcc dot gnu.org
X-Bugzilla-Status: UNCONFIRMED
X-Bugzilla-Priority: P3
X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org
X-Bugzilla-Target-Milestone: 4.9.1
X-Bugzilla-Flags:
X-Bugzilla-Changed-Fields: cc target_milestone
Message-ID: <bug-61211-4-wq9wFuW5yv@http.gcc.gnu.org/bugzilla/>
In-Reply-To: <bug-61211-4@http.gcc.gnu.org/bugzilla/>
References: <bug-61211-4@http.gcc.gnu.org/bugzilla/>
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-05/txt/msg01584.txt.bz2
Content-length: 447
https://gcc.gnu.org/bugzilla/show_bug.cgi?ida211
Richard Biener <rguenth at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |hubicka at gcc dot gnu.org,
| |jamborm at gcc dot gnu.org
Target Milestone|--- |4.9.1
^ permalink raw reply [flat|nested] 12+ messages in thread
* [Bug c++/61214] [4.9/4.10 regression] Weird interaction between -fvisibility-inlines-hidden, inline virtuals and devirtualization
2014-05-18 2:46 [Bug c++/61214] New: [4.9 regression] Weird interaction between -fvisibility-inlines-hidden, inline virtuals and devirtualization delroth@dolphin-emu.org
2014-05-19 10:39 ` [Bug c++/61214] [4.9/4.10 " rguenth at gcc dot gnu.org
@ 2014-06-03 4:14 ` jason at gcc dot gnu.org
2014-06-03 16:01 ` jason at gcc dot gnu.org
` (8 subsequent siblings)
10 siblings, 0 replies; 12+ messages in thread
From: jason at gcc dot gnu.org @ 2014-06-03 4:14 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61214
Jason Merrill <jason at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |NEW
Last reconfirmed| |2014-06-03
Ever confirmed|0 |1
--- Comment #1 from Jason Merrill <jason at gcc dot gnu.org> ---
The current trunk (r211157) doesn't devirtualize the call to Foo::clone; it
goes through the vtable even though we know which vtable we're dealing with. I
would guess that this is due to a change to can_refer_decl_in_current_unit_p.
^ permalink raw reply [flat|nested] 12+ messages in thread
* [Bug c++/61214] [4.9/4.10 regression] Weird interaction between -fvisibility-inlines-hidden, inline virtuals and devirtualization
2014-05-18 2:46 [Bug c++/61214] New: [4.9 regression] Weird interaction between -fvisibility-inlines-hidden, inline virtuals and devirtualization delroth@dolphin-emu.org
2014-05-19 10:39 ` [Bug c++/61214] [4.9/4.10 " rguenth at gcc dot gnu.org
2014-06-03 4:14 ` jason at gcc dot gnu.org
@ 2014-06-03 16:01 ` jason at gcc dot gnu.org
2014-06-13 23:49 ` delroth@dolphin-emu.org
` (7 subsequent siblings)
10 siblings, 0 replies; 12+ messages in thread
From: jason at gcc dot gnu.org @ 2014-06-03 16:01 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61214
--- Comment #2 from Jason Merrill <jason at gcc dot gnu.org> ---
I wonder why we don't inline Foo::clone, though.
^ permalink raw reply [flat|nested] 12+ messages in thread
* [Bug c++/61214] [4.9/4.10 regression] Weird interaction between -fvisibility-inlines-hidden, inline virtuals and devirtualization
2014-05-18 2:46 [Bug c++/61214] New: [4.9 regression] Weird interaction between -fvisibility-inlines-hidden, inline virtuals and devirtualization delroth@dolphin-emu.org
` (2 preceding siblings ...)
2014-06-03 16:01 ` jason at gcc dot gnu.org
@ 2014-06-13 23:49 ` delroth@dolphin-emu.org
2014-06-30 12:14 ` vz-gcc at zeitlins dot org
` (6 subsequent siblings)
10 siblings, 0 replies; 12+ messages in thread
From: delroth@dolphin-emu.org @ 2014-06-13 23:49 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61214
--- Comment #3 from Pierre Bourdon <delroth@dolphin-emu.org> ---
I'm more wondering why Foo::clone is not being instantiated by the code that
calls it.
Does C++ specify that virtual inline functions are guaranteed to be
instantiated in the compilation unit that contains the vtable? It looks like
this is the assumption made by GCC at the moment.
FYI, a more "real" testcase: if you build wxWidgets 3.0 with
-fvisibility=hidden -fvisibility-inlines-hidden (the default, afaict), the
following will work on gcc 4.8 but not 4.9:
$ cat >testcase.cpp <<EOF
#include <wx/event.h>
int main()
{
wxEvent* evt = new wxNotifyEvent();
evt->Clone();
return 0;
}
EOF
$ g++ -std=c++11 -O3 $(wx-config --cxxflags --libs) testcase.cpp
^ permalink raw reply [flat|nested] 12+ messages in thread
* [Bug c++/61214] [4.9/4.10 regression] Weird interaction between -fvisibility-inlines-hidden, inline virtuals and devirtualization
2014-05-18 2:46 [Bug c++/61214] New: [4.9 regression] Weird interaction between -fvisibility-inlines-hidden, inline virtuals and devirtualization delroth@dolphin-emu.org
` (3 preceding siblings ...)
2014-06-13 23:49 ` delroth@dolphin-emu.org
@ 2014-06-30 12:14 ` vz-gcc at zeitlins dot org
2014-07-01 23:17 ` jason at gcc dot gnu.org
` (5 subsequent siblings)
10 siblings, 0 replies; 12+ messages in thread
From: vz-gcc at zeitlins dot org @ 2014-06-30 12:14 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61214
Vadim Zeitlin <vz-gcc at zeitlins dot org> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |vz-gcc at zeitlins dot org
--- Comment #4 from Vadim Zeitlin <vz-gcc at zeitlins dot org> ---
I'd be grateful for any workaround suggestions in the meanwhile. We have one
patch at http://trac.wxwidgets.org/ticket/16359 but it is rather ugly, so it
would be great if someone could propose something better. TIA!
BTW, -O3 is not necessary to see the bug, compiling the test case with just -O
(or -O1, -O2, ...) is enough, it only links without any optimizations at all.
^ permalink raw reply [flat|nested] 12+ messages in thread
* [Bug c++/61214] [4.9/4.10 regression] Weird interaction between -fvisibility-inlines-hidden, inline virtuals and devirtualization
2014-05-18 2:46 [Bug c++/61214] New: [4.9 regression] Weird interaction between -fvisibility-inlines-hidden, inline virtuals and devirtualization delroth@dolphin-emu.org
` (4 preceding siblings ...)
2014-06-30 12:14 ` vz-gcc at zeitlins dot org
@ 2014-07-01 23:17 ` jason at gcc dot gnu.org
2014-07-16 13:31 ` jakub at gcc dot gnu.org
` (4 subsequent siblings)
10 siblings, 0 replies; 12+ messages in thread
From: jason at gcc dot gnu.org @ 2014-07-01 23:17 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61214
--- Comment #5 from Jason Merrill <jason at gcc dot gnu.org> ---
(In reply to Vadim Zeitlin from comment #4)
> I'd be grateful for any workaround suggestions in the meanwhile.
-fno-devirtualize should avoid the problem.
^ permalink raw reply [flat|nested] 12+ messages in thread
* [Bug c++/61214] [4.9/4.10 regression] Weird interaction between -fvisibility-inlines-hidden, inline virtuals and devirtualization
2014-05-18 2:46 [Bug c++/61214] New: [4.9 regression] Weird interaction between -fvisibility-inlines-hidden, inline virtuals and devirtualization delroth@dolphin-emu.org
` (5 preceding siblings ...)
2014-07-01 23:17 ` jason at gcc dot gnu.org
@ 2014-07-16 13:31 ` jakub at gcc dot gnu.org
2014-08-20 1:55 ` [Bug c++/61214] [4.9/5 " jason at gcc dot gnu.org
` (3 subsequent siblings)
10 siblings, 0 replies; 12+ messages in thread
From: jakub at gcc dot gnu.org @ 2014-07-16 13:31 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61214
Jakub Jelinek <jakub at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Target Milestone|4.9.1 |4.9.2
--- Comment #6 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
GCC 4.9.1 has been released.
^ permalink raw reply [flat|nested] 12+ messages in thread
* [Bug c++/61214] [4.9/5 regression] Weird interaction between -fvisibility-inlines-hidden, inline virtuals and devirtualization
2014-05-18 2:46 [Bug c++/61214] New: [4.9 regression] Weird interaction between -fvisibility-inlines-hidden, inline virtuals and devirtualization delroth@dolphin-emu.org
` (6 preceding siblings ...)
2014-07-16 13:31 ` jakub at gcc dot gnu.org
@ 2014-08-20 1:55 ` jason at gcc dot gnu.org
2014-08-20 2:04 ` jason at gcc dot gnu.org
` (2 subsequent siblings)
10 siblings, 0 replies; 12+ messages in thread
From: jason at gcc dot gnu.org @ 2014-08-20 1:55 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61214
--- Comment #7 from Jason Merrill <jason at gcc dot gnu.org> ---
Author: jason
Date: Wed Aug 20 01:54:40 2014
New Revision: 214208
URL: https://gcc.gnu.org/viewcvs?rev=214208&root=gcc&view=rev
Log:
PR c++/61214
PR tree-optimization/62091
* decl2.c (decl_needed_p): Return true for virtual functions when
devirtualizing.
Added:
branches/gcc-4_9-branch/gcc/testsuite/g++.dg/ipa/devirt-39.C
Modified:
branches/gcc-4_9-branch/gcc/cp/ChangeLog
branches/gcc-4_9-branch/gcc/cp/decl2.c
^ permalink raw reply [flat|nested] 12+ messages in thread
* [Bug c++/61214] [4.9/5 regression] Weird interaction between -fvisibility-inlines-hidden, inline virtuals and devirtualization
2014-05-18 2:46 [Bug c++/61214] New: [4.9 regression] Weird interaction between -fvisibility-inlines-hidden, inline virtuals and devirtualization delroth@dolphin-emu.org
` (7 preceding siblings ...)
2014-08-20 1:55 ` [Bug c++/61214] [4.9/5 " jason at gcc dot gnu.org
@ 2014-08-20 2:04 ` jason at gcc dot gnu.org
2014-09-09 11:58 ` jason at gcc dot gnu.org
2021-09-10 7:09 ` pinskia at gcc dot gnu.org
10 siblings, 0 replies; 12+ messages in thread
From: jason at gcc dot gnu.org @ 2014-08-20 2:04 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61214
Jason Merrill <jason at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|NEW |RESOLVED
Resolution|--- |FIXED
--- Comment #8 from Jason Merrill <jason at gcc dot gnu.org> ---
Fixed for 4.9.2 and trunk.
^ permalink raw reply [flat|nested] 12+ messages in thread
* [Bug c++/61214] [4.9/5 regression] Weird interaction between -fvisibility-inlines-hidden, inline virtuals and devirtualization
2014-05-18 2:46 [Bug c++/61214] New: [4.9 regression] Weird interaction between -fvisibility-inlines-hidden, inline virtuals and devirtualization delroth@dolphin-emu.org
` (8 preceding siblings ...)
2014-08-20 2:04 ` jason at gcc dot gnu.org
@ 2014-09-09 11:58 ` jason at gcc dot gnu.org
2021-09-10 7:09 ` pinskia at gcc dot gnu.org
10 siblings, 0 replies; 12+ 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=61214
--- Comment #9 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] 12+ messages in thread
* [Bug c++/61214] [4.9/5 regression] Weird interaction between -fvisibility-inlines-hidden, inline virtuals and devirtualization
2014-05-18 2:46 [Bug c++/61214] New: [4.9 regression] Weird interaction between -fvisibility-inlines-hidden, inline virtuals and devirtualization delroth@dolphin-emu.org
` (9 preceding siblings ...)
2014-09-09 11:58 ` jason at gcc dot gnu.org
@ 2021-09-10 7:09 ` pinskia at gcc dot gnu.org
10 siblings, 0 replies; 12+ messages in thread
From: pinskia at gcc dot gnu.org @ 2021-09-10 7:09 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61214
Andrew Pinski <pinskia at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |rafael at espindo dot la
--- Comment #10 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
*** Bug 58045 has been marked as a duplicate of this bug. ***
^ permalink raw reply [flat|nested] 12+ messages in thread