public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Alexander Monakov <amonakov@ispras.ru>
To: gcc-patches@gcc.gnu.org
Subject: [gomp-nvptx 5/7] nvptx backend: use POINTER_SIZE instead of BITS_PER_WORD
Date: Fri, 18 Mar 2016 17:49:00 -0000	[thread overview]
Message-ID: <1458323327-9908-6-git-send-email-amonakov@ispras.ru> (raw)
In-Reply-To: <1458323327-9908-1-git-send-email-amonakov@ispras.ru>

POINTER_SIZE is the proper macro to retrieve pointer size in bits for the
target ABI, but new code incorrectly used BITS_PER_WORD, breaking 32-bit
code generation.

	* config/nvptx/nvptx.c (nvptx_init_unisimt_predicate): Use
	POINTER_SIZE instead of BITS_PER_WORD.
	(nvptx_declare_function_name): Ditto.
	(nvptx_output_return): Ditto.
	(nvptx_file_end): Ditto.
---
 gcc/ChangeLog.gomp-nvptx | 8 ++++++++
 gcc/config/nvptx/nvptx.c | 8 ++++----
 2 files changed, 12 insertions(+), 4 deletions(-)

diff --git a/gcc/config/nvptx/nvptx.c b/gcc/config/nvptx/nvptx.c
index e69e0be..93bf781 100644
--- a/gcc/config/nvptx/nvptx.c
+++ b/gcc/config/nvptx/nvptx.c
@@ -946,7 +946,7 @@ nvptx_init_axis_predicate (FILE *file, int regno, const char *name)
 static void
 nvptx_init_unisimt_predicate (FILE *file)
 {
-  int bits = BITS_PER_WORD;
+  int bits = POINTER_SIZE;
   int master = REGNO (cfun->machine->unisimt_master);
   int pred = REGNO (cfun->machine->unisimt_predicate);
   fprintf (file, "\t{\n");
@@ -1108,7 +1108,7 @@ nvptx_declare_function_name (FILE *file, const char *name, const_tree decl)
       /* Maintain 64-bit stack alignment.  */
       int keep_align = BIGGEST_ALIGNMENT / BITS_PER_UNIT;
       sz = ROUND_UP (sz, keep_align);
-      int bits = BITS_PER_WORD;
+      int bits = POINTER_SIZE;
       fprintf (file, "\t.reg.u%d %%frame;\n", bits);
       fprintf (file, "\t.reg.u32 %%fstmp0;\n");
       fprintf (file, "\t.reg.u%d %%fstmp1;\n", bits);
@@ -1177,7 +1177,7 @@ nvptx_output_return (void)
 
   if (cfun->machine->using_softstack)
     fprintf (asm_out_file, "\tst.shared.u%d [%%fstmp2], %%fstmp1;\n",
-	     BITS_PER_WORD);
+	     POINTER_SIZE);
 
   if (mode != VOIDmode)
     fprintf (asm_out_file, "\tst.param%s\t[%s_out], %s;\n",
@@ -4191,7 +4191,7 @@ nvptx_file_end (void)
     {
       write_var_marker (asm_out_file, false, true, "__nvptx_stacks");
       fprintf (asm_out_file, ".extern .shared .u%d __nvptx_stacks[32];\n",
-	       BITS_PER_WORD);
+	       POINTER_SIZE);
     }
   if (need_unisimt_decl)
     {

  parent reply	other threads:[~2016-03-18 17:49 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-03-18 17:48 [gomp-nvptx 0/7] Various fixes Alexander Monakov
2016-03-18 17:48 ` [gomp-nvptx 1/7] libgomp: remove paste error in gomp_team_barrier_wait_end Alexander Monakov
2016-03-18 17:48 ` [gomp-nvptx 4/7] nvptx backend: re-enable line info generation Alexander Monakov
2016-03-18 17:48 ` [gomp-nvptx 2/7] nvptx libgcc: use attribute shared Alexander Monakov
2016-03-18 17:49 ` [gomp-nvptx 7/7] nvptx backend: define STACK_SIZE_MODE Alexander Monakov
2016-03-18 17:49 ` Alexander Monakov [this message]
2016-03-18 17:49 ` [gomp-nvptx 3/7] libgomp plugin: make cuMemFreeHost error non-fatal Alexander Monakov
2016-03-18 18:13 ` [gomp-nvptx 6/7] nvptx backend: change mul.u32 to mul.lo.u32 Alexander Monakov

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=1458323327-9908-6-git-send-email-amonakov@ispras.ru \
    --to=amonakov@ispras.ru \
    --cc=gcc-patches@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).