[Patch, fortran] PR31217 - ICE using FORALL on character substrings

Tobias Burnus burnus@net-b.de
Sun Oct 28 15:26:00 GMT 2007


FX Coudert wrote:
>> Looking at the patch, it think it is OK. (Though, I would not mind if
>> someone else could glance over the patch as it is rather large.)
> I haven't gone into the details, but it looks OK to me too, so let's
> get it committed and see what it breaks :)

Attached is the new version of Paul's patch, which he send me and
Dominique this morning in a private mail. (The patch contained also a
fix of PR33897, which I intent to extract and to post later.)

The attached patch is essentially the same as the one posted on 26
October, http://gcc.gnu.org/ml/fortran/2007-10/msg00341.html, except for
a fix in trans-stmt.c (see below). The previous patch plus the half of
the fix were approved yesterday by me, and FX also glanced over it.

(Build and regression tested on x86-64-linux.)
I intent to commit it in 24h unless someone approves it earlier - or has
objections.

Tobias


Interdiff for trans-stmt.c between Paul's 26 October patch and his new
patch/the attached patch:

diff -u gcc/fortran/trans-stmt.c gcc/fortran/trans-stmt.c
--- gcc/fortran/trans-stmt.c    (working copy)
+++ gcc/fortran/trans-stmt.c    (working copy)
@@ -1663,9 +1663,12 @@
      the variable will not suffice for derived types with
      pointer components.  We therefore leave these to their
      own devices.  */
+  if (lsym->ts.type == BT_DERIVED
+       && lsym->ts.derived->attr.pointer_comp)
+    return need_temp;
+
   new_symtree = NULL;
-  if ((find_forall_index (c->expr, lsym, 2) == SUCCESS)
-        && !lsym->attr.pointer_comp)
+  if (find_forall_index (c->expr, lsym, 2) == SUCCESS)
     {
       forall_make_variable_temp (c, pre, post);
       need_temp = 0;


The patch contained, additionally, changes to decl.c, parse.c and
contained_3.f90 for PR33897 and the following patch which seems to be
unrelated to either PR. (These changes are not in the attached patch.)

--- gcc/fortran/trans-intrinsic.c       (revision 129504)
+++ gcc/fortran/trans-intrinsic.c       (working copy)
@@ -3171,8 +3171,6 @@ gfc_conv_intrinsic_array_transfer (gfc_s
     {
       tmp = fold_build2 (MULT_EXPR, gfc_array_index_type,
                         tmp, dest_word_len);
-      tmp = fold_build2 (MIN_EXPR, gfc_array_index_type,
-                        tmp, source_bytes);
     }
   else
     tmp = source_bytes;
@@ -3229,7 +3227,7 @@ gfc_conv_intrinsic_array_transfer (gfc_s
                         3,
                         tmp,
                         fold_convert (pvoid_type_node, source),
-                        size_bytes);
+                        source_bytes);
   gfc_add_expr_to_block (&se->pre, tmp);

   se->expr = info->descriptor;

-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: check-mod.diff
URL: <http://gcc.gnu.org/pipermail/gcc-patches/attachments/20071028/3f61e714/attachment.ksh>


More information about the Gcc-patches mailing list