public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
* Simple returns are broken in gcc 3.X
@ 2001-07-30 15:33 John David Anglin
  2001-07-30 19:30 ` Richard Henderson
  0 siblings, 1 reply; 14+ messages in thread
From: John David Anglin @ 2001-07-30 15:33 UTC (permalink / raw)
  To: gcc

In looking into why g++ didn't work for vax-dec-ultrix4.3, I have found
that simple returns are broken.  Compiling this small test program

static char *
srealloc (char *p, char *q, int i)
{
  if (i == 0)
    return p;
  else
    return q;
}

yields

#NO_APP
	.text
	.align 1
__Z8sreallocPcS_i:
	.word 0x0
	subl2 $12,sp
	tstl 12(ap)
	jneq L2
	ret
L2:
	ret

As can been seen, the return values are not loaded into the return register
r0.

The problem is that expand_value_return () doesn't handle properly return
values in pseudos (see treatment in expand_function_end ()).  Further,
comparing what is done in expand_function_end and expand_null_return_1,
there appears to be other problems.  For example, instrumentation doesn't
work.  There could be problems with functtions that call alloca, etc.

It looks to me like there needs to be a common set of code used to expand
returns.  Thoughts?

Dave
-- 
J. David Anglin                                  dave.anglin@nrc.ca
National Research Council of Canada              (613) 990-0752 (FAX: 952-6605)

^ permalink raw reply	[flat|nested] 14+ messages in thread
[parent not found: <no.id>]

end of thread, other threads:[~2001-08-09 15:48 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2001-07-30 15:33 Simple returns are broken in gcc 3.X John David Anglin
2001-07-30 19:30 ` Richard Henderson
2001-07-30 20:38   ` John David Anglin
2001-07-30 23:16     ` Richard Henderson
2001-07-31  8:03       ` John David Anglin
2001-07-31  9:56         ` Richard Henderson
2001-07-31 10:39           ` John David Anglin
2001-07-31 13:13             ` Richard Henderson
2001-07-31 13:43               ` John David Anglin
2001-07-31 13:49                 ` Richard Henderson
2001-07-31 16:08                   ` John David Anglin
2001-07-31 16:37                     ` Richard Henderson
     [not found] <no.id>
2001-08-09 15:12 ` John David Anglin
2001-08-09 15:48   ` Richard Henderson

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).