diff options
author | rguenth <rguenth@138bc75d-0d04-0410-961f-82ee72b054a4> | 2011-07-19 14:01:59 +0000 |
---|---|---|
committer | rguenth <rguenth@138bc75d-0d04-0410-961f-82ee72b054a4> | 2011-07-19 14:01:59 +0000 |
commit | 2cc66f2ad8d743ca03465d67871cf157cf3d7124 (patch) | |
tree | 2530edff8e2622a26913a15b62d707dad7e5b286 /gcc/omp-low.c | |
parent | 8618a9e7d1c95a2e71cb31cbcfcd1c61e07fb264 (diff) | |
download | gcc-2cc66f2ad8d743ca03465d67871cf157cf3d7124.tar.gz |
2011-07-19 Richard Guenther <rguenther@suse.de>
* tree.h (fold_build_pointer_plus_loc): New helper function.
(fold_build_pointer_plus_hwi_loc): Likewise.
(fold_build_pointer_plus): Define.
(fold_build_pointer_plus_hwi): Likewise.
* builtins.c (std_gimplify_va_arg_expr): Use fold_build_pointer_plus.
(fold_builtin_memory_op): Likewise.
(fold_builtin_stpcpy): Likewise.
(fold_builtin_memchr): Likewise.
(fold_builtin_strstr): Likewise.
(fold_builtin_strchr): Likewise.
(fold_builtin_strrchr): Likewise.
(fold_builtin_strpbrk): Likewise.
(fold_builtin_strcat): Likewise.
(expand_builtin_memory_chk): Likewise.
(fold_builtin_memory_chk): Likewise.
* c-typeck.c (build_unary_op): Likewise.
* cgraphunit.c (thunk_adjust): Likewise.
* fold-const.c (build_range_check): Likewise.
(fold_binary_loc): Likewise.
* omp-low.c (extract_omp_for_data): Likewise.
(expand_omp_for_generic): Likewise.
(expand_omp_for_static_nochunk): Likewise.
(expand_omp_for_static_chunk): Likewise.
* tree-affine.c (add_elt_to_tree): Likewise.
* tree-data-ref.c (split_constant_offset_1): Likewise.
* tree-loop-distribution.c (generate_memset_zero): Likewise.
* tree-mudflap.c (mf_xform_derefs_1): Likewise.
* tree-predcom.c (ref_at_iteration): Likewise.
* tree-ssa-address.c (tree_mem_ref_addr): Likewise.
(add_to_parts): Likewise.
(create_mem_ref): Likewise.
* tree-ssa-loop-ivopts.c (force_expr_to_var_cost): Likewise.
* tree-ssa-loop-niter.c (number_of_iterations_lt_to_ne): Likewise.
(number_of_iterations_le): Likewise.
* tree-ssa-loop-prefetch.c (issue_prefetch_ref): Likewise.
* tree-vect-data-refs.c (vect_analyze_data_refs): Likewise.
(vect_create_addr_base_for_vector_ref): Likewise.
* tree-vect-loop-manip.c (vect_update_ivs_after_vectorizer): Likewise.
(vect_create_cond_for_alias_checks): Likewise.
* tree-vrp.c (extract_range_from_assert): Likewise.
* config/alpha/alpha.c (alpha_va_start): Likewise.
(alpha_gimplify_va_arg_1): Likewise.
* config/i386/i386.c (ix86_va_start): Likewise.
(ix86_gimplify_va_arg): Likewise.
* config/ia64/ia64.c (ia64_gimplify_va_arg): Likewise.
* config/mep/mep.c (mep_expand_va_start): Likewise.
(mep_gimplify_va_arg_expr): Likewise.
* config/mips/mips.c (mips_va_start): Likewise.
(mips_gimplify_va_arg_expr): Likewise.
* config/pa/pa.c (hppa_gimplify_va_arg_expr): Likewise.
* config/rs6000/rs6000.c (rs6000_va_start): Likewise.
(rs6000_gimplify_va_arg): Likewise.
* config/s390/s390.c (s390_va_start): Likewise.
(s390_gimplify_va_arg): Likewise.
* config/sh/sh.c (sh_va_start): Likewise.
(sh_gimplify_va_arg_expr): Likewise.
* config/sparc/sparc.c (sparc_gimplify_va_arg): Likewise.
* config/spu/spu.c (spu_va_start): Likewise.
(spu_gimplify_va_arg_expr): Likewise.
* config/stormy16/stormy16.c (xstormy16_expand_builtin_va_start):
Likewise.
(xstormy16_gimplify_va_arg_expr): Likewise.
* config/xtensa/xtensa.c (xtensa_va_start): Likewise.
(xtensa_gimplify_va_arg_expr): Likewise.
c-family/
* c-common.c (pointer_int_sum): Use fold_build_pointer_plus.
* c-omp.c (c_finish_omp_for): Likewise.
cp/
* call.c (build_special_member_call): Use fold_build_pointer_plus.
* class.c (build_base_path): Likewise.
(convert_to_base_statically): Likewise.
(dfs_accumulate_vtbl_inits): Likewise.
* cp-gimplify.c (cxx_omp_clause_apply_fn): Likewise.
* except.c (expand_start_catch_block): Likewise.
* init.c (expand_virtual_init): Likewise.
(build_new_1): Likewise.
(build_vec_delete_1): Likewise.
(build_vec_delete): Likewise.
* rtti.c (build_headof): Likewise.
(tinfo_base_init): Likewise.
* typeck.c (get_member_function_from_ptrfunc): Likewise.
(cp_build_addr_expr_1): Likewise.
* typeck2.c (build_m_component_ref): Likewise.
fortran/
* trans-expr.c (fill_with_spaces): Use fold_build_pointer_plus.
(gfc_trans_string_copy): Likewise.
* trans-intrinsic.c (gfc_conv_intrinsic_repeat): Likewise.
* trans-types.c (gfc_get_array_descr_info): Likewise.
* trans.c (gfc_build_array_ref): Likewise.
java/
* builtins.c (static): Use fold_build_pointer_plus.
* class.c (make_class_data): Likewise.
(build_symbol_entry): Likewise.
* except.c (build_exception_object_ref): Likewise.
* expr.c (build_java_arrayaccess): Likewise.
(build_field_ref): Likewise.
(build_known_method_ref): Likewise.
(build_invokevirtual): Likewise.
objc/
* objc-next-runtime-abi-02.c (objc_v2_build_ivar_ref):
Use fold_build_pointer_plus.
(objc2_build_ehtype_initializer): Likewise.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@176461 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/omp-low.c')
-rw-r--r-- | gcc/omp-low.c | 39 |
1 files changed, 12 insertions, 27 deletions
diff --git a/gcc/omp-low.c b/gcc/omp-low.c index 05646bf8833..ccd248c9fe8 100644 --- a/gcc/omp-low.c +++ b/gcc/omp-low.c @@ -310,9 +310,7 @@ extract_omp_for_data (gimple for_stmt, struct omp_for_data *fd, break; case LE_EXPR: if (POINTER_TYPE_P (TREE_TYPE (loop->n2))) - loop->n2 = fold_build2_loc (loc, - POINTER_PLUS_EXPR, TREE_TYPE (loop->n2), - loop->n2, size_one_node); + loop->n2 = fold_build_pointer_plus_hwi_loc (loc, loop->n2, 1); else loop->n2 = fold_build2_loc (loc, PLUS_EXPR, TREE_TYPE (loop->n2), loop->n2, @@ -321,9 +319,7 @@ extract_omp_for_data (gimple for_stmt, struct omp_for_data *fd, break; case GE_EXPR: if (POINTER_TYPE_P (TREE_TYPE (loop->n2))) - loop->n2 = fold_build2_loc (loc, - POINTER_PLUS_EXPR, TREE_TYPE (loop->n2), - loop->n2, size_int (-1)); + loop->n2 = fold_build_pointer_plus_hwi_loc (loc, loop->n2, -1); else loop->n2 = fold_build2_loc (loc, MINUS_EXPR, TREE_TYPE (loop->n2), loop->n2, @@ -3914,8 +3910,7 @@ expand_omp_for_generic (struct omp_region *region, t = fold_build2 (MULT_EXPR, itype, t, fold_convert (itype, fd->loops[i].step)); if (POINTER_TYPE_P (vtype)) - t = fold_build2 (POINTER_PLUS_EXPR, vtype, - fd->loops[i].n1, fold_convert (sizetype, t)); + t = fold_build_pointer_plus (fd->loops[i].n1, t); else t = fold_build2 (PLUS_EXPR, itype, fd->loops[i].n1, t); t = force_gimple_operand_gsi (&gsi, t, false, NULL_TREE, @@ -3944,8 +3939,7 @@ expand_omp_for_generic (struct omp_region *region, vback = gimple_omp_continue_control_def (stmt); if (POINTER_TYPE_P (type)) - t = fold_build2 (POINTER_PLUS_EXPR, type, vmain, - fold_convert (sizetype, fd->loop.step)); + t = fold_build_pointer_plus (vmain, fd->loop.step); else t = fold_build2 (PLUS_EXPR, type, vmain, fd->loop.step); t = force_gimple_operand_gsi (&gsi, t, false, NULL_TREE, @@ -3989,9 +3983,7 @@ expand_omp_for_generic (struct omp_region *region, set_immediate_dominator (CDI_DOMINATORS, bb, last_bb); if (POINTER_TYPE_P (vtype)) - t = fold_build2 (POINTER_PLUS_EXPR, vtype, - fd->loops[i].v, - fold_convert (sizetype, fd->loops[i].step)); + t = fold_build_pointer_plus (fd->loops[i].v, fd->loops[i].step); else t = fold_build2 (PLUS_EXPR, vtype, fd->loops[i].v, fd->loops[i].step); @@ -4239,8 +4231,7 @@ expand_omp_for_static_nochunk (struct omp_region *region, t = fold_convert (itype, s0); t = fold_build2 (MULT_EXPR, itype, t, fd->loop.step); if (POINTER_TYPE_P (type)) - t = fold_build2 (POINTER_PLUS_EXPR, type, fd->loop.n1, - fold_convert (sizetype, t)); + t = fold_build_pointer_plus (fd->loop.n1, t); else t = fold_build2 (PLUS_EXPR, type, t, fd->loop.n1); t = force_gimple_operand_gsi (&gsi, t, false, NULL_TREE, @@ -4251,8 +4242,7 @@ expand_omp_for_static_nochunk (struct omp_region *region, t = fold_convert (itype, e0); t = fold_build2 (MULT_EXPR, itype, t, fd->loop.step); if (POINTER_TYPE_P (type)) - t = fold_build2 (POINTER_PLUS_EXPR, type, fd->loop.n1, - fold_convert (sizetype, t)); + t = fold_build_pointer_plus (fd->loop.n1, t); else t = fold_build2 (PLUS_EXPR, type, t, fd->loop.n1); e = force_gimple_operand_gsi (&gsi, t, true, NULL_TREE, @@ -4267,8 +4257,7 @@ expand_omp_for_static_nochunk (struct omp_region *region, vback = gimple_omp_continue_control_def (stmt); if (POINTER_TYPE_P (type)) - t = fold_build2 (POINTER_PLUS_EXPR, type, vmain, - fold_convert (sizetype, fd->loop.step)); + t = fold_build_pointer_plus (vmain, fd->loop.step); else t = fold_build2 (PLUS_EXPR, type, vmain, fd->loop.step); t = force_gimple_operand_gsi (&gsi, t, false, NULL_TREE, @@ -4442,8 +4431,7 @@ expand_omp_for_static_chunk (struct omp_region *region, struct omp_for_data *fd) t = fold_build2 (MULT_EXPR, itype, threadid, fd->chunk_size); t = fold_build2 (MULT_EXPR, itype, t, fd->loop.step); if (POINTER_TYPE_P (type)) - t = fold_build2 (POINTER_PLUS_EXPR, type, fd->loop.n1, - fold_convert (sizetype, t)); + t = fold_build_pointer_plus (fd->loop.n1, t); else t = fold_build2 (PLUS_EXPR, type, t, fd->loop.n1); v_extra = force_gimple_operand_gsi (&si, t, true, NULL_TREE, @@ -4475,8 +4463,7 @@ expand_omp_for_static_chunk (struct omp_region *region, struct omp_for_data *fd) t = fold_convert (itype, s0); t = fold_build2 (MULT_EXPR, itype, t, fd->loop.step); if (POINTER_TYPE_P (type)) - t = fold_build2 (POINTER_PLUS_EXPR, type, fd->loop.n1, - fold_convert (sizetype, t)); + t = fold_build_pointer_plus (fd->loop.n1, t); else t = fold_build2 (PLUS_EXPR, type, t, fd->loop.n1); t = force_gimple_operand_gsi (&si, t, false, NULL_TREE, @@ -4487,8 +4474,7 @@ expand_omp_for_static_chunk (struct omp_region *region, struct omp_for_data *fd) t = fold_convert (itype, e0); t = fold_build2 (MULT_EXPR, itype, t, fd->loop.step); if (POINTER_TYPE_P (type)) - t = fold_build2 (POINTER_PLUS_EXPR, type, fd->loop.n1, - fold_convert (sizetype, t)); + t = fold_build_pointer_plus (fd->loop.n1, t); else t = fold_build2 (PLUS_EXPR, type, t, fd->loop.n1); e = force_gimple_operand_gsi (&si, t, true, NULL_TREE, @@ -4503,8 +4489,7 @@ expand_omp_for_static_chunk (struct omp_region *region, struct omp_for_data *fd) v_back = gimple_omp_continue_control_def (stmt); if (POINTER_TYPE_P (type)) - t = fold_build2 (POINTER_PLUS_EXPR, type, v_main, - fold_convert (sizetype, fd->loop.step)); + t = fold_build_pointer_plus (v_main, fd->loop.step); else t = fold_build2 (PLUS_EXPR, type, v_main, fd->loop.step); stmt = gimple_build_assign (v_back, t); |