This is the mail archive of the mailing list for the GCC project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

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

> > 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/ -B/home/eric/install/gcc/i586-suse-linux/bin/ -B/home/eric/install/gcc/i586-suse-linux/lib/ -isystem /home/eric/install/gcc/i586-suse-linux/include -isystem /home/eric/install/gcc/i586-suse-linux/sys-include    -c -g -O2 -gtoggle  -gnatpg -gnata -W -Wall -nostdinc -I- -I. -Iada -I/home/eric/svn/gcc/gcc/ada -I/home/eric/svn/gcc/gcc/ada/gcc-interface /home/eric/svn/gcc/gcc/ada/ali.adb -o 
> ada/ali.o
> +===========================GNAT BUG DETECTED==============================+
> | 4.8.0 20120518 (experimental) [trunk revision 187647] (i586-suse-linux) GCC 
> error:|
> | in varpool_finalize_decl, at cgraphunit.c:822                            |
> | Error detected around /home/eric/svn/gcc/gcc/ada/ali.adb:2499:1    

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 in this case.

Is folding through these variables desirable in Ada?  If not, i would suggest
clear DECL_INITIAL (it is useless), if it is, we can either relatex the
varpool_finalize_decl check or arrange TREE_STATIC to not be set.

We use the combination of STATIC and EXTERN flag to test presence of references to
static (and non-public) object from other file in:
  /* External flag is set, so we deal with C++ reference
     to static object from other file.
     We also may see weakref that is always safe.  */
  if (DECL_EXTERNAL (decl) && TREE_STATIC (decl)
      && TREE_CODE (decl) == VAR_DECL)

So this particular combination of flags would prevent us from folding into references
to these vars.  If this is not intended, I would not keep the flag set.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]