From mboxrd@z Thu Jan 1 00:00:00 1970 From: "John David Anglin" To: rth@cygnus.com (Richard Henderson) Cc: zack@wolery.cumb.org, gcc-bugs@gcc.gnu.org, gcc-patches@gcc.gnu.org Subject: Re: VAX Ultrix bootstrap with gcc-2.96 20000519: genrecog failure Date: Sun, 28 May 2000 11:00:00 -0000 Message-id: <200005281800.OAA01865@hiauly1.hia.nrc.ca> References: <20000527201917.A32738@cygnus.com> X-SW-Source: 2000-05/msg01528.html The patch fixed the missing return value in my test program. Hopefully, it will allow the build to complete. Thanks, Dave > > 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 > -- J. David Anglin dave.anglin@nrc.ca National Research Council of Canada (613) 990-0752 (FAX: 952-6605)