[og7,nvptx] Backport CUDA 9 support from trunk.

Message ID b304a127-257d-3b49-e614-e60d26ed8ddc@codesourcery.com
State New
Headers show
Series
  • [og7,nvptx] Backport CUDA 9 support from trunk.
Related show

Commit Message

Cesar Philippidis Jan. 19, 2018, 9:59 p.m.
I've committed this patch to openacc-gcc-7-branch which backports the
recent CUDA 9 changes I applied to trunk here
<https://gcc.gnu.org/ml/gcc-patches/2018-01/msg01696.html>. OG7 already
had an earlier version of this patch, but Tom requested some changes
which went made their way into trunk. This patch keeps both trunk and
og7 consistent.

Cesar

Patch

[nvptx] Backport CUDA 9 support from trunk.

2018-01-19  Cesar Philippidis  <cesar@codesourcery.com>

	Backport from mainline:
	2018-01-19  Cesar Philippidis  <cesar@codesourcery.com>

	PR target/83790
	gcc/
	* config/nvptx/nvptx.c (output_init_frag):


diff --git a/gcc/config/nvptx/nvptx.c b/gcc/config/nvptx/nvptx.c
index 55c7e3cbf90..90d87bafda6 100644
--- a/gcc/config/nvptx/nvptx.c
+++ b/gcc/config/nvptx/nvptx.c
@@ -1894,14 +1894,14 @@  output_init_frag (rtx sym)
   
   if (sym)
     {
-      bool function = SYMBOL_REF_DECL (sym)
-	&& (TREE_CODE (SYMBOL_REF_DECL (sym)) == FUNCTION_DECL);
+      bool function = (SYMBOL_REF_DECL (sym)
+		       && (TREE_CODE (SYMBOL_REF_DECL (sym)) == FUNCTION_DECL));
       if (!function)
 	fprintf (asm_out_file, "generic(");
       output_address (VOIDmode, sym);
       if (!function)
-	fprintf (asm_out_file, val ? ") + " : ")");
-      else if (val)
+	fprintf (asm_out_file, ")");
+      if (val)
 	fprintf (asm_out_file, " + ");
     }