[Bug c++/90909] [10 Regression] call devirtualized to pure virtual

2019-06-21 Thread paolo at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=90909

--- Comment #7 from paolo at gcc dot gnu.org  ---
Author: paolo
Date: Fri Jun 21 21:58:19 2019
New Revision: 272576

URL: https://gcc.gnu.org/viewcvs?rev=272576=gcc=rev
Log:
2019-06-21  Paolo Carlini  

PR c++/90909
* g++.dg/other/final7.C: New.

Added:
trunk/gcc/testsuite/g++.dg/other/final7.C
Modified:
trunk/gcc/testsuite/ChangeLog

[Bug c++/90909] [10 Regression] call devirtualized to pure virtual

2019-06-21 Thread paolo.carlini at oracle dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=90909

Paolo Carlini  changed:

   What|Removed |Added

 Status|ASSIGNED|RESOLVED
 Resolution|--- |FIXED
   Assignee|paolo.carlini at oracle dot com|unassigned at gcc dot 
gnu.org

--- Comment #6 from Paolo Carlini  ---
Fixed by reverting completely (for the time being) the offending change.

[Bug c++/90909] [10 Regression] call devirtualized to pure virtual

2019-06-21 Thread paolo at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=90909

--- Comment #5 from paolo at gcc dot gnu.org  ---
Author: paolo
Date: Fri Jun 21 20:47:40 2019
New Revision: 272574

URL: https://gcc.gnu.org/viewcvs?rev=272574=gcc=rev
Log:
/cp
2019-06-21  Paolo Carlini  

PR c++/90909
Revert:
2019-05-21  Paolo Carlini  

PR c++/67184
PR c++/69445
* call.c (build_over_call): Devirtualize when the final overrider
comes from the base.

/testsuite
2019-06-21  Paolo Carlini  

PR c++/90909
Revert:
2019-05-21  Paolo Carlini  

PR c++/67184
PR c++/69445
* g++.dg/other/final3.C: New.
* g++.dg/other/final4.C: Likewise.
* g++.dg/other/final5.C: Likewise.

* g++.dg/other/final6.C: New.

Removed:
trunk/gcc/testsuite/g++.dg/other/final3.C
trunk/gcc/testsuite/g++.dg/other/final4.C
trunk/gcc/testsuite/g++.dg/other/final5.C

[Bug c++/90909] [10 Regression] call devirtualized to pure virtual

2019-06-21 Thread paolo at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=90909

--- Comment #4 from paolo at gcc dot gnu.org  ---
Author: paolo
Date: Fri Jun 21 20:46:51 2019
New Revision: 272573

URL: https://gcc.gnu.org/viewcvs?rev=272573=gcc=rev
Log:
/cp
2019-06-21  Paolo Carlini  

PR c++/90909
Revert:
2019-05-21  Paolo Carlini  

PR c++/67184
PR c++/69445
* call.c (build_over_call): Devirtualize when the final overrider
comes from the base.

/testsuite
2019-06-21  Paolo Carlini  

PR c++/90909
Revert:
2019-05-21  Paolo Carlini  

PR c++/67184
PR c++/69445
* g++.dg/other/final3.C: New.
* g++.dg/other/final4.C: Likewise.
* g++.dg/other/final5.C: Likewise.

* g++.dg/other/final6.C: New.

Added:
trunk/gcc/testsuite/g++.dg/other/final6.C
Modified:
trunk/gcc/cp/ChangeLog
trunk/gcc/cp/call.c
trunk/gcc/testsuite/ChangeLog

[Bug c++/90909] [10 Regression] call devirtualized to pure virtual

2019-06-19 Thread paolo.carlini at oracle dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=90909

Paolo Carlini  changed:

   What|Removed |Added

 Status|NEW |ASSIGNED
 CC|paolo.carlini at oracle dot com|
   Assignee|unassigned at gcc dot gnu.org  |paolo.carlini at oracle 
dot com

--- Comment #3 from Paolo Carlini  ---
Mine.

[Bug c++/90909] [10 Regression] call devirtualized to pure virtual

2019-06-18 Thread paolo.carlini at oracle dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=90909

--- Comment #2 from Paolo Carlini  ---
I think the below tweak of r271490 should be fine, it considers the bases only
when the fn isn't pure virtual:

Index: call.c
===
--- call.c  (revision 272410)
+++ call.c  (working copy)
@@ -8244,7 +8244,9 @@ build_over_call (struct z_candidate *cand, int fla
   /* See if the function member or the whole class type is declared
 final and the call can be devirtualized.  */
   if (DECL_FINAL_P (fn)
- || CLASSTYPE_FINAL (TREE_TYPE (argtype)))
+ || CLASSTYPE_FINAL (TYPE_METHOD_BASETYPE (TREE_TYPE (fn)))
+ || (CLASSTYPE_FINAL (TREE_TYPE (argtype))
+ && !DECL_PURE_VIRTUAL_P (fn)))
flags |= LOOKUP_NONVIRTUAL;

   /* [class.mfct.nonstatic]: If a nonstatic member function of a class

[Bug c++/90909] [10 Regression] call devirtualized to pure virtual

2019-06-18 Thread marxin at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=90909

Martin Liška  changed:

   What|Removed |Added

 Status|UNCONFIRMED |NEW
  Known to work||9.1.0
   Keywords||wrong-code
   Last reconfirmed||2019-06-18
 CC||marxin at gcc dot gnu.org,
   ||paolo.carlini at oracle dot com
 Ever confirmed|0   |1
Summary|call devirtualized to pure  |[10 Regression] call
   |virtual |devirtualized to pure
   ||virtual
   Target Milestone|--- |10.0
  Known to fail||10.0

--- Comment #1 from Martin Liška  ---
Confirmed, started with r271490.