diff options
author | jakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4> | 2010-12-02 14:37:20 +0000 |
---|---|---|
committer | jakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4> | 2010-12-02 14:37:20 +0000 |
commit | ffa793638d3507c183f455f2390af1d70d87a102 (patch) | |
tree | 236b730968c457a7cee43f76f47f16b4b5f2cc97 /gcc | |
parent | 0b810b104b1805bd0febbf6980e929ab359ff1ad (diff) | |
download | gcc-ffa793638d3507c183f455f2390af1d70d87a102.tar.gz |
PR fortran/46753
* trans-openmp.c (gfc_trans_omp_do): Use build2_loc instead of
fold_build2_loc for OMP_FOR conditions.
* libgomp.fortran/pr46753.f90: New test.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@167372 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/fortran/ChangeLog | 6 | ||||
-rw-r--r-- | gcc/fortran/trans-openmp.c | 15 |
2 files changed, 14 insertions, 7 deletions
diff --git a/gcc/fortran/ChangeLog b/gcc/fortran/ChangeLog index 8b761ecec2a..8e6319b6a09 100644 --- a/gcc/fortran/ChangeLog +++ b/gcc/fortran/ChangeLog @@ -1,3 +1,9 @@ +2010-12-02 Jakub Jelinek <jakub@redhat.com> + + PR fortran/46753 + * trans-openmp.c (gfc_trans_omp_do): Use build2_loc instead of + fold_build2_loc for OMP_FOR conditions. + 2010-11-30 Janne Blomqvist <jb@gcc.gnu.org> PR fortran/28105 diff --git a/gcc/fortran/trans-openmp.c b/gcc/fortran/trans-openmp.c index 6fe362b778e..a8c861e253e 100644 --- a/gcc/fortran/trans-openmp.c +++ b/gcc/fortran/trans-openmp.c @@ -1262,10 +1262,10 @@ gfc_trans_omp_do (gfc_code *code, stmtblock_t *pblock, if (simple) { TREE_VEC_ELT (init, i) = build2_v (MODIFY_EXPR, dovar, from); - TREE_VEC_ELT (cond, i) = fold_build2_loc (input_location, simple > 0 - ? LE_EXPR : GE_EXPR, - boolean_type_node, dovar, - to); + /* The condition should not be folded. */ + TREE_VEC_ELT (cond, i) = build2_loc (input_location, simple > 0 + ? LE_EXPR : GE_EXPR, + boolean_type_node, dovar, to); TREE_VEC_ELT (incr, i) = fold_build2_loc (input_location, PLUS_EXPR, type, dovar, step); TREE_VEC_ELT (incr, i) = fold_build2_loc (input_location, @@ -1290,9 +1290,10 @@ gfc_trans_omp_do (gfc_code *code, stmtblock_t *pblock, count = gfc_create_var (type, "count"); TREE_VEC_ELT (init, i) = build2_v (MODIFY_EXPR, count, build_int_cst (type, 0)); - TREE_VEC_ELT (cond, i) = fold_build2_loc (input_location, LT_EXPR, - boolean_type_node, - count, tmp); + /* The condition should not be folded. */ + TREE_VEC_ELT (cond, i) = build2_loc (input_location, LT_EXPR, + boolean_type_node, + count, tmp); TREE_VEC_ELT (incr, i) = fold_build2_loc (input_location, PLUS_EXPR, type, count, build_int_cst (type, 1)); |