This is the mail archive of the gcc-patches@gcc.gnu.org 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]

Fix AIX bootstrap problem


Hi,
the new symtab verifier introduced by me two days ago fires during bootstrap on
AIX (and probably some other platforms not having COMDAT group support).  The
problem is that same_comdat_group list is set for symbols that are not COMDAT.
This happens on variables only, but not for functions.

C++ frontend handles same comdat group lists for both functions and variables.
For functions we already sanity check that only DECL_ONE_ONLY functions are
inserted, we have verifier for that and we skip initializing the list when
varasm didn't drop the DECL_ONE_ONLY flag (because target is not supporting
it).

This is not the case for variables, where the corresponding code tests
DECL_COMDAT.  This previously latent problem leads to missed optimization and
confussion down in the callgraph/varpool code that assume that only comdat
group lists are initialized only when target has support for them.

David has tested the following patch AIX and I've bootstrapped/regtested
it on x86_64-linux and commited.

Honza

Index: ChangeLog
===================================================================
*** ChangeLog	(revision 186626)
--- ChangeLog	(working copy)
***************
*** 1,3 ****
--- 1,9 ----
+ 2012-04-20  Jan Hubicka  <jh@suse.cz>
+ 
+ 	PR target/53042
+ 	* decl2.c (maybe_emit_vtables): Do not initialize same_comdat_group
+ 	list when target has no support for it.
+ 
  2012-04-20  Michael Matz  <matz@suse.de>
  
  	* error.c (pedwarn_cxx98): Move va_end call after user
Index: decl2.c
===================================================================
*** decl2.c	(revision 186623)
--- decl2.c	(working copy)
*************** maybe_emit_vtables (tree ctype)
*** 1894,1900 ****
  	 actually marking the variable as written.  */
        if (flag_syntax_only)
  	TREE_ASM_WRITTEN (vtbl) = 1;
!       else if (DECL_COMDAT (vtbl))
  	{
  	  current = varpool_node (vtbl);
  	  if (last)
--- 1894,1900 ----
  	 actually marking the variable as written.  */
        if (flag_syntax_only)
  	TREE_ASM_WRITTEN (vtbl) = 1;
!       else if (DECL_ONE_ONLY (vtbl))
  	{
  	  current = varpool_node (vtbl);
  	  if (last)


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