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]

Set reg_attrs for function parameters passed in registers


Hi,

currently, reg_attrs are not set for function parameters passed in registers.
This patch fixes it.

Without this patch:

(insn 3 2 4 (nil) (set (reg/v:SI 59 [ argc ])
        (reg:SI 5 edi)) -1 (nil)
    (nil))

(insn 4 3 5 (nil) (set (reg/v/f:DI 60 [ argv ])
        (reg:DI 4 rsi)) -1 (nil)
    (nil))

With this patch:

(insn 3 2 4 (nil) (set (reg/v:SI 59 [ argc ])
        (reg:SI 5 edi [ argc ])) -1 (nil)
    (nil))

(insn 4 3 5 (nil) (set (reg/v/f:DI 60 [ argv ])
        (reg:DI 4 rsi [ argv ])) -1 (nil)
    (nil))

Bootstrapped/regtested x86-64.
OK for mainline?

Josef

	* function.c (assign_parms): Set reg_attrs for parameters passed in
	registers.

Index: function.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/function.c,v
retrieving revision 1.380.2.9
diff -c -3 -p -r1.380.2.9 function.c
*** function.c	8 Feb 2003 19:43:34 -0000	1.380.2.9
--- function.c	22 Feb 2003 11:08:33 -0000
*************** assign_parms (fndecl)
*** 4452,4457 ****
--- 4452,4461 ----
  						  offset_rtx));
  
  	set_mem_attributes (stack_parm, parm, 1);
+ 
+ 	/* Set also REG_ATTRS if parameter was passed in a register.  */
+ 	if (entry_parm)
+ 	  set_reg_attrs_from_mem (entry_parm, stack_parm);
        }
  
        /* If this parameter was passed both in registers and in the stack,


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