This is the mail archive of the fortran@gcc.gnu.org mailing list for the GNU Fortran 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]

Possible patch for fortran/55086


2016-10-26  Louis Krupp  <louis.krupp@zoho.com>
	PR fortran/55086
	* trans-stmt.c (generate_loop_for_temp_to_lhs,
	gfc_trans_assign_need_temp, gfc_trans_forall_1): Make forall temp
	work for substrings, improve test coverage by adding
	-fforce-forall-temp option to force usage of temp in forall code.
	* lang.opt: Add -fforce-forall-temp option.
	* invoke.texi: Add -fforce-forall-temp option.

The problem was that forall could handle substring expressions, but not if it had to create a temporary array.  I did my best to fix this.  I left a couple of TODO comments in the code.

Part of the issue is that forall doesn't usually create a temporary, so that code doesn't get as much test coverage as it probably should.  I added an option (-fforce-forall-temp) to force forall to use a temporary, and I set that option in a couple of the test files.

I would not be surprised if there were a better way to do this.

When I tweak gfc_trans_forall_1() to force usage of a temporary for all assignments, all tests pass with the exception of forall_8.f90, and the whole point of that test is making sure that this particular forall *doesn't* use a temporary.
  
Louis Krupp
 

Attachment: patch.txt
Description: Text document


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