summaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorjvdelisle <jvdelisle@138bc75d-0d04-0410-961f-82ee72b054a4>2008-04-24 03:48:00 +0000
committerjvdelisle <jvdelisle@138bc75d-0d04-0410-961f-82ee72b054a4>2008-04-24 03:48:00 +0000
commit4b8fe540d1ad9fbae9c924fbeaeefa560a67b459 (patch)
tree04b41bfc43f3809c60b588173402eaaa2104427a /gcc
parentf9ef85c8c35002c69c3a531f77166108d1761850 (diff)
downloadgcc-4b8fe540d1ad9fbae9c924fbeaeefa560a67b459.tar.gz
2008-04-23 Jerry DeLisle <jvdelisle@gcc.gnu.org>
Francois-Xavier Coudert <fxcoudert@gcc.gnu.org> PR fortran/35994 * trans-instrinsic.c (gfc_conv_intrinsic_minmaxloc): Correctly adjust loop counter offset. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@134615 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc')
-rw-r--r--gcc/fortran/ChangeLog7
-rw-r--r--gcc/fortran/trans-intrinsic.c9
2 files changed, 12 insertions, 4 deletions
diff --git a/gcc/fortran/ChangeLog b/gcc/fortran/ChangeLog
index dedc52ad0e0..4de64f1951d 100644
--- a/gcc/fortran/ChangeLog
+++ b/gcc/fortran/ChangeLog
@@ -1,3 +1,10 @@
+2008-04-23 Jerry DeLisle <jvdelisle@gcc.gnu.org>
+ Francois-Xavier Coudert <fxcoudert@gcc.gnu.org>
+
+ PR fortran/35994
+ * trans-instrinsic.c (gfc_conv_intrinsic_minmaxloc): Correctly adjust
+ loop counter offset.
+
2008-04-23 Paolo Bonzini <bonzini@gnu.org>
* trans-expr.c (gfc_conv_structure): Don't set TREE_INVARIANT.
diff --git a/gcc/fortran/trans-intrinsic.c b/gcc/fortran/trans-intrinsic.c
index e832b8a30e9..f3cd4de9bca 100644
--- a/gcc/fortran/trans-intrinsic.c
+++ b/gcc/fortran/trans-intrinsic.c
@@ -2171,11 +2171,12 @@ gfc_conv_intrinsic_minmaxloc (gfc_se * se, gfc_expr * expr, int op)
/* Remember where we are. An offset must be added to the loop
counter to obtain the required position. */
- if (loop.temp_dim)
- tmp = build_int_cst (gfc_array_index_type, 1);
+ if (loop.from[0])
+ tmp = fold_build2 (MINUS_EXPR, gfc_array_index_type,
+ gfc_index_one_node, loop.from[0]);
else
- tmp =fold_build2 (MINUS_EXPR, gfc_array_index_type,
- gfc_index_one_node, loop.from[0]);
+ tmp = build_int_cst (gfc_array_index_type, 1);
+
gfc_add_modify_expr (&block, offset, tmp);
tmp = fold_build2 (PLUS_EXPR, TREE_TYPE (pos),