This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[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






Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]