Commit 36cefd39 by Jakub Jelinek Committed by Jakub Jelinek

re PR fortran/34247 (ICE in omp_add_variable, at gimplify.c:4677)

	* trans-expr.c (gfc_trans_string_copy): Convert both dest and
	src to void *.

	PR fortran/34247
	* trans-openmp.c (gfc_omp_privatize_by_reference): For REFERENCE_TYPE
	pass by reference only PARM_DECLs or non-artificial decls.

From-SVN: r130492
parent 1661473b
2007-11-28 Jakub Jelinek <jakub@redhat.com>
* trans-expr.c (gfc_trans_string_copy): Convert both dest and
src to void *.
PR fortran/34247
* trans-openmp.c (gfc_omp_privatize_by_reference): For REFERENCE_TYPE
pass by reference only PARM_DECLs or non-artificial decls.
2007-11-27 Jerry DeLisle <jvdelisle@gcc.gnu.org> 2007-11-27 Jerry DeLisle <jvdelisle@gcc.gnu.org>
PR fortran/32928 PR fortran/32928
......
...@@ -2708,7 +2708,10 @@ gfc_trans_string_copy (stmtblock_t * block, tree dlength, tree dest, ...@@ -2708,7 +2708,10 @@ gfc_trans_string_copy (stmtblock_t * block, tree dlength, tree dest,
We're now doing it here for better optimization, but the logic We're now doing it here for better optimization, but the logic
is the same. */ is the same. */
dest = fold_convert (pvoid_type_node, dest);
src = fold_convert (pvoid_type_node, src);
/* Truncate string if source is too long. */ /* Truncate string if source is too long. */
cond2 = fold_build2 (GE_EXPR, boolean_type_node, slen, dlen); cond2 = fold_build2 (GE_EXPR, boolean_type_node, slen, dlen);
tmp2 = build_call_expr (built_in_decls[BUILT_IN_MEMMOVE], tmp2 = build_call_expr (built_in_decls[BUILT_IN_MEMMOVE],
......
...@@ -44,7 +44,8 @@ gfc_omp_privatize_by_reference (const_tree decl) ...@@ -44,7 +44,8 @@ gfc_omp_privatize_by_reference (const_tree decl)
{ {
tree type = TREE_TYPE (decl); tree type = TREE_TYPE (decl);
if (TREE_CODE (type) == REFERENCE_TYPE) if (TREE_CODE (type) == REFERENCE_TYPE
&& (!DECL_ARTIFICIAL (decl) || TREE_CODE (decl) == PARM_DECL))
return true; return true;
if (TREE_CODE (type) == POINTER_TYPE) if (TREE_CODE (type) == POINTER_TYPE)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment