aboutsummaryrefslogtreecommitdiff
path: root/gcc/builtins.c
AgeCommit message (Collapse)AuthorFilesLines
2004-07-10builtins.c (std_gimplify_va_arg_expr): Widen align/boundary to HOST_WIDE_INT.Richard Henderson1-2/+2
* builtins.c (std_gimplify_va_arg_expr): Widen align/boundary to HOST_WIDE_INT. Fold pad-args-down arithmetic. From-SVN: r84469
2004-07-10expr.h (store_bit_field, [...]): Remove last argument.Jakub Jelinek1-2/+1
* expr.h (store_bit_field, extract_bit_field): Remove last argument. * expmed.c (store_bit_field, extract_bit_field): Remove last argument. * builtins.c (expand_builtin_signbit): Adjust callers. * optabs.c (expand_vector_binop, expand_vector_unop): Likewise. * calls.c (store_unaligned_arguments_into_pseudos): Likewise. * ifcvt.c (noce_emit_move_insn): Likewise. * stmt.c (expand_return): Likewise. * expr.c (emit_group_load, emit_group_store, copy_blkmode_from_reg, store_field, expand_expr_real_1): Likewise. From-SVN: r84447
2004-07-10* builtins.c (std_gimplify_va_arg_expr): Fix borked BIT_AND_EXPR.Richard Henderson1-6/+5
From-SVN: r84446
2004-07-09* builtins.c (expand_builtin_stpcpy): Don't modify len.Richard Henderson1-3/+3
From-SVN: r84435
2004-07-09builtins.c (std_gimplify_va_arg_expr): Deny ARGS_GROW_DOWNWARD.Richard Henderson1-42/+31
* builtins.c (std_gimplify_va_arg_expr): Deny ARGS_GROW_DOWNWARD. Always align upward to arg boundary. Use size_in_bytes/round_up. Maintain type-correctness of constants. * stor-layout.c (round_up, round_down): Special-case powers of 2. From-SVN: r84430
2004-07-09builtin-types.def (BT_UINT): Rename from BT_UNSIGNED.Jan Beulich1-0/+5
* builtin-types.def (BT_UINT): Rename from BT_UNSIGNED. (BT_FN_UINT): Rename from BT_FN_UNSIGNED. (BT_FN_PTR_UINT): Rename from BT_FN_PTR_UNSIGNED. (BT_ULONG, BT_ULONGLONG, BT_UINTMAX, BT_FN_INT_UINT, BT_FN_INT_ULONG, BT_FN_INT_ULONGLONG, BT_FN_INT_INTMAX, BT_FN_INT_UINTMAX): New. * builtins.def (BUILTIN_CLZxxx, BUILTIN_CTXxxx, BUILTIN_PARITYxxx, BUILTIN_POPCOUNTxxx): Arguments are unsigned. (BUILTIN_xxxIMAX): New. * builtins.c (expand_builtin): Handle BUILT_IN_FFSIMAX, BUILT_IN_CLZIMAX, BUILT_IN_CTZIMAX, BUILT_IN_POPCOUNIMAX, and BUILT_IN_PARITYIMAX. From-SVN: r84415
2004-07-09builtins.c (fold_builtin_strncpy): Make sure len is a constant before ↵Alexandre Oliva1-0/+5
comparing it as such. * builtins.c (fold_builtin_strncpy): Make sure len is a constant before comparing it as such. From-SVN: r84343
2004-07-08builtins.c (std_gimplify_va_arg_expr): Hoist valist into a temporary.Richard Henderson1-22/+18
* builtins.c (std_gimplify_va_arg_expr): Hoist valist into a temporary. Use bit arithmetic to align. From-SVN: r84342
2004-07-09alias.c (nonlocal_mentioned_p, [...]): Use, LABEL_P, JUMP_P, CALL_P, ↵Jerry Quinn1-11/+11
NONJUMP_INSN_P, INSN_P, NOTE_P, BARRIER_P. 2004-07-08 Jerry Quinn <jlquinn@optonline.net> * alias.c (nonlocal_mentioned_p, nonlocal_referenced_p, nonlocal_set_p, init_alias_analysis): Use, LABEL_P, JUMP_P, CALL_P, NONJUMP_INSN_P, INSN_P, NOTE_P, BARRIER_P. * bb-reorder.c (mark_bb_for_unlikely_executed_section, add_labels_and_missing_jumps, find_jump_block, fix_crossing_unconditional_branches, add_reg_crossing_jump_notes): Likewise. * bt-load.c (btr_referenced_p, compute_defs_uses_and_gen, link_btr_uses, move_btr_def): Likewise. * builtins.c (expand_builtin_longjmp, expand_builtin_nonlocal_goto, expand_builtin_expect_jump): Likewise. * caller-save.c (save_call_clobbered_regs, insert_one_insn): Likewise. * calls.c (expand_call, emit_library_call_value_1): Likewise. * cfganal.c (forwarder_block_p): Likewise. * cfgbuild.c (inside_basic_block_p, count_basic_blocks, make_label_edge, rtl_make_eh_edge, make_edges, find_basic_blocks_1, find_bb_boundaries): Likewise. * cfgcleanup.c (try_simplify_condjump, try_forward_edges, merge_blocks_move_predecessor_nojumps, merge_blocks_move_successor_nojumps, insns_match_p, flow_find_cross_jump, outgoing_edges_match, try_crossjump_to_edge, try_optimize_cfg): Likewise. * cfgexpand.c (expand_block, construct_exit_block): Likewise. * cfglayout.c (skip_insns_after_block, label_for_bb, record_effective_endpoints, insn_locators_initialize, fixup_reorder_chain, update_unlikely_executed_notes): Likewise. * cfgmainloop.c (create_loop_notes): Likewise. * cfgrtl.c (delete_insn, delete_insn_chain, create_basic_block_structure, rtl_delete_block, free_bb_for_insn, update_bb_for_insn, rtl_merge_blocks, rtl_can_merge_blocks, block_label, try_redirect_by_replacing_jump, last_loop_beg_note, redirect_branch_edge, force_nonfallthru_and_redirect, rtl_tidy_fallthru_edge, back_edge_of_syntactic_loop_p, rtl_split_edge, commit_one_edge_insertion, print_rtl_with_bb, update_br_prob_note, rtl_verify_flow_info_1, rtl_verify_flow_info, purge_dead_edges, cfg_layout_redirect_edge_and_branch, cfg_layout_delete_block, cfg_layout_can_merge_blocks_p, cfg_layout_merge_blocks, rtl_block_ends_with_call_p, need_fake_edge_p, rtl_flow_call_edges_add): Likewise. * combine.c (combine_instructions, can_combine_p, try_combine, find_split_point, record_dead_and_set_regs, reg_dead_at_p, distribute_notes, distribute_links, insn_cuid): Likewise. * cse.c (fold_rtx, cse_insn, cse_around_loop, invalidate_skipped_block, cse_set_around_loop, cse_end_of_basic_block, cse_main, cse_basic_block, cse_condition_code_reg): Likewise. * cselib.c (cselib_process_insn): Likewise. * ddg.c (create_ddg): Likewise. * df.c (df_insn_refs_record, df_bb_rd_local_compute, df_insns_modify): Likewise. * dwarf2out.c (dwarf2out_stack_adjust, dwarf2out_frame_debug, gen_label_die, dwarf2out_var_location): Likewise. * emit-rtl.c (get_first_nonnote_insn, get_last_nonnote_insn, next_insn, previous_insn, next_nonnote_insn, prev_nonnote_insn, last_call_insn, active_insn_p, next_label, prev_label, link_cc0_insns, next_cc0_user, try_split, add_insn_after, add_insn_before, remove_insn, add_function_usage_to, reorder_insns, find_line_note, remove_unnecessary_notes, emit_insn_after_1, classify_insn): Likewise. * except.c (convert_from_eh_region_ranges_1, emit_to_new_bb_before, connect_post_landing_pads, sjlj_mark_call_sites, sjlj_emit_function_enter, sjlj_emit_function_exit, reachable_handlers, can_throw_internal, can_throw_external, set_nothrow_function_flags, convert_to_eh_region_ranges): Likewise. * explow.c (optimize_save_area_alloca): Likewise. * expr.c (expand_expr_real): Likewise. * final.c (insn_current_reference_address, compute_alignments, shorten_branches, final, scan_ahead_for_unlikely_executed_note, final_scan_insn, output_asm_label, leaf_function_p): Likewise. * flow.c (first_insn_after_basic_block_note, delete_dead_jumptables, propagate_block_delete_insn, propagate_one_insn, init_propagate_block_info, propagate_block, libcall_dead_p, mark_set_1, attempt_auto_inc, find_auto_inc, try_pre_increment): Likewise. * function.c (instantiate_virtual_regs, reorder_blocks_1, expand_function_start, expand_function_end, contains, thread_prologue_and_epilogue_insns, reposition_prologue_and_epilogue_notes): Likewise. * gcse.c (constprop_register, bypass_conditional_jumps, insert_insn_end_bb, gcse_after_reload): Likewise. * genemit.c (gen_expand, gen_split): Likewise. * genpeep.c (gen_peephole, main): Likewise. * global.c (build_insn_chain): Likewise. * graph.c (node_data, print_rtl_graph_with_bb): Likewise. * haifa-sched.c (unlink_other_notes, unlink_line_notes, get_block_head_tail, no_real_insns_p, rm_line_notes, save_line_notes, restore_line_notes, rm_redundant_line_notes, rm_other_notes, ok_for_early_queue_removal, set_priorities, sched_init): Likewise. * ifcvt.c (count_bb_insns, first_active_insn, last_active_insn, cond_exec_process_insns, end_ifcvt_sequence, noce_process_if_block, merge_if_block, block_jumps_and_fallthru_p, find_if_block, dead_or_predicable): Likewise. * integrate.c (try_constants): Likewise. * jump.c (rebuild_jump_labels, cleanup_barriers, purge_line_number_notes, init_label_info, mark_all_labels, squeeze_notes, get_label_before, get_label_after, reversed_comparison_code_parts, simplejump_p, pc_set, returnjump_p, onlyjump_p, follow_jumps, mark_jump_label, delete_barrier, delete_prior_computation, delete_computation, delete_related_insns, delete_for_peephole, redirect_jump): Likewise. * lcm.c (optimize_mode_switching): Likewise. * local-alloc.c (validate_equiv_mem, update_equiv_regs, block_alloc): Likewise. * loop-doloop.c (doloop_valid_p, doloop_optimize): Likewise. * loop-invariant.c (find_exits, find_invariants_bb): Likewise. * loop-iv.c (simplify_using_assignment): Likewise. * loop.c (compute_luids, loop_optimize, scan_loop, libcall_other_reg, libcall_benefit, skip_consec_insns, move_movables, prescan_loop, find_and_verify_loops, labels_in_range_p, for_each_insn_in_loop, loop_bivs_init_find, strength_reduce, check_insn_for_bivs, check_insn_for_givs, check_final_value, update_giv_derive, basic_induction_var, product_cheap_p, check_dbra_loop, loop_insn_first_p, last_use_this_basic_block, canonicalize_condition, get_condition, loop_regs_scan, load_mems, try_copy_prop, LOOP_BLOCK_NUM, loop_dump_aux): Likewise. * modulo-sched.c (doloop_register_get, find_line_note, sms_schedule, sms_schedule_by_order): Likewise. * optabs.c (emit_no_conflict_block, emit_libcall_block): Likewise. * postreload.c (reload_cse_simplify_operands, reload_combine, reload_cse_move2add): Likewise. * predict.c (can_predict_insn_p, estimate_probability, expected_value_to_br_prob, process_note_predictions): Likewise. * print-rtl.c (print_rtx, print_rtl, print_rtl_single): Likewise. * profile.c (branch_prob): Likewise. * ra-build.c (live_out_1, livethrough_conflicts_bb, detect_webs_set_in_cond_jump): Likewise. * ra-debug.c (ra_print_rtx_object, ra_debug_insns, ra_print_rtl_with_bb): Likewise. * ra-rewrite.c (insert_stores, rewrite_program2): Likewise. * recog.c (next_insn_tests_no_inequality, find_single_use, split_all_insns, peephole2_optimize, if_test_bypass_p): Likewise. * reg-stack.c (next_flags_user, record_label_references, emit_swap_insn, swap_rtx_condition, subst_stack_regs, compensate_edge, convert_regs_1): Likewise. * regclass.c (scan_one_insn): Likewise. * regmove.c (optimize_reg_copy_1, optimize_reg_copy_2, fixup_match_2, regmove_optimize, fixup_match_1, single_set_for_csa, combine_stack_adjustments_for_block): Likewise. * regrename.c (build_def_use, copyprop_hardreg_forward_1): Likewise. * reload.c (find_reloads, find_reloads_address_1, subst_reloads, find_equiv_reg): Likewise. * reload1.c (reload, calculate_needs_all_insns, set_label_offsets, reload_as_needed, emit_input_reload_insns, do_output_reload, delete_output_reload, delete_address_reloads_1, fixup_abnormal_edges): Likewise. * reorg.c (find_end_label, emit_delay_sequence, delete_from_delay_slot, delete_scheduled_jump, optimize_skip, get_jump_flags, rare_destination, mostly_true_jump, try_merge_delay_insns, redundant_insn, own_thread_p, fill_simple_delay_slots, fill_slots_from_thread, fill_eager_delay_slots, relax_delay_slots, make_return_insns, dbr_schedule): Likewise. * resource.c (find_basic_block, next_insn_no_annul, find_dead_or_set_registers, mark_target_live_regs): Likewise. * rtl.h (RTX_PREV): Likewise. * rtlanal.c (global_reg_mentioned_p, no_labels_between_p, no_jumps_between_p, reg_used_between_p, reg_referenced_between_p, reg_set_p, find_last_value, dead_or_set_regno_p, find_reg_fusage, find_regno_fusage, pure_call_p, replace_label, rtx_referenced_p_1, tablejump_p, computed_jump_p, insns_safe_to_move_p, find_first_parameter_load, can_hoist_insn_p): Likewise. * sched-deps.c (get_condition, add_dependence, sched_analyze_2, sched_analyze_insn, sched_analyze, add_forward_dependence): Likewise. * sched-ebb.c (fix_basic_block_boundaries, add_deps_for_risky_insns, schedule_ebbs): Likewise. * sched-rgn.c (is_cfg_nonregular, find_conditional_protection, is_conditionally_protected, can_schedule_ready_p, add_branch_dependences, debug_dependencies): Likewise. * stmt.c (emit_nop, expand_start_case, emit_jump_if_reachable): Likewise. * unroll.c (unroll_loop, copy_loop_body, back_branch_in_range_p, reg_dead_after_loop, loop_find_equiv_value, loop_iterations, set_dominates_use, ujump_to_loop_cont): Likewise. * var-tracking.c (prologue_stack_adjust, vt_initialize): Likewise. * varasm.c (output_constant_pool_1): Likewise. From-SVN: r84341
2004-07-08builtins.c (ind_gimplify_va_arg_expr): New.Richard Henderson1-0/+11
* builtins.c (ind_gimplify_va_arg_expr): New. * tree.h (ind_gimplify_va_arg_expr): Declare. * config/arc/arc.c (arc_gimplify_va_arg_expr): Use it. From-SVN: r84317
2004-07-08builtins.c (fold_builtin_strcpy): Merge functionality from ↵Roger Sayle1-161/+87
simplify_builtin_strcpy. * builtins.c (fold_builtin_strcpy): Merge functionality from simplify_builtin_strcpy. Add additional len argument. No longer static. Remove function prototype. (fold_builtin_strncpy): Likewise integrate functionality from simplify_builtin_strncpy. Add additional slen argument. No longer static. Remove function prototype. (simplify_builtin_strcy, simplify_builtin_strncpy): Delete. (simplify_builtin_fputs): Rename to fold_builtin_fputs. Change types of "ignore" and "unlocked" parameters to bool. (fold_builtin_1): Add additional ignore argument. Call renamed fold_builtin_fputs to simplify GCC "fputs" and "fputs_unlocked" builtins. Update arguments to fold_builtin_strncpy and fold_builtin_strcpy. Add function prototype. (fold_builtin): Add additional Boolean ignore argument to pass to fold_builtin_1. (simplify_builtin): Call fold_builtin_fputs, fold_builtin_strcpy and fold_builtin_strncpy instead of simplify_builtin_fputs, simplify_builtin_strcpy and simplify_builtin_strncpy respectively. * expr.h (simplify_builtin_fputs, simplify_builtin_strcpy, simplify_builtin_strncpy): Delete function prototypes. * tree.h (fold_builtin_fputs, fold_builtin_strcpy, fold_builtin_strncpy): Add function prototypes here. (fold_builtin): Update function prototype with new "bool ignore". * tree-ssa-ccp.c (ccp_fold): Update call to fold_builtin. (ccp_fold_builtin): Update call to fold_builtin. Call fold_builtin_fputs, fold_builtin_strcpy and fold_builtin_strncpy instead of simplify_builtin_fputs, simplify_builtin_strcpy and simplify_builtin_strncpy respectively. * fold-const.c (fold): Update call to fold_builtin. From-SVN: r84302
2004-07-08builtins.c (expand_builtin_stpcpy): Un-simplify decay of stpcpy to strcpy.Alexandre Oliva1-1/+8
* builtins.c (expand_builtin_stpcpy): Un-simplify decay of stpcpy to strcpy. From-SVN: r84301
2004-07-08Introduce H8SX support.Alexandre Oliva1-20/+118
* expr.c (expand_strcpy): Renamed and moved to... * builtins.c (expand_movstr): ... here. Tweak. (expand_builtin_strcpy): Adjust. Use movstr if len can't be computed or has side effects. (expand_builtin_stpcpy): Likewise. Use strcpy if return value is unused, or if mempcpy fails. Adjust the return value in the latter case. Use movstr if everything else fails. * doc/md.texi (movstr): Document. (movmemM, clrmemM): Fix explanation of memory block operands. * config/h8300/h8300.md (stpcpy): Renamed to... (movstr): ... this. Adjust. 2004-07-07 Alexandre Oliva <aoliva@redhat.com> * config/h8300/h8300.md: Rename movstr*, except for movstrict*, to movmem* and clrstr* to clrmem*. 2004-06-27 Alexandre Oliva <aoliva@redhat.com> * config/h8300/h8300.c (h8300_reg_class_from_letter): Map 'D' to GENERAL_REGS, always. (h8300_swap_into_er6, h8300_swap_into_er6): Handle the case of getting the stack pointer as addr. * config/h8300/h8300.h (PREDICATE_CODES): Remove constant rtxes from general_operand_dst. * config/h8300/h8300.md (movmd_internal_normal): New, normal-mode variant of... (movmd_internal): ... this. Add modes to operands. Disparage `D' instead of requiring it to match only before reload. (stpcpy_internal_normal): New, normal-mode variant of... (stpcpy_internal): ... this. Add modes to operands. Disparage `D' instead of requiring it to match only before reload. * config/h8300/h8300-protos.h (h8300_legitimate_address_p): Add mode argument. * config/h8300/h8300.h (GO_IF_LEGITIMATE_ADDRESS): Pass it to... * config/h8300/h8300.c (h8300_legitimate_address_p): Pass it to h8300_get_index. * config/h8300/h8300.md (attr type): Add call. (attr can_delay): If type is call, set it no. (call, call_value): Set type to call. 2004-06-21 Alexandre Oliva <aoliva@redhat.com> * config/h8300/h8300.md (logicalhi3_sn, logicalsi3_sn): New. 2004-06-16 Alexandre Oliva <aoliva@redhat.com> * tree.c (get_narrower): Don't narrow integral types into non-integral types. * config/h8300/h8300.c (h8300_expand_epilogue): Initialize frame_size *before* the first use. * config/h8300/h8300.md (movstrictqi): Reintroduce post-increment on input. (peephole2): Don't widen instructions that push SP. Move decrement of SP to the end of all stm-generating peepholes. 2003-07-24 Richard Sandiford <rsandifo@redhat.com> * config/h8300/h8300.md (insv): Prefer to use AND to clear a bitfield and OR to set it to all ones. 2003-07-24 Richard Sandiford <rsandifo@redhat.com> * config/h8300/h8300.md (can_delay): Default to "no" for bit branches. (call, call_value): Set can_delay to "no". 2003-07-22 Richard Sandiford <rsandifo@redhat.com> * config/h8300/h8300.md (extzv): Make subreg check more robust. 2003-07-21 Richard Sandiford <rsandifo@redhat.com> * config/h8300/h8300.md (*brabit): Remove. * config/h8300/h8300.md (*brabc, *brabs): Remove mode from zero_extract. Use bit_memory_operand as the predicate for operand 1 and 'WU' as the constraint. Check the difference between the base length and the final one when deciding which type of branch to use. 2003-07-21 Richard Sandiford <rsandifo@redhat.com> * config/h8300/h8300.md (extzv): Remove mode from operands 0 and 1. Use convert_move to extend the result for TARGET_H8300SX. Check for QImode memory references. Optimize the case where the destination is a paradoxical subreg. 2003-07-21 Richard Sandiford <rsandifo@redhat.com> * config/h8300/h8300.md (*movsf_h8sx): Add an r <- G alternative. * config/h8300/h8300.md (andqi): Remove bclr from h8sx version. 2003-07-21 Richard Sandiford <rsandifo@redhat.com> * config/h8300/h8300.md: Include mova.md (length_table): Add mova and mova_zero. * config/h8300/h8300.c (print_operand): Handle '%o'. Print a length after all constant addresses for '%R', '%X', '%T' and '%S'. (h8300_mova_length): New function. (h8300_insn_length_from_table): Use it to handle mova and mova_zero. * config/h8300/t-h8300 (mova.md): Generate from genmova.sh. Add to dependencies for s-config, etc. * config/h8300/gemova.sh: New file. * config/h8300/mova.md: Generated. 2003-07-20 Alexandre Oliva <aoliva@redhat.com> * config/h8300/h8300.c (h8300_bitfield_length): New. (nibble_operand): Adjust. (h8300_binary_length): Handle conditional binary op. (h8300_insn_length_from_table): Handle bitfield and bitbranch. * config/h8300/h8300.h: Change constraints W# and Y# to P#>X and P#<X, respectively. The original P is now IP4>X. Introduced P#>0 and P#<0, unused so far. W and Y are now prefixes to multi-letter constraints. WU is introduced as a variant of U that requires a mem, and is therefore considered an EXTRA_MEMORY_CONSTRAINT. * config/h8300/h8300.md (attr type): Added bitbranch. (attr length_table): Added bitfield and bitbranch. (attr length): Compute bitbranch length. (andqi): Separate pattern for H8300SX. Use bfld for loading the least-significant bit of a byte. (brabit, brabc, brabs): New. (insv, extzv): Emit bfst and bfld on H8300SX. (bfld, bfst, seq, sne): New. (bstzhireg, cmpstz, bstz, bistz): New. (cmpcondbset, condbset, cmpcondbclr, condbclr): New. (cmpcondbsetreg, condbsetreg, cmpcondbclrreg, condbclrreg): New. 2003-07-11 Richard Sandiford <rsandifo@redhat.com> * config/h8300/h8300.c (h8sx_binary_memory_operator): New function. (h8sx_unary_memory_operator): New function. * config/h8300/h8300.h (EXTRA_MEMORY_CONSTRAINT): Disable. (PREDICATE_CODES): Add h8sx_{unary,binary}_memory_operator. * config/h8300/h8300.md: Add peepholes to combine reloads and arithmetic insns. 2003-07-10 Richard Sandiford <rsandifo@redhat.com> * config/h8300/h830.md (cmpqi): Use 'i' rather than 'n' in constraints. (*cmphi_h8300hs, *addqi3, *addhi3_h8sx, subhi3): Likewise. (and?i, ior?i, xor?i): Likewise. 2003-07-10 Richard Sandiford <rsandifo@redhat.com> * config/h8300/h8300.c: Move enums and prototypes to head of file. Various whitespace fixes. (h8300_constant_length): New function, split out from... (h8300_displacement_size): ...here. Rename h8300_displacement_length. (h8300_classify_operand): Use IN_RANGE. (h8300_classify_operand): Use h8300_constant_length. (h8300_short_move_mem_p): Tighten size check. (h8sx_mergeable_memrefs_p): Tighten equality check. 2003-06-30 Richard Sandiford <rsandifo@redhat.com> * config/h8300/h8300.h (TARGET_CPU_CPP_BUILTINS): Define __H8300SX__ for -msx. * config/h8300/crti.asm: Use .h8300sx or .h8300sxn for -msx code. * config/h8300/crtn.asm: Likewise. * config/h8300/lib1funcs.asm: Likewise. Use 32-bit pointers if __H8300SX__ is defined. 2003-06-27 Richard Sandiford <rsandifo@redhat.com> * config/h8300/h8300-protos.h (h8300_get_index): Add mode parameter. * config/h8300/h8300.h (GO_IF_LEGITIMATE_ADDRESS): Update accordingly. (GO_IF_MODE_DEPENDENT_ADDRESS): Treat POST_DEC, PRE_INC and indexed addresses as mode-dependent. * config/h8300/h8300.c (print_operand_address): Update call to h8300_get_index. (h8300_get_index): Take a mode argument. Rework to fix an earlier misunderstanding. 2003-06-26 Richard Sandiford <rsandifo@redhat.com> * config/h8300/h8300.c (zero_extendqisi2): Force the source operand into a register if TARGET_H8300SX. (*zero_extendqisi2_h8300hs, *extendqisi2_h8300): Disable for TARGET_H8300SX. Also disable related define_splits. (*zero_extendqisi2_h8sx, *extendqisi2_h8sx): New patterns. 2003-06-23 Richard Sandiford <rsandifo@redhat.com> * config/h8300/h8300.c (h8300_rtx_costs): Add h8sx handling. 2003-06-20 Richard Sandiford <rsandifo@redhat.com> * config/h8300/h8300.h (OK_FOR_Z): New macro. (EXTRA_CONSTRAINT_STR): Check it. * config/h8300/h8300.c (h8300_classify_operand): Accept null class arguments. (h8300_insn_length_from_table): Handle LENGTH_TABLE_MOV_IMM4. * config/h8300/h8300.md (length_table): Add mov_imm4. (movqi, movhi): Add Z <- W4 alternatives to h8sx patterns. 2003-06-20 Richard Sandiford <rsandifo@redhat.com> * genattrtab.c (write_eligible_delay): Allow candidate_insn to be a label. * config/h8300/h8300.h (DELAY_SLOT_LENGTH): New macro. * config/h8300/h8300.c (h8300_reorg): New function. (TARGET_MACHINE_DEPENDENT_REORG): Define. * config/h8300/h8300.md (length): Subtract the length of the delay slot from (pc) when checking the range of forward branches. (delay_slot, can_delay): New attributes. (define_delay): Add bra/s handling. (movmd_internal, return_h8sx, *return_1): Set can_delay to no. (jump): Add delayed-branch handling. 2003-06-17 Richard Sandiford <rsandifo@redhat.com> * expr.c (expand_strcpy): New function. * builtins.c (expand_builtin_strcpy): Fall back on expand_strcpy. (expand_builtin_stpcpy): Likewise. * config/h8300/h8300-protos.h (h8sx_split_movmd): Remove. (h8300_swap_into_er6, h8300_swap_out_of_er6): Declare. * config/h8300/h8300.c (h8300_reg_class_from_letter): Tweak 'd' handling to improve register allocation for -fno-omit-frame-pointer. (h8sx_split_movmd): Delete, moving er6 handling into... (h8300_swap_into_er6, h8300_swap_out_of_er6): ...these new functions. * config/h8300/h8300.md (UNSPEC_STPCPY): New unspec constant. (movmd): Add calls to copy_rtx. (movmd_internal): In the second alternative, allow the initial and final destination registers to be different . Update the splitter accordingly. Call h8300_swap_into_er6 and h8300_swap_out_of_er6 instead of h8sx_split_movmd. (stpcpy, movsd): New expanders. (movsd_internal): New define_insn. 2003-06-13 Richard Sandiford <rsandifo@redhat.com> * config/h8300/h8300-protos.h (h8300_reg_class_from_letter): Declare. (h8sx_emit_movmd, h8sx_split_movmd): Declare. * config/h8300/h8300.h (reg_class): Add COUNTER_REGS, SOURCE_REGS and DESTINATION_REGS. (REG_CLASS_NAMES, REG_CLASS_CONTENTS): Update accordingly. (REGNO_REG_CLASS): Map er4, er5 and er6 to the new classes. (REG_CLASS_FROM_LETTER): Use h8300_reg_class_from_letter. (h8300_move_ratio): Declare. (MOVE_RATIO): Use it. * config/h8300/h8300.c (h8300_move_ratio): New variable. (h8300_init_once): Initialize it. (h8300_reg_class_from_letter): New function. (print_operand): Add an 'm' prefix for printing ".b", ".w" or ".l". (h8sx_emit_movmd, h8sx_split_movmd): New functions. * config/h8300/h8300.md (UNSPEC_MOVMD): New unspec constant. (COUNTER_REG, SOURCE_REG, DESTINATION_REG): New register constants. (movstrsi, movmd): New expanders. (movmd_internal): New insn. 2003-06-06 Richard Sandiford <rsandifo@redhat.com> * config/h8300/h8300.h (EXTRA_MEMORY_CONSTRAINT): Define. 2003-06-04 Richard Sandiford <rsandifo@redhat.com> * config/h8300/elf.h (LINK_SPEC): Use -m h8300sxnelf for -msx -mn. * config/h8300/h8300.c (asm_file_start): Use .h8300sxn likewise. 2003-06-03 Richard Sandiford <rsandifo@redhat.com> * config/h8300/h8300.c (nibble_operand): Fix warning. * config/h8300/h8300.md (movstricthi): Set adjust_length to no. (movsi_h8sx): Likewise here and the normal h8sx movhi pattern. (movsf_h8300h): Disable for TARGET_H8300SX. 2003-06-03 Richard Sandiford <rsandifo@redhat.com> * config/h8300/h8300.h (PREDICATE_CODES): Add h8300_ldm_parallel, h8300_stm_parallel and h8300_return_parallel. * config/h8300/h8300.c (h8300_push_pop, h8300_stack_offset_p, h8300_ldm_stm_regno, h8300_ldm_stm_parallel, h8300_ldm_parallel, h8300_stm_parallel, h8300_return_parallel): New functions. (h8300_expand_prologue): Don't enforce ldm/stm register alignment if TARGET_H8300SX. Use h8300_push_pop. (h8300_expand_epilogue): Likewise. Try to merge the return insn and final pop when generating h8sx code. Always emit some form of return insn. * config/h8300/h8300.md: Don't enforce register alignment in stm peepholes if TARGET_H8300SX. (ldm_h8300s, stm_h8300s, return_h8sx): New patterns. (ldm_h8300s_[234], stm_h8300_[234]): Disable. (epilogue): Expect h8300_expand_epilogue to emit a return insn. 2003-06-03 Richard Sandiford <rsandifo@redhat.com> * config/h8300/t-h8300 (MULTILIB_OPTIONS): Add a -msx multilib. (MULTILIB_DIRNAMES): Add a directory for it. (MULTILIB_MATCHES): Delete. 2003-05-28 Richard Sandiford <rsandifo@redhat.com> * final.c (walk_alter_subreg): Handle addresses with subregs inside a ZERO_EXTEND or AND. * config/h8300/h8300-protos.h (h8300_get_index): Declare. * config/h8300/h8300.h (INDEX_REG_CLASS): Set to GENERAL_REGS if TARGET_H8300SX. (GO_IF_LEGITIMATE_ADDRESS): Use h8300_get_index. * config/h8300/h8300.c (print_operand_address): Handle @(dd,RnL.b), @(dd,Rn.w) and @(dd,ERn.L). (h8300_displacement_size): Take the whole address as argument. (h8300_classify_operand, h8300_short_move_mem_p): Adjust accordingly. 2003-05-28 Richard Sandiford <rsandifo@redhat.com> * config/mips/mips-protos.h (h8300_operands_match_p): Declare. (h8sx_mergeable_memrefs_p): Declare. * config/h8300/h8300.h (HAVE_POST_DECREMENT): Define to TARGET_H8300SX. (HAVE_PRE_INCREMENT): Likewise. (GO_IF_LEGITIMATE_ADDRESS): Accept pre/post increment/decrement addresses for TARGET_H8300SX, * config/h8300/h8300.c (print_operand_address): Deal with PRE_INC and POST_DEC. (movb_length_table, movl_length_table): New tables. (movw_length_table): Define to movb_length_table. (h8300_displacement_size): New, split out from... (h8300_classify_address): ...here. Handle pre/post inc/dec. (h8300_short_immediate_length): Allow H8OP_MEM_COMPLEX operands. (h8300_insn_length_from_table): Add cases for movb, movw and movl. (h8sx_mergeable_memrefs_p, h8300_operands_match_p): New functions. (output_plussi): Use add.l #xx:3,Rn and sub.l #xx:3,Rn for h8sx. (compute_plussi_length, compute_plussi_cc): Update accordingly. (h8sx_unary_shift_operator): Get the mode from the operator. (binary_shift_operator): Likewise. * config/h8300/h8300.md: If a peephole2 applies gen_lowpart to a memory reference, check whether the reference is offsettable. (length_table): Add movb, movw and movl. (movqi): Add new h8sx pattern. Don't force one operand to be a register when generating h8sx code. (movhi, movsi, movsf): Likewise. (movstrictqi): Use the length_table attribute. (movstricthi): Likewise. Add h8sx alternative for mov.w #xx:3,Rn. (addqi3): Split into a define_expand and define_insn. Don't accept memory operands in the expander. Use h8300_operands_match_p to check for matching operands in the define_insn. (subqi3, negqi2, one_cmplqi2): Likewise. (add[hs]i3): Don't accept memory operands in the expander. Likewise in any patterns that are unused in h8sx code. In the h8sx patterns, use h8300_operands_match_p to check whether operands match. (sub[hs]i3, and[hi]3, ior[hs]i3, xor[hs]i3, neg[hsi]3, one_cmpl[hs]i3): Likewise. (andqi3, iorqi3, xorqi3): Likewise. Don't call fix_bit_operand in the expander. 2003-05-23 Richard Sandiford <rsandifo@redhat.com> * config/h8300/h8300-protos.h (expand_a_shift): Return a bool. (h8300_insn_length_from_table): Add a second parameter. (output_h8sx_shift): Declare. * config/h8300/h8300.h (OK_FOR_W, OK_FOR_Y): New macros. (EXTRA_CONSTRAINT): Replace with... (EXTRA_CONSTRAINT_STR): ...this. Use OK_FOR_W and OK_FOR_Y. (CONSTRAINT_LEN): Define, returning 2 for 'W' and 'Y'. (PREDICATE_CODES): Add entries for h8sx_unary_shift_operator and h8sx_binary_shift_operator. * config/h8300/h8300.c (two_insn_adds_subs_operand): Return false for TARGET_H8300SX. (bit_operand): Replace use of EXTRA_CONSTRAINT with OK_FOR_U. (bit_memory_operand, fix_bit_operand): Likewise. (h8300_length_table_for_insn): Remove. (h8300_classify_operand): Fix check for 16-bit operands in 32-bit instructions. (h8300_short_immediate_length, h8300_binary_length): New functions. (h8300_insn_length_from_table): Add an opcodes parameter. Rework. (output_plussi): Use sub to add negative constants. (compute_plussi_length): Adjust accordingly. (h8sx_single_shift_type): New enum. (h8sx_single_shift, h8sx_unary_shift_operator, h8sx_binary_shift_operator, output_h8sx_shift): New functions. (expand_a_shift, expand_a_rotate): Emit nothing if the shift is a single h8sx instruction. Return false in this case. * config/h8300/h8300.md (length_table): Add short_immediate. (length): Pass the operand array to h8300_insn_length_from_table. (adjust_length): Assume "no" for insns with a length_table attribute. (*cmphi_h8300hs, cmpsi): Add alternatives for #xx:3. (*addhi3_h8300hs): Don't use for h8sx. (*addhi3_h8sx): New pattern, with alternatives for add.w #xx:3 and sub.w #xx:3. (ashl[qhs]i3, lshr[qhs]i3, ashr[qhs]i3, rotl[qhs]i3): Change operand 1's predicate to nonimmediate_operand. Only skip default expansion if expand_a_shift or expand_a_rotate returns true. Add new patterns for single h8sx shift instructions. 2003-05-22 Alexandre Oliva <aoliva@redhat.com> * config/h8300/h8300.c (nibble_operand): Split out of... (reg_or_nibble_operand): ... this. * config/h8300/h8300.h (PREDICATE_CODES): Added nibble_operand. * config/h8300/h8300.md: (mulqihi3, mulhisi3, umulqihi3, umulhisi3): Introduce expand, and introduce separate insns for sign- or zero-extended REG and already-extended CONST_INT. 2003-05-20 Richard Sandiford <rsandifo@redhat.com> * config/h8300/h8300.c (h8300_unary_length): Fix miscounting. * config/h8300/h8300.md (subqi3): Generalize for h8sx. (subhi3): Likewise. Don't accept immediates for operand 1. Remove the early clobber from second alternative of the h8300s pattern. (subsi3): Generalize for h8sx. Force operand 2 into a register on plain h8300 targets. (subsi3_h8300): Use h8300_dst_operand for consistency with expander. (subsi3_h8300h): Generalize for h8sx. (one_cmplqi2, one_cmplhi2, one_cmplsi2): Likewise. 2003-05-19 Alexandre Oliva <aoliva@redhat.com> * config/h8300/h8300.c (reg_or_nibble_operand): New. * config/h8300/h8300.h (PREDICATE_CODES): Adjust. (TARGET_H8300SXMUL): New. (CONST_OK_FOR_P): New. (CONST_OK_FOR_LETTER_P): Adjust. * config/h8300/h8300.md (mulqihi3, mulhisi3, umulqihi3, umulhisi3): Accept 4-bit immediate on H8SX. (mulhi3, mulsi3, smulsi3_highpart, umulsi3_highpart): New. (udivsi3, divhi3, udivsi3, divsi3): New. 2003-05-19 Richard Sandiford <rsandifo@redhat.com> * config/h8300/h8300-protos.h (h8300_insn_length_from_table): Declare. * config/h8300/h8300.h (OK_FOR_Q): New macro. (EXTRA_CONSTRAINT): Use it to check the 'Q' constraint. (PREDICATE_CODES): Add h8300_src_operand and h8300_dst_operand. Add ADDRESSOF to the bit_operand entry. * config/h8300/h8300.c (h8300_dst_operand): New predicate. (h8300_src_operand): Likewise. (bit_operand): Check nonimmediate_operand rather than general_operand. Accept any nonimmediate_operand in h8sx code. (h8300_and_costs): Initialize operands[1]. (h8300_rtx_costs) <AND>: Return false if the operands aren't valid. (h8300_operand_class): New enum. (h8300_length_table): New typedef. (addb_length_table, addw_length_table, addl_length_table, logicl_length_table): New tables. (logicb_length_table, logicw_length_table): New macros. (h8300_classify_operand, h8300_length_from_table, h8300_length_table_for_insn, h8300_unary_length, h8300_insn_length_from_table): New functions. (output_plussi): Only use adds and subs for register destinations. Disable redundant clause. (compute_plussi_cc): Likewise. (compute_plussi_length): Likewise. Use h8300_length_from_table to work out the length of an insn. (output_logical_op): Only use narrower immediate instructions if the destination is a register. (compute_logical_op_cc): Likewise. (compute_logical_op_length): Likewise. Use h8300_length_from_table. (h8300_adjust_insn_length): Tighten check for reg<->mem moves. * config/h8300/h8300.md (length_table): New attribute. (length): When an instruction has a length_table attribute, use h8300_insn_length_from_table to calculate its default length. (cmpqi): Use h8300_dst_operand for the first operand and h8300_src_operand for the second. (cmphi, *cmphi_h8300hs, cmpsi, negqi2, neghi2, neghi2_h8300h, negsi2, negsi2_h8300h, addqi3, addhi3, *addhi3_h8300, *addhi3_h8300hs, addsi3, addsi_h8300, addsi_h8300h, andhi3, andsi3, iorhi3, iorsi3, xorhi3, xorsi3): Likewise. (andqi3): Use h8300_src_operand for operand 2. Adjust the condition so that it allows any combination of operands for TARGET_H8300SX. (iorqi3, xorqi3): Likewise. (cmpqi): Use the length_table attribute. (*cmphi_h8300hs, cmpsi, addqi, *addhi3_h8300hs, andqi3, iorqi3, xorqi3, negqi2, neghi2_h8300h, negsi2_h8300h): Likewise. (cmpqi): Add 'Q' constraint. (*cmphi_h8300hs, cmpsi, addqi, *addhi3_h8300hs, addsi_h8300h, andqi3, iorqi3, xorqi3, negqi2, neghi2_h8300h, negsi2_h8300h): Likewise. 2003-05-14 Richard Sandiford <rsandifo@redhat.com> * config/h8300/h8300.h (MASK_H8300SX): New macro. (TARGET_H8300S): True for both -ms and -msx. (TARGET_H8300SX): New macro. (TARGET_SWITCHES): Add entries for -msx and -mno-sx. * config/h8300/h8300.c (asm_file_start): Write .h8300sx for -msx. * config/h8300/elf.h (LINK_SPEC): Use -m h8300sxelf for -msx. * config/h8300/t-h8300 (MULTILIB_MATCHES): Use -ms multilibs for -msx. [Temporary change.] 2003-02-28 Alexandre Oliva <aoliva@redhat.com> * config/h8300/h8300.h (SIZE_TYPE, PTRDIFF_TYPE): Use short with 16-bit pointers and 32-bit ints. * config/h8300/h8300.h (LEGITIMATE_CONSTANT_P): Accept CONST_DOUBLE with mode no wider than SImode. * config/h8300/h8300.md (extendqisi2_h8300): Add constraints for output operand. 2003-02-27 Alexandre Oliva <aoliva@redhat.com> * config/h8300/h8300.c (general_operand_src): Match CONSTANT_P_RTX or SUBREG thereof. * config/h8300/h8300.h (PREDICATE_CODES): Adjust. 2003-02-22 Alexandre Oliva <aoliva@redhat.com> * config/h8300/h8300.c (dosize): Truncate sign * size to Pmode. From-SVN: r84257
2004-07-07builtins.c: Rename movstr*, except for movstrict*, to movmem* and clrstr* to ↵Alexandre Oliva1-1/+1
clrmem*. gcc/ChangeLog: * builtins.c: Rename movstr*, except for movstrict*, to movmem* and clrstr* to clrmem*. * expr.c: Likewise. * expr.h: Likewise. * genopinit.c: Likewise. * integrate.c: Likewise. * local-alloc.c: Likewise. * optabs.c: Likewise. * optabs.h: Likewise. * config/alpha/alpha.h: Likewise. * config/alpha/alpha.md: Likewise. * config/arm/arm-protos.h: Likewise. * config/arm/arm.c: Likewise. * config/arm/arm.md: Likewise. * config/avr/avr.md: Likewise. * config/c4x/c4x.c: Likewise. * config/c4x/c4x.md: Likewise. * config/frv/frv.md: Likewise. * config/i386/i386-protos.h: Likewise. * config/i386/i386.c: Likewise. * config/i386/i386.h: Likewise. * config/i386/i386.md: Likewise. * config/i860/i860.c: Likewise. * config/i860/i860.md: Likewise. * config/ip2k/ip2k.md: Likewise. * config/ip2k/libgcc.S: Likewise. * config/ip2k/t-ip2k: Likewise. * config/m32r/m32r.c: Likewise. * config/m32r/m32r.md: Likewise. * config/mcore/mcore.md: Likewise. * config/mips/mips.c: Likewise. * config/mips/mips.md: Likewise. * config/ns32k/ns32k.c: Likewise. * config/ns32k/ns32k.h: Likewise. * config/ns32k/ns32k.md: Likewise. * config/pa/pa.c: Likewise. * config/pa/pa.md: Likewise. * config/pdp11/pdp11.h: Likewise. * config/pdp11/pdp11.md: Likewise. * config/rs6000/rs6000.c: Likewise. * config/rs6000/rs6000.md: Likewise. * config/s390/s390-protos.h: Likewise. * config/s390/s390.c: Likewise. * config/s390/s390.md: Likewise. * config/sh/lib1funcs.asm: Likewise. * config/sh/sh.c: Likewise. * config/sh/sh.md: Likewise. * config/sh/t-sh: Likewise. * config/sparc/sparc.h: Likewise. * config/vax/vax.md: Likewise. * config/xtensa/xtensa.c: Likewise. * config/xtensa/xtensa.md: Likewise. * doc/invoke.texi: Likewise. * doc/md.texi: Likewise. * doc/rtl.texi: Likewise. gcc/testsuite/ChangeLog: * gcc.c-torture/execute/builtins/mempcpy-2.c: Rename movstr*, except for movstrict*, to movmem* and clrstr* to clrmem*. From-SVN: r84222
2004-07-01alias.c (get_alias_set, [...]): Use MEM_P.Jerry Quinn1-3/+3
2004-07-01 Jerry Quinn <jlquinn@optonline.net> * alias.c (get_alias_set, canon_rtx, get_addr, nonoverlapping_memrefs_p, nonlocal_referenced_p_1, memory_modified_1): Use MEM_P. * builtins.c (expand_builtin_prefetch, expand_builtin_profile_func, expand_builtin): Likewise. * calls.c (expand_call, emit_library_call_value_1, store_one_arg): Likewise. * combine.c (can_combine_p, combinable_i3pat, try_combine, find_split_point, combine_simplify_rtx, simplify_set, make_extraction, rtx_equal_for_field_assignment_p, gen_lowpart_for_combine, record_dead_and_set_regs_1, get_last_value_validate, mark_used_regs_combine, move_deaths, unmentioned_reg_p_1): Likewise. * cse.c (check_dependence, canon_hash, equiv_constant, gen_lowpart_if_possible, cse_insn, invalidate_from_clobbers, cse_around_loop, cse_check_loop_start, cse_set_around_loop, count_reg_usage): Likewise. * cselib.c (rtx_equal_for_cselib_p, add_mem_for_addr, cselib_lookup, cselib_invalidate_mem, cselib_invalidate_rtx, cselib_record_set, cselib_record_sets): Likewise. * dbxout.c (PARM_PASSED_IN_MEMORY, dbxout_symbol, dbxout_symbol_location, dbxout_parms, dbxout_reg_parms): Likewise. * ddg.c (mark_mem_use, mark_mem_store, rtx_mem_access_p): Likewise. * df.c (df_uses_record): Likewise. * dojump (do_jump): Likewise. * dwarf2out.c (stack_adjust_offset, mem_loc_descriptor, loc_descriptor_from_tree, rtl_for_decl_location, add_bound_info, decl_start_label): Likewise. * emit-rtl.c (gen_complex_constant_part, gen_highpart, operand_subword, change_address_1, make_safe_from): Likewise. * explow.c (break_out_memory_refs, copy_all_regs, validize_mem, stabilize, force_not_mem): Likewise. * expmed.c (store_bit_field, store_split_bit_field, extract_bit_field, expand_mult_const, expand_divmod, emit_store_flag): Likewise. * expr.c (convert_move, convert_modes, emit_block_move, emit_group_load, emit_group_store, clear_storage, emit_move_insn, emit_move_insn_1, expand_assignment, store_expr, store_constructor_field, store_constructor, store_field, force_operand, safe_from_p, expand_expr_real_1, expand_increment): Likewise. * final.c (cleanup_subreg_operands, alter_subreg, get_mem_expr_from_op): Likewise. * flow.c (notice_stack_pointer_modification_1, init_propagate_block_info, insn_dead_p, mark_set_1, mark_used_regs): Likewise. * function.c (mark_temp_addr_taken, preserve_temp_slots, preserve_rtl_expr_result, put_var_into_stack, fixup_var_refs_1, optimize_bit_field, flush_addressof, purge_addressof_1, instantiate_decl, instantiate_virtual_regs_1, assign_parms, setjmp_protect, setjmp_protect_args, fix_lexical_addr, keep_stack_depressed): Likewise. * ifcvt.c (noce_try_cmove_arith, noce_try_abs, noce_operand_ok, noce_process_if_block, find_memory): Likewise. * integrate.c (subst_constants, allocate_initial_values): Likewise. * local-alloc.c (validate_equiv_mem_from_store, memref_referenced_p, update_equiv_regs): Likewise. * loop.c (scan_loop, prescan_loop, note_addr_stored, check_store, maybe_eliminate_biv_1, find_mem_in_note_1): Likewise. * optabs.c (expand_abs, emit_unop_insn): Likewise. * passes.c (rest_of_handle_final): Likewise. * postreload.c (reload_cse_simplify_set, reload_cse_simplify_operands, move2add_note_store): Likewise. * ra-build.c (detect_remat_webs): Likewise. * ra-debug.c (dump_static_insn_cost): Likewise. * ra-rewrite.c (slots_overlap_p, insert_stores): Likewise. * recog.c (validate_change, apply_change_group, cancel_changes, validate_replace_rtx_1, general_operand, register_operand, nonmemory_operand, push_operand, pop_operand, memory_operand, indirect_operand, asm_operand_ok, offsettable_memref_p, offsettable_nonstrict_memref_p, constrain_operands, store_data_bypass_p): Likewise. * reg-stack.c (subst_stack_regs_pat): Likewise. * regclass.c (record_operand_costs, scan_one_insn, record_reg_classes, copy_cost, reg_scan_mark_refs): Likewise. * regmove.c (optimize_reg_copy_3, stack_memref_p, combine_stack_adjustments_for_block): Likewise. * regrename.c (copyprop_hardreg_forward_1): Likewise. * reload.c (can_reload_into, push_reload, decompose, immune_p, find_reloads, find_reloads_address, find_reloads_address_1, reg_overlap_mentioned_for_reload_p, refers_to_mem_for_reload_p, find_equiv_reg): Likewise. * reload1.c (reload, eliminate_regs, eliminate_regs_in_insn, reload_as_needed, choose_reload_regs, emit_input_reload_insns, do_input_reload, emit_reload_insns, gen_reload, delete_output_reload, delete_address_reloads): Likewise. * resource.c (mark_referenced_resources): Likewise. * rtlanal.c (get_jump_table_offset, count_occurrences, reg_referenced_p, reg_set_p, set_of_1, set_noop_p, reg_overlap_mentioned_p, note_uses, replace_regs, nonzero_bits1, num_sign_bit_copies1): Likewise. * rtlhooks.c (gen_lowpart_general): Likewise. * sched-deps.c (sched_analyze_1, sched_analyze_2): Likewise. * sdbout.c (PARM_PASSED_IN_MEMORY, sdbout_symbol, sdbout_toplevel_data, sdbout_parms, sdbout_reg_parms, sdbout_global_decl): Likewise. * simplify-rtx.c (simplify_subreg): Likewise. * stmt.c (expand_asm_operands, expand_expr_stmt_value, expand_decl, expand_anon_union_decl, expand_end_case_type): Likewise. * unroll.c (calculate_giv_inc): Likewise. * var-tracking.c (stack_adjust_offset_pre_post, bb_stack_adjust_offset, track_expr_p, count_uses, add_uses, add_stores, compute_bb_dataflow, vt_get_decl_and_offset, vt_add_function_parameters): Likewise. * varasm.c (make_var_volatile, notice_global_symbol, assemble_external, decode_addr_const, mark_weak, default_encode_section_info): Likewise. From-SVN: r83980
2004-07-01builtins.c (fold_builtin_classify): Fix typo.Paolo Bonzini1-1/+1
2004-07-01 Paolo Bonzini <bonzini@gnu.org> * builtins.c (fold_builtin_classify): Fix typo. From-SVN: r83962
2004-07-01builtins.c (fold_builtin_classify): New.Paolo Bonzini1-5/+106
gcc/ChangeLog: 2004-07-01 Paolo Bonzini <bonzini@gnu.org> * builtins.c (fold_builtin_classify): New. (fold_builtin_unordered_cmp): Fix commentary. (fold_builtin): Use it. * builtins.def: Define builtins for isnan, isnanf, isnanl, finite, finitef, finitel, isinf, isinff, isinfl. gcc/testsuite/ChangeLog: 2004-07-01 Paolo Bonzini <bonzini@gnu.org> * gcc.dg/builtins-43.c: New. * gcc.dg/builtins-44.c: New. * gcc.dg/builtins-45.c: New. From-SVN: r83960
2004-06-29re PR middle-end/16216 (ICE in gimplify_va_arg_expr after error)Richard Henderson1-1/+4
PR middle-end/16216 * builtins.c (gimplify_va_arg_expr): Check for valist being an error_mark_node. From-SVN: r83881
2004-06-20re PR middle-end/16089 (unwind-dw2.c:1311: error: insn outside basic block)Andrew Pinski1-7/+0
2004-06-20 Andrew Pinski <pinskia@physics.uc.edu> PR middle-end/16089 * builtins.c (entry_of_function): Move to ... * cfgrtl.c (entry_of_function): Here and make non-static. * integrate.c (emit_initial_value_sets): Use entry_of_function. * rtl.h (entry_of_function): Prototype. From-SVN: r83415
2004-06-20c-common.h (has_c_linkage): New interface.Zack Weinberg1-3/+1
* c-common.h (has_c_linkage): New interface. * c-cppbuiltin.c: Include target.h. (c_cpp_builtins): Define __PRAGMA_REDEFINE_EXTNAME and __PRAGMA_EXTERN_PREFIX when appropriate. * c-pragma.c: Include target.h. Document clarified semantics of symbol-renaming #pragmas. (handle_pragma_redefine_extname, handle_pragma_extern_prefix) (maybe_apply_renaming_pragma): Rewrite according to clarified semantics. Always recognize, but do not necessarily execute. (init_pragma): Unconditionally register symbol-renaming pragmas. * system.h: Poison HANDLE_PRAGMA_REDEFINE_EXTNAME and HANDLE_PRAGMA_EXTERN_PREFIX. * target.h (struct gcc_target): Add handle_pragma_redefine_extname and handle_pragma_extern_prefix flags. * target-def.h: Add defaults for TARGET_HANDLE_PRAGMA_REDEFINE_EXTNAME and TARGET_HANDLE_PRAGMA_EXTERN_PREFIX. * Makefile.in (c-pragma.o, c-cppbuiltin.o): Update dependencies. * config/sol2.h: Define TARGET_HANDLE_PRAGMA_REDEFINE_EXTNAME, not HANDLE_PRAGMA_REDEFINE_EXTNAME. (TARGET_OS_CPP_BUILTINS): No need to define __PRAGMA_REDEFINE_EXTNAME. (TRANSFER_FROM_TRAMPOLINE): Prototype mprotect. * config/alpha/osf.h: Define TARGET_HANDLE_PRAGMA_EXTERN_PREFIX, not HANDLE_PRAGMA_EXTERN_PREFIX. (TARGET_OS_CPP_BUILTINS): No need to define __PRAGMA_EXTERN_PREFIX. * doc/extend.texi (Solaris Pragmas, Tru64 Pragmas): Combine into one section "Symbol-Renaming Pragmas"; clarify; document adjusted semantics. * builtins.c (expand_builtin): Do not issue error for a builtin with no special case code and no DECL_ASSEMBLER_NAME; just do the library call. * c-decl.c (builtin_function): Don't call make_decl_rtl. * c-objc-common.c (has_c_linkage): Stub implementation. * cgraphunit.c (cgraph_expand_function) (cgraph_remove_unreachable_nodes): Don't clear DECL_ARGUMENTS. cp: * cp-lang.c (has_c_linkage): Implement. * cp-tree.h (set_mangled_name_for_decl): Don't prototype. * decl.c (duplicate_decls): Use COPY_DECL_RTL. (builtin_function_1): Don't call make_decl_rtl. (build_cp_library_fn): Don't call set_mangled_name_for_decl. (grokvardecl): Don't call mangle_decl. * except.c (nothrow_libfn_p): Look at DECL_NAME, not DECL_ASSEMBLER_NAME. * method.c (set_mangled_name_for_decl): Delete. * name-lookup.c (pushdecl): When a local extern shadows a file-scope declaration of the same object, give both DECLs the same DECL_UID. * typeck.c (cxx_mark_addressable): Don't set TREE_ADDRESSABLE on DECL_ASSEMBLER_NAME. testsuite: * g++.dg/expr/enum1.C, g++.dg/opt/const3.C: Declare abort with extern "C". * g++.dg/other/pragma-re-1.C: Add comments. From-SVN: r83405
2004-06-20builtins.c (fold_builtin_unordered_cmp): Take an EXP argument instead of ↵Roger Sayle1-21/+68
both an ARGLIST and a result TYPE. * builtins.c (fold_builtin_unordered_cmp): Take an EXP argument instead of both an ARGLIST and a result TYPE. Handle these C99 comparison functions as "polymorphic" builtins. Also handle lowering of BUILT_IN_ISUNORDERED to an UNORDERED_EXPR tree node. (fold_builtin_1): Update calls to fold_builtin_unordered_cmp. Move handling of BUILT_IN_ISUNORDERED from here to there. From-SVN: r83404
2004-06-19CFG transparent RTL expansion:Jan Hubicka1-2/+10
* Makefile.in (cfgexpand.o): New object file. (builtins.o): Add dependency on basic-block.h * builtins.c: Include basic-block.h (entry_of_function): New function. (expand_builtin_apply_args, expand_builtin_saveargs): Use it. * cfgexpand.c: New file. * expr.c (execute_expand, pass_expand): Kill. * pass.c (rest_of_compilation): Do not build CFG unless called from coverage code. * tree-cfg.c (delete_tree_cfg): Rename to.. (delete_tree_cfg_annotations): ... this one; Do not remove the CFG itself. * tree-flow.h (delete_tree_cfg_annotations): Declare. (dleete_tree_cfg): Kill. * tree-optimize.c (execute_rebuild_bind, pass_rebuild_bind): Kill. (execute_del_cfg): Rename to... (execute_free_datastructures): This one... (pass_del_cfg): Rename to... (pass_free_datastructures): ... this one; Do not kill PROP_cfg. (init_tree_optimization_passes): Make cfg build and profiling to happen unconditionally. * tree-mudflap.c (mf_decl_cache_locals): Skip labels before inserting the cache variables. * tree-mudflap.c: Include headers to make basic_block available. Move functions around such that related functions are near each other. Add prototypes for all static functions. Add comments briefly explaining what IR the mudflap1 and mudflap2 work on and what they do. (mudflap_function_decls): Rename to execute_mudflap_function_decls. (mudflap_function_ops): Rename to execute_mudflap_function_ops. (pass_mudflap_1, pass_mudflap_2): Update. (mf_decl_cache_locals): Make it work on the CFG instead of the saved function tree. (mf_build_check_statement_for): Make it work on the CFG. (mf_xform_derefs_1): Likewise. Cleanup code style. (mf_xform_derefs): Likewise. * tree-cfg.c (label_to_block): Invent the label destination for undefined labels. (cleanup_dead_labels): Update table in the case label_to_block added new label. From-SVN: r83385
2004-06-15alias.c (record_set, [...]): Use REG_P.Jerry Quinn1-8/+8
2004-06-15 Jerry Quinn <jlquinn@optonline.net> * alias.c (record_set, record_base_value, canon_rtx, get_addr, nonlocal_mentioned_p_1, init_alias_analysis): Use REG_P. * bt-load.c (find_btr_reference, insn_sets_btr_p, note_btr_set): Likewise. * builtins.c (expand_builtin_setjmp, expand_builtin_apply, expand_builtin_mathfn, expand_builtin_strlen, expand_builtin_memcmp, expand_builtin_strcmp, expand_builtin_strncmp, expand_builtin_frame_address): Likewise. * caller-save.c (mark_set_regs, add_stored_regs, mark_referenced_regs, insert_one_insn): Likewise. * calls.c (prepare_call_address, precompute_register_parameters, precompute_arguments, expand_call, emit_library_call_value_1): Likewise. * cfganal.c (flow_active_insn_p): Likewise. * combine.c (set_nonzero_bits_and_sign_copies, can_combine_p, combinable_i3pat, try_combine, find_split_point, COMBINE_RTX_EQUAL_P, subst, combine_simplify_rtx, simplify_if_then_else, simplify_set, make_extraction, recog_for_combine, gen_lowpart_for_combine, simplify_comparison, record_dead_and_set_regs_1, record_dead_and_set_regs, record_promoted_value, check_promoted_subreg, get_last_value_validate, get_last_value, reg_dead_at_p_1, reg_bitfield_target_p, distribute_notes, unmentioned_reg_p_1): Likewise. * conflict.c (mark_reg): Likewise. * cse.c (HASH, COST, COST_IN, approx_reg_cost_1, notreg_cost, mention_regs, insert_regs, lookup, lookup_for_remove, insert, merge_equiv_classes, flush_hash_table, invalidate, remove_invalid_refs, remove_invalid_subreg_refs, rehash_using_reg, invalidate_for_call, use_related_value, canon_hash, exp_equiv_p, cse_rtx_varies_p, canon_reg, find_best_addr, fold_rtx, equiv_constant, record_jump_cond, cse_insn, addr_affects_sp_p, invalidate_from_clobbers, cse_process_notes, cse_around_loop, cse_set_around_loop, count_reg_usage, set_live_p, cse_change_cc_mode, cse_cc_succs, cse_condition_code_reg): Likewise. * cselib.c (cselib_reg_set_mode, rtx_equal_for_cselib_p, cselib_lookup, cselib_invalidate_regno, cselib_invalidate_rtx, cselib_record_set, cselib_record_sets): Likewise. * dbxout.c (dbxout_symbol_location, dbxout_parms, dbxout_reg_parms, dbxout_block): Likewise. * df.c (df_ref_record, df_def_record_1, df_uses_record): Likewise. * dojump.c (do_jump): Likewise. * dwarf2out.c (dwarf2out_frame_debug_expr, is_pseudo_reg, is_based_loc, rtl_for_decl_location): Likewise. * emit-rtl.c (set_reg_attrs_for_parm, set_decl_rtl, set_decl_incoming_rtl, mark_user_reg): Likewise. * explow.c (copy_all_regs, copy_all_regs, memory_address, force_reg, copy_to_suggested_reg, allocate_dynamic_stack_space, probe_stack_range, hard_function_value): Likewise. * expmed.c (store_bit_field, store_fixed_bit_field, store_split_bit_field, extract_bit_field, extract_fixed_bit_field, extract_split_bit_field, expand_divmod, emit_store_flag_force): Likewise. * expr.c (convert_move, convert_modes, block_move_libcall_safe_for_call_parm, emit_group_load, use_reg, use_group_regs, emit_move_insn, emit_move_insn_1, compress_float_constant, push_block, emit_single_push_insn, emit_push_insn, get_subtarget, expand_assignment, store_expr, store_constructor, store_field, force_operand, safe_from_p, expand_expr_real_1, expand_increment, do_store_flag, do_tablejump): Likewise. * final.c (profile_function, final_scan_insn, alter_subreg, get_mem_expr_from_op, output_asm_operand_names, output_operand, only_leaf_regs_used, leaf_renumber_regs_insn): Likewise. * flow.c (verify_wide_reg_1, mark_regs_live_at_end, find_regno_partial, propagate_one_insn, init_propagate_block_info, insn_dead_p, libcall_dead_p, mark_set_1, not_reg_cond, attempt_auto_inc, find_auto_inc, mark_used_regs, count_or_remove_death_notes_bb): Likewise. * function.c (find_temp_slot_from_address, update_temp_slot_address, preserve_temp_slots, put_var_into_stack, fixup_var_refs_insn, fixup_var_refs_1, fixup_stack_1, optimize_bit_field, flush_addressof, put_addressof_into_stack, purge_addressof_1, insns_for_mem_walk, purge_single_hard_subreg_set, instantiate_decl, instantiate_virtual_regs_1, aggregate_value_p, assign_parms, promoted_input_arg, setjmp_vars_warning, setjmp_args_warning, setjmp_protect, setjmp_protect_args, fix_lexical_addr, expand_function_start, diddle_return_value, clobber_return_register, expand_function_end, keep_stack_depressed, handle_epilogue_set, update_epilogue_consts): Likewise. * genemit.c (gen_exp, gen_insn): Likewise. * genrecog.c (make_insn_sequence): Likewise. * global.c (global_conflicts, expand_preferences, mark_reg_store, mark_reg_conflicts, set_preference, reg_becomes_live, build_insn_chain, mark_reg_change): Likewise. * haifa_sched.c (CONST_BASED_ADDRESS_P, find_set_reg_weight): Likewise. * ifcvt.c (noce_try_abs, noce_get_condition, noce_process_if_block): Likewise. * integrate.c (copy_rtx_and_substitute, try_constants, subst_constants, mark_stores, allocate_initial_values): Likewise. * jump.c (reversed_comparison_code_parts, delete_prior_computation, delete_computation, rtx_renumbered_equal_p, true_regnum, reg_or_subregno): Likewise. * lcm.c (reg_dies, reg_becomes_live): Likewise. * local-alloc.c (validate_equiv_mem_from_store, validate_equiv_mem, update_equiv_regs, no_equiv, block_alloc, combine_regs, reg_is_set, wipe_dead_reg, no_conflict_p): Likewise. * loop-iv.c (simple_reg_p, simple_set_p, kill_sets, iv_get_reaching_def, iv_analyze_biv, altered_reg_used, mark_altered, simple_rhs_p, simplify_using_assignment, implies_p): Likewise. * loop.c (scan_loop, combine_movables, rtx_equal_for_loop_p, move_movables, note_set_pseudo_multiple_uses, consec_sets_invariant_p, find_single_use_in_loop, count_one_set, loop_bivs_init_find, loop_givs_rescan, check_insn_for_bivs, check_insn_for_givs, valid_initial_value_p, simplify_giv_expr, consec_sets_giv, loop_regs_update, check_dbra_loop, maybe_eliminate_biv, maybe_eliminate_biv_1, record_initial, update_reg_last_use, canonicalize_condition, loop_regs_scan, load_mems, try_copy_prop, try_swap_copy_prop): Likewise. * optabs.c (expand_binop, expand_vector_binop, expand_vector_unop, expand_abs, emit_no_conflict_block, emit_libcall_block, expand_float): Likewise. * postreload.c (reload_cse_simplify, reload_cse_simplify_set, reload_cse_simplify_operands, reload_combine, reload_combine_note_store, reload_combine_note_use, reload_cse_move2add, move2add_note_store): Likewise. * print-rtl.c (print_rtx): Likewise. * ra-build.c (copy_insn_p, remember_move, init_one_web_common, contains_pseudo, handle_asm_insn): Likewise. * ra-debug.c (ra_print_rtx_object, dump_constraints, dump_static_insn_cost): Likewise. * ra-rewrite.c (slots_overlap_p, emit_colors, remove_suspicious_death_notes): Likewise. * recog.c (validate_replace_rtx_1, find_single_use_1, find_single_use, register_operand, scratch_operand, nonmemory_operand, constrain_operands): Likewise. * reg-stack (check_asm_stack_operands, remove_regno_note, emit_swap_insn, swap_rtx_condition, subst_stack_regs_pat, subst_asm_stack_regs): Likewise. * regclass.c (scan_one_insn, record_reg_classes, copy_cost, record_address_regs, reg_scan_mark_refs): Likewise. * regmove.c (discover_flags_reg, replacement_quality, copy_src_to_dest, reg_is_remote_constant_p, regmove_optimize, fixup_match_1): Likewise. * regrename.c (note_sets, clear_dead_regs, build_def_use, kill_value, kill_set_value, copyprop_hardreg_forward_1): Likewise. * reload.c (MATCHES, push_secondary_reload, find_reusable_reload, reload_inner_reg_of_subreg, can_reload_into, push_reload, combine_reloads, find_dummy_reload, hard_reg_set_here_p, operands_match_p, decompose, find_reloads, find_reloads_toplev, find_reloads_address, subst_indexed_address, find_reloads_address_1, find_reloads_subreg_address, find_replacement, refers_to_regno_for_reload_p, reg_overlap_mentioned_for_reload_p, refers_to_mem_for_reload_p, find_equiv_reg, regno_clobbered_p): Likewise. * reload1.c (replace_pseudos_in, reload, calculate_needs_all_insns, find_reg, delete_dead_insn, alter_reg, eliminate_regs, elimination_effects, eliminate_regs_in_insn, scan_paradoxical_subregs, forget_old_reloads_1, reload_reg_free_for_value_p, choose_reload_regs, emit_input_reload_insns, emit_output_reload_insns, do_input_reload, do_output_reload, emit_reload_insns, gen_reload, delete_address_reloads_1, inc_for_reload): Likewise. * reorg.c (update_reg_dead_notes, fix_reg_dead_note, update_reg_unused_notes, fill_slots_from_thread): Likewise. * resource.c (update_live_status, mark_referenced_resources, mark_set_resources, mark_target_live_regs): Likewise. * rtlanal.c (nonzero_address_p, get_jump_table_offset, global_reg_mentioned_p_1, reg_mentioned_p, reg_referenced_p, reg_set_p, set_noop_p, find_last_value, refers_to_regno_p, note_stores, dead_or_set_p, dead_or_set_regno_p, find_regno_note, find_reg_fusage, find_regno_fusage, replace_regs, regno_use_in, parms_set, find_first_parameter_load, keep_with_call_p, hoist_test_store, hoist_update_store, address_cost, nonzero_bits1, num_sign_bit_copies1): Likewise. * rtlhooks.c (gen_lowpart_general): Likewise. * sched-deps.c (deps_may_trap_p, sched_analyze_1, sched_analyze_insn, sched_analyze): Likewise. * sched-rgn.c (check_live_1, update_live_1, sets_likely_spilled_1): Likewise. * sdbout.c (sdbout_symbol, sdbout_parms, sdbout_reg_parms): Likewise. * simplify-rtx.c (simplify_replace_rtx, simplify_unary_operation, simplify_binary_operation, simplify_const_relational_operation, simplify_subreg): Likewise. * stmt.c (decl_conflicts_with_clobbers_p, expand_asm_operands, expand_end_stmt_expr, expand_return, expand_decl, expand_anon_union_decl): Likewise. * unroll.c (precondition_loop_p, calculate_giv_inc, copy_loop_body, find_splittable_regs, find_splittable_givs, find_common_reg_term, loop_iterations): Likewise. * var-tracking.c (variable_union, variable_part_different_p, variable_different_p, count_uses, add_uses, add_stores, compute_bb_dataflow, set_variable_part, delete_variable_part, emit_notes_in_bb, vt_get_decl_and_offset, vt_add_function_parameters): Likewise. * varasm.c (assemble_variable): Likewise. From-SVN: r83195
2004-06-12fold-const.c (omit_two_operands): New function.Roger Sayle1-23/+62
* fold-const.c (omit_two_operands): New function. * tree.h (omit_two_operands): Prototype here. * builtins.c (fold_builtin_unordered_cmp): New function to lower C99 unordered comparison builtins to the appropriate tree nodes. (fold_builtin_1): Use fold_builtin_unordered_cmp to lower BUILT_IN_ISGREATER, BUILT_IN_ISGREATEREQUAL, BUILT_IN_ISLESS, BUILT_IN_ISLESSEQUAL and BUILT_IN_ISLESSGREATER. Manually lower BUILT_IN_ISUNORDERED comparisons to an UNORDERED_EXPR tree node. (simplify_builtin_memcmp, simplify_builtin_strncmp, simplify_builtin_strncat, simplify_builtin_strspn): Use the new omit_two_operands function to build the required COMPOUND_EXPRs. From-SVN: r83040
2004-06-10builtins.c (expand_builtin): Fall back to library function call for conj...Roger Sayle1-13/+23
* builtins.c (expand_builtin): Fall back to library function call for conj, conjf, conjl, creal, crealf, creall, cimag, cimagf and cimagl. (fold_builtin_1): Lower built-ins BUILT_IN_CONJ{,F,L} to CONJ_EXPR, BUILT_IN_CREAL{,F,L} to REALPART_EXPR, and BUILT_IN_CIMAG{,F,L} to IMAGPART_EXPR respectively. From-SVN: r82938
2004-06-10target.h (struct gcc_target): Change gimplify_va_arg_expr hook signature.Jason Merrill1-15/+22
* target.h (struct gcc_target): Change gimplify_va_arg_expr hook signature. * tree-gimple.h: Adjust. * config/alpha/alpha.c (alpha_gimplify_va_arg): Adjust. * config/i386/i386.c (ix86_gimplify_va_arg): Adjust. Use fold_convert. * config/ia64/ia64.c (ia64_gimplify_va_arg): Adjust. * config/rs6000/rs6000.c (rs6000_gimplify_va_arg): Adjust. Use COMPLEX_EXPR for complex numbers. Use fold_convert. * builtins.c (std_gimplify_va_arg_expr): Adjust. Use fold_convert. (gimplify_va_arg_expr): Return GS_ERROR in error case. Gimplify valist rather than calling stabilize_va_list. From-SVN: r82925
2004-06-10fold-const.c (fold_abs_const): Make extern.Roger Sayle1-10/+41
* fold-const.c (fold_abs_const): Make extern. * tree.h (fold_abs_const): Prototype here. * builtins.c (fold_builtin_fabs): New function to transform fabs, fabsf and fabsl builtins into ABS_EXPR tree nodes. (fold_builtin_abs): New function to transform abs, labs, llabs and imaxabs builtins into ABS_EXPR tree nodes. (expand_builtin): Fall back to a function call for abs, labs, llabs and imaxabs builtins that survive constant folding. (fold_builtin_1): Call fold_builtin_fabs for FABS, FABSF and FABSL, and fold_builtin_abs for ABS, LABS, LLABS and IMAXABS. From-SVN: r82916
2004-06-09Gimplify VA_ARG_EXPR into simpler forms.Jason Merrill1-6/+180
* target.h: Add gimplify_va_arg_expr hook. * target-def.h: Add TARGET_GIMPLIFY_VA_ARG_EXPR. * fold-const.c (build_fold_addr_expr) (build_fold_addr_expr_with_type): Move from gimplify.c. * tree.h: Declare them. * gimplify.c (gimplify_and_add): New fn. (build_addr_expr, build_addr_expr_with_type): Move to fold-const.c. (gimplify_array_ref_to_plus, gimplify_modify_expr) (gimplify_expr): Use build_fold_*. (copy_if_shared_r): Only mark VA_ARG_EXPR volatile if we don't know how to gimplify it. * builtins.c (std_gimplify_va_arg_expr): New fn. (dummy_object): New static fn. (gimplify_va_arg_expr): New fn. (stabilize_va_list): Use build_fold_*. * tree-gimple.h: Declare new fns. * config/i386/i386.c (TARGET_GIMPLIFY_VA_ARG_EXPR): Define. (ix86_gimplify_va_arg): New fn. * config/i386/ia64.c (TARGET_GIMPLIFY_VA_ARG_EXPR): Define. (ia64_gimplify_va_arg): New fn. * config/i386/rs6000.c (rs6000_gimplify_va_arg): New fn. (TARGET_GIMPLIFY_VA_ARG_EXPR): Define. * config/i386/sparc.c (sparc_gimplify_va_arg): New fn. * alias.c (get_varargs_alias_set): Just return 0 for now. * c-objc-common.c (c_tree_printer): Improve handling of %T. From-SVN: r82838
2004-06-07real.c (real_copysign): New function to implement libm's copysign.Roger Sayle1-3/+57
* real.c (real_copysign): New function to implement libm's copysign. * real.h (real_copysign): Prototype here. * fold-const.c (tree_expr_nonnegative_p): The result of sqrt, sqrtf and sqrtl can be negative, as sqrt(-0.0) = -0.0. Correct whitespace. * builtins.c (fold_builtin_isascii, fold_builtin_toascii, fold_builtin_isdigit): Add function prototypes. (fold_builtin_copysign): New function to fold copysign, copysignf and copysignl. Optimize copysign(x,x) as x. Evaluate copysign of constant arguments at compile-time using real_copysign. Fold copysign(X,Y) as fabs(X) if Y is always non-negative. (fold_builtin_1): Correct minor whitespace/style issues. Call fold_builtin_copysign for BUILT_IN_COPYSIGN{,F,L}. * gcc.dg/builtins-41.c: New test case. * gcc.dg/builtins-42.c: New test case. From-SVN: r82721
2004-06-02re PR tree-optimization/15738 ([tree-ssa] Convert strrchr(s, c) to strchr(s, ↵Kazu Hirata1-0/+15
c) if c is known to be 0) PR tree-optimization/15738. * builtins.c (fold_builtin_strchr): Transform strrchr (s, '\0') to strchr (s, '\0'). From-SVN: r82572
2004-05-31re PR tree-optimization/15743 (Fold index() at tree level.)Kazu Hirata1-0/+2
PR tree-optimization/15743. * builtins.c (fold_builtin_1): Fold index() and rindex(). From-SVN: r82491
2004-05-31* builtins.c: Add a prototype for fold_builtin_strchr().Kazu Hirata1-0/+1
From-SVN: r82477
2004-05-30re PR tree-optimization/14819 ([tree-ssa] strchr is not folded at tree-level)Steven Bosscher1-0/+47
PR tree-optimization/14819 * builtins.c (fold_builtin_strchr): New. (fold_builtin_1): Handle BUILT_IN_STRCHR and BUILT_IN_STRRCHR with fold_builtin_strchr(). From-SVN: r82464
2004-05-30bb-reorder.c, [...]: Fix comment formatting.Kazu Hirata1-2/+2
* bb-reorder.c, builtins.c, c-common.c, c-gimplify.c, c-incpath.c, cgraphunit.c, ddg.c, defaults.h, dwarf2out.c, expmed.c, flags.h, gcc.c, gensupport.c, gimplify.c, global.c, passes.c, reg-stack.c, target.h, toplev.c, tree-alias-ander.c, tree-alias-common.c, tree-cfg.c, tree-complex.c, tree-dfa.c, tree-eh.c, tree-mudflap.c, tree-mudflap.h, tree-outof-ssa.c, tree-phinodes.c, tree-pretty-print.c, tree-ssa-alias.c, tree-ssa-ccp.c, tree-ssa-live.c, tree-ssa-live.h, tree-ssa-pre.c, tree.h, value-prof.h, varasm.c: Fix comment formatting. From-SVN: r82463
2004-05-24re PR tree-optimization/14197 (Wrong code for bcopy/memmove (string-asm-2.c))Ulrich Weigand1-2/+15
PR tree-optimization/14197 * builtins.c: Include "tree-gimple.h" (readonly_data_expr): Use get_base_address. Make sure to call decl_readonly_section only on trees it can handle. * tree-gimple.c (get_base_address): Accept STRING_CST and CONSTRUCTOR expressions. * Makefile.in: Update dependencies. From-SVN: r82209
2004-05-22builtins.c (expand_builtin_strstr, [...]): Replace calls to build with calls ↵Roger Sayle1-142/+135
to build2, build3 or omit_one_operand. * builtins.c (expand_builtin_strstr, expand_builtin_strchr, expand_builtin_strrchr, expand_builtin_strpbrk, expand_builtin_mempcpy, expand_builtin_memcmp, expand_builtin_strcmp, expand_builtin_strncmp, expand_builtin_strcat, std_expand_builtin_va_start, std_expand_builtin_va_arg, expand_builtin_va_copy, expand_builtin_signbit, fold_builtin_cabs, fold_builtin_logarithm, fold_builtin_mempcpy, fold_builtin_signbit, fold_builtin_isascii, fold_builtin_toascii, fold_builtin_isdigit, fold_builtin_1, build_function_call_expr, simplify_builtin_strchr, simplify_builtin_strrchr, simplify_builtin_strpbrk, simplify_builtin_strncpy, simplify_builtin_memcmp, simplify_builtin_strcmp, simplify_builtin_strncmp, simplify_builtin_strncat, simplify_builtin_strspn, simplify_builtin_strcspn, simplify_builtin_fputs, simplify_builtin_sprintf): Replace calls to build with calls to build2, build3 or omit_one_operand. From-SVN: r82151
2004-05-21fold-const.c (fold, [...]): Use fold_convert instead of convert.Roger Sayle1-16/+16
* fold-const.c (fold, fold_relational_hi_lo, nondestructive_fold_binary_to_constant, fold_read_from_constant_string): Use fold_convert instead of convert. * builtins.c (simplify_builtin, simplify_builtin_strstr, simplify_builtin_strchr, simplify_builtin_strrchr, simplify_builtin_strpbrk): Use fold_convert instead of convert. From-SVN: r82102
2004-05-15builtins.c (simplify_builtin_strcpy): Avoid use of chainon...Roger Sayle1-6/+9
* builtins.c (simplify_builtin_strcpy): Avoid use of chainon, so that simplify_builtin doesn't destructively modify its argument. From-SVN: r81893
2004-05-13Merge tree-ssa-20020619-branch into mainline.Diego Novillo1-80/+1441
From-SVN: r81764
2004-05-07optabs.h (enum optab_index): Add new OTI_log1p.Uros Bizjak1-0/+7
* optabs.h (enum optab_index): Add new OTI_log1p. (log1p_optab): Define corresponding macro. * optabs.c (init_optabs): Initialize log1p_optab. * genopinit.c (optabs): Implement log1p_optab using log1p?f2 patterns. * builtins.c (expand_builtin_mathfn): Handle BUILT_IN_LOG1P{,F,L} using log1p_optab. (expand_builtin): Expand BUILT_IN_LOG1P{,F,L} using expand_builtin_mathfn if flag_unsafe_math_optimizations is set. * reg-stack.c (subst_stack_regs_pat): Handle UNSPEC_FYL2XP1. * config/i386/i386.c (ix86_emit_i387_log1p): New function. * config/i386/i386-protos.h (ix86_emit_i387_log1p): Prototype here. * config/i386/i386.md (UNSPEC_FYL2XP1): New unspec to represent x87's fyl2xp1 instruction. (*fyl2x_xf3): Rename insn definition to fyl2x_xf3. (fyl2xp1_xf3): New pattern to implement fyl2xp1 x87 instruction. (log1psf2, log1pdf2, log1pxf2): New expanders to implement log1pf, log1p and log1pl built-ins as inline x87 intrinsics. * testsuite/gcc.dg/builtins-33.c: Also check log1p*. From-SVN: r81606
2004-05-06optabs.h (enum optab_index): Add new OTI_fmod and OTI_drem.Uros Bizjak1-0/+14
* optabs.h (enum optab_index): Add new OTI_fmod and OTI_drem. (fmod_optab): Define corresponding macros. * optabs.c (init_optabs): Initialize fmod_optab and drem_optab. * genopinit.c (optabs): Implement fmod_optab and drem_optab using fmod?f3 and drem?f3 patterns. * builtins.c (expand_builtin_mathfn_2): Handle BUILT_IN_FMOD{,F,L} using fmod_optab and BUILT_IN_DREM{,F,L} using drem_optab. (expand_builtin): Expand BUILT_IN_FMOD{,F,L} and BUILT_IN_DREM{,F,L} using expand_builtin_mathfn_2 if flag_unsafe_math_optimizations is set. * reg-stack.c (subst_stack_regs_pat): Handle UNSPEC_FPREM_F, UNSPEC_FPREM_U, UNSPEC_FPREM1_F and UNSPEC_FPREM1_U. * config/i386/i386.c (ix86_emit_fp_unordered_jump): New function. * config/i386/i386-protos.h (ix86_emit_fp_unordered_jump): Prototype here. * config/i386/i386.md (UNSPEC_FPREM_F, UNSPEC_FPREM_U, UNSPEC_FPREM1_F, UNSPEC_FPREM1_U): New unspecs to represent x87's fprem and fprem1 instructions. (*x86_fnstsw_1): Change input parameter to (reg:CCFP 18). Rename insn definition to x86_fnstsw_1. (fpremxf4, fprem1xf4): New patterns to implement fprem and fprem1 x87 instructions. (fmodsf3, fmoddf3, fmodxf3): New expanders to implement fmodf, fmod and fmodl built-ins as inline x87 intrinsics. (dremsf3, dremdf3, dremxf3): New expanders to implement dremf, drem and dreml built-ins as inline x87 intrinsics. * testsuite/gcc.dg/builtins-40.c: New test. From-SVN: r81555
2004-05-03optabs.h (enum optab_index): Add new OTI_expm1.Uros Bizjak1-0/+7
2004-05-03 Uros Bizjak <uros@kss-loka.si> * optabs.h (enum optab_index): Add new OTI_expm1. (expm1_optab): Define corresponding macro. * optabs.c (init_optabs): Initialize expm1_optab. * genopinit.c (optabs): Implement expm1_optab using expm1?f2 patterns. * builtins.c (expand_builtin_mathfn): Handle BUILT_IN_EXPM1{,F,L} using expm1_optab. (expand_builtin): Expand BUILT_IN_EXPM1{,F,L} using expand_builtin_mathfn if flag_unsafe_math_optimizations is set. * config/i386/i386.md (expm1df2, expm1sf2, expm1xf2): New expanders to implement expm1, expm1f and expm1l built-ins as inline x87 intrinsics. testsuite: * gcc.dg/builtins-34.c: Also check expm1*. From-SVN: r81425
2004-05-02builtins.c (fold_fixed_mathfn): New function.Kaveh R. Ghazi1-1/+48
* builtins.c (fold_fixed_mathfn): New function. (fold_builtin_lround, fold_builtin): Use it. testsuite: * gcc.dg/torture/builtin-integral-1.c: Reorg and add more cases. * gcc.dg/torture/builtin-convert-3.c: New test. From-SVN: r81403
2004-05-01builtins.c (fold_builtin_round): Fix comment typo.Kaveh R. Ghazi1-1/+45
* builtins.c (fold_builtin_round): Fix comment typo. (fold_builtin_lround): New function. (fold_builtin): Use it. testsuite: * gcc.dg/torture/builtin-rounding-1.c: New test. * gcc.dg/builtins-25.c: Delete. * gcc.dg/builtins-29.c: Delete. From-SVN: r81380
2004-04-29builtins.c, [...]: Fix comment typos.Kazu Hirata1-1/+1
* builtins.c, cgraph.c, cgraphunit.c, final.c, fold-const.c: Fix comment typos. From-SVN: r81291
2004-04-26builtins.c (expand_builtin_update_setjmp_buf): New function.Richard Kenner1-0/+48
* builtins.c (expand_builtin_update_setjmp_buf): New function. (expand_builtin, case BUILT_IN_UPDATE_SETJMP_BUF): New case. * builtins.def (BUILT_IN_UPDATE_SETJMP_BUF): New code. From-SVN: r81198
2004-04-23Makefile.in (LIBGCOV): Add _gcov_fork...Zdenek Dvorak1-0/+74
* Makefile.in (LIBGCOV): Add _gcov_fork, _gcov_execl, _gcov_execlp, _gcov_execle, _gcov_execv, _gcov_execvp, _gcov_execve. * builtin-types.def (BT_PID, BT_PTR_CONST_STRING, BT_FN_PID, BT_FN_INT_CONST_STRING_PTR_CONST_STRING, BT_FN_INT_CONST_STRING_PTR_CONST_STRING_PTR_CONST_STRING): New. * builtins.c (expand_builtin_fork_or_exec): New. (expand_builtin): Call it. * builtins.def (BUILT_IN_EXECL, BUILT_IN_EXECLP,BUILT_IN_EXECLE, BUILT_IN_EXECV, BUILT_IN_EXECVP, BUILT_IN_EXECVE, BUILT_IN_FORK): New. * c-common.c (PID_TYPE): New macro. (c_common_nodes_and_builtins): Initialize pid_type_node. * calls.c (special_function_p): Do not handle fork and exec. (expand_call): Do not handle ECF_FORK_OR_EXEC. * gcov-io.h (__gcov_fork, __gcov_execl, __gcov_execlp, __gcov_execle, __gcov_execv, __gcov_execvp, __gcov_execve): Declare. * libgcov.c (__gcov_fork, __gcov_execl, __gcov_execlp, __gcov_execle, __gcov_execv, __gcov_execvp, __gcov_execve): New. * tree.h (enum tree_index): Add TI_PID_TYPE. (pid_type_node): New macro. (ECF_FORK_OR_EXEC): Removed. From-SVN: r81118
2004-04-20optabs.h (enum optab_index): Add new OTI_asin and OTI_acos.Uros Bizjak1-0/+14
2004-04-20 Uros Bizjak <uros@kss-loka.si> * optabs.h (enum optab_index): Add new OTI_asin and OTI_acos. (asin_optab, acos_optab): Define corresponding macros. * optabs.c (init_optabs): Initialize asin_optab and acos_optab. * genopinit.c (optabs): Implement asin_optab and acos_optab using asin?f2 and acos?f2 patterns. * builtins.c (expand_builtin_mathfn): Handle BUILT_IN_ASIN{,F,L} using asin_optab, and BUILT_IN_ACOS{,F,L} using acos_optab. (expand_builtin): Expand BUILT_IN_ASIN{,F,L} and BUILT_IN_ACOS{,F,L} using expand_builtin_mathfn if flag_unsafe_math_optimizations is set. * config/i386/i386.md (asindf2, asinsf2, asinxf2, acosdf2, acossf2, acosxf2): New expanders to implement asin, asinf, asinl, acos, acosf and acosl built-ins as inline x87 intrinsics. * gcc.dg/builtins-39.c: New test. From-SVN: r80921
2004-04-20fold-const.c (fold_convert): Make function extern/public.Roger Sayle1-42/+41
* fold-const.c (fold_convert): Make function extern/public. * tree.h (fold_convert): Prototype here. * builtins.c (expand_builtin_strstr, expand_builtin_strchr, expand_builtin_strrchr, expand_builtin_strpbrk, expand_builtin_mempcpy, expand_builtin_bcopy, expand_builtin_bzero, expand_builtin_memcmp, expand_builtin_strcmp, expand_builtin_strncmp, stabilize_va_list, expand_builtin_sprintf, fold_trunc_transparent_mathfn, fold_builtin_logarithm, fold_builtin_exponent, fold_builtin_mempcpy, fold_builtin_strcpy, fold_builtin_strcmp, fold_builtin_strncmp, fold_builtin_signbit, fold_builtin_isdigit, fold_builtin): Prefer fold_convert to "convert" or "fold (build1 (NOP_EXPR, ...))". From-SVN: r80878
2004-04-19builtins.c (fold_builtin_cabs): Remove fndecl parameter.Andrew Pinski1-6/+6
* builtins.c (fold_builtin_cabs): Remove fndecl parameter. (fold_builtin): Update caller to match. From-SVN: r80850