From: Thomas Schwinge <thomas@codesourcery.com>
To: Nathan Sidwell <nathan@codesourcery.com>,
GCC Patches <gcc-patches@gcc.gnu.org>
Subject: Re: [gomp4] internal fns for id & nid
Date: Mon, 10 Aug 2015 19:39:00 -0000 [thread overview]
Message-ID: <87si7rj5m1.fsf@kepler.schwinge.homeip.net> (raw)
In-Reply-To: <55BFD258.1010301@acm.org>
[-- Attachment #1: Type: text/plain, Size: 4517 bytes --]
Hi!
On Mon, 3 Aug 2015 16:43:04 -0400, Nathan Sidwell <nathan@acm.org> wrote:
> I've committed this to gomp4 branch. It replaces the regular builtins
> __builtin_GOACC_nid/__builtin_GOACC_id with internal functions IFN_OACC_DIM_SIZE
> and IFN_OACC_DIM_POS -- moving further away from the PTX-specific naming of id &
> nid.
Thanks!
> --- gcc/internal-fn.c (revision 226515)
> +++ gcc/internal-fn.c (working copy)
> +static void
> +expand_GOACC_DIM_SIZE (gcall *stmt)
> +{
> + tree lhs = gimple_call_lhs (stmt);
> +
> + if (!lhs)
> + return;
> +
> + rtx target = expand_expr (lhs, NULL_RTX, VOIDmode, EXPAND_WRITE);
> + rtx val = expand_expr (gimple_call_arg (stmt, 0), NULL_RTX,
> + VOIDmode, EXPAND_NORMAL);
> +#ifdef HAVE_oacc_dim_size
> + emit_insn (gen_oacc_dim_size (target, val));
> +#else
> + emit_move_insn (target, const1_rtx);
> +#endif
> +}
> +
> +static void
> +expand_GOACC_DIM_POS (gcall *stmt)
> +{
> + tree lhs = gimple_call_lhs (stmt);
> +
> + if (!lhs)
> + return;
> +
> + rtx target = expand_expr (lhs, NULL_RTX, VOIDmode, EXPAND_WRITE);
> + rtx val = expand_expr (gimple_call_arg (stmt, 0), NULL_RTX,
> + VOIDmode, EXPAND_NORMAL);
> +#ifdef HAVE_oacc_dim_pos
> + emit_insn (gen_oacc_dim_pos (target, val));
> +#else
> + emit_move_insn (target, const0_rtx);
> +#endif
> +}
Bootstrap failure:
[...]/source-gcc/gcc/internal-fn.c: In function 'void expand_GOACC_DIM_SIZE(gcall*)':
[...]/source-gcc/gcc/internal-fn.c:1996:7: error: unused variable 'val' [-Werror=unused-variable]
rtx val = expand_expr (gimple_call_arg (stmt, 0), NULL_RTX,
^
[...]/source-gcc/gcc/internal-fn.c: In function 'void expand_GOACC_DIM_POS(gcall*)':
[...]/source-gcc/gcc/internal-fn.c:2014:7: error: unused variable 'val' [-Werror=unused-variable]
rtx val = expand_expr (gimple_call_arg (stmt, 0), NULL_RTX,
^
I'm assuming it is permissible to not expand_expr the call argument (for
side effects) in these two cases (please shout if that's wrong);
committed to gomp-4_0-branch in r226767:
commit f3907d648a9c9420deb4fb9f295b6e192a209f8d
Author: tschwinge <tschwinge@138bc75d-0d04-0410-961f-82ee72b054a4>
Date: Mon Aug 10 19:37:49 2015 +0000
Address -Werror=unused-variable diagnostic
Fixup for r226531.
gcc/
* internal-fn.c (expand_GOACC_DIM_SIZE) [!HAVE_oacc_dim_size]:
Don't define and set variable val.
(expand_GOACC_DIM_POS) [!HAVE_oacc_dim_pos]: Likewise.
* internal-fn.c (expand_GOACC_DIM_SIZE, expand_GOACC_DIM_POS)
[!HAVE_oacc_dim_size]: Don't define and set variable val.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/gomp-4_0-branch@226767 138bc75d-0d04-0410-961f-82ee72b054a4
---
gcc/ChangeLog.gomp | 6 ++++++
gcc/internal-fn.c | 8 ++++----
2 files changed, 10 insertions(+), 4 deletions(-)
diff --git gcc/ChangeLog.gomp gcc/ChangeLog.gomp
index 62f5e59..542b1af 100644
--- gcc/ChangeLog.gomp
+++ gcc/ChangeLog.gomp
@@ -1,3 +1,9 @@
+2015-08-10 Thomas Schwinge <thomas@codesourcery.com>
+
+ * internal-fn.c (expand_GOACC_DIM_SIZE) [!HAVE_oacc_dim_size]:
+ Don't define and set variable val.
+ (expand_GOACC_DIM_POS) [!HAVE_oacc_dim_pos]: Likewise.
+
2015-08-06 Cesar Philippidis <cesar@codesourcery.com>
* config/nvptx/nvptx.c (nvptx_expand_lock_unlock): Pass an
diff --git gcc/internal-fn.c gcc/internal-fn.c
index 72bb0bd..05321e1 100644
--- gcc/internal-fn.c
+++ gcc/internal-fn.c
@@ -1993,9 +1993,9 @@ expand_GOACC_DIM_SIZE (gcall *stmt)
return;
rtx target = expand_expr (lhs, NULL_RTX, VOIDmode, EXPAND_WRITE);
- rtx val = expand_expr (gimple_call_arg (stmt, 0), NULL_RTX,
- VOIDmode, EXPAND_NORMAL);
#ifdef HAVE_oacc_dim_size
+ rtx val = expand_expr (gimple_call_arg (stmt, 0), NULL_RTX,
+ VOIDmode, EXPAND_NORMAL);
emit_insn (gen_oacc_dim_size (target, val));
#else
emit_move_insn (target, const1_rtx);
@@ -2011,9 +2011,9 @@ expand_GOACC_DIM_POS (gcall *stmt)
return;
rtx target = expand_expr (lhs, NULL_RTX, VOIDmode, EXPAND_WRITE);
- rtx val = expand_expr (gimple_call_arg (stmt, 0), NULL_RTX,
- VOIDmode, EXPAND_NORMAL);
#ifdef HAVE_oacc_dim_pos
+ rtx val = expand_expr (gimple_call_arg (stmt, 0), NULL_RTX,
+ VOIDmode, EXPAND_NORMAL);
emit_insn (gen_oacc_dim_pos (target, val));
#else
emit_move_insn (target, const0_rtx);
Grüße,
Thomas
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 472 bytes --]
prev parent reply other threads:[~2015-08-10 19:39 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-08-03 20:43 Nathan Sidwell
2015-08-10 19:39 ` Thomas Schwinge [this message]
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=87si7rj5m1.fsf@kepler.schwinge.homeip.net \
--to=thomas@codesourcery.com \
--cc=gcc-patches@gcc.gnu.org \
--cc=nathan@codesourcery.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).