This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[gfortran] Call fold


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]