[Bug lto/50430] Constructors of static external vars are throwed away leading to missed optimizations (and ipa-cp ICE).

2021-01-07 Thread jamborm at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=50430

--- Comment #5 from Martin Jambor  ---
Am I correct thinking that this has been addressed (long time ago)?

The entire optimized dump of the testcase from comment #3 is now the
following, so no missed devirtualization there:

void _GLOBAL__sub_I_typelib_TypeClass ()
{
   [local count: 1073741824]:
  __ct_comp  (&typelib_TypeClass, 0, 1); [tail call]
  return;

}

[Bug lto/50430] Constructors of static external vars are throwed away leading to missed optimizations (and ipa-cp ICE).

2012-05-07 Thread rguenth at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=50430

Richard Guenther  changed:

   What|Removed |Added

   Keywords||lto, missed-optimization
 Status|UNCONFIRMED |NEW
   Last reconfirmed||2012-05-07
 Ever Confirmed|0   |1
   Severity|normal  |enhancement

--- Comment #4 from Richard Guenther  2012-05-07 
12:57:52 UTC ---
Confirmed.


[Bug lto/50430] Constructors of static external vars are throwed away leading to missed optimizations (and ipa-cp ICE).

2011-09-22 Thread hubicka at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=50430

--- Comment #3 from Jan Hubicka  2011-09-22 
14:20:07 UTC ---
Created attachment 25340
  --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=25340
reduced testcase

This is somewhat reduced testcase.  The problem can be a bit illustrated on C.

We have something like

extern vtable[]={vtable2}

where vtable2 sits in other unit and is static.  We however know the
constructor and it is
extern static vtable2[]={function_ptr};

now we can fold vtable[0] to the external vtable2 that we can not reffer in
code, but still can fold references into it into function_ptr.

now with LTO we decide to not stream vtable initializer and replace it by
error_mark losing the knowledge.  This is an regression to 4.6 even though it
is not too important one.


[Bug lto/50430] Constructors of static external vars are throwed away leading to missed optimizations (and ipa-cp ICE).

2011-09-16 Thread hubicka at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=50430

--- Comment #2 from Jan Hubicka  2011-09-16 
15:02:42 UTC ---
Created attachment 25306
  --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=25306
testcase

One will need to revert the gimple-fold.c patch mentioned above to get an
error. Otherwise it is just missed optimization.

/abuild/jh/trunk-install/bin/g++ -O2 -flto -fuse-linker-plugin -Ur -nostdlib
*.ii -fpermissive -std=c++0x
lto1: internal compiler error: Segmentation fault
Please submit a full bug report,
with preprocessed source if appropriate.
See  for instructions.
lto-wrapper: /abuild/jh/trunk-install/bin/g++ returned 1 exit status


[Bug lto/50430] Constructors of static external vars are throwed away leading to missed optimizations (and ipa-cp ICE).

2011-09-16 Thread hubicka at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=50430

--- Comment #1 from Jan Hubicka  2011-09-16 
14:40:14 UTC ---
Author: hubicka
Date: Fri Sep 16 14:40:06 2011
New Revision: 178908

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=178908
Log:
PR lto/50430
* gimple-fold.c (gimple_get_virt_method_for_binfo): Do not ICE on
error_mark_node in the DECL_INITIAL of vtable.

Modified:
trunk/gcc/ChangeLog
trunk/gcc/gimple-fold.c