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 unresolved symbol problem with -gstabs (3.4 regression)


Hello,

when building the Linux kernel with -gstabs on s390 with gcc 3.4
(which is useful for the lcrash analysis tool), the build fails
with unresolved references; these are caused by the stabs code
emitting references to optimized-out constant pool symbols.

The patch below fixes the problem by simply omitting those symbols;
it used the same method to test for presence of constant pool
entries as the DWARF-2 code already does.

Bootstrapped/regtested on s390-ibm-linux and s390x-ibm-linux
on 3.4 and mainline.  OK?


ChangeLog:

	* dbxout.c (dbxout_symbol_location): Do not output references
	to optimized-out constant pool symbols.

Index: gcc/dbxout.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/dbxout.c,v
retrieving revision 1.172
diff -c -p -r1.172 dbxout.c
*** gcc/dbxout.c	16 Jan 2004 01:44:06 -0000	1.172
--- gcc/dbxout.c	8 Mar 2004 21:55:41 -0000
*************** dbxout_symbol_location (tree decl, tree 
*** 2461,2471 ****
  	      if (GET_CODE (current_sym_addr) == SYMBOL_REF
  		  && CONSTANT_POOL_ADDRESS_P (current_sym_addr))
  		{
! 		  rtx tmp = get_pool_constant (current_sym_addr);
  
! 		  if (GET_CODE (tmp) == SYMBOL_REF
! 		      || GET_CODE (tmp) == LABEL_REF)
! 		    current_sym_addr = tmp;
  		}
  
  	      /* Ultrix `as' seems to need this.  */
--- 2461,2487 ----
  	      if (GET_CODE (current_sym_addr) == SYMBOL_REF
  		  && CONSTANT_POOL_ADDRESS_P (current_sym_addr))
  		{
! 		  bool marked;
! 		  rtx tmp = get_pool_constant_mark (current_sym_addr, &marked);
  
! 		  if (GET_CODE (tmp) == SYMBOL_REF)
! 		    {
! 		      current_sym_addr = tmp;
! 		      if (CONSTANT_POOL_ADDRESS_P (current_sym_addr))
! 		        get_pool_constant_mark (current_sym_addr, &marked);
! 		      else
! 			marked = true;
! 		    }
! 		  else if (GET_CODE (tmp) == LABEL_REF)
! 		    {
! 		      current_sym_addr = tmp;
! 		      marked = true;
! 		    }
! 
! 		   /* If all references to the constant pool were optimized
! 		      out, we just ignore the symbol.  */
! 		  if (!marked)
! 		    return 0;
  		}
  
  	      /* Ultrix `as' seems to need this.  */
-- 
  Dr. Ulrich Weigand
  weigand@informatik.uni-erlangen.de


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