Commit e8300d6e by Francois-Xavier Coudert Committed by François-Xavier Coudert

re PR libfortran/27524 (-fbounds-check interacts with array function)

	PR fortran/27524

	* trans-array.c (gfc_trans_dummy_array_bias): Don't use stride as
	a temporary variable when -fbounds-check is enabled, since its
	value will be needed later.

	* gfortran.dg/bounds_check_1.f90: New test.

From-SVN: r114142
parent 7c7ce73a
2006-05-26 Francois-Xavier Coudert <coudert@clipper.ens.fr>
PR fortran/27524
* trans-array.c (gfc_trans_dummy_array_bias): Don't use stride as
a temporary variable when -fbounds-check is enabled, since its
value will be needed later.
2006-05-26 Thomas Koenig <Thomas.Koenig@online.de> 2006-05-26 Thomas Koenig <Thomas.Koenig@online.de>
PR fortran/23151 PR fortran/23151
......
...@@ -3564,7 +3564,7 @@ gfc_trans_dummy_array_bias (gfc_symbol * sym, tree tmpdesc, tree body) ...@@ -3564,7 +3564,7 @@ gfc_trans_dummy_array_bias (gfc_symbol * sym, tree tmpdesc, tree body)
tree dumdesc; tree dumdesc;
tree tmp; tree tmp;
tree stmt; tree stmt;
tree stride; tree stride, stride2;
tree stmt_packed; tree stmt_packed;
tree stmt_unpacked; tree stmt_unpacked;
tree partial; tree partial;
...@@ -3711,9 +3711,9 @@ gfc_trans_dummy_array_bias (gfc_symbol * sym, tree tmpdesc, tree body) ...@@ -3711,9 +3711,9 @@ gfc_trans_dummy_array_bias (gfc_symbol * sym, tree tmpdesc, tree body)
tmp = fold_build2 (MINUS_EXPR, gfc_array_index_type, tmp = fold_build2 (MINUS_EXPR, gfc_array_index_type,
ubound, lbound); ubound, lbound);
stride = build2 (MINUS_EXPR, gfc_array_index_type, stride2 = build2 (MINUS_EXPR, gfc_array_index_type,
dubound, dlbound); dubound, dlbound);
tmp = fold_build2 (NE_EXPR, gfc_array_index_type, tmp, stride); tmp = fold_build2 (NE_EXPR, gfc_array_index_type, tmp, stride2);
gfc_trans_runtime_check (tmp, gfc_strconst_bounds, &block); gfc_trans_runtime_check (tmp, gfc_strconst_bounds, &block);
} }
} }
......
2006-05-26 Francois-Xavier Coudert <coudert@clipper.ens.fr>
PR fortran/27524
* gfortran.dg/bounds_check_1.f90: New test.
2006-05-26 Ulrich Weigand <uweigand@de.ibm.com> 2006-05-26 Ulrich Weigand <uweigand@de.ibm.com>
PR rtl-optimization/27661 PR rtl-optimization/27661
! { dg-do run }
! { dg-options "-fbounds-check" }
! PR fortran/27524
integer :: res(1)
res = F()
if (res(1) /= 1) call abort
contains
function F()
integer :: F(1)
f = 1
end function F
end
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment