This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[Patch, fortran] PR30273
- From: Paul Thomas <paulthomas2 at wanadoo dot fr>
- To: gcc-patches <gcc-patches at gcc dot gnu dot org>, Fortran List <fortran at gcc dot gnu dot org>
- Date: Thu, 21 Dec 2006 20:13:07 +0100
- Subject: [Patch, fortran] PR30273
:ADDPATCH fortran:
This problem is due to the fact that gfc_check_dependency has not been
told about the existence of EXPR_NULL, with the result that
forall (k=1:n)
rc% spots (k)% vm => NULL() ! gfortran doesn't swallow this
end forall
in the reporter's testscase sees the dependency check return the
default, which results in the assignment trying to turn the rhs into a
temporary. Since the rhs is an array element, the scalarizer ICEs on
it. The fix consists of two lines
Index: gcc/fortran/dependency.c
===================================================================
*** gcc/fortran/dependency.c (révision 120108)
--- gcc/fortran/dependency.c (copie de travail)
*************** gfc_check_dependency (gfc_expr * expr1,
*** 700,705 ****
--- 700,708 ----
/* Probably ok in the majority of (constant) cases. */
return 1;
+ case EXPR_NULL:
+ return 0;
+
default:
return 1;
}
That reflect that there is no possibility of a dependence if the rhs is NULL().
2006-12-21 Paul Thomas <pault@gcc.gnu.org>
PR fortran/30202
* dependency.c (gfc_check_dependency): There is no dependency with
EXPR_NULL so always return 0.
I intend to commit this as obvious, later tonight, unless I receive any objections.
It is so obvious and the solution so stable that I see no point in a testcase but
will happily add the reporter's should that be deemed necessary.
Cheers
Paul