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]

Re: [patch RFC] SH: Use FRAME_GROWS_DOWNWARD


Kaz Kojima wrote:

Joern RENNECKE <joern.rennecke@st.com> wrote:


I see. Blindly using reg_raw_mode to initialize apply_args_mode is
just nonsentical. Does the attached patch work?



Not yet, but with the same change for apply_result_size
builtin-apply testcases passed.



Oops, I analyzed the problem with apply_result_mode /
apply_result_size, but when I intended to return to the function to patch it,
I ended up in apply_args_size. FUNCTION_ARG_REGNO_P is true for
to all function argument passing registers, so apply_args_mode s hould
be fine.
2005-07-21  J"orn Rennecke <joern.rennecke@st.com>

	* builtins.c (apply_result_size): Consider modes that span multiple
	hard registers.

Index: builtins.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/builtins.c,v
retrieving revision 1.450.2.2
diff -p -r1.450.2.2 builtins.c
*** builtins.c	19 Jul 2005 15:43:00 -0000	1.450.2.2
--- builtins.c	21 Jul 2005 11:39:14 -0000
*************** apply_result_size (void)
*** 1119,1128 ****
--- 1119,1140 ----
        for (regno = 0; regno < FIRST_PSEUDO_REGISTER; regno++)
  	if (FUNCTION_VALUE_REGNO_P (regno))
  	  {
+ 	    unsigned n;
+ 	    enum machine_mode wider_mode;
+ 
  	    mode = reg_raw_mode[regno];
  
  	    gcc_assert (mode != VOIDmode);
  
+ 	    n = hard_regno_nregs[regno][mode];
+ 	    while (regno + n < FIRST_PSEUDO_REGISTER
+ 		   && call_used_regs[regno + n])
+ 	      {
+ 		n++;
+ 		wider_mode = choose_hard_reg_mode (regno, n, false);
+ 		if (wider_mode != VOIDmode)
+ 		  mode = wider_mode;
+ 	      }
  	    align = GET_MODE_ALIGNMENT (mode) / BITS_PER_UNIT;
  	    if (size % align != 0)
  	      size = CEIL (size, align) * align;

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