[PR 70857] Copy RESULT_DECL of HSA outlined kernel function
authorMartin Jambor <mjambor@suse.cz>
Mon, 16 May 2016 15:40:30 +0000 (17:40 +0200)
committerMartin Jambor <jamborm@gcc.gnu.org>
Mon, 16 May 2016 15:40:30 +0000 (17:40 +0200)
2016-05-16  Martin Jambor  <mjambor@suse.cz>

PR hsa/70857
* omp-low.c (grid_expand_target_grid_body): Copy RESULT_DECL of
the outlined kernel function.

From-SVN: r236291

gcc/ChangeLog
gcc/omp-low.c

index ef550790b0ad8b83c3a166084ebe45ad501dd44e..0f06f1d79cc38a9e1487f7e0f0e51252c9641c7b 100644 (file)
@@ -1,3 +1,9 @@
+2016-05-16  Martin Jambor  <mjambor@suse.cz>
+
+       PR hsa/70857
+       * omp-low.c (grid_expand_target_grid_body): Copy RESULT_DECL of
+       the outlined kernel function.
+
 2016-05-16  Robert Suchanek  <robert.suchanek@imgtec.com>
 
        * config/mips/mips.h (ISA_HAS_LSA): Enable for -mmsa.
index c9600fb6d33424f46e78fe221fc041745c4efb09..a11f44b84a7929283352f42b4c66f580ce670edc 100644 (file)
@@ -13681,6 +13681,9 @@ grid_expand_target_grid_body (struct omp_region *target)
   tree new_parm_decl = copy_node (DECL_ARGUMENTS (kern_fndecl));
   DECL_CONTEXT (new_parm_decl) = kern_fndecl;
   DECL_ARGUMENTS (kern_fndecl) = new_parm_decl;
+  gcc_assert (VOID_TYPE_P (TREE_TYPE (DECL_RESULT (kern_fndecl))));
+  DECL_RESULT (kern_fndecl) = copy_node (DECL_RESULT (kern_fndecl));
+  DECL_CONTEXT (DECL_RESULT (kern_fndecl)) = kern_fndecl;
   struct function *kern_cfun = DECL_STRUCT_FUNCTION (kern_fndecl);
   kern_cfun->curr_properties = cfun->curr_properties;