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] PR 38669 Array bounds violation for arguments of elemental subroutine


Hi all,

first, I join everybody to wish everybody a happy new year.

This patch fixes an array bounds violation with elemental arguments.
This is a regression.

The array bounds variables were used before they were assigned a value.
This is fixed by adding the offending code (dependency code) _after_ the
loop's pre code.

This patch also contains a fix for the fix for PR 38487 which was
supposed to only circumvent the warning, but was also changing the
return value.

As a bonus, it also fixes a function name in the ChangeLog.

Regression tested on x86_64-unknown-linux-gnu. Ok for trunk (and later
4.3?)?


Mikael


2009-01-03  Mikael Morin  <mikael.morin@tele2.fr>

	PR fortran/35681
	* ChangeLog: Fix function name.

	PR fortran/38487
	* dependency.c (gfc_check_argument_var_dependency):
	Move the check for pointerness inside the if block
	so that it doesn't affect the return value.

	PR fortran/38669
	* trans-stmt.c (gfc_trans_call):
	Add the dependency code after the loop bounds calculation one.

2009-01-03  Mikael Morin  <mikael.morin@tele2.fr>

	PR fortran/38669
	* gfortran.dg/elemental_dependency_3.f90: New test.
	* gfortran.dg/elemental_subroutine_7.f90: New test.

Attachment: pr38669_07.diff
Description: Text document


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