[Bug ipa/83346] inliner crash with attribute always_inline/flatten on a destructor

2018-06-25 Thread jakub at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83346

Jakub Jelinek  changed:

   What|Removed |Added

 Status|NEW |RESOLVED
 CC||jakub at gcc dot gnu.org
 Resolution|--- |FIXED

--- Comment #7 from Jakub Jelinek  ---
Fixed.

[Bug ipa/83346] inliner crash with attribute always_inline/flatten on a destructor

2018-06-25 Thread jakub at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83346

--- Comment #6 from Jakub Jelinek  ---
Author: jakub
Date: Mon Jun 25 17:02:47 2018
New Revision: 262046

URL: https://gcc.gnu.org/viewcvs?rev=262046&root=gcc&view=rev
Log:
Backported from mainline
2017-12-19  Jakub Jelinek  

PR ipa/82801
PR ipa/83346
* ipa-inline.c (flatten_remove_node_hook): New function.
(ipa_inline): Keep only nodes with flatten attribute at the end of
the array in the order from ipa_reverse_postorder, only walk that
portion of array for flattening, if there is more than one such
node, temporarily register a removal hook and ignore removed nodes.

* g++.dg/ipa/pr82801.C: New test.

Added:
branches/gcc-6-branch/gcc/testsuite/g++.dg/ipa/pr82801.C
Modified:
branches/gcc-6-branch/gcc/ChangeLog
branches/gcc-6-branch/gcc/ipa-inline.c
branches/gcc-6-branch/gcc/testsuite/ChangeLog

[Bug ipa/83346] inliner crash with attribute always_inline/flatten on a destructor

2017-12-22 Thread jakub at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83346

--- Comment #5 from Jakub Jelinek  ---
Author: jakub
Date: Fri Dec 22 08:50:30 2017
New Revision: 255968

URL: https://gcc.gnu.org/viewcvs?rev=255968&root=gcc&view=rev
Log:
Backported from mainline
2017-12-19  Jakub Jelinek  

PR ipa/82801
PR ipa/83346
* ipa-inline.c (flatten_remove_node_hook): New function.
(ipa_inline): Keep only nodes with flatten attribute at the end of
the array in the order from ipa_reverse_postorder, only walk that
portion of array for flattening, if there is more than one such
node, temporarily register a removal hook and ignore removed nodes.

* g++.dg/ipa/pr82801.C: New test.

Added:
branches/gcc-7-branch/gcc/testsuite/g++.dg/ipa/pr82801.C
Modified:
branches/gcc-7-branch/gcc/ChangeLog
branches/gcc-7-branch/gcc/ipa-inline.c
branches/gcc-7-branch/gcc/testsuite/ChangeLog

[Bug ipa/83346] inliner crash with attribute always_inline/flatten on a destructor

2017-12-18 Thread jakub at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83346

--- Comment #4 from Jakub Jelinek  ---
Author: jakub
Date: Tue Dec 19 07:41:30 2017
New Revision: 255805

URL: https://gcc.gnu.org/viewcvs?rev=255805&root=gcc&view=rev
Log:
PR ipa/82801
PR ipa/83346
* ipa-inline.c (flatten_remove_node_hook): New function.
(ipa_inline): Keep only nodes with flatten attribute at the end of
the array in the order from ipa_reverse_postorder, only walk that
portion of array for flattening, if there is more than one such
node, temporarily register a removal hook and ignore removed nodes.

* g++.dg/ipa/pr82801.C: New test.

Added:
trunk/gcc/testsuite/g++.dg/ipa/pr82801.C
Modified:
trunk/gcc/ChangeLog
trunk/gcc/ipa-inline.c
trunk/gcc/testsuite/ChangeLog

[Bug ipa/83346] inliner crash with attribute always_inline/flatten on a destructor

2017-12-12 Thread andi-gcc at firstfloor dot org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83346

--- Comment #3 from Andi Kleen  ---
Fixed by https://gcc.gnu.org/ml/gcc-patches/2017-12/msg00764.html

[Bug ipa/83346] inliner crash with attribute always_inline/flatten on a destructor

2017-12-11 Thread rguenth at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83346

Richard Biener  changed:

   What|Removed |Added

 Status|UNCONFIRMED |NEW
   Last reconfirmed||2017-12-11
 CC||hubicka at gcc dot gnu.org,
   ||rguenth at gcc dot gnu.org
 Ever confirmed|0   |1

--- Comment #2 from Richard Biener  ---
(gdb) p node->debug ()
_ZN12_GLOBAL__N_11bIiNS_12_GLOBAL__N_12acIcccEEED2Ev/1 ({anonymous}::b >::~b()) @0x76db8170
  Type: function definition analyzed
  Visibility: prevailing_def_ironly artificial
  References: 
  Referring: 
  Function {anonymous}::b >::~b()/1 is
inline copy in {anonymous}::ae::~ae()/6
  Availability: local
  First run: 0
  Function flags: count: 574129753 (estimated locally) body local
  Called by: {anonymous}::ae::~ae()/6 (inlined) (574129753 (estimated
locally),0.53 per call) 
  Calls: {anonymous}::{anonymous}::ac,
 >::~ac() [with  = char;
 = char;  = char]/15 (574129752
(estimated locally),0.53 per call) 


so it's an inline clone.  BUT ... at the start of the loop it is

_ZN12_GLOBAL__N_11bIiNS_12_GLOBAL__N_12acIcccEEED1Ev/2 ({anonymous}::b >::~b()) @0x76db82e0
  Type: function definition analyzed alias cpp_implicit_alias
  Visibility: prevailing_def_ironly artificial
  References: _ZN12_GLOBAL__N_11bIiNS_12_GLOBAL__N_12acIcccEEED2Ev/1 (alias)
  Referring: 
  Availability: local
  First run: 0
  Function flags: local
  Called by: {anonymous}::ae::~ae()/6 (574129753 (estimated locally),0.53 per
call) 
  Calls: 

so I'm not sure if 'order' stays valid during flatten processing or if we're
just lucky in re-using GC memory with the inline clone.

Honza?