From: Ian Lance Taylor <iant@golang.org>
To: gcc-patches <gcc-patches@gcc.gnu.org>,
"gofrontend-dev@googlegroups.com"
<gofrontend-dev@googlegroups.com>
Subject: Go patch committed: Implement go:noinline and go:nosplit directives
Date: Wed, 10 Aug 2016 00:46:00 -0000 [thread overview]
Message-ID: <CAOyqgcX1N_rUYb6L+Kk1UjrcWZa3MUJy7-HfxT3GkPJWfQ5Y0Q@mail.gmail.com> (raw)
[-- Attachment #1: Type: text/plain, Size: 181 bytes --]
This patch to the Go frontend implements the go:noinline and
go:nosplit compiler directives. Bootstrapped and ran Go testsuite on
x86_64-pc-linux-gnu. Committed to mainline.
Ian
[-- Attachment #2: patch.txt --]
[-- Type: text/plain, Size: 2103 bytes --]
Index: gcc/go/gofrontend/MERGE
===================================================================
--- gcc/go/gofrontend/MERGE (revision 239311)
+++ gcc/go/gofrontend/MERGE (working copy)
@@ -1,4 +1,4 @@
-85a9c6992d9660e36972c279a5252fd9591bb765
+8da2129a005cc1f44d4d993b0b7312b64c0d68a4
The first line of this file holds the git revision number of the last
merge done from the gofrontend repository.
Index: gcc/go/gofrontend/gogo.cc
===================================================================
--- gcc/go/gofrontend/gogo.cc (revision 239311)
+++ gcc/go/gofrontend/gogo.cc (working copy)
@@ -5083,11 +5083,19 @@ Function::get_or_make_decl(Gogo* gogo, N
if (this->calls_defer_retaddr_)
is_inlinable = false;
+ // Check the //go:noinline compiler directive.
+ if ((this->pragmas_ & GOPRAGMA_NOINLINE) != 0)
+ is_inlinable = false;
+
// If this is a thunk created to call a function which calls
// the predeclared recover function, we need to disable
// stack splitting for the thunk.
bool disable_split_stack = this->is_recover_thunk_;
+ // Check the //go:nosplit compiler directive.
+ if ((this->pragmas_ & GOPRAGMA_NOSPLIT) != 0)
+ disable_split_stack = true;
+
// This should go into a unique section if that has been
// requested elsewhere, or if this is a nointerface function.
// We want to put a nointerface function into a unique section
Index: gcc/go/gofrontend/lex.cc
===================================================================
--- gcc/go/gofrontend/lex.cc (revision 239311)
+++ gcc/go/gofrontend/lex.cc (working copy)
@@ -1842,13 +1842,11 @@ Lex::skip_cpp_comment()
{
// Applies to the next function. Do not split the stack when
// entering the function.
- // FIXME: Not implemented.
this->pragmas_ |= GOPRAGMA_NOSPLIT;
}
else if (verb == "go:noinline")
{
// Applies to the next function. Do not inline the function.
- // FIXME: Not implemented.
this->pragmas_ |= GOPRAGMA_NOINLINE;
}
else if (verb == "go:systemstack")
reply other threads:[~2016-08-10 0:46 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=CAOyqgcX1N_rUYb6L+Kk1UjrcWZa3MUJy7-HfxT3GkPJWfQ5Y0Q@mail.gmail.com \
--to=iant@golang.org \
--cc=gcc-patches@gcc.gnu.org \
--cc=gofrontend-dev@googlegroups.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).