diff options
author | Paul Thomas <pault@gcc.gnu.org> | 2010-07-23 14:25:55 +0000 |
---|---|---|
committer | Paul Thomas <pault@gcc.gnu.org> | 2010-07-23 14:25:55 +0000 |
commit | 3d03ead0b8273efde57f6194617b35111a84b05d (patch) | |
tree | be85c1a1d325c1a8b6496500d502795c61e15506 /gcc/fortran/trans-expr.c | |
parent | c4fcd06a10ddacc81f535b165034dbaa93b6005c (diff) | |
download | gcc-3d03ead0b8273efde57f6194617b35111a84b05d.zip gcc-3d03ead0b8273efde57f6194617b35111a84b05d.tar.gz gcc-3d03ead0b8273efde57f6194617b35111a84b05d.tar.bz2 |
re PR fortran/24524 (Fortran dependency checking should reverse loops)
2009-07-23 Paul Thomas <pault@gcc.gnu.org>
PR fortran/24524
* trans-array.c (gfc_init_loopinfo): Initialize the reverse
field.
gfc_trans_scalarized_loop_end: If reverse set in dimension n,
reverse the scalarization loop.
gfc_conv_resolve_dependencies: Pass the reverse field of the
loopinfo to gfc_dep_resolver.
trans-expr.c (gfc_trans_assignment_1): Enable loop reversal for
assignment by resetting loop.reverse.
gfortran.h : Add the gfc_reverse enum.
trans.h : Add the reverse field to gfc_loopinfo.
dependency.c (gfc_check_dependency): Pass null to the new arg
of gfc_dep_resolver.
(gfc_check_section_vs_section): Check for reverse dependencies.
(gfc_dep_resolver): Add reverse argument and deal with the loop
reversal logic.
dependency.h : Modify prototype for gfc_dep_resolver to include
gfc_reverse *.
From-SVN: r162462
Diffstat (limited to 'gcc/fortran/trans-expr.c')
-rw-r--r-- | gcc/fortran/trans-expr.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/gcc/fortran/trans-expr.c b/gcc/fortran/trans-expr.c index 09ad110..a83d4b3 100644 --- a/gcc/fortran/trans-expr.c +++ b/gcc/fortran/trans-expr.c @@ -5303,6 +5303,7 @@ gfc_trans_assignment_1 (gfc_expr * expr1, gfc_expr * expr2, bool init_flag, bool l_is_temp; bool scalar_to_array; tree string_length; + int n; /* Assignment of the form lhs = rhs. */ gfc_start_block (&block); @@ -5348,6 +5349,9 @@ gfc_trans_assignment_1 (gfc_expr * expr1, gfc_expr * expr2, bool init_flag, /* Calculate the bounds of the scalarization. */ gfc_conv_ss_startstride (&loop); + /* Enable loop reversal. */ + for (n = 0; n < loop.dimen; n++) + loop.reverse[n] = GFC_REVERSE_NOT_SET; /* Resolve any data dependencies in the statement. */ gfc_conv_resolve_dependencies (&loop, lss, rss); /* Setup the scalarizing loops. */ |