OSDN Git Service

PR fortran/20897
[pf3gnuchains/gcc-fork.git] / gcc / tree-ssa-math-opts.c
index bb51c31..0bb999c 100644 (file)
@@ -1,5 +1,5 @@
 /* Global, SSA-based optimizations using mathematical identities.
-   Copyright (C) 2005 Free Software Foundation, Inc.
+   Copyright (C) 2005, 2006, 2007 Free Software Foundation, Inc.
    
 This file is part of GCC.
    
@@ -303,9 +303,10 @@ insert_reciprocals (block_stmt_iterator *def_bsi, struct occurrence *occ,
       /* Make a variable with the replacement and substitute it.  */
       type = TREE_TYPE (def);
       recip_def = make_rename_temp (type, "reciptmp");
-      new_stmt = build2 (GIMPLE_MODIFY_STMT, void_type_node, recip_def,
-                        fold_build2 (RDIV_EXPR, type, build_one_cst (type),
-                                     def));
+      new_stmt = build_gimple_modify_stmt (recip_def,
+                                          fold_build2 (RDIV_EXPR, type,
+                                                       build_one_cst (type),
+                                                       def));
   
   
       if (occ->bb_has_division)
@@ -606,8 +607,8 @@ execute_cse_sincos_1 (tree name)
   if (!fndecl)
     return;
   res = make_rename_temp (TREE_TYPE (TREE_TYPE (fndecl)), "sincostmp");
-  call = build_function_call_expr (fndecl, build_tree_list (NULL_TREE, name));
-  stmt = build2 (GIMPLE_MODIFY_STMT, NULL_TREE, res, call);
+  call = build_call_expr (fndecl, 1, name);
+  stmt = build_gimple_modify_stmt (res, call);
   def_stmt = SSA_NAME_DEF_STMT (name);
   if (bb_for_stmt (def_stmt) == top_bb
       && TREE_CODE (def_stmt) == GIMPLE_MODIFY_STMT)
@@ -684,7 +685,7 @@ execute_cse_sincos (void)
                CASE_FLT_FN (BUILT_IN_SIN):
                CASE_FLT_FN (BUILT_IN_CEXPI):
                  arg = GIMPLE_STMT_OPERAND (stmt, 1);
-                 arg = TREE_VALUE (TREE_OPERAND (arg, 1));
+                 arg = CALL_EXPR_ARG (arg, 0);
                  if (TREE_CODE (arg) == SSA_NAME)
                    execute_cse_sincos_1 (arg);
                  break;