[PR hsa/87863] Set assembler name of group and global variables early
authorMartin Jambor <mjambor@suse.cz>
Fri, 1 Feb 2019 16:22:13 +0000 (17:22 +0100)
committerMartin Jambor <jamborm@gcc.gnu.org>
Fri, 1 Feb 2019 16:22:13 +0000 (17:22 +0100)
2019-02-01  Martin Jambor  <mjambor@suse.cz>

PR hsa/87863
* omp-grid.c (grid_mark_variable_segment): Set assembler name of group
segment and global segment variables before making them static.

From-SVN: r268452

gcc/ChangeLog
gcc/omp-grid.c

index 700dd701df5fbad33a2c6b0d72c28707d6ebee47..5b34956eb062e3bcefe6ce4bd4d3be866590a172 100644 (file)
@@ -1,3 +1,9 @@
+2019-02-01  Martin Jambor  <mjambor@suse.cz>
+
+       PR hsa/87863
+       * omp-grid.c (grid_mark_variable_segment): Set assembler name of group
+       segment and global segment variables before making them static.
+
 2019-02-01  Martin Jambor  <mjambor@suse.cz>
 
        * omp-grid.c (grid_target_follows_gridifiable_pattern): Guard two
index 79e9405ce3f15f3fe4718b93d4fdbe43c96b76f4..1fdd8fc2efb4565823efb3571adb27d8379a7ec5 100644 (file)
@@ -934,6 +934,8 @@ grid_mark_variable_segment (tree var, enum grid_var_segment segment)
   if (!TREE_STATIC (var))
     {
       TREE_STATIC (var) = 1;
+      const char *prefix = IDENTIFIER_POINTER (DECL_NAME (var));
+      SET_DECL_ASSEMBLER_NAME (var, create_tmp_var_name (prefix));
       varpool_node::finalize_decl (var);
     }