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 gcc.dg/builtin-apply2.c


Hi,
I've installed this patch on both mainline and csl-arm-branch. It fixes
a failure of gcc.dg/builtin-apply2.c on arm. As the patch is applicable
to other targets, I've installed it on mainline too.

booted & tested on i686-pc-linux-gnu, approved by Mark.

nathan
--
Nathan Sidwell    ::   http://www.codesourcery.com   ::     CodeSourcery LLC
         The voices in my head said this was stupid too
nathan@codesourcery.com    ::     http://www.planetfall.pwp.blueyonder.co.uk

2003-12-29  Nathan Sidwell  <nathan@codesourcery.com>

	* builtins.c (expand_builtin_apply_args_1): Add pretend args size
	to the virtual incoming args pointer for downward stacks.

Index: builtins.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/builtins.c,v
retrieving revision 1.260.4.1
diff -c -3 -p -r1.260.4.1 builtins.c
*** builtins.c	23 Dec 2003 22:07:34 -0000	1.260.4.1
--- builtins.c	29 Dec 2003 18:31:40 -0000
*************** result_vector (int savep, rtx result)
*** 1096,1102 ****
  static rtx
  expand_builtin_apply_args_1 (void)
  {
!   rtx registers;
    int size, align, regno;
    enum machine_mode mode;
    rtx struct_incoming_value = targetm.calls.struct_value_rtx (cfun ? TREE_TYPE (cfun->decl) : 0, 1);
--- 1096,1102 ----
  static rtx
  expand_builtin_apply_args_1 (void)
  {
!   rtx registers, tem;
    int size, align, regno;
    enum machine_mode mode;
    rtx struct_incoming_value = targetm.calls.struct_value_rtx (cfun ? TREE_TYPE (cfun->decl) : 0, 1);
*************** expand_builtin_apply_args_1 (void)
*** 1114,1121 ****
    for (regno = 0; regno < FIRST_PSEUDO_REGISTER; regno++)
      if ((mode = apply_args_mode[regno]) != VOIDmode)
        {
- 	rtx tem;
- 
  	align = GET_MODE_ALIGNMENT (mode) / BITS_PER_UNIT;
  	if (size % align != 0)
  	  size = CEIL (size, align) * align;
--- 1114,1119 ----
*************** expand_builtin_apply_args_1 (void)
*** 1127,1134 ****
        }
  
    /* Save the arg pointer to the block.  */
!   emit_move_insn (adjust_address (registers, Pmode, 0),
! 		  copy_to_reg (virtual_incoming_args_rtx));
    size = GET_MODE_SIZE (Pmode);
  
    /* Save the structure value address unless this is passed as an
--- 1125,1138 ----
        }
  
    /* Save the arg pointer to the block.  */
!   tem = copy_to_reg (virtual_incoming_args_rtx);
! #ifdef STACK_GROWS_DOWNWARDS
!   /* We need the pointer as the caller actually passed them to us, not
!      as we might have pretended they were passed.  */
!   tem = plus_constant (tem, current_function_pretend_args_size);
! #endif
!   emit_move_insn (adjust_address (registers, Pmode, 0), tem);
!   
    size = GET_MODE_SIZE (Pmode);
  
    /* Save the structure value address unless this is passed as an

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