Re: Symbol table 21/many: analyze initializers of external vars

2012-05-21 Thread Jan Hubicka
> > + 2012-05-17  Jan Hubicka   > > + > > +       * lto-symtab.c (lto_symtab_resolve_symbols): Preffer decl with > > constructor > > +       over decl without. > > +       * cgraph.c (cgraph_remove_node): Clear also body of unanalyzed > > nodes. > > +       * cgraph.h (varpool_can_remove_if_no_re

Re: Symbol table 21/many: analyze initializers of external vars

2012-05-20 Thread H.J. Lu
On Thu, May 17, 2012 at 9:42 AM, Jan Hubicka wrote: > Hi, > C++ virtual tables keyed to other compilation units are represented as > DECL_EXTERNAL > variables with constructor known. Knowhing the constructor helps constant > folding to do > devirtualization. > > At the moment these costructors a

Re: Symbol table 21/many: analyze initializers of external vars

2012-05-18 Thread Eric Botcazou
> my apologize for the breakage. I somehow missed Ada in --enable-languages > list. I've comitted the following fix that also cures enable checking > failure of g++.dg/torture/pr46154.C No problem, thanks for the quick fix! -- Eric Botcazou

Re: Symbol table 21/many: analyze initializers of external vars

2012-05-18 Thread Jan Hubicka
Hi, my apologize for the breakage. I somehow missed Ada in --enable-languages list. I've comitted the following fix that also cures enable checking failure of g++.dg/torture/pr46154.C Honza * cgraphunit.c (varpool_finalize_decl): Allow external decls. (mark_functions_to_output):

Re: Symbol table 21/many: analyze initializers of external vars

2012-05-18 Thread Jan Hubicka
> > OK, does the following patch fix the problem? I will try to understand how > > conistent is C++ frontend about the flags. It would be nice to have safer > > way to declare the "static var in other unit" than combination of EXTERNAL > > and STATIC... > > Not sufficient it seems: > > /home/er

Re: Symbol table 21/many: analyze initializers of external vars

2012-05-18 Thread Eric Botcazou
> OK, does the following patch fix the problem? I will try to understand how > conistent is C++ frontend about the flags. It would be nice to have safer > way to declare the "static var in other unit" than combination of EXTERNAL > and STATIC... Not sufficient it seems: /home/eric/build/gcc/nat

Re: Symbol table 21/many: analyze initializers of external vars

2012-05-18 Thread Jan Hubicka
> > The problem here seems to be that Ada constructs an variable that is > > DECL_EXTERNAL, passes const_value_known_p and has DECL_INITIAL, yet its > > TREE_STATIC is not set. C++ always output those variables with TREE_STATIC > > set and to be honest, I am unsure what is intended semantics of thi

Re: Symbol table 21/many: analyze initializers of external vars

2012-05-18 Thread Eric Botcazou
> The problem here seems to be that Ada constructs an variable that is > DECL_EXTERNAL, passes const_value_known_p and has DECL_INITIAL, yet its > TREE_STATIC is not set. C++ always output those variables with TREE_STATIC > set and to be honest, I am unsure what is intended semantics of this flag >

Re: Symbol table 21/many: analyze initializers of external vars

2012-05-18 Thread Jan Hubicka
> > Bootstrapped/regtested x86_64-linux, comitted. > > It presumably breaks Ada bootstrap on x86/Linux: I suppose so. I tested x86_64/linux with Ada. > > /home/eric/build/gcc/native32/./prev-gcc/xgcc > -B/home/eric/build/gcc/native32/./prev-gcc/ > -B/home/eric/install/gcc/i586-suse-linux/bin/

Re: Symbol table 21/many: analyze initializers of external vars

2012-05-18 Thread Eric Botcazou
> Bootstrapped/regtested x86_64-linux, comitted. It presumably breaks Ada bootstrap on x86/Linux: /home/eric/build/gcc/native32/./prev-gcc/xgcc -B/home/eric/build/gcc/native32/./prev-gcc/ -B/home/eric/install/gcc/i586-suse-linux/bin/ -B/home/eric/install/gcc/i586-suse-linux/bin/ -B/home/eric/