aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRoger Sayle <roger@eyesopen.com>2006-02-20 14:15:35 +0000
committerRoger Sayle <sayle@gcc.gnu.org>2006-02-20 14:15:35 +0000
commit3c90c9ae61060bdc092b64b2d0189f88ede9267f (patch)
treeea5fe3394aa41b27c51e0729a63820918522c5da
parenta6c550f98551764dab0f1d5492c993fa94426688 (diff)
downloadgcc-3c90c9ae61060bdc092b64b2d0189f88ede9267f.zip
gcc-3c90c9ae61060bdc092b64b2d0189f88ede9267f.tar.gz
gcc-3c90c9ae61060bdc092b64b2d0189f88ede9267f.tar.bz2
trans-stmt.c (gfc_trans_where_assign): Remove code to handle traversing a linked list of MASKs.
* trans-stmt.c (gfc_trans_where_assign): Remove code to handle traversing a linked list of MASKs. The MASK is now always a single element requiring no ANDing during the assignment. From-SVN: r111301
-rw-r--r--gcc/fortran/ChangeLog6
-rw-r--r--gcc/fortran/trans-stmt.c31
2 files changed, 10 insertions, 27 deletions
diff --git a/gcc/fortran/ChangeLog b/gcc/fortran/ChangeLog
index 2370246..885cdee 100644
--- a/gcc/fortran/ChangeLog
+++ b/gcc/fortran/ChangeLog
@@ -1,3 +1,9 @@
+2006-02-20 Roger Sayle <roger@eyesopen.com>
+
+ * trans-stmt.c (gfc_trans_where_assign): Remove code to handle
+ traversing a linked list of MASKs. The MASK is now always a
+ single element requiring no ANDing during the assignment.
+
2006-02-19 Thomas Koenig <Thomas.Koenig@online.de>
* gfortran.texi: Document environment variables which
diff --git a/gcc/fortran/trans-stmt.c b/gcc/fortran/trans-stmt.c
index 32c750a..2ee881a 100644
--- a/gcc/fortran/trans-stmt.c
+++ b/gcc/fortran/trans-stmt.c
@@ -2740,7 +2740,7 @@ gfc_trans_where_assign (gfc_expr *expr1, gfc_expr *expr2, tree mask,
tree tmp;
stmtblock_t block;
stmtblock_t body;
- tree index, maskexpr, tmp1;
+ tree index, maskexpr;
#if 0
/* TODO: handle this special case.
@@ -2835,21 +2835,10 @@ gfc_trans_where_assign (gfc_expr *expr1, gfc_expr *expr2, tree mask,
else
gfc_conv_expr (&lse, expr1);
- /* Form the mask expression according to the mask tree list. */
+ /* Form the mask expression according to the mask. */
index = count1;
- tmp = mask;
- if (tmp != NULL)
- maskexpr = gfc_build_array_ref (tmp, index);
- else
- maskexpr = NULL;
+ maskexpr = gfc_build_array_ref (mask, index);
- tmp = TREE_CHAIN (tmp);
- while (tmp)
- {
- tmp1 = gfc_build_array_ref (tmp, index);
- maskexpr = build2 (TRUTH_AND_EXPR, TREE_TYPE (tmp1), maskexpr, tmp1);
- tmp = TREE_CHAIN (tmp);
- }
/* Use the scalar assignment as is. */
tmp = gfc_trans_scalar_assign (&lse, &rse, expr1->ts.type);
tmp = build3_v (COND_EXPR, maskexpr, tmp, build_empty_stmt ());
@@ -2898,20 +2887,8 @@ gfc_trans_where_assign (gfc_expr *expr1, gfc_expr *expr2, tree mask,
/* Form the mask expression according to the mask tree list. */
index = count2;
- tmp = mask;
- if (tmp != NULL)
- maskexpr = gfc_build_array_ref (tmp, index);
- else
- maskexpr = NULL;
+ maskexpr = gfc_build_array_ref (mask, index);
- tmp = TREE_CHAIN (tmp);
- while (tmp)
- {
- tmp1 = gfc_build_array_ref (tmp, index);
- maskexpr = build2 (TRUTH_AND_EXPR, TREE_TYPE (tmp1),
- maskexpr, tmp1);
- tmp = TREE_CHAIN (tmp);
- }
/* Use the scalar assignment as is. */
tmp = gfc_trans_scalar_assign (&lse, &rse, expr1->ts.type);
tmp = build3_v (COND_EXPR, maskexpr, tmp, build_empty_stmt ());