diff options
Diffstat (limited to 'gcc/fortran/trans-decl.c')
-rw-r--r-- | gcc/fortran/trans-decl.c | 64 |
1 files changed, 18 insertions, 46 deletions
diff --git a/gcc/fortran/trans-decl.c b/gcc/fortran/trans-decl.c index 79a3e8b8c31..52393b46bf2 100644 --- a/gcc/fortran/trans-decl.c +++ b/gcc/fortran/trans-decl.c @@ -1,5 +1,5 @@ /* Backend function setup - Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007 Free Software + Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc. Contributed by Paul Brook @@ -99,10 +99,6 @@ tree gfor_fndecl_associated; trans-intrinsic.c. */ gfc_powdecl_list gfor_fndecl_math_powi[4][3]; -tree gfor_fndecl_math_cpowf; -tree gfor_fndecl_math_cpow; -tree gfor_fndecl_math_cpowl10; -tree gfor_fndecl_math_cpowl16; tree gfor_fndecl_math_ishftc4; tree gfor_fndecl_math_ishftc8; tree gfor_fndecl_math_ishftc16; @@ -693,8 +689,8 @@ gfc_build_qualified_array (tree decl, gfc_symbol * sym) { tree size, range; - size = build2 (MINUS_EXPR, gfc_array_index_type, - GFC_TYPE_ARRAY_SIZE (type), gfc_index_one_node); + size = fold_build2 (MINUS_EXPR, gfc_array_index_type, + GFC_TYPE_ARRAY_SIZE (type), gfc_index_one_node); range = build_range_type (gfc_array_index_type, gfc_index_zero_node, size); TYPE_DOMAIN (type) = range; @@ -1733,9 +1729,8 @@ build_entry_thunks (gfc_namespace * ns) pushdecl (union_decl); DECL_CONTEXT (union_decl) = current_function_decl; - tmp = build2 (MODIFY_EXPR, - TREE_TYPE (union_decl), - union_decl, tmp); + tmp = fold_build2 (MODIFY_EXPR, TREE_TYPE (union_decl), + union_decl, tmp); gfc_add_expr_to_block (&body, tmp); for (field = TYPE_FIELDS (TREE_TYPE (union_decl)); @@ -1744,19 +1739,19 @@ build_entry_thunks (gfc_namespace * ns) thunk_sym->result->name) == 0) break; gcc_assert (field != NULL_TREE); - tmp = build3 (COMPONENT_REF, TREE_TYPE (field), union_decl, field, - NULL_TREE); - tmp = build2 (MODIFY_EXPR, - TREE_TYPE (DECL_RESULT (current_function_decl)), - DECL_RESULT (current_function_decl), tmp); + tmp = fold_build3 (COMPONENT_REF, TREE_TYPE (field), + union_decl, field, NULL_TREE); + tmp = fold_build2 (MODIFY_EXPR, + TREE_TYPE (DECL_RESULT (current_function_decl)), + DECL_RESULT (current_function_decl), tmp); tmp = build1_v (RETURN_EXPR, tmp); } else if (TREE_TYPE (DECL_RESULT (current_function_decl)) != void_type_node) { - tmp = build2 (MODIFY_EXPR, - TREE_TYPE (DECL_RESULT (current_function_decl)), - DECL_RESULT (current_function_decl), tmp); + tmp = fold_build2 (MODIFY_EXPR, + TREE_TYPE (DECL_RESULT (current_function_decl)), + DECL_RESULT (current_function_decl), tmp); tmp = build1_v (RETURN_EXPR, tmp); } gfc_add_expr_to_block (&body, tmp); @@ -1878,8 +1873,8 @@ gfc_get_fake_result_decl (gfc_symbol * sym, int parent_flag) break; gcc_assert (field != NULL_TREE); - decl = build3 (COMPONENT_REF, TREE_TYPE (field), decl, field, - NULL_TREE); + decl = fold_build3 (COMPONENT_REF, TREE_TYPE (field), + decl, field, NULL_TREE); } var = create_tmp_var_raw (TREE_TYPE (decl), sym->name); @@ -2024,10 +2019,6 @@ gfc_build_intrinsic_function_decls (void) tree gfc_real8_type_node = gfc_get_real_type (8); tree gfc_real10_type_node = gfc_get_real_type (10); tree gfc_real16_type_node = gfc_get_real_type (16); - tree gfc_complex4_type_node = gfc_get_complex_type (4); - tree gfc_complex8_type_node = gfc_get_complex_type (8); - tree gfc_complex10_type_node = gfc_get_complex_type (10); - tree gfc_complex16_type_node = gfc_get_complex_type (16); /* String functions. */ gfor_fndecl_compare_string = @@ -2195,25 +2186,6 @@ gfc_build_intrinsic_function_decls (void) #undef NRKINDS } - gfor_fndecl_math_cpowf = - gfc_build_library_function_decl (get_identifier ("cpowf"), - gfc_complex4_type_node, - 1, gfc_complex4_type_node); - gfor_fndecl_math_cpow = - gfc_build_library_function_decl (get_identifier ("cpow"), - gfc_complex8_type_node, - 1, gfc_complex8_type_node); - if (gfc_complex10_type_node) - gfor_fndecl_math_cpowl10 = - gfc_build_library_function_decl (get_identifier ("cpowl"), - gfc_complex10_type_node, 1, - gfc_complex10_type_node); - if (gfc_complex16_type_node) - gfor_fndecl_math_cpowl16 = - gfc_build_library_function_decl (get_identifier ("cpowl"), - gfc_complex16_type_node, 1, - gfc_complex16_type_node); - gfor_fndecl_math_ishftc4 = gfc_build_library_function_decl (get_identifier (PREFIX("ishftc4")), gfc_int4_type_node, @@ -2457,7 +2429,7 @@ gfc_trans_auto_character_variable (gfc_symbol * sym, tree fnbody) /* Emit a DECL_EXPR for this variable, which will cause the gimplifier to allocate storage, and all that good stuff. */ - tmp = build1 (DECL_EXPR, TREE_TYPE (decl), decl); + tmp = fold_build1 (DECL_EXPR, TREE_TYPE (decl), decl); gfc_add_expr_to_block (&body, tmp); gfc_add_expr_to_block (&body, fnbody); @@ -3345,8 +3317,8 @@ gfc_generate_function_code (gfc_namespace * ns) types may be different for scalar default REAL functions with -ff2c, therefore we have to convert. */ tmp = convert (TREE_TYPE (DECL_RESULT (fndecl)), result); - tmp = build2 (MODIFY_EXPR, TREE_TYPE (tmp), - DECL_RESULT (fndecl), tmp); + tmp = fold_build2 (MODIFY_EXPR, TREE_TYPE (tmp), + DECL_RESULT (fndecl), tmp); tmp = build1_v (RETURN_EXPR, tmp); gfc_add_expr_to_block (&block, tmp); } |