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]

[PATCH] Fix dwarf2out ICE


When testing with -g g++.dg/ext/attr-alias-3.C ICEs because we mess
up the context of class-scope vars with aliases.  The following fixes
this.

Bootstrapped and tested on x86_64-unknown-linux-gnu, applied.

Richard.

2015-09-21  Richard Biener  <rguenther@suse.de>

	* passes.c (rest_of_decl_compilation): Do not call
	dwarf2out_early_global_decl for aliases.

	* g++.dg/ext/attr-alias-3.C: Add -g.

Index: gcc/passes.c
===================================================================
*** gcc/passes.c	(revision 227899)
--- gcc/passes.c	(working copy)
*************** rest_of_decl_compilation (tree decl,
*** 327,333 ****
  	     and thus have incomplete early debug and late debug
  	     called from varpool node removal fails to handle it
  	     properly.  */
! 	  || (TREE_CODE (decl) == VAR_DECL
  	      && TREE_STATIC (decl) && !DECL_EXTERNAL (decl)))
        /* Avoid confusing the debug information machinery when there are
  	 errors.  */
--- 327,334 ----
  	     and thus have incomplete early debug and late debug
  	     called from varpool node removal fails to handle it
  	     properly.  */
! 	  || (finalize
! 	      && TREE_CODE (decl) == VAR_DECL
  	      && TREE_STATIC (decl) && !DECL_EXTERNAL (decl)))
        /* Avoid confusing the debug information machinery when there are
  	 errors.  */
Index: gcc/testsuite/g++.dg/ext/attr-alias-3.C
===================================================================
*** gcc/testsuite/g++.dg/ext/attr-alias-3.C	(revision 227899)
--- gcc/testsuite/g++.dg/ext/attr-alias-3.C	(working copy)
***************
*** 1,5 ****
--- 1,6 ----
  // PR c++/56134
  // { dg-require-alias "" }
+ // { dg-options "-g" }
  
  char a;
  class Q


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