This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
Re: VAX Ultrix bootstrap with gcc-2.96 20000519: genrecog failure
- To: rth at cygnus dot com (Richard Henderson)
- Subject: Re: VAX Ultrix bootstrap with gcc-2.96 20000519: genrecog failure
- From: "John David Anglin" <dave at hiauly1 dot hia dot nrc dot ca>
- Date: Sun, 28 May 2000 14:00:25 -0400 (EDT)
- Cc: zack at wolery dot cumb dot org, gcc-bugs at gcc dot gnu dot org, gcc-patches at gcc dot gnu dot org
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)