This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[gomp4 1/8] nvptx: remove assumption of OpenACC attrs presence
- From: Alexander Monakov <amonakov at ispras dot ru>
- To: gcc-patches at gcc dot gnu dot org
- Cc: Jakub Jelinek <jakub at redhat dot com>, Arutyun Avetisyan <arut at ispras dot ru>, Alexander Monakov <amonakov at ispras dot ru>
- Date: Wed, 23 Sep 2015 20:22:15 +0300
- Subject: [gomp4 1/8] nvptx: remove assumption of OpenACC attrs presence
- Authentication-results: sourceware.org; auth=none
- References: <1443028942-4081-1-git-send-email-amonakov at ispras dot ru>
This patch makes one OpenACC-specific path in nvptx_record_offload_symbol
optional.
* config/nvptx/nvptx.c (nvptx_record_offload_symbol): Allow missing
OpenACC attributes.
---
gcc/config/nvptx/nvptx.c | 19 +++++++++++--------
1 file changed, 11 insertions(+), 8 deletions(-)
diff --git a/gcc/config/nvptx/nvptx.c b/gcc/config/nvptx/nvptx.c
index 53850a1..21c59ef 100644
--- a/gcc/config/nvptx/nvptx.c
+++ b/gcc/config/nvptx/nvptx.c
@@ -4026,19 +4026,22 @@ nvptx_record_offload_symbol (tree decl)
case FUNCTION_DECL:
{
- tree attr = get_oacc_fn_attrib (decl);
- tree dims = TREE_VALUE (attr);
- unsigned ix;
-
fprintf (asm_out_file, "//:FUNC_MAP \"%s\"",
IDENTIFIER_POINTER (DECL_ASSEMBLER_NAME (decl)));
- for (ix = 0; ix != GOMP_DIM_MAX; ix++, dims = TREE_CHAIN (dims))
+ tree attr = get_oacc_fn_attrib (decl);
+ if (attr)
{
- int size = TREE_INT_CST_LOW (TREE_VALUE (dims));
+ tree dims = TREE_VALUE (attr);
+ unsigned ix;
- gcc_assert (!TREE_PURPOSE (dims));
- fprintf (asm_out_file, ", %#x", size);
+ for (ix = 0; ix != GOMP_DIM_MAX; ix++, dims = TREE_CHAIN (dims))
+ {
+ int size = TREE_INT_CST_LOW (TREE_VALUE (dims));
+
+ gcc_assert (!TREE_PURPOSE (dims));
+ fprintf (asm_out_file, ", %#x", size);
+ }
}
fprintf (asm_out_file, "\n");