From: Bernd Schmidt <bschmidt@redhat.com>
To: Chen Gang <xili_gchen_5257@hotmail.com>,
Mike Stump <mikestump@comcast.net>
Cc: Jeff Law <law@redhat.com>, Richard Henderson <rth@redhat.com>,
"Joseph S. Myers" <joseph@codesourcery.com>,
gcc-patches List <gcc-patches@gcc.gnu.org>
Subject: Re: [PATCH] gcc/ira.c: Check !HAVE_FP_INSTEAD_INSNS when frame pointer is needed and as global register
Date: Tue, 13 Oct 2015 14:56:00 -0000 [thread overview]
Message-ID: <561D1B80.8050706@redhat.com> (raw)
In-Reply-To: <BLU437-SMTP937E579C4A787611A6BF66B9300@phx.gbl>
On 10/13/2015 04:50 PM, Chen Gang wrote:
> OK, under the bugzilla, the maintainer treated it as expected behavior
> (not a bug). For me, we need more explanation for it (why we treat it
> as expected behavior).
A global register is under control of the user. If the compiler uses it
as a frame pointer, it will get clobbered outside the user's control,
which is unexpected behaviour. Therefore, the code Mike quoted detects
that case and issues an error, indicating that you must use
-fomit-frame-pointer if you expect to use the frame pointer register for
other purposes.
If you want an address on the stack there's __builtin_frame_address
which may or may not do what was intended. The code quoted in the
bugzilla is just invalid.
>> to `fix itâ, one would simple remove this chunk as misguided and fix up any code gen issues exposed.
>>
>
> If there were not only one issues related with it, for me, what you said
> sounds reasonable to me.
That's totally the wrong thing to do as the issue is not compiler code
generation, it's the danger of clobbering a user variable.
Bernd
next prev parent reply other threads:[~2015-10-13 14:56 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <561A7D5C.40409@hotmail.com>
2015-10-11 15:16 ` Chen Gang
2015-10-12 10:49 ` Bernd Schmidt
2015-10-12 22:30 ` Chen Gang
2015-10-12 23:03 ` Mike Stump
2015-10-13 14:48 ` Chen Gang
2015-10-13 14:56 ` Bernd Schmidt [this message]
2015-10-13 15:10 ` Chen Gang
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=561D1B80.8050706@redhat.com \
--to=bschmidt@redhat.com \
--cc=gcc-patches@gcc.gnu.org \
--cc=joseph@codesourcery.com \
--cc=law@redhat.com \
--cc=mikestump@comcast.net \
--cc=rth@redhat.com \
--cc=xili_gchen_5257@hotmail.com \
/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).