From: "John David Anglin" <dave@hiauly1.hia.nrc.ca>
To: gcc@gcc.gnu.org
Subject: Simple returns are broken in gcc 3.X
Date: Mon, 30 Jul 2001 15:33:00 -0000 [thread overview]
Message-ID: <200107302233.f6UMXEMK026255@hiauly1.hia.nrc.ca> (raw)
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)
next reply other threads:[~2001-07-30 15:33 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2001-07-30 15:33 John David Anglin [this message]
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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=200107302233.f6UMXEMK026255@hiauly1.hia.nrc.ca \
--to=dave@hiauly1.hia.nrc.ca \
--cc=gcc@gcc.gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).