OSDN Git Service

* trans-expr.c (gfc_trans_string_copy): Convert both dest and
authorjakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4>
Wed, 28 Nov 2007 19:43:03 +0000 (19:43 +0000)
committerjakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4>
Wed, 28 Nov 2007 19:43:03 +0000 (19:43 +0000)
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.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@130492 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/fortran/ChangeLog
gcc/fortran/trans-expr.c
gcc/fortran/trans-openmp.c

index 19eba46..b117d18 100644 (file)
@@ -1,3 +1,12 @@
+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>
 
        PR fortran/32928
index e3e98b9..493f73b 100644 (file)
@@ -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
      is the same.  */
-  
+
+  dest = fold_convert (pvoid_type_node, dest);
+  src = fold_convert (pvoid_type_node, src);
+
   /* Truncate string if source is too long.  */
   cond2 = fold_build2 (GE_EXPR, boolean_type_node, slen, dlen);
   tmp2 = build_call_expr (built_in_decls[BUILT_IN_MEMMOVE],
index 047c2b8..ea595a0 100644 (file)
@@ -44,7 +44,8 @@ gfc_omp_privatize_by_reference (const_tree 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;
 
   if (TREE_CODE (type) == POINTER_TYPE)