diff options
author | Jakub Jelinek <jakub@redhat.com> | 2010-12-02 15:37:20 +0100 |
---|---|---|
committer | Jakub Jelinek <jakub@gcc.gnu.org> | 2010-12-02 15:37:20 +0100 |
commit | edaadf74d4cd2bc4f0ef72456a4a6df8a4502470 (patch) | |
tree | 236b730968c457a7cee43f76f47f16b4b5f2cc97 /gcc/fortran/trans-openmp.c | |
parent | 4c698cf891a7d946b64d95ba89d6a0d255f40712 (diff) | |
download | gcc-edaadf74d4cd2bc4f0ef72456a4a6df8a4502470.zip gcc-edaadf74d4cd2bc4f0ef72456a4a6df8a4502470.tar.gz gcc-edaadf74d4cd2bc4f0ef72456a4a6df8a4502470.tar.bz2 |
re PR fortran/46753 (ICE: OpenMP - in extract_omp_for_data, at omp-low.c:335)
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.
From-SVN: r167372
Diffstat (limited to 'gcc/fortran/trans-openmp.c')
-rw-r--r-- | gcc/fortran/trans-openmp.c | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/gcc/fortran/trans-openmp.c b/gcc/fortran/trans-openmp.c index 6fe362b..a8c861e 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)); |