[gfortran] Call fold
Paul Brook
paul@nowt.org
Fri Sep 12 23:33:00 GMT 2003
Patch below adds some missing calls to fold. Most folding is done by the
frontend, but it can't see inside intrinsic functions.
Applied to tree-ssa branch.
Paul
2003-09-12 Paul Brook <paul@nowt.org>
* trans-intrinsic.c (gfc_conv_intrinsic_sign): Call fold.
diff -urpxCVS clean/tree-ssa/gcc/fortran/trans-intrinsic.c gcc/gcc/fortran/
trans-intrinsic.c
--- clean/tree-ssa/gcc/fortran/trans-intrinsic.c
+++ gcc/gcc/fortran/trans-intrinsic.c
@@ -841,11 +841,11 @@ gfc_conv_intrinsic_sign (gfc_se * se, gf
type = TREE_TYPE (arg);
zero = gfc_build_const (type, integer_zero_node);
- testa = build (GE_EXPR, boolean_type_node, arg, zero);
- testb = build (GE_EXPR, boolean_type_node, arg2, zero);
- tmp = build (TRUTH_XOR_EXPR, boolean_type_node, testa, testb);
- se->expr = build (COND_EXPR, type, tmp,
- build1 (NEGATE_EXPR, type, arg), arg);
+ testa = fold (build (GE_EXPR, boolean_type_node, arg, zero));
+ testb = fold (build (GE_EXPR, boolean_type_node, arg2, zero));
+ tmp = fold (build (TRUTH_XOR_EXPR, boolean_type_node, testa, testb));
+ se->expr = fold (build (COND_EXPR, type, tmp,
+ build1 (NEGATE_EXPR, type, arg), arg));
}
More information about the Gcc-patches
mailing list