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
This commit is contained in:
Roger Sayle 2006-04-15 05:50:42 +00:00 committed by Roger Sayle
parent db753da024
commit a01de5ece5
2 changed files with 7 additions and 2 deletions

View File

@ -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

View File

@ -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)));