This is the mail archive of the gcc-bugs@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]

Re: VAX Ultrix bootstrap with gcc-2.96 20000519: genrecog failure


On Sat, May 27, 2000 at 05:38:48PM -0400, John David Anglin wrote:
> In looking at function.c (expand_function_end), I can't see how struct
> returns every worked in this situation:

The code in this area has changed quite a bit over the past year.
It's possible that it didn't work before the changes, or that it
worked by accident, or that I really did mess up.

> The movq is generated by line 6673 of function.c.   However, doesn't
> something need to be done to get it into current_function_return_rtx?

I don't think it's supposed to.  Looking at where that value gets
loaded up, it appears that diddle_return_value isn't handling this
case correctly.

I've given i386 and sparc64 output (to pick two other styles of struct
return at random) a quick glance, and nothing appears to be broken by
this change; I'll wait for a complete bootstrap and test cycle to be sure.


r~


	* function.c (diddle_return_value): A pcc-style struct return
	returns a pointer.

Index: function.c
===================================================================
RCS file: /cvs/gcc/egcs/gcc/function.c,v
retrieving revision 1.199
diff -c -p -d -r1.199 function.c
*** function.c	2000/05/27 20:10:38	1.199
--- function.c	2000/05/28 02:50:35
*************** diddle_return_value (doit, arg)
*** 6319,6332 ****
       void *arg;
  {
    rtx outgoing = current_function_return_rtx;
  
    if (! outgoing)
      return;
  
!   if (GET_CODE (outgoing) == REG
!       && REGNO (outgoing) >= FIRST_PSEUDO_REGISTER)
      {
        tree type = TREE_TYPE (DECL_RESULT (current_function_decl));
  #ifdef FUNCTION_OUTGOING_VALUE
        outgoing = FUNCTION_OUTGOING_VALUE (type, current_function_decl);
  #else
--- 6319,6343 ----
       void *arg;
  {
    rtx outgoing = current_function_return_rtx;
+   int pcc;
  
    if (! outgoing)
      return;
  
!   pcc = (current_function_returns_struct
!          || current_function_returns_pcc_struct);
! 
!   if ((GET_CODE (outgoing) == REG
!        && REGNO (outgoing) >= FIRST_PSEUDO_REGISTER)
!       || pcc)
      {
        tree type = TREE_TYPE (DECL_RESULT (current_function_decl));
+ 
+       /* A PCC-style return returns a pointer to the memory in which
+ 	 the structure is stored.  */
+       if (pcc)
+ 	type = build_pointer_type (type);
+ 
  #ifdef FUNCTION_OUTGOING_VALUE
        outgoing = FUNCTION_OUTGOING_VALUE (type, current_function_decl);
  #else

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