aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorMartin Jambor <mjambor@suse.cz>2016-05-16 17:40:30 +0200
committerMartin Jambor <jamborm@gcc.gnu.org>2016-05-16 17:40:30 +0200
commit636542efb52ab08939b4c77f90b6cf373ad7058f (patch)
tree8650fae09331232d78158b489c00c04309d2f1df /gcc
parent704b85c7d8ae0b3d4e933e801c7b9329ca32c09c (diff)
downloadgcc-636542efb52ab08939b4c77f90b6cf373ad7058f.zip
gcc-636542efb52ab08939b4c77f90b6cf373ad7058f.tar.gz
gcc-636542efb52ab08939b4c77f90b6cf373ad7058f.tar.bz2
[PR 70857] Copy RESULT_DECL of HSA outlined kernel function
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
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ChangeLog6
-rw-r--r--gcc/omp-low.c3
2 files changed, 9 insertions, 0 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index ef55079..0f06f1d 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -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.
diff --git a/gcc/omp-low.c b/gcc/omp-low.c
index c9600fb..a11f44b 100644
--- a/gcc/omp-low.c
+++ b/gcc/omp-low.c
@@ -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;