diff options
author | pault <pault@138bc75d-0d04-0410-961f-82ee72b054a4> | 2010-11-28 13:47:26 +0000 |
---|---|---|
committer | pault <pault@138bc75d-0d04-0410-961f-82ee72b054a4> | 2010-11-28 13:47:26 +0000 |
commit | 929c6f457d512cffe535b6f4be0525d8d95b78bb (patch) | |
tree | 22c201ed393b50d88c4f265a2798d7bbdbe6e26a /gcc/fortran/lang.opt | |
parent | dc1b560ec6b4a4f427b8736643db1f5e09633af2 (diff) | |
download | gcc-929c6f457d512cffe535b6f4be0525d8d95b78bb.tar.gz |
2010-11-28 Paul Thomas <pault@gcc.gnu.org>
PR fortran/35810
* trans-array.c (gfc_trans_array_constructor): If the loop->to
is a VAR_DECL, assume this is dynamic. In this case, use the
counter to obtain the value and set loop->to appropriately.
(gfc_conv_ss_descriptor): Always save the offset of a variable
in info.saved_offset.
(gfc_conv_ss_startstride): Do not attempt bound checking of the
lhs of an assignment, if allocatable and f2003 is allowed.
(gfc_conv_loop_setup): If possible, do not use an allocatable
lhs variable for the loopspec.
(gfc_is_reallocatable_lhs): New function.
(get_std_lbound): New function.
(gfc_alloc_allocatable_for_assignment): New function.
* gfortran.h : Add flag_realloc_lhs to the options structure.
* lang.opt : Add option f(no-)realloc-lhs.
* invoke.texi : Document option f(no-)realloc-lhs.
* options.c (gfc_init_options, gfc_post_options,
gfc_handle_option): Incorporate f(no-)realloc-lhs with default
to frealloc_lhs for -std > f95.
* trans-array.h : Add primitive for previous.
* trans-expr.c (gfc_conv_string_length): Return if character
length is a variable and the expression is NULL.
(gfc_conv_procedure_call): If the call is of the kind x = f(...)
and the lhs is allocatable and reallocation on assignment OK,
call gfc_alloc_allocatable_for_assignment. Do not generate the
function call unless direct by reference.
(realloc_lhs_loop_for_fcn_call): New function.
(realloc_lhs_bounds_for_intrinsic_call): New function.
(gfc_trans_arrayfunc_assign): Reallocation assignments need
a loopinfo and for the loop bounds to be set. With intrinsic
functions, free the lhs data and let the library allocate the
data array. Done by the new functions above.
(gfc_trans_assignment_1): If the lhs is allocatable and
reallocation on assignment is allowed, mark the lhs and use
gfc_alloc_allocatable_for_assignment to make the reallocation.
* trans.h : Add is_alloc_lhs bitfield to gfc_ss structure.
2010-11-28 Paul Thomas <pault@gcc.gnu.org
PR fortran/35810
* gfortran.dg/realloc_on_assign_1.f03: New test.
* gfortran.dg/realloc_on_assign_2.f03: New test.
* gfortran.dg/transpose_2.f90: dg-option -fno-realloc-lhs.
* gfortran.dg/unpack_bounds_1.f90: The same.
* gfortran.dg/cshift_bounds_2.f90: The same.
* gfortran.dg/matmul_bounds_2.f90: The same.
* gfortran.dg/matmul_bounds_3.f90: The same.
* gfortran.dg/matmul_bounds_4.f90: The same.
* gfortran.dg/matmul_bounds_5.f90: The same.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@167220 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/fortran/lang.opt')
-rw-r--r-- | gcc/fortran/lang.opt | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/gcc/fortran/lang.opt b/gcc/fortran/lang.opt index 371b71d809f..69b3144d656 100644 --- a/gcc/fortran/lang.opt +++ b/gcc/fortran/lang.opt @@ -474,6 +474,10 @@ frange-check Fortran Enable range checking during compilation +frealloc-lhs +Fortran +Reallocate the LHS in assignments + frecord-marker=4 Fortran RejectNegative Use a 4-byte record marker for unformatted files |