From: Nathan Sidwell <nathan@acm.org>
To: GCC Patches <gcc-patches@gcc.gnu.org>
Cc: Bernd Schmidt <bernds_cb1@t-online.de>
Subject: [nvptx] fix complex args
Date: Sun, 23 Aug 2015 16:07:00 -0000 [thread overview]
Message-ID: <55D9DCA4.2000305@acm.org> (raw)
[-- Attachment #1: Type: text/plain, Size: 278 bytes --]
I've committed this patch, which fixes gcc.dg/compat/struct-by-value-11
That test passes 'complex char', which is split into two char arguments. We
fail to promote the type in one place, leading to a PTX type mismatch where we
claim an 8 bit type is a 32 bit type.
nathan
[-- Attachment #2: ptx-cplx.patch --]
[-- Type: text/x-patch, Size: 1827 bytes --]
2015-08-23 Nathan Sidwell <nathan@acm.org>
* config/nvptx/nvptx.c (walk_args_for_param): Promote arg reg
decls.
(nvptx_declare_function_name): Insert formatting tabs for
consistency.
Index: config/nvptx/nvptx.c
===================================================================
--- config/nvptx/nvptx.c (revision 227101)
+++ config/nvptx/nvptx.c (working copy)
@@ -1,4 +1,3 @@
-
/* Target code for NVPTX.
Copyright (C) 2014-2015 Free Software Foundation, Inc.
Contributed by Bernd Schmidt <bernds@codesourcery.com>
@@ -413,10 +412,10 @@ walk_args_for_param (FILE *file, tree ar
i++;
if (write_copy)
fprintf (file, "\tld.param%s %%ar%d, [%%in_ar%d];\n",
- nvptx_ptx_type_from_mode (mode, false), i, i);
+ nvptx_ptx_type_from_mode (mode, true), i, i);
else
fprintf (file, "\t.reg%s %%ar%d;\n",
- nvptx_ptx_type_from_mode (mode, false), i);
+ nvptx_ptx_type_from_mode (mode, true), i);
}
}
}
@@ -546,7 +545,7 @@ nvptx_declare_function_name (FILE *file,
else if (TYPE_MODE (result_type) != VOIDmode)
{
machine_mode mode = arg_promotion (TYPE_MODE (result_type));
- fprintf (file, ".reg%s %%retval;\n",
+ fprintf (file, "\t.reg%s %%retval;\n",
nvptx_ptx_type_from_mode (mode, false));
}
@@ -618,10 +617,10 @@ nvptx_declare_function_name (FILE *file,
walk_args_for_param (file, TYPE_ARG_TYPES (fntype), DECL_ARGUMENTS (decl),
true, return_in_mem);
if (return_in_mem)
- fprintf (file, "ld.param.u%d %%ar1, [%%in_ar1];\n",
+ fprintf (file, "\tld.param.u%d %%ar1, [%%in_ar1];\n",
GET_MODE_BITSIZE (Pmode));
if (stdarg_p (fntype))
- fprintf (file, "ld.param.u%d %%argp, [%%in_argp];\n",
+ fprintf (file, "\tld.param.u%d %%argp, [%%in_argp];\n",
GET_MODE_BITSIZE (Pmode));
}
reply other threads:[~2015-08-23 14: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=55D9DCA4.2000305@acm.org \
--to=nathan@acm.org \
--cc=bernds_cb1@t-online.de \
--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).