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]

[rfc,patch] PR 15387


Hello,

check_sibcall_argument_overlap_1 (which checks whether the code to
compute a value of the argument does not use something that was
already rewritten by the previous arguments of the sibcall)
assumes that when base of the memory reference is not
current_function_internal_arg_pointer, it cannot refer to incoming args
space.  Which does not have to be true, in case address of some
parameter was taken (it used to work, since before tree-ssa, taking
of address of anything inside the function marked it invalid for
sibcall).

The following patch fixes the problem by preventing us from using this
assumption; it however seems to me that it might be too conservative
and prevent us from doing sibcall optimization unnecesarily often.

Zdenek

	* calls.c (check_sibcall_argument_overlap_1): Handle pointers
	to incoming args space correctly.

Index: calls.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/calls.c,v
retrieving revision 1.334
diff -c -3 -p -r1.334 calls.c
*** calls.c	21 May 2004 01:03:15 -0000	1.334
--- calls.c	21 May 2004 21:26:40 -0000
*************** check_sibcall_argument_overlap_1 (rtx x)
*** 1797,1803 ****
  	       && GET_CODE (XEXP (XEXP (x, 0), 1)) == CONST_INT)
  	i = INTVAL (XEXP (XEXP (x, 0), 1));
        else
! 	return 0;
  
  #ifdef ARGS_GROW_DOWNWARD
        i = -i - GET_MODE_SIZE (GET_MODE (x));
--- 1797,1803 ----
  	       && GET_CODE (XEXP (XEXP (x, 0), 1)) == CONST_INT)
  	i = INTVAL (XEXP (XEXP (x, 0), 1));
        else
! 	return 1;
  
  #ifdef ARGS_GROW_DOWNWARD
        i = -i - GET_MODE_SIZE (GET_MODE (x));


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