aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRoger Sayle <roger@eyesopen.com>2006-04-15 05:50:42 +0000
committerRoger Sayle <sayle@gcc.gnu.org>2006-04-15 05:50:42 +0000
commita01de5ece55c8b495118daa649e6ab5eb78912ca (patch)
tree34d50e038e1fa1be7464a9855bb63a2ecb849cfe
parentdb753da024d28482c4df4a7c1150df8a53651a06 (diff)
downloadgcc-a01de5ece55c8b495118daa649e6ab5eb78912ca.zip
gcc-a01de5ece55c8b495118daa649e6ab5eb78912ca.tar.gz
gcc-a01de5ece55c8b495118daa649e6ab5eb78912ca.tar.bz2
trans-io.c (set_string): Use fold_build2 and build_int_cst instead of build2 and convert to construct "x...
* trans-io.c (set_string): Use fold_build2 and build_int_cst instead of build2 and convert to construct "x < 0" rather than "x <= -1". From-SVN: r112968
-rw-r--r--gcc/fortran/ChangeLog5
-rw-r--r--gcc/fortran/trans-io.c4
2 files changed, 7 insertions, 2 deletions
diff --git a/gcc/fortran/ChangeLog b/gcc/fortran/ChangeLog
index 8523b9a..df5a576 100644
--- a/gcc/fortran/ChangeLog
+++ b/gcc/fortran/ChangeLog
@@ -1,3 +1,8 @@
+2006-04-14 Roger Sayle <roger@eyesopen.com>
+
+ * trans-io.c (set_string): Use fold_build2 and build_int_cst instead
+ of build2 and convert to construct "x < 0" rather than "x <= -1".
+
2006-04-13 Richard Henderson <rth@redhat.com>
* trans-openmp.c (gfc_trans_omp_sections): Adjust for changed
diff --git a/gcc/fortran/trans-io.c b/gcc/fortran/trans-io.c
index db1a481..9a60161 100644
--- a/gcc/fortran/trans-io.c
+++ b/gcc/fortran/trans-io.c
@@ -532,8 +532,8 @@ set_string (stmtblock_t * block, stmtblock_t * postblock, tree var,
msg =
gfc_build_cstring_const ("Assigned label is not a format label");
tmp = GFC_DECL_STRING_LEN (se.expr);
- tmp = build2 (LE_EXPR, boolean_type_node,
- tmp, convert (TREE_TYPE (tmp), integer_minus_one_node));
+ tmp = fold_build2 (LT_EXPR, boolean_type_node,
+ tmp, build_int_cst (TREE_TYPE (tmp), 0));
gfc_trans_runtime_check (tmp, msg, &se.pre);
gfc_add_modify_expr (&se.pre, io,
fold_convert (TREE_TYPE (io), GFC_DECL_ASSIGN_ADDR (se.expr)));