aboutsummaryrefslogtreecommitdiff
path: root/gcc/builtins.c
AgeCommit message (Collapse)AuthorFilesLines
2008-02-26re PR tree-optimization/26264 (Extraneous warning with ↵Manuel López-Ibáñez1-1/+0
__builtin_stdarg_start and optimization) 2008-02-26 Manuel Lopez-Ibanez <manu@gcc.gnu.org> PR 26264 * builtins.def (BUILT_IN_STDARG_START): Remove. * builtins.c (expand_builtin): Remove BUILT_IN_STDARG_START. * tree-stdarg.c (execute_optimize_stdarg): Likewise. * tree-inline.c (inline_forbidden_p_1): Likewise. cp/ * call.c (magic_varargs_p): Remove BUILT_IN_STDARG_START. testsuite/ * 20021023-1.c: Use __builtin_va_start instead of __builtin_stdarg_start. * pr17301-1.c: Likewise. * pr17301-2.c: Likewise. From-SVN: r132677
2008-02-20re PR middle-end/35265 (__builtin_popcount expansion bug)Richard Guenther1-0/+3
2008-02-20 Richard Guenther <rguenther@suse.de> PR middle-end/35265 * builtins.c (validate_arg): If we want an INTEGER_TYPE, be happy with INTEGRAL_TYPE_P. * gcc.dg/builtins-66.c: New testcase. From-SVN: r132485
2007-12-06re PR middle-end/20983 (varargs functions force va_list variable to stack ↵Jakub Jelinek1-5/+4
unnecessarily) PR middle-end/20983 * tree-ssa-ccp.c (optimize_stdarg_builtin): New function. (execute_fold_all_builtins): Call it for BUILT_IN_VA_START, BUILT_IN_VA_COPY and BUILT_IN_VA_END. * target.h (struct ggc_target): Add expand_builtin_va_start hook. * target-def.h (TARGET_EXPAND_BUILTIN_VA_START): Define. (TARGET_INITIALIZER): Add it. * builtins.c (expand_builtin_va_start): Use targetm.expand_builtin_va_start hook instead of EXPAND_BUILTIN_VA_START macro. * alpha/alpha.c (alpha_va_start): Made static. (override_options): Clear targetm.expand_builtin_va_start if TARGET_UNICOSMK. (TARGET_EXPAND_BUILTIN_VA_START): Define. * alpha/unicosmk.h (EXPAND_BUILTIN_VA_START): Remove. * alpha/alpha.h (EXPAND_BUILTIN_VA_START): Remove. * alpha/alpha-protos.h (alpha_va_start): Remove prototype. * xtensa/xtensa.h (EXPAND_BUILTIN_VA_START): Remove. * xtensa/xtensa.c (TARGET_EXPAND_BUILTIN_VA_START): Define. (xtensa_va_start): Made static. * xtensa/xtensa-protos.h (xtensa_va_start): Remove prototype. * pa/pa-protos.h (hppa_va_start): Remove prototype. * pa/pa.h (EXPAND_BUILTIN_VA_START): Remove. * pa/pa.c (hppa_va_start): Made static, add prototype. (TARGET_EXPAND_BUILTIN_VA_START): Define. * frv/frv.c (frv_expand_builtin_va_start): Made static, add prototype. (TARGET_EXPAND_BUILTIN_VA_START): Define. * frv/frv-protos.h (frv_expand_builtin_va_start): Remove prototype. * frv/frv.h (EXPAND_BUILTIN_VA_START): Remove. * i386/i386.c (override_options): Clear targetm.expand_builtin_va_start if -m32 or 64-bit MS ABI. (ix86_va_start): Made static. (TARGET_EXPAND_BUILTIN_VA_START): Define. * i386/i386.h (EXPAND_BUILTIN_VA_START): Remove. * i386/i386-protos.h (ix86_va_start, ix86_va_arg): Remove prototypes. * iq2000/iq2000-protos.h (iq2000_va_start): Remove prototype. * iq2000/iq2000.h (EXPAND_BUILTIN_VA_START): Remove. * iq2000/iq2000.c (iq2000_va_start): Made static, add prototype. (TARGET_EXPAND_BUILTIN_VA_START): Define. * rs6000/rs6000-protos.h (rs6000_va_start): Remove prototype. * rs6000/rs6000.c (rs6000_va_start): Made static, add prototype. (TARGET_EXPAND_BUILTIN_VA_START): Define. (rs6000_override_options): Clear targetm.expand_builtin_va_start if DEFAULT_ABI != ABI_V4. * rs6000/rs6000.h (EXPAND_BUILTIN_VA_START): Remove. * spu/spu.c (spu_va_start): Made static, add prototype. (TARGET_EXPAND_BUILTIN_VA_START): Define. * spu/spu.h (EXPAND_BUILTIN_VA_START): Remove. * spu/spu-protos.h spu_va_start): Remove prototype. * stormy16/stormy16.h (EXPAND_BUILTIN_VA_START): Remove. * stormy16/stormy16-protos.h (xstormy16_expand_builtin_va_start): Remove prototype. * stormy16/stormy16.c (xstormy16_expand_builtin_va_start): Made static. (TARGET_EXPAND_BUILTIN_VA_START): Define. * s390/s390-protos.h (s390_va_start): Remove prototype. * s390/s390.c (s390_va_start): Made static. (TARGET_EXPAND_BUILTIN_VA_START): Define. * s390/s390.h (EXPAND_BUILTIN_VA_START): Remove. * mn10300/mn10300.h (EXPAND_BUILTIN_VA_START): Remove. * mn10300/mn10300-protos.h (mn10300_va_start): Remove prototype. * mn10300/mn10300.c (mn10300_va_start): Made static, add prototype. (TARGET_EXPAND_BUILTIN_VA_START): Define. * arc/arc.c (arc_va_start): Made static, add prototype. (TARGET_EXPAND_BUILTIN_VA_START): Define. * arc/arc.h (EXPAND_BUILTIN_VA_START): Remove. * arc/arc-protos.h (arc_va_start): Remove prototype. * mt/mt-protos.h (mt_va_start): Remove prototype. * sparc/sparc.c (sparc_va_start): Made static, add prototype. (TARGET_EXPAND_BUILTIN_VA_START): Define. * sparc/sparc-protos.h (sparc_va_start): Remove prototype. * sparc/sparc.h (EXPAND_BUILTIN_VA_START): Remove. * sh/sh.c (sh_va_start): Made static, add prototype. (TARGET_EXPAND_BUILTIN_VA_START): Define. * sh/sh-protos.h (sh_va_start): Remove prototype. * sh/sh.h (EXPAND_BUILTIN_VA_START): Remove. * mips/mips-protos.h (mips_va_start): Remove prototype. * mips/mips.h (EXPAND_BUILTIN_VA_START): Remove. * mips/mips.c (mips_va_start): Made static. (TARGET_EXPAND_BUILTIN_VA_START): Define. From-SVN: r130650
2007-11-28re PR target/32406 (MIPS: FAIL in nestfunc-6.c at -O3)Richard Sandiford1-0/+14
gcc/ PR target/32406 * builtins.c (expand_builtin_nonlocal_goto): Also emit a use of GP register, if valid and fixed. Revert: 2007-06-21 David Daney <ddaney@avtrex.com> PR target/32406 * config/mips/mips.md (define_constants): Rename UNSPEC_EH_RECEIVER to UNSPEC_NONLOCAL_GOTO_RECEIVER globally. (exception_receiver): Renamed to ... (nonlocal_goto_receiver): ... this. From-SVN: r130493
2007-11-27builtins.c (fold_builtin_1): Verify the argument types of BUILT_IN_ISNORMAL.Richard Guenther1-0/+57
2007-11-27 Richard Guenther <rguenther@suse.de> * builtins.c (fold_builtin_1): Verify the argument types of BUILT_IN_ISNORMAL. (fold_builtin_n): Verify the number of arguments to variadic built-in functions. * gcc.dg/builtins-error.c: New testcase. From-SVN: r130465
2007-11-26re PR middle-end/34233 (ICE: get_callee_fndecl, at tree.c:6592)Richard Guenther1-1/+3
2007-11-26 Richard Guenther <rguenther@suse.de> PR middle-end/34233 * builtins.c (expand_builtin_pow): Use expand_expr to expand the result of build_call_expr. * gcc.dg/pr34233.c: New testcase. From-SVN: r130436
2007-10-17builtins.c (gimplify_va_arg_expr): Use inform for help message.Manuel López-Ibáñez1-1/+1
2007-10-17 Manuel Lopez-Ibanez <manu@gcc.gnu.org> * builtins.c (gimplify_va_arg_expr): Use inform for help message. * toplev.c (check_global_declaration_1): Use appropriate warning option instead of unnamed warning. * stor-layout.c (layout_decl): Likewise. * c-typeck.c (build_conditional_expr): Likewise. (build_compound_expr): Fix wrong comment. (build_binary_op): Use appropriate warning option instead of unnamed warning. * cfgexpand.c (tree_expand_cfg): Likewise. * tree-optimize.c (tree_rest_of_compilation): Likewise. * tree-cfg.c (remove_useless_stmts_warn_notreached): Likewise. (execute_warn_function_return): Likewise. * stmt.c (warn_if_unused_value): Likewise. cp/ * typeck.c (build_binary_op) : Use appropriate warning option instead of unnamed warning. From-SVN: r129393
2007-09-27builtins.c (expand_builtin, [...]): Use new %K format string specifier for ↵Jakub Jelinek1-20/+14
diagnostics. * builtins.c (expand_builtin, expand_builtin_object_size, expand_builtin_memory_chk, maybe_emit_chk_warning, maybe_emit_sprintf_chk_warning): Use new %K format string specifier for diagnostics. * expr.c (expand_expr_real_1): Likewise. * langhooks-def.h (struct diagnostic_info): Add forward decl. (lhd_print_error_function): Add third argument. * langhooks.h (struct diagnostic_info): Add forward decl. (struct lang_hooks): Add third argument to print_error_function. * diagnostic.h (diagnostic_info): Add abstract_origin field. (diagnostic_last_function_changed, diagnostic_set_last_function): Add second argument. (diagnostic_report_current_function): Likewise. * toplev.c (announce_function): Pass NULL as second argument to diagnostic_set_last_function. * diagnostic.c (diagnostic_report_current_function): Add second argument, pass it as third argument to lang_hooks.print_error_function. (default_diagnostic_starter): Pass DIAGNOSTIC as second argument to diagnostic_report_current_function. (diagnostic_report_diagnostic): Initialize diagnostic->abstract_origin and message.abstract_origin. (verbatim): Initialize abstract_origin. * pretty-print.h (text_info): Add abstract_origin field. * pretty-print.c (pp_base_format): Handle %K. * langhooks.c (lhd_print_error_function): Add third argument. If diagnostic->abstract_origin, print virtual backtrace. * c-format.c (gcc_diag_char_table, gcc_tdiag_char_table, gcc_cdiag_char_table, gcc_cxxdiag_char_table): Support %K. (init_dynamic_diag_info): Likewise. cp/ * error.c (cxx_print_error_function): Add third argument, pass it over to lhd_print_error_function. (cp_print_error_function): If diagnostic->abstract_origin, print virtual backtrace. * cp-tree.h (struct diagnostic_info): New forward decl. (cxx_print_error_function): Add third argument. java/ * lang.c (java_print_error_function): Add third argument. testsuite/ * lib/prune.exp: Prune also "^In function .*$" lines and "^ inlined from .*$" lines. From-SVN: r128830
2007-09-18re PR middle-end/33423 (internal compiler error: in expand_expr_real_1, at ↵Jakub Jelinek1-0/+14
expr.c:8670) PR middle-end/33423 * builtins.c (expand_builtin_memory_chk): Handle COMPOUND_EXPRs returned by build_call_expr. * gcc.c-torture/compile/20070915-1.c: New test. From-SVN: r128554
2007-09-11builtins.def (BUILT_IN_VA_ARG_PACK_LEN): New builtin.Jakub Jelinek1-0/+6
* builtins.def (BUILT_IN_VA_ARG_PACK_LEN): New builtin. * builtins.c (expand_builtin) <case BUILT_IN_VA_ARG_PACK_LEN>: Issue error if __builtin_va_arg_pack_len () wasn't optimized out during inlining. * tree-inline.c (copy_bb): Replace __builtin_va_arg_pack_len () with the number of inline's anonymous arguments. * doc/extend.texi: Document __builtin_va_arg_pack_len (). * gcc.dg/va-arg-pack-len-1.c: New test. * g++.dg/va-arg-pack-len-1.C: New test. From-SVN: r128376
2007-09-06re PR tree-optimization/32586 (New VN misses FRE opportunities)Richard Guenther1-7/+7
2007-09-06 Richard Guenther <rguenther@suse.de> PR tree-optimization/32586 * tree-ssa-sccvn.c (simplify_binary_expression): Avoid folding if nothing changed. (simplify_unary_expression): New function. Do tree combining on conversion like codes. (try_to_simplify): Call it. * builtins.c (fold_builtin_cexp): Fold the built expressions. * fold-const.c (fold_unary): Test result of get_callee_fndecl(). * g++.dg/tree-ssa/pr27090.C: Remove XFAILs. * gcc.dg/tree-ssa/ssa-fre-1.c: Likewise. * gcc.dg/tree-ssa/ssa-fre-3.c: Likewise. * gcc.dg/tree-ssa/ssa-fre-5.c: Likewise. * gcc.dg/tree-ssa/ssa-fre-4.c: Likewise, remove scan for now obsolete simplification. From-SVN: r128189
2007-09-05builtins.def (BUILT_IN_VA_ARG_PACK): New built-in.Jakub Jelinek1-3/+38
* builtins.def (BUILT_IN_VA_ARG_PACK): New built-in. * tree.h (CALL_EXPR_VA_ARG_PACK): Define. * tree-inline.h (copy_body_data): Add call_expr field. * tree-inline.c (expand_call_inline): Initialize call_expr. (copy_bb): Append anonymous inline fn arguments to arguments when inlining a CALL_EXPR_VA_ARG_PACK call. * builtins.c (expand_builtin): Issue an error if BUILT_IN_VA_ARG_PACK is seen during expand. (fold_call_expr, fold_builtin_call_array): Don't fold CALL_EXPR_VA_ARG_PACK CALL_EXPRs or calls with __builtin_va_arg_pack () call as last argument. * gimplify.c (gimplify_call_expr): If last argument to a vararg function is __builtin_va_arg_pack (), decrease number of call arguments and instead set CALL_EXPR_VA_ARG_PACK on the CALL_EXPR. * expr.c (expand_expr_real_1): Issue an error if CALL_EXPR_VA_ARG_PACK CALL_EXPR is seen during expand. * tree-pretty-print.c (dump_generic_node): Handle printing CALL_EXPR_VA_ARG_PACK bit on CALL_EXPRs. * doc/extend.texi (__builtin_va_arg_pack): Document. * gcc.c-torture/execute/va-arg-pack-1.c: New test. * gcc.dg/va-arg-pack-1.c: New test. From-SVN: r128150
2007-09-05re PR tree-optimization/21513 (__builtin_expect getting in the way of ↵Adam Nemet1-13/+72
uninitialized warnings) PR tree-optimization/21513 * builtins.c (build_builtin_expect_predicate): New function. (fold_builtin_expect): Add argument for expected value. Distribute __builtin_expect over short-circuiting operations. Fold nested builtin_expects. (fold_builtin_2): Adjust call to fold_builtin_expect. From-SVN: r128147
2007-09-04optabs.c (debug_optab_libfunc): Update; make available to gdb.Jan Hubicka1-1/+1
* optabs.c (debug_optab_libfunc): Update; make available to gdb. (libfunc_entry): New structure. (libfunc_hash): New hashtable. (hash_libfunc): New function. (eq_libfunc): New function. (convert_optab_libfunc): New function. (optab_libfunc): New function. (expand_binop, sign_expand_binop, expand_twoval_binop_libfunc, expand_unop, prepare_cmp_insn, prepare_float_insn, gen_add2_insn, expand_float, expand_fix, new_optab, new_convert_optab): Update for new libfunc API. (init_libfunc, init_integral_libfuncs, init_floating_libfuncs, init_interclass_conv_libfuncs init_intraclass_conv_libfuncs): Remove; reorganize all logic to: (gen_libfunc, gen_int_libfunc, gen_fp_libfunc, gen_int_fp_libfunc, gen_intv_fp_libfunc, gen_interclass_conv_libfunc, gen_int_to_fp_conv_libfunc, gen_ufloat_conv_libfunc, gen_int_to_fp_nondecimal_conv_libfunc, gen_fp_to_int_conv_libfunc, gen_intraclass_conv_libfunc, gen_trunc_conv_libfunc, gen_extend_conv_libfunc): New. (init_one_libfunc): Revamp for hashtables. (set_conv_libfunc): Likewise. (init_optabs): Initialize hashtable; use lazy initialization where possible. * optabs.h (optab_handlers): Move out of GGC. (optab, convert_optab): Move out of GGC; add lazy gen info. (code_to_optab, convert_optab_table, optab_table): Move out of GGC. (optab_libfunc, convert_optab_libfunc): New. * builtins.c (expand_builtin_powi): Update for new API. * expr.c (convert_move): Likewise. * expmed.c (expand_divmod): Likewise. From-SVN: r128083
2007-08-24re PR target/11787 (always call memcpy for block move in mips16)Sandra Loosemore1-12/+14
2007-08-24 Sandra Loosemore <sandra@codesourcery.com> Nigel Stephens <nigel@mips.com> PR target/11787 gcc/ * doc/tm.texi (SET_RATIO, SET_BY_PIECES_P): Document new macros. (STORE_BY_PIECES_P): No longer applies to __builtin_memset. * expr.c (SET_BY_PIECES_P): Define. (can_store_by_pieces, store_by_pieces): Add MEMSETP argument; use it to decide whether to use SET_BY_PIECES_P or STORE_BY_PIECES_P. (store_expr): Pass MEMSETP argument to can_store_by_pieces and store_by_pieces. * expr.h (SET_RATIO): Define. (can_store_by_pieces, store_by_pieces): Update prototypes. * builtins.c (expand_builtin_memcpy): Pass MEMSETP argument to can_store_by_pieces/store_by_pieces. (expand_builtin_memcpy_args): Likewise. (expand_builtin_strncpy): Likewise. (expand_builtin_memset_args): Likewise. Also remove special case for optimize_size so that can_store_by_pieces/SET_BY_PIECES_P can decide what to do instead. * value-prof.c (tree_stringops_transform): Pass MEMSETP argument to can_store_by_pieces. * config/sh/sh.h (SET_BY_PIECES_P): Clone from STORE_BY_PIECES_P. * config/s390/s390.h (SET_BY_PIECES_P): Likewise. * config/mips/mips.opt (mmemcpy): Change from Var to Mask. * config/mips/mips.c (override_options): Make -Os default to -mmemcpy. * config/mips/mips.h (MIPS_CALL_RATIO): Define. (MOVE_RATIO, CLEAR_RATIO, SET_RATIO): Define. (STORE_BY_PIECES_P): Define. Co-Authored-By: Nigel Stephens <nigel@mips.com> From-SVN: r127790
2007-08-24expr.c (store_expr): Optimize initialization of an array with STRING_CST.Jakub Jelinek1-2/+1
* expr.c (store_expr): Optimize initialization of an array with STRING_CST. * expr.h (builtin_strncpy_read_str): New prototype. * builtins.c (builtin_strncpy_read_str): Remove prototype. No longer static. * gcc.dg/array-init-1.c: New test. From-SVN: r127769
2007-08-23builtins.c (expand_builtin_mathfn): Wrap argument in save_expr directly ↵Richard Guenther1-40/+11
instead of re-building the call. 2007-08-23 Richard Guenther <rguenther@suse.de> * builtins.c (expand_builtin_mathfn): Wrap argument in save_expr directly instead of re-building the call. (expand_builtin_mathfn_2): Likewise. (expand_builtin_mathfn_3): Likewise. (expand_builtin_interclass_mathfn): Likewise. (expand_builtin_int_roundingfn): Set arg. (expand_builtin_int_roundingfn_2): Likewise. From-SVN: r127740
2007-08-22re PR middle-end/33007 (builtin lround doesn't work)Richard Guenther1-14/+4
2007-08-22 Richard Guenther <rguenther@suse.de> PR middle-end/33007 * builtins.c (expand_builtin_int_roundingfn): Replace call argument wrapped with SAVE_EXPR directly. (expand_builtin_int_roundingfn_2): Likewise. * gcc.dg/pr33007.c: New testcase. From-SVN: r127701
2007-08-11alias.h (alias_set_type): Define new type.Ian Lance Taylor1-1/+1
./: * alias.h (alias_set_type): Define new type. (ALIAS_SET_MEMORY_BARRIER): Use it. * rtl.h: Include alias.h. (struct mem_attrs): Use alias_set_type. * tree.h: Include alias.h (struct tree_type): Use alias_set_type. (struct tree_struct_field_tag): Likewise. (struct tree_decl_common): Likewise. * alias.c (struct alias_set_entry): Use alias_set_type. (get_alias_set_entry, alias_set_subset_of): Likewise. (alias_sets_conflict_p): Likewise. (alias_sets_must_conflict_p): Likewise. (objects_must_conflict_p): Likewise. (get_alias_set, new_alias_set): Likewise. (record_alias_subset, record_component_aliases): Likewise. (varargs_set, frame_set): Change to alias_set_type. (get_varargs_alias_set): Use alias_set_type. (get_frame_alias_set): Likewise. * builtins.c (setjmp_alias_set): Change to alias_set_type. * dse.c (struct store_info): Use alias_set_type. (struct read_info, struct clear_alias_mode_holder): Likewise. (clear_alias_set_lookup, canon_address): Likewise. (record_store, check_mem_read_rtx): Likewise. (dse_record_singleton_alias_set): Likewise. (dse_invalidate_singleton_alias_set): Likewise. * emit-rtl.c (get_mem_attrs): Likewise. (set_mem_attributes_minus_bitpos): Likewise. (set_mem_alias_set): Likewise. * expr.c (store_constructor_field, store_field): Likewise. * gimplify.c (struct gimplify_init_ctor_preeval_data): Likewise. * langhooks.c (lhd_get_alias_set): Likewise. * langhooks-def.h (lhd_get_alias_set): Likewise. * reload1.c (alter_reg): Likewise. * tree-flow.h (struct fieldoff): Likewise. * tree-ssa-alias.c (struct alias_map_d): Likewise. (may_alias_p, get_smt_for, create_sft): Likewise. * tree-ssa-alias-warnings.c (nonstandard_alias_types_p): Likewise. * tree-ssa-structalias.c (set_uids_in_ptset): Likewise. (merge_smts_into): Likewise. * varasm.c (const_alias_set): Likewise. * c-common.c (strict_aliasing_warning): Likewise. (c_common_get_alias_set): Likewise. * dse.h (dse_record_singleton_alias_set): Update declaration. (dse_invalidate_singleton_alias_set): Likewise. * emit-rtl.h (set_mem_alias_set): Likewise. * c-common.h (c_common_get_alias_set): Likewise. * print-rtl.c (print_rtx): Cast MEM_ALIAS_SET when printing it. * print-tree.c (print_node): Likewise. * config/alpha/alpha.c (alpha_sr_alias_set): Change to alias_set_type. (alpha_setup_incoming_varargs): Use alias_set_type. * config/i386/i386.c (setup_incoming_varargs_64): Use alias_set_type. (setup_incoming_varargs_ms_64): Likewise. (ix86_GOT_alias_set): Likewise. * config/mn10300/mn10300.c (mn10300_builtin_saveregs): Likewise. * config/rs6000/rs6000.c (setup_incoming_varargs): Likewise. (set): Change to alias_set_type. (get_TOC_alias_set): Use alias_set_type. * config/rs6000/rs6000-protos.h (get_TOC_alias_set): Update declaration. * config/sh/sh.c (sh_builtin_saveregs): Use alias_set_type. * config/sparc/sparc.c (sparc_sr_alias_set): Change to alias_set_type. (struct_value_alias_set): Likewise. * Makefile.in (GTFILES): Add $(srcdir)/alias.h. ada/: * misc.c (gnat_get_alias_set): Change return type to alias_set_type. cp/: * cp-objcp-common.c (cxx_get_alias_set): Change return type to alias_set_type. * cp/cp-tree.h (cxx_get_alias_set): Update declaration. fortran:/ * f95-lang.c (gfc_get_alias_set): Change return type to alias_set_type. From-SVN: r127362
2007-08-09optabs.c (expand_widen_pattern_expr): Use optabs accestors.Jan Hubicka1-9/+9
* optabs.c (expand_widen_pattern_expr): Use optabs accestors. (expand_ternary_op): Likewise. (expand_vec_shift_expr): Likewise. (expand_binop_directly): Likewise. (expand_binop): Likewise. (sign_expand_binop): Likewise. (expand_twoval_unop): Likewise. (expand_twoval_binop): Likewise. (expand_twoval_binop_libfunc): Likewise. (widen_clz): Likewise. (widen_bswap): Likewise. (expand_parity): Likewise. (expand_unop): Likewise. (expand_abs_nojump): Likewise. (expand_copysign): Likewise. (emit_no_conflict_block): Likewise. (emit_libcall_block): Likewise. (can_compare_p): Likewise. (prepare_cmp_insn): Likewise. (emit_cmp_and_jump_insn_1): Likewise. (prepare_float_lib_cmp): Likewise. (emit_conditional_add): Likewise. (gen_add2_insn): Likewise. (have_add2_insn): Likewise. (gen_sub2_insn): Likewise. (have_sub2_insn): Likewise. (can_extend_p): Likewise. (can_fix_p): Likewise. (can_float_p): Likewise. (expand_float): Likewise. (expand_fix): Likewise. (expand_sfix_optab): Likewise. (new_optab): Likewise. (new_convert_optab): Likewise. (init_libfuncs): Likewise. (init_interclass_conv_libfuncs): Likewise. (init_intraclass_conv_libfuncs): Likewise. (set_conv_libfunc): Likewise. (init_optabs): Likewise. (debug_optab_libfuncs): Likewise. (gen_cond_trap): Likewise. * optabs.h (optab_handler, convert_optab_hanlder): New. * genopinit.c: Update optabs generation table. * reload.c (find_reloads_address_1): Use optabs accestors. * builtins.c (expand_builtin_mathfn): Likewise. (expand_builtin_mathfn_2): Likewise. (expand_builtin_mathfn_3): Likewise. (expand_builtin_interclass_mathfn): Likewise. (expand_builtin_sincos): Likewise. (expand_builtin_cexpi): Likewise. (expand_builtin_powi): Likewise. (expand_builtin_strlen): Likewise. * dojump.c (do_jump): Likewise. * expr.c (convert_move): Likewise. (move_by_pieces): Likewise. (move_by_pieces_ninsns): Likewise. (can_store_by_pieces): Likewise. (store_by_pieces_1): Likewise. (emit_move_via_integer): Likewise. (emit_move_complex): Likewise. (emit_move_ccmode): Likewise. (emit_move_insn_1): Likewise. (emit_single_push_insn): Likewise. (store_constructor): Likewise. (expand_expr_real_1): Likewise. (do_store_flag): Likewise. * ada/misc.c (gnat_compute_largest_alignment): Likewise. (enumerate_modes): Likewise. * tree-vectorizer.c (vect_supportable_dr_alignment): Likewise. (supportable_widening_operation): Likewise. (supportable_narrowing_operation): Likewise. * expmed.c (store_bit_field_1): Likewise. (extract_bit_field_1): Likewise. (expand_mult_highpart_optab): Likewise. (expand_smod_pow2): Likewise. (expand_divmod): Likewise. (emit_store_flag): Likewise. * tree-vect-patterns.c (vect_pattern_recog_1): Likewise. * tree-ssa-loop-prefetch.c (nontemporal_store_p): Likewise. * tree-vect-transform.c (vect_model_reduction_cost): Likewise. (vect_create_epilog_for_reduction): Likewise. (vectorizable_reduction): Likewise. (vectorizable_operation): Likewise. (vect_strided_store_supported): Likewise. (vectorizable_store): Likewise. (vect_strided_load_supported): Likewise. (vectorizable_load): Likewise. * combine.c (simplify_comparison): Likewise. * tree-vect-generic.c (type_for_widest_vector_mode): Likewise. (expand_vector_operations_1): Likewise. * config/spu/spu.c (spu_expand_mov): Likewise. (spu_emit_vector_compare): Likewise. * config/rs6000/rs6000.c (rs6000_emit_vector_compare): Likewise. * stmt.c (add_case_node): Likewise. * reload1.c (gen_reload): From-SVN: r127317
2007-07-29attribs.c (hash_attr, [...]): Constify.Kaveh R. Ghazi1-16/+16
* attribs.c (hash_attr, eq_attr, init_attributes): Constify. * builtins.c (validate_arg, builtin_mathfn_code, validate_arglist): Likewise. * calls.c (call_expr_flags): Likewise. * combine.c (reg_nonzero_bits_for_combine, reg_num_sign_bit_copies_for_combine, get_last_value, reg_truncated_to_mode): Likewise. * emit-rtl.c (subreg_lowpart_p): Likewise. * expr.c (highest_pow2_factor_for_target, categorize_ctor_elements_1, categorize_ctor_elements, count_type_elements, contains_packed_reference, highest_pow2_factor, highest_pow2_factor_for_target): Likewise. * fold-const.c (may_negate_without_overflow_p, int_const_binop, fold_convertible_p, operand_equal_p, tree_swap_operands_p, native_encode_int, native_encode_real, native_encode_complex, native_encode_vector, native_encode_expr, native_interpret_int, native_interpret_real, native_interpret_complex, native_interpret_vector, native_interpret_expr): Likewise. * function.c (use_register_for_decl): Likewise. * gimplify.c (get_name): Likewise. * langhooks-def.h (lhd_return_null_const_tree): New. (LANG_HOOKS_GET_CALLEE_FNDECL): Use it. * langhooks.c (lhd_return_null_const_tree): New. * langhooks.h (lang_get_callee_fndecl): Constify. * output.h (constructor_static_from_elts_p): Likewise. * rtl-factoring.c (gen_symbol_ref_rtx_for_label): Likewise. * rtl.h (nonzero_bits, num_sign_bit_copies, truncated_to_mode, subreg_lowpart_p, noop_move_p, struct rtl_hooks): Likewise. * rtlanal.c (cached_nonzero_bits, nonzero_bits1, cached_num_sign_bit_copies, num_sign_bit_copies1, noop_move_p, nonzero_bits, num_sign_bit_copies, truncated_to_mode): Likewise. * rtlhooks-def.h (reg_nonzero_bits_general, reg_num_sign_bit_copies_general, reg_truncated_to_mode_general): Likewise. * rtlhooks.c (reg_num_sign_bit_copies_general, reg_nonzero_bits_general, reg_truncated_to_mode_general): Likewise. * stmt.c (warn_if_unused_value, is_body_block): Likewise. * stor-layout.c (mode_for_size_tree): Likewise. * tree-ssa-loop-im.c (memref_eq): Likewise. * tree-ssa-loop-ivopts.c (tree_int_cst_sign_bit): Likewise. * tree.c (contains_placeholder_p, type_list_equal, simple_cst_equal, get_callee_fndecl, operand_equal_for_phi_arg_p): Likewise. * tree.h (tree_int_cst_sign_bit, may_negate_without_overflow_p, mode_for_size_tree, categorize_ctor_elements, count_type_elements, contains_placeholder_p, contains_packed_reference, get_callee_fndecl, operand_equal_for_phi_arg_p, warn_if_unused_value, is_body_block, native_encode_expr, native_interpret_expr, fold_convertible_p, operand_equal_p, int_const_binop, tree_swap_operands_p, builtin_mathfn_code, validate_arglist, simple_cst_equal, type_list_equal, use_register_for_decl, call_expr_flags, get_name, highest_pow2_factor): Likewise. (const_call_expr_arg_iterator_d, init_const_call_expr_arg_iterator, next_const_call_expr_arg, first_const_call_expr_arg, more_const_call_expr_args_p, FOR_EACH_CONST_CALL_EXPR_ARG): New. * varasm.c (constructor_static_from_elts_p): Constify. cp: * parser.c (eof_token): Un-constify. (cp_lexer_new_main, cp_lexer_new_from_tokens, VEC_alloc, cp_lexer_consume_token, cp_lexer_purge_token): Remove spurious casts. java: * lang.c (java_get_callee_fndecl): Constify. objc: * objc-act.c (objc_get_callee_fndecl): Constify. * objc-act.h (objc_get_callee_fndecl): Likewise. From-SVN: r127036
2007-07-26Change copyright header to refer to version 3 of the GNU General Public ↵Nick Clifton1-4/+3
License and to point readers at the COPYING3 file and the FSF's license web page. From-SVN: r126948
2007-07-21optabs.h (enum optab_index): Add new OTI_signbit.Uros Bizjak1-9/+4
* optabs.h (enum optab_index): Add new OTI_signbit. (signbit_optab): Define corresponding macro. (enum insn_code signbit_optab[]): Remove array. * optabs.c (init_optabs): Initialize signbit_optab using init_optab. (expand_copysign_absneg): If back end provides signbit insn, use it instead of bit operations on floating point argument. * builtins.c (enum insn_code signbit_optab[]): Remove array. (expand_builtin_signbit): Check signbit_optab->handlers[].insn_code for availability of signbit insn. * config/i386/i386.md (signbit<mode>2): New insn pattern to implement signbitf, signbit and signbitl built-ins as inline x87 intrinsics when SSE mode is not active. (isinf<mode>2): Disable for mfpmath=sse,387. From-SVN: r126813
2007-07-18re PR target/30652 (SSE expansion is missing for isinf() and other ↵Kaveh R. Ghazi1-0/+24
fpclassify functions) PR target/30652 * builtins.c (expand_builtin_interclass_mathfn): Provide a generic transformation for builtin ISNORMAL. (expand_builtin): Handle BUILT_IN_ISNORMAL. * builtins.def (BUILT_IN_ISNORMAL): New. * doc/extend.texi: Document isnormal. testsuite: * gcc.dg/pr28796-2.c: Add more cases. From-SVN: r126726
2007-07-18re PR target/30652 (SSE expansion is missing for isinf() and other ↵Kaveh R. Ghazi1-5/+29
fpclassify functions) PR target/30652 * builtins.c (expand_builtin_interclass_mathfn): Allow for missing optabs infrastructure. Provide generic implementation for FINITE/ISFINITE. (expand_builtin): Handle FINITE/ISFINITE. (fold_builtin_classify): Make ISFINITE canonical instead of FINITE. (fold_builtin_1): Likewise. * builtins.def (BUILT_IN_ISFINITE): New. * doc/extend.texi: Document isfinite. testsuite: * gcc.dg/pr28796-1.c: Add more cases. * gcc.dg/pr28796-2.c: Likewise. From-SVN: r126725
2007-07-18re PR target/30652 (SSE expansion is missing for isinf() and other ↵Kaveh R. Ghazi1-0/+24
fpclassify functions) PR target/30652 PR middle-end/20558 * builtins.c (expand_builtin_interclass_mathfn): Provide a generic fallback for isinf. * c-cppbuiltin.c (builtin_define_float_constants): Move FP max calculation code ... * real.c (get_max_float): ... to here. * real.h (get_max_float): New. testsuite: * gcc.dg/pr28796-1.c: Add more cases. * gcc.dg/pr28796-2.c: Likewise. From-SVN: r126724
2007-07-12builtins.c (get_pointer_alignment): Honor DECL_ALIGN on a FUNCTION_DECL.Geoffrey Keating1-3/+1
* builtins.c (get_pointer_alignment): Honor DECL_ALIGN on a FUNCTION_DECL. * tree.c (build_decl_stat): Move code from here... (make_node_stat): ... to here. Don't uselessly clear DECL_USER_ALIGN. (expr_align): Honor DECL_ALIGN on a FUNCTION_DECL. Add comment about using DECL_ALIGN of LABEL_DECL and CONST_DECL. * tree.h (DECL_USER_ALIGN): Fix misplaced comment. * varasm.c (assemble_start_function): Use DECL_ALIGN instead of FUNCTION_BOUNDARY. From-SVN: r126588
2007-07-11builtins.def (BUILT_IN_CLEAR_CACHE): New builtin.David Daney1-0/+59
2007-07-10 David Daney <ddaney@avtrex.com> * builtins.def (BUILT_IN_CLEAR_CACHE): New builtin. * builtins.c (expand_builtin___clear_cache): New function. (expand_builtin): Call expand_builtin___clear_cache for BUILT_IN_CLEAR_CACHE case. * doc/extend.texi (__builtin___clear_cache): Document new builtin. * doc/md.texi (clear_cache): Document new instruction pattern. * testsuite/gcc.dg/builtins-64.c: New test. From-SVN: r126535
2007-07-09optabs.h: Added declaration for signbit_optab.Wolfgang Gellerich1-7/+30
2007-07-09 Wolfgang Gellerich <gellerich@de.ibm.com> * optabs.h: Added declaration for signbit_optab. * optabs.c: (init_optabs): Added initialization for signbit_optab. * genoptinit.c (optabs): Added entry for signbit insns. * builtins.c (expand_builtin_signbit): Added code to use a signbit insn, if available. * config/s390/s390.h (S390_TDC_SIGNBIT_SET): New constant. * config/s390/s390.md (signbit<mode>2): New expander. From-SVN: r126495
2007-07-06re PR middle-end/32441 (ICE in expand_expr_real_1, at expr.c:7109)Ian Lance Taylor1-8/+2
2007-07-06 Ian Lance Taylor <iant@google.com> Zack Weinberg <zackw@panix.com> PR middle-end/32441 * builtins.c (std_expand_builtin_va_start): Don't use make_tree. Co-Authored-By: Zack Weinberg <zackw@panix.com> From-SVN: r126424
2007-07-02tree-flow.h (tree_ssa_useless_type_conversion_1): Rename to ...Richard Guenther1-1/+1
2007-07-02 Richard Guenther <rguenther@suse.de> * tree-flow.h (tree_ssa_useless_type_conversion_1): Rename to ... (useless_type_conversion_p): ... this. * tree-ssa.c (tree_ssa_useless_type_conversion_1): Rename to ... (useless_type_conversion_p): ... this. * builtins.c (fold_builtin_memory_op): Rename tree_ssa_useless_type_conversion_1 to useless_type_conversion_p. * tree-cfg.c (verify_expr): Likewise. * tree-ssa-address.c (tree_ssa_useless_type_conversion_1): Likewise. * tree-ssa-ccp.c (ccp_fold): Likewise. * tree-ssa-copy.c (may_propagate_copy): Likewise. * tree-ssa-dom.c (eliminate_redundant_computations): Likewise. * tree-ssa-forwprop.c (forward_propagate_addr_expr_1): Likewise. * tree-ssa-loop-niter.c (refine_bounds_using_guard): Likewise. * tree-ssa-pre.c (eliminate): Likewise. * tree-ssa.c (delete_tree_ssa): Likewise. (tree_ssa_useless_type_conversion): Likewise. * tree.c (build2_stat): Likewise. From-SVN: r126194
2007-06-26* builtins.c (expand_builtin_next_arg): Change Pmode to ptr_mode.Steve Ellcey1-1/+1
From-SVN: r126031
2007-06-20re PR middle-end/31959 (ICE in expand_builtin_expect, at builtins.c:5112)Jakub Jelinek1-1/+3
PR middle-end/31959 * builtins.c: Include diagnostic.h. (expand_builtin_expect): Make gcc_assert more permissive. * Makefile.in (builtins.o): Depend on $(DIAGNOSTIC_H). * gcc.dg/pr31959.c: New test. From-SVN: r125875
2007-06-15[multiple changes]Andrew Pinski1-30/+27
2007-06-15 Andrew Pinski <andrew_pinski@playstation.sony.com> Zdenek Dvorak <dvorakz@suse.cz> Richard Guenther <rguenther@suse.de> Kaz Kojima <kkojima@gcc.gnu.org> * tree-vrp.c (compare_values_warnv): Convert val2 to the type of val1. (extract_range_from_assert): Create POINTER_PLUS_EXPR for pointer types. (extract_range_from_binary_expr): Handle only POINTER_PLUS_EXPR, MIN_EXPR, and MAX_EXPR for pointer types. * doc/c-tree.texi (POINTER_PLUS_EXPR): Document. * tree-ssa-loop-niter.c (split_to_var_and_offset): Handle POINTER_PLUS_EXPR as PLUS_EXPR. (number_of_iterations_lt_to_ne): For pointer types, use sizetype when creating MINUS_EXPR/PLUS_EXPRs. (assert_loop_rolls_lt): For pointer types, use sizetype when creating MINUS_EXPR/PLUS_EXPRs. (number_of_iterations_le): Likewise. (expand_simple_operations): POINTER_PLUS_EXPR are simple also. (derive_constant_upper_bound): Handle POINTER_PLUS_EXPR just like PLUS_EXPR and MINUS_EXPR. * tree-pretty-print.c (dump_generic_node): Handle POINTER_PLUS_EXPR. (op_prio): Likewise. (op_symbol_1): Likewise. * optabs.c (optab_for_tree_code): Likewise. * tree-ssa-loop-manip.c (create_iv): Handle pointer base specially. * tree-tailcall.c (process_assignment): Mention POINTER_PLUS_EXPR in a TODO comment. * tree.c (build2_stat): Assert when trying to use PLUS_EXPR or MINUS_EXPR with a pointer. Also assert for POINTER_PLUS_EXPR not used with a pointer and an integer type. * tree-scalar-evolution.c (add_to_evolution_1): Convert the increment using chrec_convert_rhs instead of chrec_convert. (follow_ssa_edge_in_rhs): Handle POINTER_PLUS_EXPR like PLUS_EXPR except for the right hand side's type will be sizetype. (interpret_rhs_modify_stmt): Handle POINTER_PLUS_EXPR. (fold_used_pointer_cast): Kill. (pointer_offset_p): Kill. (fold_used_pointer): Kill. (pointer_used_p): Kill. (analyze_scalar_evolution_1 <case GIMPLE_MODIFY_STMT>): Don't call fold_used_pointer. (instantiate_parameters_1): Convert the increment using chrec_convert_rhs instead of chrec_convert. Handle POINTER_PLUS_EXPR as PLUS_EXPR. * builtins.c (get_pointer_alignment): Handle POINTER_PLUS_EXPR instead of PLUS_EXPR. (expand_builtin_strcat): Create a POINTER_PLUS_EXPR instead of PLUS_EXPR for pointers. (std_gimplify_va_arg_expr): Likewise. (fold_builtin_memory_op): Likewise. (fold_builtin_strstr): Likewise. (fold_builtin_strchr): Likewise. (fold_builtin_strrchr): Likewise. (fold_builtin_strpbrk): Likewise. (expand_builtin_memory_chk): Likewise. (fold_builtin_memory_chk): Likewise. (std_expand_builtin_va_start): Use sizetype for the call to make_tree and then convert to the pointer type. (fold_builtin_memchr): Use POINTER_PLUS_EXPR instead of PLUS_EXPR for adding to a pointer. (std_gimplify_va_arg_expr): Use fold_build2 for the creating of POINTER_PLUS_EXPR. For the BIT_AND_EXPR, cast the operands to sizetype first and then cast the BIT_AND_EXPR back to the pointer type. * fold-const.c (build_range_check): Handle pointer types specially. (extract_array_ref): Look for POINTER_PLUS_EXPR instead of PLUS_EXPR's. Make sure the offset is converted to sizetype. (try_move_mult_to_index): Strip the NOPs from the offset. Remove code argument and replace all uses with PLUS_EXPR. (fold_to_nonsharp_ineq_using_bound): Handle pointer types specially. Don't use a pointer type for MINUS_EXPR. (fold_unary): Handle for (T1)(X op Y), only p+ as that is the only as that can be handled for binary operators now. (fold_binary <case POINTER_PLUS_EXPR>): Add folding of POINTER_PLUS_EXPR. <case PLUS_EXPR>: Add folding of PTR+INT into PTR p+ INT. Don't call try_move_mult_to_index. <case MINUS_EXPR>: Fold (PTR0 p+ A) - (PTR1 p+ B) into (PTR0 - PTR1) + (A - B). Fold (PTR0 p+ A) - PTR1 into (PTR0 - PTR1) + A iff (PTR0 - PTR1) simplifies. Don't call try_move_mult_to_index. (tree_expr_nonnegative_warnv_p): Handle POINTER_PLUS_EXPR. (tree_expr_nonzero_p): Likewise. (fold_indirect_ref_1): Look at POINTER_PLUS_EXPR instead of PLUS_EXPR for the complex expression folding. * tree-chrec.c (chrec_fold_plus_poly_poly): If the first chrec is a pointer type, then the second should be sizetype and not the first's type. For POINTER_PLUS_EXPR, use a different right hand side type. Handle POINTER_PLUS_EXPR like PLUS_EXPR. (chrec_fold_plus_1): For POINTER_PLUS_EXPR, use a different right hand side type. Handle POINTER_PLUS_EXPR like PLUS_EXPR. (chrec_fold_plus): For pointer types, use POINTER_PLUS_EXPR instead of PLUS_EXPR. When either operand is zero, convert the other operand. (chrec_apply): Use chrec_convert_rhs on the argument x instead of chrec_convert. (reset_evolution_in_loop): For pointer types, the new_evol should be sizetype. (convert_affine_scev): For POINTER_PLUS_EXPR, use a different right hand side type. Handle POINTER_PLUS_EXPR like PLUS_EXPR. (chrec_convert_rhs): New function. (chrec_convert_aggressive): For POINTER_PLUS_EXPR, use a different right hand side type. Handle POINTER_PLUS_EXPR like PLUS_EXPR. * tree-chrec.h (chrec_convert_rhs): New prototype. (build_polynomial_chrec): For pointer types, the right hand * tree-ssa-ccp.c (maybe_fold_stmt_indirect): Look for POINTER_PLUS_EXPR instead of PLUS_EXPR's. Remove subtraction case as it is always addition now. Make sure the offset is converted to sizetype. (fold_stmt_r): Don't handle PLUS_EXPR/MINUS_EXPR specially. Handle POINTER_PLUS_EXPR like PLUS_EXPR was handled before. * tree-ssa-loop-ivopts.c (determine_base_object): Abort for PLUS_EXPR in pointer type. Handle POINTER_PLUS_EXPR. (tree_to_aff_combination): Likewise. (force_expr_to_var_cost): Likewise. (force_expr_to_var_cost): Likewise. Create a POINTER_PLUS_EXPR instead of PLUS_EXPR for pointers. * c-format.c (check_format_arg): Handle POINTER_PLUS_EXPR instead of PLUS_EXPR of pointer types. * tree-stdarg.c (va_list_counter_bump): Handle POINTER_PLUS_EXPR as PLUS_EXPR. (check_va_list_escapes): Likewise. (check_all_va_list_escapes): Likewise. * dwarf2out.c (loc_descriptor_from_tree_1): Handle POINT_PLUS_EXPR as a PLUS_EXPR. * expr.c (expand_expr_real_1): Handle POINTER_PLUS_EXPR. (string_constant): Likewise. * tree-ssa-address.c (tree_mem_ref_addr): When adding the offset to the base, use POINTER_PLUS_EXPR. (add_to_parts): Convert the index to sizetype. (create_mem_ref): Create A POINTER_PLUS_EXPR for the one case. * matrix-reorg.c (collect_data_for_malloc_call): Stmt will now only be either INDIRECT_REF and POINTER_PLUS_EXPR. Offset only holds something for PLUS_EXPR. (ssa_accessed_in_tree): Handle POINTER_PLUS_EXPR just as a PLUS_EXPR. (analyze_transpose): POINTER_PLUS_EXPR will only show up now and not PLUS_EXPR. (analyze_accesses_for_modify_stmt): Likewise. Remove comment about the type being integral type as it is wrong now. (can_calculate_expr_before_stmt): Handle POINTER_PLUS_EXPR as PLUS_EXPR. (transform_access_sites): POINTER_PLUS_EXPR will only show up now and not PLUS_EXPR. Correct the type which the artimentic is done in (is now sizetype). Reindent one loop. * tree-data-ref.c (split_constant_offset): Handle POINTER_PLUS_EXPR * tree-affine.c (tree_to_aff_combination): Likewise. * c-typeck.c (build_unary_op): For pointers create the increment as a sizetype. Create a POINTER_PLUS_EXPR instead of PLUS_EXPR for pointers. * gimplify.c (gimplify_self_mod_expr): Create a POINTER_PLUS_EXPR instead of PLUS_EXPR for pointers. (gimplify_omp_atomic_fetch_op): Handle POINTER_PLUS_EXPR. * tree.def (POINTER_PLUS_EXPR): New tree code. * tree-predcom.c (ref_at_iteration): If we have a pointer type do the multiplication in sizetype. * tree-mudflap.c (mf_xform_derefs_1): Create a POINTER_PLUS_EXPR instead of PLUS_EXPR for pointers. * tree-ssa-forwprop.c (forward_propagate_addr_into_variable_array_index): Don't expect there to be a cast for the index as that does not exist anymore. (forward_propagate_addr_expr_1): Check for POINTER_PLUS_EXPR instead of PLUS_EXPR. Don't check for the first operand of the POINTER_PLUS_EXPR was the index as it cannot be. Call forward_propagate_addr_into_variable_array_index with the SSA_NAME instead of the statement. * varasm.c (const_hash_1): Handle POINTER_PLUS_EXPR. (compare_constant): Likewise. (copy_constant): Likewise. (compute_reloc_for_constant): Likewise. (output_addressed_constants): Likewise. (initializer_constant_valid_p): Likewise. * tree-ssa.c (tree_ssa_useless_type_conversion_1): Convert the MIN/MAX of the inner type to the outer type before comparing them. * tree-ssa-loop-prefetch.c (idx_analyze_ref): Handle POINTER_PLUS_EXPR instead of PLUS_EXPR. (issue_prefetch_ref): Create a POINTER_PLUS_EXPR instead of PLUS_EXPR for pointers. * tree-inline.c (estimate_num_insns_1): Handle POINTER_PLUS_EXPR. * tree-vect-transform.c (vect_create_addr_base_for_vector_ref): Create a POINTER_PLUS_EXPR instead of PLUS_EXPR for pointers. (bump_vector_ptr): Create a POINTER_PLUS_EXPR instead of PLUS_EXPR for the pointer increment statement. (vect_update_ivs_after_vectorizer): For pointer types, create POINTER_PLUS_EXPR instead of PLUS_EXPR and also create MULT_EXPR in sizetype. (vect_gen_niters_for_prolog_loop): Add a cast when creating byte_misalign. * tree-object-size.c (plus_expr_object_size): Handle POINTER_PLUS_EXPR instead of PLUS_EXPR. Removing all the extra code which is trying to figure out which side is a pointer and is the index. (check_for_plus_in_loops_1): Likewise. (check_for_plus_in_loops): Likewise. * c-common.c (pointer_int_sum): Create a POINTER_PLUS_EXPR instead of PLUS_EXPR for pointers. * tree-ssa-structalias.c (handle_ptr_arith): Handle only POINTER_PLUS_EXPR. Removing all the extra code which is trying to figure out which side is a pointer and is the index. * tree-cfg.c (verify_expr): Add extra checking for pointers and PLUS_EXPR and MINUS_EXPR. Also add checking to make sure the operands of POINTER_PLUS_EXPR are correct. * config/frv/frv.c (frv_expand_builtin_va_start): Use sizetype with make_tree, instead of a pointer type. * config/s390/s390.c (s390_va_start): Use POINTER_PLUS_EXPR for pointers instead of PLUS_EXPR. (s390_gimplify_va_arg): Likewise. * config/spu/spu.c (spu_va_start): Create POINTER_PLUS_EXPR instead of PLUS_EXPR when doing addition on pointer types. Use sizetype for the second operand. (spu_gimplify_va_arg_expr): Likewise. * config/sparc/sparc.c (sparc_gimplify_va_arg): Use POINTER_PLUS_EXPR instead of PLUS_EXPR when the operand was a pointer. Don't create a BIT_AND_EXPR for pointer types. * config/i386/i386.c (ix86_va_start): Use POINTER_PLUS_EXPR for the pointer addition and also use size_int/sizetype for the offset. (ix86_gimplify_va_arg): Likewise. Perform BIT_AND_EXPR on sizetype arguments. * config/sh/sh.c (sh_va_start): Call make_tree with sizetype and convert its result to a pointer type. Use POINTER_PLUS_EXPR for the pointer additions and also use size_int for the offsets. (sh_gimplify_va_arg_expr): Use POINTER_PLUS_EXPR for the pointer additions and also use size_int for the offsets. Perform BIT_AND_EXPR on sizetype arguments. * config/ia64/ia64.c (ia64_gimplify_va_arg): Use POINTER_PLUS_EXPR for pointers and create the BIT_AND_EXPR in sizetype. * config/rs6000/rs6000.c (rs6000_va_start): Use POINTER_PLUS_EXPR instead of PLUS_EXPR for pointer addition. (rs6000_va_start): Likewise. Also use sizetype for the offset. * config/pa/pa.c (reloc_needed): Handle POINTER_PLUS_EXPR as PLUS_EXPR/MINUS_EXPR. (hppa_gimplify_va_arg_expr): Don't create MINUS_EXPR or PLUS_EXPR for pointers, instead use POINTER_PLUS_EXPR. Don't use BIT_AND_EXPR on a pointer type, convert the expression to sizetype first. * config/mips/mips.c (mips_va_start): Use POINTER_PLUS_EXPR for pointers. (mips_gimplify_va_arg_expr): Likewise. Don't create BIT_AND_EXPR in a pointer type. 2007-06-15 Andrew Pinski <andrew_pinski@playstation.sony.com> * trans-intrinsic.c (gfc_conv_intrinsic_repeat): Use POINTER_PLUS_EXPR instead of PLUS_EXPR for pointer addition. * trans-expr.c (gfc_trans_string_copy): Create POINTER_PLUS_EXPR instead of a PLUS_EXPR for pointer types. 2007-06-15 Andrew Pinski <andrew_pinski@playstation.sony.com> * typeck.c (build_binary_op): For templates build the expression in pieces to avoid the assert in build2_stat. (get_member_function_from_ptrfunc): Change over to using POINTER_PLUS_EXPR and convert the second operand to sizetype. * typeck2.c (build_m_component_ref): Likewise. * init.c (expand_virtual_init): Create a POINTER_PLUS_EXPR instead of PLUS_EXPR for pointers. (build_new_1): Likewise. (build_vec_delete_1): Likewise. (build_vec_delete): Likewise. * class.c (build_base_path): Likewise. (build_base_path): Likewise. (convert_to_base_statically): Likewise. (fixed_type_or_null): Handle POINTER_PLUS_EXPR. (get_vtbl_decl_for_binfo): Handle POINTER_PLUS_EXPR instead of PLUS_EXPR. (dfs_accumulate_vtbl_inits): Create a POINTER_PLUS_EXPR instead of PLUS_EXPR for pointers. * call.c (build_special_member_call): Likewise. * rtti.c (build_headof): Likewise. Use sizetype instead of ptrdiff_type_node. (tinfo_base_init): Create a POINTER_PLUS_EXPR instead of PLUS_EXPR for pointers. * except.c (expand_start_catch_block): Do a NEGATIVE and then a POINTER_PLUS_EXPR instead of a MINUS_EXPR. * cp-gimplify.c (cxx_omp_clause_apply_fn): Convert PLUS_EXPR on pointer types over to use POINTER_PLUS_EXPR and remove the conversion to the pointer types. * method.c (thunk_adjust): Use POINTER_PLUS_EXPR for adding to a pointer type. Use size_int instead of ssize_int. Convert the index to sizetype before adding it to the pointer. 2007-06-15 Andrew Pinski <andrew_pinski@playstation.sony.com> * trans.c (Attribute_to_gnu): When subtracting an offset from a pointer, use POINTER_PLUS_EXPR with NEGATE_EXPR instead of MINUS_EXPR. (gnat_to_gnu): Likewise. * utils.c (convert): When converting between thin pointers, use POINTER_PLUS_EXPR and sizetype for the offset. * utils2.c (known_alignment): POINTER_PLUS_EXPR have the same semantics as PLUS_EXPR for alignment. (build_binary_op): Add support for the semantics of POINTER_PLUS_EXPR's operands. When adding an offset to a pointer, use POINTER_PLUS_EXPR. 2007-06-15 Andrew Pinski <andrew_pinski@playstation.sony.com> * class.c (make_class_data): Build the index in sizetype. Use POINTER_PLUS_EXPR instead of PLUS_EXPR when adding to a pointer type. (build_symbol_entry): Likewise. * expr.c (build_java_arrayaccess): Likewise. (build_field_ref): Likewise. (build_known_method_ref): Likewise. (build_invokevirtual): Likewise. * except.c (build_exception_object_ref): Do a NEGATIVE and then a POINTER_PLUS_EXPR instead of a MINUS_EXPR. 2007-06-15 Andrew Pinski <andrew_pinski@playstation.sony.com> PR tree-opt/32225 * gcc.c-torture/compile/20070605-1.c: New test. * gcc.c-torture/compile/20070603-1.c: New testcase. * gcc.c-torture/compile/20070603-2.c: New testcase. * gcc.c-torture/compile/20070531-1.c: New test. PR tree-opt/32167 * gcc.c-torture/compile/20070531-2.c: New test. PR tree-opt/32144 * gcc.c-torture/compile/20070529-1.c: New test. PR tree-opt/32145 * gcc.c-torture/compile/20070529-2.c: New test. PR tree-opt/32015 * gcc.c-torture/compile/20070520-1.c: New test. * g++.dg/ext/java-1.C: New test. * gcc.dg/vect/vect-106.c: We are now able to vectorize two loops instead of one. Remove the "can't determine dependence" check. * gcc.dg/tree-ssa/20030815-1.c: Remove testcase which is no longer needed as the cast is gone in the first place. * gcc.dg/max-1.c: Change local variable a to be a global one. * gcc.dg/tree-ssa/ssa-pre-8.c: Update testcase since we don't have a cast which is PREd. From-SVN: r125755
2007-06-12real.c (real_isfinite): New.Kaveh R. Ghazi1-17/+11
* real.c (real_isfinite): New. (real_sqrt): Use it. * real.h (real_isfinite): New. * builtins.c: Use it. From-SVN: r125654
2007-06-11Merge dataflow branch into mainlineDaniel Berlin1-6/+4
From-SVN: r125624
2007-05-22re PR middle-end/31095 (ICE in expand_expr_real_1, at expr.c:8786)Andrew Pinski1-0/+1
2007-05-22 Andrew Pinski <andrew_pinski@playstation.sony.com> PR middle-end/31095 * builtins.c (expand_builtin_memmove_args): Strip nops that don't change the type before looking for a COMPOUND_EXPR. 2007-05-22 Andrew Pinski <andrew_pinski@playstation.sony.com> PR middle-end/31095 * gcc.c-torture/compile/bcopy-1.c: New testcase. From-SVN: r124975
2007-05-21builtins.c (expand_builtin_setjmp_setup): Update comment.Nathan Sidwell1-2/+1
* builtins.c (expand_builtin_setjmp_setup): Update comment. * function.h (struct function): Move va_list_gpr_size, va_list_fpr_size, function_frequency to front of bitfields. Add calls_unwind_init. (current_function_calls_unwind_init): New. * except.c (expand_builtin_unwind_init): Set current_function_calls_unwind_init not current_function_has_nonlocal_label. * reload1.c (has_nonexceptional_receiver): New. (reload): Use it and current_function_calls_unwind_init to determine whether call-saved regs must be saved. From-SVN: r124898
2007-05-19re PR middle-end/30250 (Evaluate lgamma/gamma at compile-time)Kaveh R. Ghazi1-0/+71
PR middle-end/30250 * builtins.c (do_mpfr_lgamma_r): New. (fold_builtin_2): Handle builtin gamma_r/lgamma_r. * tree.h (CASE_FLT_FN_REENT): New. testsuite: * gcc.dg/torture/builtin-math-2.c: Add gamma_r/lgamma_r tests. * gcc.dg/torture/builtin-math-4.c: Likewise. From-SVN: r124849
2007-05-18builtins.c (CASE_MATHFN_REENT): New macro.Kaveh R. Ghazi1-0/+7
* builtins.c (CASE_MATHFN_REENT): New macro. (mathfn_built_in): Use it. * builtins.def (BUILT_IN_GAMMA_R, BUILT_IN_GAMMAF_R, BUILT_IN_GAMMAL_R, BUILT_IN_LGAMMA_R, BUILT_IN_LGAMMAF_R, BUILT_IN_LGAMMAL_R): New. * doc/extend.texi: Document new builtins. testsuite: * gcc.dg/builtins-1.c: Test reentrant gamma functions. From-SVN: r124821
2007-05-18re PR middle-end/31796 (Evaluate remquo/remainder/drem at compile-time)Kaveh R. Ghazi1-0/+89
PR middle-end/31796 * builtins.c (do_mpfr_remquo): New. (fold_builtin_2): Handle BUILT_IN_DREM/BUILT_IN_REMAINDER. (fold_builtin_3): Handle BUILT_IN_REMQUO. testsuite: * gcc.dg/torture/builtin-math-2.c: Add tests for remquo, remainder and drem. * gcc.dg/torture/builtin-math-4.c: Likewise. From-SVN: r124820
2007-05-18re PR middle-end/30251 (Evaluate bessel functions at compile-time)Kaveh R. Ghazi1-0/+19
PR middle-end/30251 * builtins.c (fold_builtin_1): Handle y0, y1. (fold_builtin_2): Handle yn. testsuite: * gcc.dg/torture/builtin-math-2.c: Test y0, y1, yn. * gcc.dg/torture/builtin-math-4.c: Likewise. From-SVN: r124819
2007-05-18re PR middle-end/30251 (Evaluate bessel functions at compile-time)Kaveh R. Ghazi1-0/+73
PR middle-end/30251 * builtins.c (do_mpfr_bessel_n): New. (fold_builtin_1): Handle BUILT_IN_J0 and BUILT_IN_J1. (fold_builtin_2): Handle BUILT_IN_JN. testsuite: * gcc.dg/torture/builtin-math-4.c: New test. From-SVN: r124818
2007-05-14builtins.c (expand_builtin_mathfn): Use EXPAND_NORMAL instead of 0 in the ↵Uros Bizjak1-22/+25
call to expand_expr(). * builtins.c (expand_builtin_mathfn): Use EXPAND_NORMAL instead of 0 in the call to expand_expr(). (expand_builtin_mathfn_3): Ditto. (expand_builtin_interclass_mathfn): Ditto. (expand_builtin_cexpi): Ditto. (expand_builtin_int_roundingfn): Ditto. (expand_builtin_int_roundingfn_2): Ditto. (expand_builtin_pow): Ditto. (expand_builtin_powi): Ditto. (expand_builtin_bswap): Ditto. (expand_builtin_unop): Ditto. (expand_builtin_fabs): Ditto. (get_builtin_sync_mem): Use NULL_RTX instead of NULL in the call to expand_expr(). (expand_builtin_sync_operation): Ditto. (expand_builtin_compare_and_swap): Ditto. (expand_builtin_lock_test_and_set): Ditto. * except.c (expand_builtin_eh_return_data_regno): Use EXPAND_NORMAL instead of 0 in the call to expand_expr(). (expand_builtin_extract_return_addr): Ditto. (expand_builtin_eh_return): Ditto. (expand_eh_return): Ditto. * explow.c (expr_size): Ditto. * expr.c (optimize_bitfield_assignment_op): Ditto. (expand_assignement): Ditto. (store_expr): Ditto. (store_field): Ditto. (expand_expr_addr_expr_1): Use NULL_RTX instead of NULL in the call to expand_expr(). (expand_expr_real_1) [COMPLEX_CST]: Use EXPAND_NORMAL instead of 0 in the call to expand_expr(). [CONSTRUCTOR, PLUS_EXPR, MINUS_EXPR, NEGATE_EXPR, ABS_EXPR, BIT_NOT_EXPR, LSHIFT_EXPR, LT_EXPR, TRUTH_NOT_EXPR]: Ditto. [VEC_UNPACK_HI_EXPR, VEC_UNPACK_LO]: Use expand_normal() instead of expand_expr(). * optabs.c (expand_vec_shift_expr): Ditto. (expand_vec_cond_expr): Ditto. (vector_compare_rtx): Use EXPAND_STACK_PARM instead of 1 in the call to expand_expr(). * stmt.c (expand_return): Use EXPAND_NORMAL instead of 0 in the call to expand_expr(). From-SVN: r124722
2007-05-11re PR other/31852 (Missing __builtin_memchr)Paolo Carlini1-0/+73
2007-05-11 Paolo Carlini <pcarlini@suse.de> PR other/31852 * builtin-types.def: Add BT_FN_PTR_CONST_PTR_INT_SIZE. * builtins.def: Add BUILT_IN_MEMCHR, use the latter. * builtins.c (fold_builtin_memchr): New. (expand_builtin_memchr): Call the latter. (expand_builtin, fold_builtin_3): Deal with BUILT_IN_MEMCHR. * doc/extend.texi ([Other built-in functions provided by GCC]): Document memchr. /testsuite 2007-05-11 Paolo Carlini <pcarlini@suse.de> PR other/31852 * gcc.c-torture/execute/builtins/memchr.c: New. * gcc.c-torture/execute/builtins/memchr-lib.c: New. * gcc.c-torture/execute/builtins/lib/memchr.c: New. From-SVN: r124617
2007-04-24real.c (mpfr_from_real): Handle Inf and NaN, and allow the rounding mode to ↵Brooks Moses1-8/+8
be specified by the caller. * real.c (mpfr_from_real): Handle Inf and NaN, and allow the rounding mode to be specified by the caller. (real_to_mpfr) Likewise. * real.h: Update mpfr_from_real, mpfr_to_real prototypes to include new arguments. * builtins.c: Update mpfr_from_real, mpfr_to_real calls. From-SVN: r124139
2007-04-05extend.texi (Other Builtins): Add decimal float variants of signbit.Janis Johnson1-1/+5
* doc/extend.texi (Other Builtins): Add decimal float variants of signbit. * builtins.def: Ditto. * builtins.c (expand_builtin): Ditto. testsuite/ * gcc.dg/dfp/signbit-1.c * gcc.dg/dfp/signbit-2.c M gcc/doc/extend.texi M gcc/builtins.c M gcc/ChangeLog A gcc/testsuite/gcc.dg/dfp/signbit-2.c A gcc/testsuite/gcc.dg/dfp/signbit-1.c M gcc/testsuite/ChangeLog M gcc/builtins.def From-SVN: r123528
2007-03-19builtins.c (expand_builtin_sync_operation, [...]): Care for extending ↵Michael Matz1-8/+27
CONST_INTs correctly. * builtins.c (expand_builtin_sync_operation, expand_builtin_compare_and_swap, expand_builtin_lock_test_and_set): Care for extending CONST_INTs correctly. * config/i386/sync.md (sync_double_compare_and_swapdi_pic, sync_double_compare_and_swap_ccdi_pic): Use "SD" as constraint for operand 3. From-SVN: r123064
2007-03-16builtins.c (expand_builtin_cexpi): Use the right argument for the expansion ↵Richard Guenther1-1/+1
via cexp. 2007-03-16 Richard Guenther <rguenther@suse.de> * builtins.c (expand_builtin_cexpi): Use the right argument for the expansion via cexp. From-SVN: r122982
2007-03-15re PR middle-end/29719 (newlib targets ICEs in expand_builtin_int_roundingfn)Richard Guenther1-6/+65
2007-03-15 Richard Guenther <rguenther@suse.de> PR middle-end/29719 PR middle-end/31161 * builtins.c (expand_builtin_int_roundingfn): Always fall back to floor/ceil and its variants even if they may be not available. (expand_builtin_cexpi): As a fallback if we don't have builtins for sincos or cexp create a function declaration for cexp and expand to a call to that. From-SVN: r122958