aboutsummaryrefslogtreecommitdiff
path: root/gcc/cp
diff options
context:
space:
mode:
authorNathan Froyd <froydnj@codesourcery.com>2010-11-03 00:49:00 +0000
committerNathan Froyd <froydnj@gcc.gnu.org>2010-11-03 00:49:00 +0000
commite8160c9a604ed01f38060655561a8fdf8ef854c8 (patch)
treeaa2d2827a0f82adc2311c64a062ea2a424f865c4 /gcc/cp
parent7d1c5d3530bcea4099af22a346315c70e62a9b25 (diff)
downloadgcc-e8160c9a604ed01f38060655561a8fdf8ef854c8.zip
gcc-e8160c9a604ed01f38060655561a8fdf8ef854c8.tar.gz
gcc-e8160c9a604ed01f38060655561a8fdf8ef854c8.tar.bz2
builtins.c (fold_builtin_signbit): Use build_zero_cst instead of fold_convert.
gcc/ * builtins.c (fold_builtin_signbit): Use build_zero_cst instead of fold_convert. * c-typeck.c (build_function_call_vec): Likewise. * cfgexpand.c (expand_debug_expr): Likewise. * cgraphunit.c (assemble_thunk): Likewise. * config/sparc/sparc.c (sparc_fold_builtin): Likewise. * fold-const.c (fold_unary_loc, fold_mult_zconjz): Likewise. (fold_binary_loc, fold_ternary_loc): Likewise. * gimple-fold.c (get_symbol_constant_value): Likewise. * gimple-low.c (lower_builtin_setjmp): Likewise. * gimple.c (gimple_cond_get_ops_from_tree): Likewise. * gimplify.c (gimplify_init_constructor): Likewise. * lambda.h (build_linear_expr): Likewise. * omp-low.c (omp_reduction_init): Likewise. * tree-inline.c (remap_ssa_name): Likewise. * tree-object-size.c (compute_object_sizes): Likewise. * tree-sra.c (init_subtree_with_zero): Likewise. (sra_ipa_modify_assign): Likewise. * tree-ssa-copy.c (propagate_tree_value_into_stmt): Likewise. * tree-ssa-reassoc.c (eliminate_duplicate_pair): Likewise. (eliminate_plus_minus_pair, eliminate_not_pairs): Likewise. (undistribute_ops_list): Likewise. * tree-ssa-sccvn.c (vn_reference_lookup_3): Likewise. * tree-vect-stmts.c (vectorizable_call): Likewise. * tree.c (build_vector_from_ctor, build_one_cst): Likewise. (build_zero_cst): Handle more cases directly. Update comment. gcc/cp/ * class.c (build_base_path, add_vcall_offset): Use build_zero_cst instead of fold_convert. * init.c (build_zero_init): Likewise. * typeck.c (cp_build_binary_op): Likewise. gcc/fortran/ * trans-decl.c (add_argument_checking): Use build_zero_cst instead of fold_convert. * trans-expr.c (gfc_conv_missing_dummy, fill_with_spaces): Likewise. * trans-stmt.c (gfc_trans_do): Likewise. From-SVN: r166227
Diffstat (limited to 'gcc/cp')
-rw-r--r--gcc/cp/ChangeLog7
-rw-r--r--gcc/cp/class.c6
-rw-r--r--gcc/cp/init.c2
-rw-r--r--gcc/cp/typeck.c9
4 files changed, 13 insertions, 11 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog
index 0bfb03b..24783f5 100644
--- a/gcc/cp/ChangeLog
+++ b/gcc/cp/ChangeLog
@@ -1,3 +1,10 @@
+2010-11-02 Nathan Froyd <froydnj@codesourcery.com>
+
+ * class.c (build_base_path, add_vcall_offset): Use build_zero_cst
+ instead of fold_convert.
+ * init.c (build_zero_init): Likewise.
+ * typeck.c (cp_build_binary_op): Likewise.
+
2010-11-02 Dodji Seketeli <dodji@redhat.com>
PR c++/46170
diff --git a/gcc/cp/class.c b/gcc/cp/class.c
index 7aa6974..ded0a03 100644
--- a/gcc/cp/class.c
+++ b/gcc/cp/class.c
@@ -431,8 +431,7 @@ build_base_path (enum tree_code code,
out:
if (null_test)
expr = fold_build3_loc (input_location, COND_EXPR, target_type, null_test, expr,
- fold_build1_loc (input_location, NOP_EXPR, target_type,
- integer_zero_node));
+ build_zero_cst (target_type));
return expr;
}
@@ -8267,8 +8266,7 @@ add_vcall_offset (tree orig_fn, tree binfo, vtbl_init_data *vid)
/* Find the overriding function. */
fn = find_final_overrider (vid->rtti_binfo, binfo, orig_fn);
if (fn == error_mark_node)
- vcall_offset = build1 (NOP_EXPR, vtable_entry_type,
- integer_zero_node);
+ vcall_offset = build_zero_cst (vtable_entry_type);
else
{
base = TREE_VALUE (fn);
diff --git a/gcc/cp/init.c b/gcc/cp/init.c
index d632816..1f73d14 100644
--- a/gcc/cp/init.c
+++ b/gcc/cp/init.c
@@ -254,7 +254,7 @@ build_zero_init (tree type, tree nelts, bool static_storage_p)
init = build_constructor (type, v);
}
else if (TREE_CODE (type) == VECTOR_TYPE)
- init = fold_convert (type, integer_zero_node);
+ init = build_zero_cst (type);
else
gcc_assert (TREE_CODE (type) == REFERENCE_TYPE);
diff --git a/gcc/cp/typeck.c b/gcc/cp/typeck.c
index 5f8d321..6a52fc4 100644
--- a/gcc/cp/typeck.c
+++ b/gcc/cp/typeck.c
@@ -4047,8 +4047,7 @@ cp_build_binary_op (location_t location,
tree e1 = cp_build_binary_op (location,
EQ_EXPR,
pfn0,
- fold_convert (TREE_TYPE (pfn0),
- integer_zero_node),
+ build_zero_cst (TREE_TYPE (pfn0)),
complain);
tree e2 = cp_build_binary_op (location,
BIT_AND_EXPR,
@@ -4138,8 +4137,7 @@ cp_build_binary_op (location_t location,
complain);
e2 = cp_build_binary_op (location, EQ_EXPR,
pfn0,
- fold_convert (TREE_TYPE (pfn0),
- integer_zero_node),
+ build_zero_cst (TREE_TYPE (pfn0)),
complain);
e2 = cp_build_binary_op (location,
TRUTH_ANDIF_EXPR, e2, e1, complain);
@@ -4164,8 +4162,7 @@ cp_build_binary_op (location_t location,
e2 = cp_build_binary_op (location,
EQ_EXPR,
pfn0,
- fold_convert (TREE_TYPE (pfn0),
- integer_zero_node),
+ build_zero_cst (TREE_TYPE (pfn0)),
complain);
e1 = cp_build_binary_op (location,
TRUTH_ORIF_EXPR, e1, e2, complain);