Commit Graph

31652 Commits

Author SHA1 Message Date
Paolo Bonzini ad12460bed pointer-set.c (insert_aux): Only return insertion slot.
2007-02-02  Paolo Bonzini  <bonzini@gnu.org>

	* pointer-set.c (insert_aux): Only return insertion slot.
	(pointer_set_insert): Adjust.
	(pointer_set_traverse, struct pointer_map_t, pointer_map_create,
	pointer_map_destroy, pointer_map_insert, pointer_map_contains,
	pointer_map_traverse): New.
	* pointer-set.h (pointer_set_traverse, struct pointer_map_t,
	pointer_map_create,  pointer_map_destroy, pointer_map_insert,
	pointer_map_contains, pointer_map_traverse): Declare.

From-SVN: r121507
2007-02-02 16:21:18 +00:00
Jakub Jelinek 6b01cd54dd re PR middle-end/30473 (Internal Compiler Error with a sprintf with few arguments for format %s)
PR middle-end/30473
	* builtins.c (fold_builtin_sprintf): Do not attempt to optimize
	sprintf (str, "%s").  Do not optimize sprintf (str, "nopercent", p++).

	* gcc.dg/pr30473.c: New test.
	* gcc.c-torture/execute/20070201-1.c: New test.

From-SVN: r121495
2007-02-02 13:21:13 +01:00
Maxim Kuvyrkov b198261f9c re PR middle-end/28071 (A file that can not be compiled in reasonable time/space)
* sched-int.h (ds_to_dk, dk_to_ds): Declare functions.
	
	(struct _dep): New type.
	(dep_t): New typedef.
	(DEP_PRO, DEP_CON, DEP_KIND): New access macros.
	(DEP_STATUS): New access macro.  The macro with the same name was
	renamed to DEP_LINK_STATUS.
	(dep_init): Declare function

	(struct _dep_link): New type.
	(dep_link_t): New typedef.
	(DEP_LINK_NODE, DEP_LINK_NEXT, DEP_LINK_PREV_NEXTP): New access macros.
	(DEP_LINK_DEP, DEP_LINK_PRO, DEP_LINK_CON, DEP_LINK_KIND): New macros.
	(DEP_LINK_STATUS): New macro.
	(debug_dep_links): New debug function.

	(struct _deps_list): New type.
	(deps_list_t): New typedef.
	(DEPS_LIST_FIRST): New access macro.
	(FOR_EACH_DEP_LINK): New cycle macro.
	(create_deps_list, free_deps_list, delete_deps_list): Declare
	functions.
	(deps_list_empty_p, debug_deps_list, add_back_dep_to_deps_list): Ditto.
	(find_link_by_pro_in_deps_list, find_link_by_con_in_deps_list): Ditto.
	(copy_deps_list_change_con): Ditto.

	(move_dep_link): Declare function.

	(struct _dep_node): New type.
	(dep_node_t): New typedef.
	(DEP_NODE_BACK, DEP_NODE_DEP, DEP_NODE_FORW): New access macros.

	(struct haifa_insn_data.back_deps): New field to hold backward
	dependencies of the insn.
	(struct haifa_insn_data.depend): Rename to forw_deps.  Change its type
	to deps_list_t.
	(struct haifa_insn_data.resolved_deps): Rename to resolved_back_deps.
	Change its type	to deps_list_t.
	(INSN_BACK_DEPS): New access macro to use instead of LOG_LINKS.
	(INSN_DEPEND): Rename to INSN_FORW_DEPS.
	(RESOLVED_DEPS): Rename to INSN_RESOLVED_BACK_DEPS.

	(INSN_COST): Move to haifa-sched.c.  Use insn_cost () instead.
	
	(DEP_STATUS): Rename to DEP_LINK_STATUS.  Fix typo in the comment.

	(add_forw_dep, delete_back_forw_dep, insn_cost): Update declaration and
	all callers.
	(dep_cost): Declare.
	
	* sched-deps.c (CHECK): New macro to (en/dis)able sanity checks.
	(ds_to_dk, dk_to_ds): New functions.
	
	(init_dep_1): New static function.
	(init_dep): New function.
	(copy_dep): New static function.
	
	(dep_link_consistent_p, attach_dep_link, add_to_deps_list): New static
	functions.
	(detach_dep_link): New static function.
	(move_dep_link): New function.
	
	(dep_links_consistent_p, dump_dep_links): New static functions.
	(debug_dep_links): New debugging function.
	
	(deps_obstack, dl_obstack, dn_obstack): New static variables.
	
	(alloc_deps_list, init_deps_list): New static functions.
	(create_deps_list): New function.
	(clear_deps_list): New static function.
	(free_deps_list, delete_deps_list, deps_list_empty_p): New functions.
	(deps_list_consistent_p, dump_deps_list): New static functions.
	(debug_deps_list): New function.
	(add_back_dep_to_deps_list, find_link_by_pro_in_deps_list): New
	functions.
	(find_link_by_con_in_deps_list, copy_deps_list_change_con): Ditto.

	(maybe_add_or_update_back_dep_1, add_or_update_back_dep_1): Update to
	use new scheduler dependencies lists.
	(add_back_dep, delete_all_dependences, fixup_sched_groups): Ditto.
	(sched_analyze): Ditto.  Initialize dependencies lists.
	(add_forw_dep, compute_forward_dependences): Update to use new
	scheduler dependencies lists.
	
	(init_dependency_caches): Init deps_obstack.
	(free_dependency_caches): Free deps_obstack.
	
	(adjust_add_sorted_back_dep, adjust_back_add_forw_dep): Update to use
	new scheduler dependencies lists.
	(delete_forw_dep, add_or_update_back_forw_dep): Ditto.
	(add_back_forw_dep, delete_back_forw_dep): Ditto.

	* sched-rgn.c (set_spec_fed, find_conditional_protection, is_pfree):
	Update to use new scheduler dependencies lists.
	(is_conditionally_protected, is_prisky, add_branch_dependences): Ditto.
	(debug_dependencies): Ditto.
	(schedule_region): Update comments.
	
	* sched-ebb.c (earliest_block_with_similiar_load): Update to use new
	scheduler dependencies lists.
	(schedule_ebb): Update comments.
	
	* rtl.def (DEPS_LIST): Remove.
	
	* lists.c (unused_deps_list): Remove.
	(free_list): Update assertions.
	
	(alloc_DEPS_LIST, free_DEPS_LIST_list, free_DEPS_LIST_node): Remove.
	(remove_free_DEPS_LIST_elem, copy_DEPS_LIST_list): Ditto.

	* rtl.h (free_DEPS_LIST_list, alloc_DEPS_LIST): Remove declarations.
	(remove_free_DEPS_LIST_elem, copy_DEPS_LIST_list): Ditto.
	
	* haifa-sched.c (comments): Update.
	(insn_cost1): Remove.  Inline the code into insn_cost ().
	(insn_cost): Update to use new scheduler dependencies lists.  Move
	processing of the dependency cost to dep_cost ().
	(dep_cost): New function.  Use it instead of insn_cost () when
	evaluating cost of the dependency.  Use compatible interface to
	interact with the target.
	(priority): Update to use new scheduler dependencies lists.
	(rank_for_schedule): Ditto.  Optimize heuristic that prefers the insn
	with greater number of insns that depend on the insn.
	(schedule_insn): Update to use new scheduler dependencies lists.  Add
	code to free backward dependencies lists.  Inline and optimize code
	from resolve_dep () - see PR28071.
	(ok_for_early_queue_removal): Update to use new scheduler dependencies
	lists.  Update call to targetm.sched.is_costly_dependence hook.
	
	(fix_inter_tick, try_ready, fix_tick_ready): Update to use new
	scheduler dependencies lists.
	
	(resolve_dep): Remove.  Move the logic to schedule_insn ().
	(init_h_i_d): Initialize dependencies lists.
	
	(process_insn_depend_be_in_spec): Rename to
	process_insn_forw_deps_be_in_spec.  Update to use new scheduler
	dependencies lists.
	(add_to_speculative_block, create_check_block_twin, fix_recovery_deps):
	Update to use new scheduler dependencies lists.
	(clear_priorities, calc_priorities, add_jump_dependencies): Ditto.
	
	* ddg.c (create_ddg_dependence, create_ddg_dep_no_link): Update to use
	new scheduler dependencies lists.
	(build_intra_loop_deps): Ditto.
	
	* target.h (struct _dep): Declare to use in
	gcc_target.sched.is_costly_dependence.
	(struct gcc_target.sched.adjust_cost): Fix typo.
	(struct gcc_target.sched.is_costly_dependence): Change signature to use
	single dep_t parameter instead of an equivalent triad.
	(struct gcc_target.sched.adjust_cost_2): Remove.

	* target-def.h (TARGET_SCHED_ADJUST_COST_2): Remove.

	* reg-notes.def (DEP_TRUE, DEP_OUTPUT, DEP_ANTI): Update comments.

	* doc/tm.texi (TARGET_SCHED_IS_COSTLY_DEPENDENCE): Update
	documentation.
	(TARGET_SCHED_ADJUST_COST_2): Remove documentation.

	* doc/rtl.texi (LOG_LINKS): Remove part about instruction scheduler.
	(REG_DEP_TRUE): Document.
	
	* config/ia64/ia64.c (ia64_adjust_cost_2): Rename to ia64_adjust_cost.
	Change signature to correspond to the targetm.sched.adjust_cost hook.  
	Update use in TARGET_SCHED_ADJUST_COST_2.
	(TARGET_SCHED_ADJUST_COST_2): Rename to TARGET_SCHED_ADJUST_COST.
	(ia64_dependencies_evaluation_hook, ia64_dfa_new_cycle): Update to use
	new scheduler dependencies lists.
	(ia64_gen_check): Ditto.

	* config/mips/mips.c (vr4130_swap_insns_p): Update to use new scheduler
	dependencies lists.
	
	* config/rs6000/rs6000.c (rs6000_is_costly_dependence): Change
	signature to correspond to the targetm.sched.is_costly_dependence hook.
	(is_costly_group): Update to use new scheduler dependencies lists.

	* config/spu/spu.c (spu_sched_adjust_cost): Use insn_cost () function
	instead of INSN_COST () macro.

From-SVN: r121494
2007-02-02 09:11:11 +00:00
Ian Lance Taylor 9a5a8e58d2 * lower-subreg.c (resolve_clobber): Handle a subreg of a concatn.
From-SVN: r121493
2007-02-02 07:20:35 +00:00
Guy Martin 546dcc4352 pa.md (tp_load): Correct mfctl instruction syntax.
* pa.md (tp_load): Correct mfctl instruction syntax.

From-SVN: r121487
2007-02-02 02:09:36 +00:00
Geoffrey Keating 9278121c0f rs6000.c (rs6000_stack_info): Correct altivec_padding_size calculation on AIX.
* config/rs6000/rs6000.c (rs6000_stack_info): Correct
	altivec_padding_size calculation on AIX.  Improve comment, add
	assert to verify that it's right.

From-SVN: r121485
2007-02-02 01:47:02 +00:00
Geoffrey Keating 7c40d6662b darwin.h (MD_UNWIND_SUPPORT): Don't define for 64-bit.
* config/rs6000/darwin.h (MD_UNWIND_SUPPORT): Don't define for
	64-bit.

From-SVN: r121484
2007-02-02 01:37:53 +00:00
Seongbae Park 9012cdf36a 2007-2-01 Seongbae Park <seongbae.park@gmail.com>
PR inline-asm/28686
	* global.c (global_alloc): Add mising initialization of
	ELIMINABLE_REGSET.

2007-02-01  Roger Sayle  <roger@eyesopen.com>

From-SVN: r121477
2007-02-01 23:15:13 +00:00
Roger Sayle 62e5bf5d42 alias.c (init_alias_analysis): Correct whitespace.
* alias.c (init_alias_analysis): Correct whitespace.
	* bb-reorder.c (fix_edges_for_rarely_executed_code,
	partition_hot_cold_basic_blocks): Likewise.
	* builtins.c (expand_builtin_printf, expand_builtin_fprintf,
	expand_builtin_sprintf, fold_builtin_carg, fold_builtin_sprintf,
	maybe_emit_sprintf_chk_warning, fold_builtin_sprintf_chk,
	fold_builtin_snprintf_chk, fold_builtin_printf,
	fold_builtin_fprintf, do_mpfr_ckconv, do_mpfr_arg1, do_mpfr_arg2,
	do_mpfr_arg3, do_mpfr_sincos): Likewise.
	* cfgcleanup.c (cleanup_cfg): Likewise.
	* cfgexpand.c (tree_expand_cfg): Likewise.
	* fold-const.c (fold_binary) <RDIV_EXPR>: Likewise.
	* function.c (get_next_funcdef_no): Likewise.
	* gengtype.c (main): Likewise.
	* genmodes.c (main): Likewise.
	* gcse.c (bypass_conditional_jumps, print_ldst_list): Likewise.
	* haifa-sched.c (schedule_block, extend_h_i_d): Likewise.
	* ifcvt.c (noce_emit_move_insn): Likewise.
	* modulo-sched.c (generate_prolog_epilog, sms_schedule_by_order):
	Likewise.
	* stor-layout.c (get_best_mode): Likewise.
	* tree-ssa-loop-niter.c (get_val_for): Likewise.
	* tree-ssa-structalias.c (get_varinfo, get_varinfo_fc,
	scc_visit, do_ds_constraint, do_complex_constraint, label_visit,
	perform_var_substitution, solve_graph): Likewise.
	* tree-vrp.c (vrp_finalize): Likewise.

From-SVN: r121470
2007-02-01 20:32:20 +00:00
Ian Lance Taylor 0e6c5b5854 lower-subreg.c (simplify_gen_subreg_concatn): If we ask for the high part of a paradoxical subreg, return a constant zero.
* lower-subreg.c (simplify_gen_subreg_concatn): If we ask for the
	high part of a paradoxical subreg, return a constant zero.

From-SVN: r121466
2007-02-01 16:43:20 +00:00
Zdenek Dvorak c0d919fa35 toplev.c (lang_dependent_init): Call init_set_costs.
* toplev.c (lang_dependent_init): Call init_set_costs.
	* loop-init.c (loop_optimizer_init): Do not call init_set_costs.

From-SVN: r121464
2007-02-01 14:57:08 +00:00
Richard Guenther ee7d8048d5 re PR middle-end/30656 (ICE with -ftrapv)
2007-02-01  Richard Guenther  <rguenther@suse.de>

	PR middle-end/30656
	* fold-const.c (fold_negate_expr): Allow negating a
	constant if overflow does not change.

From-SVN: r121460
2007-02-01 10:27:17 +00:00
Ralf Wildenhues ab873839aa c-tree.texi (Expression trees): Improve markup.
2007-01-31  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>

	* doc/c-tree.texi (Expression trees): Improve markup.
	* doc/tm.texi (Register Classes, Addressing Modes)
	(Floating Point): Fix spacing after abbreviations.  Fix some
	typos.

From-SVN: r121457
2007-01-31 21:36:17 -08:00
Ben Elliston b818de221c invoke.texi: Replace "bugfix" with "bug fix" throughout.
* doc/invoke.texi: Replace "bugfix" with "bug fix" throughout.
	* doc/contrib.texi: Likewise.
	* doc/install.texi: Likewise.

From-SVN: r121455
2007-02-01 14:05:18 +11:00
Ian Lance Taylor e53a16e75f lower-subreg.c: New file.
gcc/:
	* lower-subreg.c: New file.
	* rtl.def (CONCATN): Define.
	* passes.c (init_optimization_passes): Add pass_lower_subreg and
	pass_lower_subreg2.
	* emit-rtl.c (update_reg_offset): New static function, broken out
	of gen_rtx_REG_offset.
	(gen_rtx_REG_offset): Call update_reg_offset.
	(gen_reg_rtx_offset): New function.
	* regclass.c: Revert patch of 2006-03-05, restoring
	reg_scan_update.
	(clear_reg_info_regno): New function.
	* dwarf2out.c (concatn_loc_descriptor): New static function.
	(loc_descriptor): Handle CONCATN.
	* common.opt (fsplit_wide_types): New option.
	* opts.c (decode_options): Set flag_split_wide_types when
	optimizing.
	* timevar.def (TV_LOWER_SUBREG): Define.
	* rtl.h (gen_reg_rtx_offset): Declare.
	(reg_scan_update): Declare.
	* regs.h (clear_reg_info_regno): Declare.
	* tree-pass.h (pass_lower_subreg): Declare.
	(pass_lower_subreg2): Declare.
	* doc/invoke.texi (Option Summary): List -fno-split-wide-types.
	(Optimize Options): Add -fsplit-wide-types to -O1 list.  Document
	-fsplit-wide-types.
	* doc/rtl.texi (Regs and Memory): Document concat and concatn.
	* Makefile.in (OBJS-common): Add lower-subreg.o.
	(lower-subreg.o): New target.
gcc/testsuite/:
	* gcc.dg/lower-subreg-1.c (test): New test.

From-SVN: r121453
2007-02-01 01:09:35 +00:00
Kazu Hirata 52f7138e13 * config/sh/sh.h (HAVE_SECONDARY_RELOADS): Remove.
From-SVN: r121443
2007-01-31 23:46:54 +00:00
Anatoly Sokolov d1fc69e4a5 re PR target/19087 (Overflowed address in dwarf debug line information)
PR target/19087
	* config/avr/avr.c (DWARF2_ADDR_SIZE): Define.

From-SVN: r121426
2007-01-31 20:23:49 +03:00
Kaveh R. Ghazi 4fc7842350 re PR middle-end/29335 (transcendental functions with constant arguments should be resolved at compile-time)
PR middle-end/29335
	* builtins.c (fold_builtin_sqrt): Use MPFR for constant args.

testsuite:
	* gcc.dg/torture/builtin-math-2.c: Add sqrt cases.
	* gcc.dg/torture/builtin-math-3.c: Likewise.

From-SVN: r121423
2007-01-31 15:06:19 +00:00
Zdenek Dvorak 677cc14d2d cfgloop.h: Include vec-prim.h.
* cfgloop.h: Include vec-prim.h.
	(enum li_flags): Remove LI_ONLY_OLD.
	(loop_iterator): Changed.
	(fel_next, fel_init): Iterate over loop tree.
	(FOR_EACH_LOOP_BREAK): New macro.
	* loop-unswitch.c (unswitch_loops): Do not pass LI_ONLY_OLD to
	FOR_EACH_LOOP.
	* tree-ssa-loop-unswitch.c (tree_ssa_unswitch_loops): Ditto.
	* modulo-sched.c (sms_schedule): Ditto.
	* tree-vectorizer.c (vectorize_loops): Ditto.
	* doc/loop.texi: Update information on loop numbering and behavior of
	FOR_EACH_LOOP wrto new loops.
	* tree-scalar-evolution.c (compute_overall_effect_of_inner_loop,
	add_to_evolution_1): Test nestedness of loops instead of comparing
	their numbers.
	* tree-chrec.c (chrec_fold_plus_poly_poly,
	chrec_fold_multiply_poly_poly, chrec_evaluate,
	hide_evolution_in_other_loops_than_loop, chrec_component_in_loop_num,
	reset_evolution_in_loop): Ditto.
	* Makefile.in (CFGLOOP_H): Add vecprim.h dependency.

From-SVN: r121422
2007-01-31 13:50:06 +00:00
Dirk Mueller e7917d06e8 c-common.c (warn_about_parentheses): Separate warning about un-parenthized sequence of comparison operators from the...
2007-01-31  Dirk Mueller  <dmueller@suse.de>

        * c-common.c (warn_about_parentheses): Separate warning about
        un-parenthized sequence of comparison operators from the one
        which is supposed to warn about x <= y <= z.

        * testsuite/gcc.dg/Wparentheses-2.c: Update and add new tests.

From-SVN: r121421
2007-01-31 13:43:40 +00:00
Uros Bizjak 9ed4207fce optabs.h (enum optab_index): Add new OTI_isinf.
* optabs.h (enum optab_index): Add new OTI_isinf.
	(isinf_optab): Define corresponding macro.
	* optabs.c (init_optabs): Initialize isinf_optab.
	* genopinit.c (optabs): Implement isinf_optab using isinf?f2
	patterns.
	* builtins.c (mathfn_built_in): Handle BUILT_IN_ISINF{,F,L}.
	(expand_builtin_interclass_mathfn): Expand BUILT_IN_ISINF{,F,L}
	using isinf_optab.
	(expand_builtin): Expand BUILT_IN_ISINF{,F,L} using
	expand_builtin_interclass_mathfn.
	* reg_stack.c (subst_stack_regs_pat): Handle UNSPEC_FXAM.
	* config/i386/i386.md (UNSPEC_FXAM): New constant.
	(fxam<mode>2_i387): New insn pattern.
	(isinf<mode>2) New expander to implement isinf, isinff and isinfl
	built-in functions as x87 inline asm.

testsuite/ChangeLog:

	* gcc.dg/builtins-63.c: New test.

From-SVN: r121419
2007-01-31 13:30:20 +01:00
Kazu Hirata c9cde24cd1 * gcc/config/arm/unwind-arm.h (_sleb128_t, _uleb128_t): New.
From-SVN: r121377
2007-01-31 05:23:09 +00:00
Eric Christopher 537bbabdc3 config.gcc: Add geode.
2007-01-30  Eric Christopher  <echristo@apple.com>

	* config.gcc: Add geode.

From-SVN: r121376
2007-01-31 05:16:23 +00:00
Kazu Hirata 88512ba0b8 cgraphunit.c, [...]: Fix comment typos.
* cgraphunit.c, config/arm/arm.c, config/m68k/m68k.c,
	ipa-inline.c, tree-profile.c, tree-ssa-live.c,
	tree-ssa-math-opts.c, tree-ssanames.c, tree-vect-analyze.c,
	value-prof.c: Fix comment typos.

From-SVN: r121374
2007-01-31 03:45:38 +00:00
Manuel López-Ibáñez b9edb4b11c re PR c++/24745 (unpleasant warning for "if (NULL)")
2007-01-30  Manuel Lopez-Ibanez  <manu@gcc.gnu.org>

	PR c++/24745
	* doc/invoke.texi (Wpointer-arith): Document warning.

cp/
	* typeck.c (build_binary_op): Fix logic for warning. Move warning
	to -Wpointer-arith.
	* call.c (convert_like_real): Don't warn when converting to
	boolean type.

testsuite/
	* g++.dg/warn/null4.C: New.

From-SVN: r121361
2007-01-30 22:29:11 +00:00
Janis Johnson 05f182f63a extend.texi (Decimal Floating Types): Remove decfloat.h from the list of discrepancies from the draft TR.
* doc/extend.texi (Decimal Floating Types): Remove decfloat.h from
	the list of discrepancies from the draft TR.

From-SVN: r121358
2007-01-30 20:23:25 +00:00
Dirk Mueller 01a40464d4 re PR c++/30601 (-Wreturn-type warns about more than what the documentation says)
2007-01-30  Dirk Mueller  <dmueller@suse.de>

       PR c++/30601
       * doc/invoke.texi (-Wreturn-type): Update description to
       match new behavior.

From-SVN: r121342
2007-01-30 16:20:06 +00:00
Richard Sandiford 9caea4a72f cfgrtl.c (try_redirect_by_replacing_jump): Check only_sets_cc0_p.
gcc/
	* cfgrtl.c (try_redirect_by_replacing_jump): Check only_sets_cc0_p.

From-SVN: r121339
2007-01-30 15:07:34 +00:00
Uros Bizjak eaee446477 builtins.c (expand_builtin_int_interclass_roundingfn): New function to handle optabs that operate on floating point input argument and...
* builtins.c (expand_builtin_int_interclass_roundingfn): New function
	to handle optabs that operate on floating point input argument and
	output to integer output.
	(expand_builtin_mathfn) [BUILT_IN_ILOGB]: Move from here ...
	(expand_builtin_interclass_mathfn) [BUILT_IN_ILOGB]: ... to here.
	(expand_builtin): Expand BUILT_IN_ILOGB{,F,L} using
	expand_builtin_interclass_mathfn ().
	* config/i386/i386.md (fxtractxf3_i387): Rename from *fxtractxf3_i387.
	(ilogbsi2): Remove.
	(ilogbxf2, ilogb<mode>2): New expanders to implement ilogb, ilogbf and
	ilogbl built-in functions as x87 intrinsics.

From-SVN: r121336
2007-01-30 12:20:07 +01:00
Richard Guenther 9b1959ffca re PR middle-end/27657 (bogus undefined reference error to static var with -g and -O)
2007-01-30  Richard Guenther  <rguenther@suse.de>

	PR middle-end/27657
	* dwarf2out.c (reference_to_unused): Query varpool if the
	variable was output.

	* g++.dg/debug/pr27657.C: New testcase.

From-SVN: r121335
2007-01-30 10:23:01 +00:00
Richard Guenther 91851351be re PR c/30313 (sizeof of expression including bit-field)
2007-01-30  Richard Guenther  <rguenther@suse.de>

	PR middle-end/30313
	* passes.c (execute_one_pass): Reset in_gimple_form to not
	confuse non-unit-at-a-time mode.

	* gcc.dg/torture/pr30313.c: New testcase.

From-SVN: r121334
2007-01-30 10:17:09 +00:00
Roger Sayle bcf52d7b57 fold-const.c (round_up): Make HIGH an unsigned HOST_WIDE_INT to avoid undefined behaviour on overflow.
* fold-const.c (round_up): Make HIGH an unsigned HOST_WIDE_INT to
	avoid undefined behaviour on overflow.  Use force_fit_type_double
	to construct the constant with the specified TREE_OVERFLOW.

From-SVN: r121332
2007-01-30 04:39:59 +00:00
Ben Elliston 5b08110801 Belated typo fix from 2007-01-02.
From-SVN: r121319
2007-01-30 10:06:44 +11:00
Janis Johnson d9a66f98c1 decExcept.c: New.
libdecnumber/
	* decExcept.c: New.
	* decExcept.h: New.
libgcc/
	* Makefile.in (dec-filenames): Add decExcept.
gcc/
	* config/dfp-bit.c: Add parameterized support for fp exceptions.
	* config/dfp-bit.h: Ditto.
gcc/testsuite/
	* gcc.dg/dfp/dfp-except.h: New file.
	* gcc.dg/dfp/fe-check.h: New file.
	* gcc.dg/dfp/fe-binop.c: New test.
	* gcc.dg/dfp/fe-convert-1.c: New test.
	* gcc.dg/dfp/fe-convert-2.c: New test.
	* gcc.dg/dfp/fe-convert-3.c: New test.

From-SVN: r121317
2007-01-29 23:01:35 +00:00
Manuel López-Ibáñez c616e51b00 007-01-29 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
* c-decl.c (pop_scope): Replace warnings with call to
	warn_for_unused_label.
	* c-common.h (warn_for_unused_label): Declare.
	* c-common.c (warn_for_unused_label): Define.
cp/
	* decl.c (pop_label): Replace warning with call to
	warn_for_unused_label.

From-SVN: r121310
2007-01-29 21:05:58 +00:00
Manuel López-Ibáñez 971005966f tree-optimize.c (update_inlined_to_pointers): Delete unused function.
2007-01-29  Manuel Lopez-Ibanez  <manu@gcc.gnu.org>

        * tree-optimize.c (update_inlined_to_pointers): Delete unused
        function.

From-SVN: r121309
2007-01-29 20:54:59 +00:00
Janis Johnson b7f0fff23b Makefile.in (USER_H): Remove decfloat.h.
gcc/
	* Makefile.in (USER_H): Remove decfloat.h.
	* ginclude/decfloat.h: Delete, moving contents to ...
	* ginclude/float.h: Add support for decimal floating point,
	guarded by __STDC_WANT_DEC_FP__.

gcc/testsuite/
	* gcc.dg/dfp/dec-eval-method.c: Replace decfloat.h with float.h.
	* gcc.dg/dfp/decfloat-constants.c: Ditto.
	* gcc.dg/dfp/convert-dfp.c: Ditto.
	* gcc.dg/dfp/convert-int-saturate.c: Ditto.

From-SVN: r121308
2007-01-29 20:27:41 +00:00
Mike Stump 821f6218d7 gccint.texi (Top): Rename Loop Representation to Loop Analysis and Representation to resolve case...
* doc/gccint.texi (Top): Rename Loop Representation to Loop
	Analysis and Representation to resolve case insensitive conflict.
	* doc/loop.texi (Loop Analysis and Representation): Likewise.

From-SVN: r121306
2007-01-29 20:10:33 +00:00
Daniel Berlin 306219a28d tree.h (struct tree_memory_tag): Add aliases member.
2007-01-28  Daniel Berlin  <dberlin@dberlin.org>

	* tree.h (struct tree_memory_tag): Add aliases member.
	(MTAG_ALIASES): New macro.
	* tree-ssa-alias.c (alias_bitmap_obstack): New variable.
	(add_may_alias): Remove pointer-set. Update for may_aliases being
	a bitmap. 
	(mark_aliases_call_clobbered): Update for may_aliases being a
	bitmap.
	(compute_tag_properties): Ditto.
	(create_partition_for): Ditto.
	(compute_memory_partitions): Ditto.
	(dump_may_aliases_for): Ditto.
	(is_aliased_with): Ditto.
	(add_may_alias_for_new_tag): Ditto.
	(rewrite_alias_set_for): Rewrite for may_aliases being a bitmap.
	(compute_is_aliased): New function.
	(compute_may_aliases): Call compute_is_aliased).
	(init_alias_info): Initialize alias_bitmap_obstack.
	(union_alias_set_into): New function.
	(compute_flow_sensitive_aliasing): Use union_aliases_into.
	(have_common_aliases_p): Rewrite to take two bitmaps and use
	intersection.
	(compute_flow_insensitive_aliasing): Stop using pointer-sets.
	Update for bitmaps.
	(finalize_ref_all_pointers): Update for add_may_alias changes.
	(new_type_alias): Ditto.
	* tree-flow-inline.h (may_aliases): Return a bitmap.
	* tree-dfa.c (dump_variable): Check for MTAG_P'ness.
	* tree-ssa.c (verify_flow_insensitive_alias_info): Update for
	may_aliases being a bitmap.
	* tree-flow.h (struct var_ann_d): Remove may_aliases member.
	may_aliases now returns a bitmap.
	* tree-ssa-structalias.c (merge_smts_into): Update for may_aliases
	being a bitmap.
	* tree-ssa-operands.c (add_virtual_operand): Update for
	may_aliases being a bitmap.

From-SVN: r121302
2007-01-29 19:38:00 +00:00
Daniel Berlin 48e540b04f re PR tree-optimization/30630 (Trunk GCC hangs while compiling cpu2k6/perlbench at -O2)
2007-01-29  Daniel Berlin  <dberlin@dberlin.org>

	PR tree-optimization/30630
	* tree-ssa-structalias.c (do_complex_constraint): Mark correct
	variable as changed.

From-SVN: r121295
2007-01-29 17:25:04 +00:00
Simon Martin abc67de15a re PR c++/28266 (ICE on invalid default variable)
PR c++/28266
        * gimplify.c (gimplify_target_expr): Make sure that the TARGET_EXPR is
        expanded only once even if an error occurs.

From-SVN: r121288
2007-01-29 11:27:21 -05:00
Ben Elliston 098b68ad53 gcov-io.h (__gcov_indirect_call_profiler): Declare.
* gcov-io.h (__gcov_indirect_call_profiler): Declare.
	(__gcov_average_profiler): Likewise.
	(__gcov_ior_profiler): Likewise.
	(__gcov_merge_ior): Likewise.

From-SVN: r121280
2007-01-29 16:53:40 +11:00
Jan Hubicka 52ca6d3504 builtins.c (expand_builtin_memset): Fix typo in my last patch.
* builtins.c (expand_builtin_memset): Fix typo in my last patch.
	* value-prof.c (stringop_block_profile): Likewise.

From-SVN: r121272
2007-01-28 22:27:37 +00:00
Jan Hubicka 079a182e02 expr.c (emit_block_move_via_movmem, [...]): Add variant handling histograms; add wrapper.
* expr.c (emit_block_move_via_movmem, emit_block_move_via_libcall): Add
	variant handling histograms; add wrapper.
	(clear_storage_via_libcall): Export.
	(emit_block_move_hints): Break out from ...; add histograms.
	(emit_block_move): ... this one.
	(clear_storage_hints): Break out from ...; add histograms.
	(clear_storage): ... this one.
	(set_storage_via_memset): Handle histogram.
	* expr.h (emit_block_move_via_libcall, emit_block_move_hints): Declare.
	(clear_storage_hints, clear_storage_via_libcall): Declare.
	(set_storage_via_setmem): Update prototype.
	* doc/md.texi (movmem, setmem): Document new arguments.

	* value-prof.c (dump_histogram_value, tree_find_values_to_profile): Add
	new histograms.
	(stringop_block_profile): New global function.
	(tree_stringops_values_to_profile): Profile block size and alignment.
	* value-prof.h (enum hist_type): add HIST_TYPE_AVERAGE and
	HIST_TYPE_IOR.
	(struct profile_hooks): Add gen_average_profiler and gen_ior_profiler.
	(stringop_block_profile): Declare.
	* builtins.c: Include value-prof.h.
	(expand_builtin_memcpy, expand_builtin_memset): Pass block profile.
	* gcov-ui.h (GCOV_COUNTER_NAMES): Add new counter.
	(GCOV_COUNTER_AVERAGE, GCOV_COUNTER_IOR): New constants.
	(GCOV_COUNTERS, GCOV_LAST_VALUE_COUNTER): Update.
	* profile.c (instrument_values): Add new counters.
	* cfgexpand.c (expand_gimple_basic_block): Propagate histograms to
	calls.
	* tree-profile.c (tree_average_profiler_fn, tree_ior_profiler_fn): New.
	(tree_init_edge_profiler): Build new profilers.
	(tree_gen_average_profiler, tree_gen_ior_profiler): New.
	(pass_tree_profile): Add dump.
	(tree_profile_hooks): Update.
	* Makefile.in (LIBGCOV): Add new constants.
	* libgcov.c (__gcov_merge_ior, __gcov_average_profiler,
	__gcov_ior_profiler): New.
	* i386.md (movmem/setmem expanders): Add new optional arguments.

From-SVN: r121270
2007-01-28 19:38:39 +00:00
David Edelsohn b6bd337183 * doc/md.texi (Standard Pattern Names): Document blockage pattern.
From-SVN: r121268
2007-01-28 14:26:43 -05:00
Zdenek Dvorak 7f9bc51b09 tree-ssa-loop-unswitch.c: Include tree-inline.h.
* tree-ssa-loop-unswitch.c: Include tree-inline.h.
	(tree_unswitch_single_loop): Pass eni_size_weights to
	tree_num_loop_insns.
	* tree-ssa-loop-manip.c: Include tree-inline.h.
	(can_unroll_loop_p): Pass eni_size_weights to
	tree_num_loop_insns.
	* tree-ssa-loop-ch.c (should_duplicate_loop_header_p):
	Pass eni_size_weights to estimate_num_insns.
	* tree.h (init_inline_once): Export.
	* toplev.c (backend_init): Call init_inline_once.
	* cgraphunit.c (cgraph_process_new_functions,
	cgraph_analyze_function): Pass eni_inlining_weights to
	estimate_num_insns.
	* ipa-inline.c (compute_inline_parameters): Ditto.
	* tree-ssa-loop-ivcanon.c (tree_num_loop_insns): Pass weights
	to estimate_num_insns.
	(try_unroll_loop_completely): Pass eni_size_weights to
	tree_num_loop_insns.
	* tree-eh.c (decide_copy_try_finally): Pass eni_size_weights
	ot estimate_num_insns.
	* tree-ssa-loop-prefetch.c: Include tree-inline.h.
	(loop_prefetch_arrays): Pass eni_time_weights to tree_num_loop_insns.
	* tree-inline.c (eni_inlining_weights, eni_size_weights,
	eni_time_weights): New variables.
	(init_inline_once): Initialize them.
	(struct eni_data): Mew.
	(estimate_num_insns_1, estimate_num_insns): Use weights.
	* tree-inline.h (struct eni_weights_d): New.
	(eni_inlining_weights, eni_size_weights, eni_time_weights): Declare.
	(estimate_num_insns): Declaration changed.
	* cfgloop.h (tree_num_loop_insns): Declaration changed.
	* Makefile.in (tree-ssa-loop-unswitch.o, tree-ssa-loop-prefetch.o,
	tree-ssa-loop-manip.o): Add TREE_INLINE_H dependency.

	* gcc.dg/tree-ssa/loop-23.c: New test.

From-SVN: r121260
2007-01-28 17:40:38 +00:00
Zdenek Dvorak b39c670645 tree-data-ref.c (conflict_fn): Assert that the number of affine relations in the conflict function is valid.
* tree-data-ref.c (conflict_fn): Assert that the number of affine
	relations in the conflict function is valid.

From-SVN: r121259
2007-01-28 17:29:30 +00:00
Ian Lance Taylor eeef0e452e common.opt: Add fstrict-overflow.
./:	* common.opt: Add fstrict-overflow.
	* opts.c (decode_options): Set flag_strict_overflow if -O2.
	* flags.h (TYPE_OVERFLOW_WRAPS): Define.
	(TYPE_OVERFLOW_UNDEFINED): Define.
	(TYPE_OVERFLOW_TRAPS): Define.  This replaces TYPE_TRAP_SIGNED.
	Replace all uses.
	* tree.h (TYPE_TRAP_SIGNED): Don't define.
	* fold-const.c (negate_expr_p): Use TYPE_OVERFLOW_UNDEFINED.
	(fold_negate_expr): Likewise.
	(make_range): Likewise.
	(extract_muldiv_1): Likewise.
	(maybe_canonicalize_comparison): Likewise.
	(fold_comparison): Likewise.
	(fold_binary): Likewise.
	(tree_expr_nonnegative_p): Likewise.
	(tree_expr_nonzero_p): Likewise.
	* tree-vrp.c (compare_values): Likewise.
	(extract_range_from_binary_expr): Likewise.
	(extract_range_from_unary_expr): Likewise.
	* tree-ssa-loop-niter.c (infer_loop_bounds_from_signedness):
	Likewise.
	(nowrap_type_p): Likewise.
	* tree-scalar-evolution.c (simple_iv): Likewise.
	* fold-const.c (negate_expr_p): Use TYPE_OVERFLOW_WRAPS.
	(build_range_check): Likewise.
	(extract_muldiv_1): Likewise.
	(fold_comparison): Likewise.
	* tree-vrp.c (vrp_int_const_binop): Likewise.
	(extract_range_from_unary_expr): Likewise.
	* convert.c (convert_to_integer): Likewise.
	* fold-const.c (fold_negate_expr): Use TYPE_OVERFLOW_TRAPS.
	(fold_comparison): Likewise.
	(fold_binary): Likewise.
	* optabs.c (optab_for_tree_code): Likewise.
	* tree-vectorizer.c (vect_is_simple_reduction): Likewise.
	* simplify-rtx.c (simplify_const_relational_operation): Check
	flag_strict_overflow and flag_trapv.
	(simplify_const_relational_operation): Likewise.
	* doc/invoke.texi (Option Summary): Mention -fstrict-overflow.
	(Optimize Options): Add -fstrict-overflow to -O2 list.  Document
	-fstrict-overflow.
testsuite/:
	* gcc.dg/strict-overflow-1.c: New test.
	* gcc.dg/no-strict-overflow-1.c: New test.
	* gcc.dg/strict-overflow-2.c: New test.
	* gcc.dg/no-strict-overflow-2.c: New test.
	* gcc.dg/strict-overflow-3.c: New test.
	* gcc.dg/no-strict-overflow-3.c: New test.
	* gcc.dg/strict-overflow-4.c: New test.
	* gcc.dg/no-strict-overflow-4.c: New test.
	* gcc.dg/fold-mod-1.c: Add -fstrict-overflow option.
	* gcc.dg/pr15784-1.c: Likewise.
	* gcc.dg/pr20922-1.c: Likewise.
	* gcc.dg/pr20922-3.c: Likewise.
	* gcc.dg/pr20922-4.c: Likewise.
	* gcc.dg/pr20922-6.c: Likewise.
	* gcc.dg/compare-4.c: Likewise.
	* gcc.dg/torture/pr26898-1.c: Likewise.
	* gcc.dg/tree-ssa/divide-1.c: Likewise.
	* gcc.dg/tree-ssa/divide-2.c: Likewise.
	* gcc.dg/tree-ssa/divide-3.c: Likewise.
	* gcc.dg/tree-ssa/divide-4.c: Likewise.
	* gcc.dg/tree-ssa/pr14490-1.c: Likewise.
	* gcc.dg/tree-ssa/pr14490-3.c: Likewise.
	* gcc.dg/tree-ssa/pr21082.c: Likewise.
	* gcc.dg/tree-ssa/pr26899.c: Likewise.
	* g++.dg/tree-ssa/pr21082.C: Likewise.

From-SVN: r121254
2007-01-28 05:15:06 +00:00
Roger Sayle b73a605656 tree.c (tree_fold_gcd): Delete.
* tree.c (tree_fold_gcd): Delete.
	* tree.h (tree_fold_gcd): Remove prototype.
	* tree-data-ref.c (tree_fold_divides_p): Don't use tree_fold_gcd to
	test whether one constant integer is a multiple of another.  Instead
	call int_const_binop with TRUNC_MOD_EXPR and test for a zero result.
	* fold-const.c (multiple_of_p):  We've determined both TOP and
	BOTTOM are integer constants so we can call int_const_binop directly
	instead of the more generic const_binop.

From-SVN: r121253
2007-01-28 05:04:48 +00:00
Roger Sayle 74890d7bbd fold-const.c (size_binop): In the fast-paths for X+0...
* fold-const.c (size_binop): In the fast-paths for X+0, 0+X, X-0 and
	1*X check that the constant hasn't overflowed, to preserve the
	TREE_OVERFLOW bit.
	(round_up): Provide an efficient implementation when rouding-up an
	INTEGER_CST to a power-of-two.

	* gcc-dg/large-size-array-3.c: New test case.

From-SVN: r121252
2007-01-28 03:48:41 +00:00
Gerald Pfeifer b93633383b Add missing doc/install.texi to ChangeLog entry of the previous commit.
From-SVN: r121245
2007-01-28 00:12:11 +00:00
Ralf Wildenhues 2a01aae626 sourcebuild.texi: Add comma for clarity.
* doc/sourcebuild.texi: Add comma for clarity.
	* doc/extend.texi: Fix some typos.
	* doc/passes.texi: Likewise.
	* doc/cppinternals.texi: Likewise.
	* doc/c-tree.texi: Likewise.
	* doc/tree-ssa.texi: Likewise.

From-SVN: r121242
2007-01-27 23:55:27 +00:00
Jan Hubicka 7fbb9a499c tree-sra.c (sra_walk_function): Don't rely on aliases being build.
* tree-sra.c (sra_walk_function): Don't rely on aliases being build.
	(pass_sra): Do not require alias information.
	* passes.c (init_optimization_passes): Add SRA

From-SVN: r121240
2007-01-27 22:31:19 +00:00
Steven Bosscher 9eab67850b tracer.c (rest_of_handle_tracer): We already cleaned up the CFG in tracer() so don't do it here again.
* tracer.c (rest_of_handle_tracer): We already cleaned
	up the CFG in tracer() so don't do it here again.
	* cfgcleanup.c (rest_of_handle_jump2): Don't repeat
	cleanup_cfg here, either.  And don't call renumber_insns.

	* cfgrtl.c (rtl_verify_flow_info_1): Don't verify that BB_END
	and BB_HEAD are in the insn stream here.  Instead make sure
	that BB_INSN is valid on all insns.  Also, do check here that
	there are no pending branch predictions...
	(rtl_verify_flow_info): ...instead of doing it here.  Checks
	for BB_END and BB_HEAD moved from rtl_verify_flow_info_1 to
	here.

From-SVN: r121231
2007-01-27 14:48:02 +00:00
Roger Sayle ffa1b3c684 i386.c (ix86_swap_binary_operands_p): New helper function to simplify/factorize operand order canonicalization.
* config/i386/i386.c (ix86_swap_binary_operands_p): New helper
	function to simplify/factorize operand order canonicalization.
	(ix86_fixup_binary_operands): Reorganize using the above function.
	(ix86_binary_operator_ok): Likewise.

From-SVN: r121227
2007-01-27 02:52:37 +00:00
Jakub Jelinek e2e3023612 genattrtab.c (struct attr_value_list, [...]): Move to file scope from optimize_attrs.
* genattrtab.c (struct attr_value_list, insn_code_values): Move to
	file scope from optimize_attrs.
	(simplify_test_exp): If insn_code_values is not NULL, use it to speed
	up search.
	(optimize_attrs): Clear insn_code_values after freeing it.

From-SVN: r121216
2007-01-27 00:15:08 +01:00
Zdenek Dvorak cdd76d88c8 tree-ssa-address.c (create_mem_ref): Remove ", bsi" from a parts.base assignment.
* tree-ssa-address.c (create_mem_ref): Remove ", bsi" from
	a parts.base assignment.

From-SVN: r121213
2007-01-26 19:47:20 +00:00
Zdenek Dvorak d93817c435 tree-data-ref.c (dump_subscript): Use dump_conflict_function.
* tree-data-ref.c (dump_subscript): Use dump_conflict_function.
	(compute_subscript_distance, initialize_data_dependence_relation,
	finalize_ddr_dependent, analyze_ziv_subscript,
	analyze_siv_subscript_cst_affine,
	compute_overlap_steps_for_affine_univar,
	compute_overlap_steps_for_affine_1_2, analyze_subscript_affine_affine,
	analyze_siv_subscript, analyze_miv_subscript,
	analyze_overlapping_iterations, subscript_dependence_tester_1,
	compute_self_dependence, free_dependence_relation): Work
	with affine_fn instead of chrecs.
	(dump_affine_function, dump_conflict_function, affine_function_equal_p,
	common_affine_function, affine_function_base,
	affine_function_constant_p, affine_fn_op, affine_fn_plus,
	affine_fn_minus, affine_fn_free, conflict_fn_not_known,
	conflict_fn_no_dependence, free_conflict_function, free_subscripts,
	conflict_fn, affine_fn_cst, affine_fn_univar): New functions.
	(all_chrecs_equal_p): Removed.
	* tree-data-ref.h (affine_fn, conflict_function): New types.
	(struct subscript): Change type of conflicting_iterations_in_a
	and conflicting_iterations_in_b.

From-SVN: r121212
2007-01-26 19:33:04 +00:00
Steve Ellcey dfcb2b5145 re PR target/30182 (FAIL: gcc.dg/pr28796-2.c (test for excess errors))
PR other/30182
	* config/pa/pa.h (TARGET_HPUX_11): New.
	* config/pa/pa-hpux11.h (TARGET_HPUX_11): New.
	* config/pa/pa.c (pa_init_builtins): Use TARGET_HPUX_11.

From-SVN: r121211
2007-01-26 18:16:29 +00:00
Daniel Berlin d3c3697412 tree-ssa-structalias.c (solve_graph): Handle case we merged the variable to another.
2007-01-26  Daniel Berlin  <dberlin@dberlin.org>
	Richard Guenther  <rguenther@suse.de>

	* tree-ssa-structalias.c (solve_graph): Handle case
	we merged the variable to another.

Co-Authored-By: Richard Guenther <rguenther@suse.de>

From-SVN: r121202
2007-01-26 12:36:01 +00:00
Kaveh R. Ghazi 4b26d10bcc builtins.c (fold_builtin_1): Treat ccos and ccosh as 'even' functions.
* builtins.c (fold_builtin_1): Treat ccos and ccosh as 'even'
	functions.

	* fold-const.c (negate_mathfn_p): Treat casin, casinh, catan,
	catanh, cproj, csin, csinh, ctan and ctanh as 'odd' functions.
	
testsuite:
	* gcc.dg/builtins-20.c: Add more cases.
	* gcc.dg/torture/builtin-symmetric-1.c: Likewise.

From-SVN: r121200
2007-01-26 02:40:31 +00:00
DJ Delorie db9c839733 m32c.c (m32c_cannot_change_mode_class): We don't allow changes to modes which don't fit in those registers.
* config/m32c/m32c.c (m32c_cannot_change_mode_class): We don't
allow changes to modes which don't fit in those registers.

From-SVN: r121199
2007-01-25 20:16:57 -05:00
DJ Delorie 21f14ff955 reload1.c (choose_reload_regs): Check for invalid subregs before computing their locations, not after.
* reload1.c (choose_reload_regs): Check for invalid subregs before
computing their locations, not after.

From-SVN: r121198
2007-01-25 20:15:05 -05:00
Geoffrey Keating 22fa69dace re PR target/25127 (internal compiler error: in rs6000_emit_prologue, at config/rs6000/rs6000.c:14039)
2007-01-24  Geoffrey Keating  <geoffk@apple.com>

	PR 25127
	* config/rs6000/rs6000.c (first_altivec_reg_to_save): On Darwin,
	save Altivec registers in an eh_return function.
	(compute_vrsave_mask): Likewise.
	(rs6000_stack_info): Correct AIX/Darwin stack alignment computation
	for saving Altivec registers.
	(rs6000_emit_prologue): Don't allocate stack twice in
	eh_return function.  Correct expected value of altivec_save_offset
	when using save_world.  Describe save of R0 to stack when using
	save_world.  Describe stack pointer adjustment when using
	save_world.  Remove duplicated eh_return parameter register saving.
	Update sp_offset variable after save_world.
	* config/rs6000/t-darwin (LIB2FUNCS_STATIC_EXTRA): Remove
	darwin-world.asm.
	(LIB2FUNCS_EXTRA): Add darwin-world.asm.
	* config/rs6000/darwin.h (SUBTARGET_OVERRIDE_OPTIONS): -m64
	implies Altivec.

Index: gcc/testsuite/ChangeLog
2007-01-24  Geoffrey Keating  <geoffk@apple.com>

	* gcc.target/powerpc/darwin-ehreturn-1.c: New.
	* g++.dg/eh/simd-2.C: Also run on Darwin.
	* g++.dg/eh/simd-3.C: New.
	* g++.dg/eh/simd-4.C: New.

From-SVN: r121184
2007-01-25 20:32:06 +00:00
Steve Ellcey 79e8b6c016 * config.gcc (ia64*-*-hpux*): Make posix threads the default.
From-SVN: r121180
2007-01-25 18:08:16 +00:00
Steve Ellcey 7d52200069 re PR target/30182 (FAIL: gcc.dg/pr28796-2.c (test for excess errors))
PR other/30182
	* config/pa/pa.c (pa_init_builtins): Set asm names for finite routines.
	* config/ia64/ia64.c (ia64_init_builtins):  Ditto.

From-SVN: r121178
2007-01-25 17:06:55 +00:00
Richard Guenther 16c1c158d8 invoke.texi (-Wcoverage-mismatch): Document.
2007-01-25  Richard Guenther  <rguenther@suse.de>

	* doc/invoke.texi (-Wcoverage-mismatch): Document.
	* common.opt (-Wcoverage-mismatch): New warning option.
	* coverage.c (get_coverage_counts): Ignore coverage mismatch
	if -Wcoverage-mismatch is given.

	* gcc.dg/tree-prof/tree-prof.exp: Define _PROFILE_GENERATE
	and _PROFILE_USE.
	* gcc.dg/tree-prof/wcoverage-mismatch.c: New testcase.

From-SVN: r121169
2007-01-25 12:35:13 +00:00
Razya Ladelsky b9c369e618 ipa-cp.c (ipcp_insert_stage, [...]): Support for SSA.
2007-01-25  Razya Ladelsky  <razya@il.ibm.com>

        * ipa-cp.c (ipcp_insert_stage, ipcp_driver): Support for SSA.
          (ipcp_driver): Change to static definition.
          Add dumping of the ifunctions.
          (constant_val_insert): Remove unused parameter. Support for SSA.
          (ipcp_propagate_const): Support for SSA.
          (ipcp_profile_bb_print): Print only analyzed nodes.
          (ipcp_replace_map_create): Remove support for Fortran constant
          for now.
          * ipa-prop.c (ipa_method_modify_stmt,
          ipa_callsite_compute_param): Support for SSA.
          * ipa-prop.h (ipcp_driver): Remove declaration.
          (IS_VALID_TREE_MAP_INDEX): Add define.

From-SVN: r121167
2007-01-25 10:54:47 +00:00
Geoffrey Keating 9dc5c4f5eb * unwind-dw2.c (execute_stack_op): Handle DW_OP_swap.
From-SVN: r121165
2007-01-25 07:08:33 +00:00
Kaveh R. Ghazi 01ffa37015 re PR middle-end/30447 (Evaluate complex math functions at compile-time)
PR middle-end/30447
	* builtins.c (fold_builtin_cabs): Use MPFR to evaluate a
	constant argument to cabs and do it without checking for
	-funsafe-math-optimizations.

From-SVN: r121163
2007-01-25 04:15:26 +00:00
Douglas Gregor e1f1ee86a8 c-common.h (RID_FIRST_CXX0X): New.
2007-01-24  Douglas Gregor  <dgregor@osl.iu.edu>

	* c-common.h (RID_FIRST_CXX0X): New.
	(RID_LAST_CXX0X): New.
	* c-opts.c (c_common_handle_option): -Wc++0x-compat is triggered
	by -Wall.
	* c.opt (Wc++0x-compat): New.
	* doc/invoke.texi (-Wc++0x-compat): Document.

From-SVN: r121162
2007-01-25 04:04:18 +00:00
Kaveh R. Ghazi 527cab2096 builtins.c (fold_builtin_carg): New.
* builtins.c (fold_builtin_carg): New.
	(fold_builtin_1): Use it.

testsuite:
	* gcc.dg/builtins-20.c: Test builtin carg.

From-SVN: r121159
2007-01-25 03:57:30 +00:00
Jan Hubicka ee41133693 * ipa-inline.c (cgraph_decide_inlining): Initialize initial_insns.
From-SVN: r121156
2007-01-25 01:13:02 +00:00
Jan Hubicka b7c27d5169 ipa-inline.c (initial_insns, max_insns): Delete.
* ipa-inline.c (initial_insns, max_insns): Delete.
	(compute_max_insns): New function.
	(cgraph_decide_inlining_of_small_function): Use it; take minimal amount
	of insns as base for code growth.
	(cgraph_decide_inlining): Make initial_insns local; do not compute
	max_insns.
	* params.def (PARAM_INLINE_UNIT_GROWTH): Set to 60.
	* doc/invoke.texi (inline-unit-growth): Update docs.

From-SVN: r121144
2007-01-24 22:45:00 +00:00
Jakub Jelinek 15a26abf30 i386.h (x86_cmpxchg16b): Remove const.
* config/i386/i386.h (x86_cmpxchg16b): Remove const.
	(TARGET_CMPXCHG16B): Define to x86_cmpxchg16b.
	* config/i386/i386.c (x86_cmpxchg16b): Remove const.
	(override_options): Add PTA_CX16 flag.  Set x86_cmpxchg16b
	for CPUs that have PTA_CX16 set.

From-SVN: r121140
2007-01-24 23:00:03 +01:00
Jakub Jelinek 07b7aade9d re PR middle-end/27416 (ICE on invalid firstprivate/lastprivate)
PR middle-end/27416
	* gimplify.c (omp_check_private): New function.
	(gimplify_scan_omp_clauses): Use it for
	firstprivate/lastprivate/reduction.

	* gcc.dg/gomp/pr27416.c: New test.

From-SVN: r121133
2007-01-24 21:58:21 +01:00
Jakub Jelinek 4288fea212 re PR middle-end/30494 (ICE with VLA and openmp)
PR middle-end/30494
	* gimplify.c (omp_add_variable): Don't call omp_notice_variable
	on TYPE_SIZE_UNIT for GOVD_LOCAL VLAs.

	* gcc.dg/gomp/pr30494.c: New test.
	* g++.dg/gomp/pr30494.C: New test.

	* testsuite/libgomp.c/pr30494.c: New test.

From-SVN: r121132
2007-01-24 21:56:45 +01:00
Jakub Jelinek 3d55c64b49 re PR middle-end/30421 (incorrect warning when using firstprivate and lastprivate clauses)
PR middle-end/30421
	* omp-low.c (lower_omp_for_lastprivate): Add dlist argument.
	If lower_lastprivate_clauses emits some statements, append them
	to dlist rather than body_p and to body_p append an initializer.
	(lower_omp_for): Adjust caller.

	* gcc.dg/gomp/pr30421.c: New test.

From-SVN: r121131
2007-01-24 21:53:08 +01:00
Steve Ellcey 3b313c7838 Forgot ChangeLog in previous commit.
From-SVN: r121129
2007-01-24 19:40:57 +00:00
Andreas Krebbel f767122b2e unwind-dw2-fde.c (get_cie_encoding): Replaced _Unwind_Word with _uleb128_t and _Unwind_SWord with _sleb128_t.
2007-01-24  Andreas Krebbel  <krebbel1@de.ibm.com>

	* unwind-dw2-fde.c (get_cie_encoding): Replaced _Unwind_Word with 
	_uleb128_t and _Unwind_SWord with _sleb128_t.
	* unwind-dw2.c (extract_cie_info, execute_stack_op, execute_cfa_program,
	uw_frame_state_for, uw_update_context_1): Likewise.
	* unwind-c.c (parse_lsda_header, PERSONALITY_FUNCTION): Likewise.
	* unwind-pe.h (read_uleb128, read_sleb128,
	read_encoded_value_with_base): Likewise.
	* unwind-generic.h: Define _sleb128_t and _uleb128_t types.

2007-01-24  Andreas Krebbel  <krebbel1@de.ibm.com>

	* libsupc++/eh_personality.cc (parse_lsda_header, check_exception_spec,
	get_ttype_entry, empty_exception_spec, PERSONALITY_FUNCTION): Replaced
	_Unwind_Word with _uleb128_t and _Unwind_SWord with _sleb128_t.

2007-01-24  Andreas Krebbel  <krebbel1@de.ibm.com>

	* exception.cc (parse_lsda_header, PERSONALITY_FUNCTION): Replaced
	_Unwind_Word with _uleb128_t and _Unwind_SWord with _sleb128_t.

From-SVN: r121116
2007-01-24 14:46:47 +00:00
Richard Guenther 9d972b2dd3 builtins.c (expand_builtin_cexpi): Get the fndecl for cexp in the correct way.
2007-01-24  Richard Guenther  <rguenther@suse.de>

	* builtins.c (expand_builtin_cexpi): Get the fndecl
	for cexp in the correct way.

From-SVN: r121114
2007-01-24 13:49:18 +00:00
Jan Hubicka cf22730346 pr23382.c: Avoid DCE from eliminating dead variable.
* gcc.dg/tree-ssa/pr23382.c: Avoid DCE from eliminating dead variable.
	* tree-ssa-dce.c (eliminate_unnecesary_stmts): Remove dead LHS of calls.

From-SVN: r121108
2007-01-24 12:13:45 +00:00
Andreas Krebbel 024a85aeb6 c-cppbuiltin.c (builtin_define_type_sizeof): New function.
2007-01-24  Andreas Krebbel  <krebbel1@de.ibm.com>

	* c-cppbuiltin.c (builtin_define_type_sizeof): New function.
	(c_cpp_builtins): New builtin macros: __SIZEOF_INT__, __SIZEOF_LONG__,
	__SIZEOF_LONG_LONG__, __SIZEOF_SHORT__, __SIZEOF_POINTER__,
	__SIZEOF_FLOAT__, __SIZEOF_DOUBLE__, __SIZEOF_LONG_DOUBLE__,
	__SIZEOF_SIZE_T__, __SIZEOF_WCHAR_T__, __SIZEOF_WINT_T__ and
	__SIZEOF_PTRDIFF_T__.
	* doc/cpp.texi: Documentation for the new builtin macros added.

2007-01-24  Andreas Krebbel  <krebbel1@de.ibm.com>

	* gcc.c-torture/compile/sizeof-macros-1.c: New testcase.

From-SVN: r121107
2007-01-24 12:03:38 +00:00
Uros Bizjak 9db2744988 i386.md (tanxf2, [...]): Use op2 instead of operands[2] to avoid access past the end of array.
* config/i386/i386.md (tanxf2, tan<mode>2, atan<mode>2, log<mode>2,
	log10<mode>2, log2<mode>2, expxf2, exp10xf2, exp2xf2): Use op2
	instead of operands[2] to avoid access past the end of array.

From-SVN: r121106
2007-01-24 12:17:09 +01:00
Richard Sandiford 92d5459253 reload1.c (emit_reload_insns): Pass the reload register for a non-spill output reload through forget_old_reloads_1.
gcc/
	* reload1.c (emit_reload_insns): Pass the reload register
	for a non-spill output reload through forget_old_reloads_1.

From-SVN: r121105
2007-01-24 08:16:14 +00:00
Joseph Myers 17caeff262 rs6000-c.c (rs6000_cpu_cpp_builtins): Define _SOFT_DOUBLE if doubles use software floating-point.
gcc:
	* config/rs6000/rs6000-c.c (rs6000_cpu_cpp_builtins): Define
	_SOFT_DOUBLE if doubles use software floating-point.
	* config/rs6000/libgcc-ppc-glibc.ver: Export additional long
	double functions if _SOFT_DOUBLE, not _SOFT_FLOAT.
	* config/rs6000/darwin-ldouble.c: Also compile functions for
	hard-float without FPRs.  Use fmsub function for all __NO_FPRS__
	cases.  Compile extra functions if _SOFT_DOUBLE, not _SOFT_FLOAT.
	* config/rs6000/linuxspe.h (SUBSUBTARGET_OVERRIDE_OPTIONS): Remove
	commented-out long double override.
	(CPP_LONGDOUBLE_DEFAULT_SPEC): Likewise.
	* config/rs6000/eabispe.h: Likewise.
	* config/rs6000/rs6000.c (rs6000_override_options): Don't override
	long double for non-SPE.
	(rs6000_handle_option): Likewise.
	(invalid_e500_subreg): Disallow more subregs involding DImode,
	DFmode, TImode or TFmode.
	(rs6000_legitimate_offset_address_p): Check TFmode offsets for
	E500 double.
	(legitimate_lo_sum_address_p): Also check for TFmode for E500
	double.
	(rs6000_legitimize_address): Also handle TFmode for E500 double.
	(rs6000_legitimize_reload_address): Also handle TFmode for E500
	double.
	(rs6000_legitimate_address): Also check for TFmode for E500
	double.
	(rs6000_emit_move): Use DFmode subregs of TFmode for E500 double.
	(spe_build_register_parallel): Handle TFmode and TCmode.
	(rs6000_spe_function_arg): Handle TFmode and TCmode for E500
	double.
	(function_arg): Handle TFmode and TCmode for E500 double.
	(rs6000_init_libfuncs): Initialize extra libfuncs for soft double
	in general.
	(print_operand): Handle TFmode and TImode for %y.
	(rs6000_generate_compare): Handle TFmode comparisons for E500
	double.
	(spe_func_has_64bit_regs_p): Check for TFmode for E500 double.
	(rs6000_function_value): Handle TFmode and TCmode for E500 double.
	(rs6000_libcall_value): Handle TFmode and TCmode for E500 double.
	* config/rs6000/rs6000.h (CANNOT_CHANGE_MODE_CLASS): Check for
	TFmode for E500 double.
	* config/rs6000/rs6000.md (FP): Allow TF for E500 double.
	(floatsidf2): Enable for E500 double.
	(movtf_softfloat): Use rs6000_nonimmediate_operand.
	(extenddftf2): Change to extenddftf2_fprs.
	(extenddftf2): Call gen_spe_extenddftf2 or gen_extenddftf2_fprs
	depending on TARGET_E500_DOUBLE.
	(extendsftf2): Enable for E500 double.
	(trunctfdf2): Enable for E500 double.
	(trunctfsf2): Change to trunctfsf2_fprs.
	(trunctfsf2): Call gen_spe_trunctfsf2 or gen_trunctfsf2_fprs
	depending on TARGET_E500_DOUBLE.
	(floatsitf2): Enable for E500 double.
	(fix_trunctfsi2): Change to fix_trunctfsi2_fprs.
	(fix_trunctfsi2): Call gen_spe_fix_trunctfsi2 or
	gen_fix_trunctfsi2_fprs depending on TARGET_E500_DOUBLE.
	(negtf2): Change to negtf2_internal.
	(negtf2): New expander.
	(abstf2): Enable for E500 double.  Call gen_spe_abstf2_tst,
	gen_spe_abstf2_cmp or gen_abstf2_internal depending on
	TARGET_E500_DOUBLE and flag_unsafe_math_optimizations.
	(movdi_internal32): Use rs6000_nonimmediate_operand.
	(unnamed splitter): Likewise.
	* config/rs6000/spe.md (CMPTFEQ_GPR, TSTTFEQ_GPR, CMPTFGT_GPR,
	TSTTFGT_GPR, CMPTFLT_GPR, TSTTFLT_GPR): New unspecs.
	(SPE64TF, DITI): New mode macros.
	(frob_df_di): Change to frob_<SPE64:mode>_<DITI:mode>; allow more
	modes.
	(frob_tf_ti): New.
	(frob_<mode>_di_2): New.
	(frob_tf_di_8_2): New.
	(frob_di_df): Change to frob_di_<mode>; allow more modes.
	(frob_ti_tf): New.
	(frob_di_df_2): Change to frob_<DITI:mode>_<SPE64:mode>_2; allow
	more modes.
	(frob_ti_<mode>_8_2): New.
	(frob_ti_tf_2): New.
	(mov_si<mode>_e500_subreg0, mov_si<mode>_e500_subreg0_2,
	mov_si<mode>_e500_subreg4, mov_si<mode>_e500_subreg4_2): Allow
	TFmode.
	(mov_sitf_e500_subreg8, mov_sitf_e500_subreg8_2,
	mov_sitf_e500_subreg12, mov_sitf_e500_subreg12_2): New.
	(spe_trunctfdf2_internal1, spe_trunctfsf2, spe_extenddftf2,
	spe_fix_trunctfsi2, spe_fix_trunctfsi2_internal,
	spe_negtf2_internal, spe_abstf2_cmp, spe_abstf2_tst): New.
	(cmptfeq_gpr, tsttfeq_gpr, cmptfgt_gpr, tsttfgt_gpr, cmptflt_gpr,
	tsttflt_gp): New.

libgcc:
	* config/rs6000/t-ldbl128: Always use -mlong-double-128.

From-SVN: r121085
2007-01-23 19:38:33 +00:00
Ian Lance Taylor d5dc6badbf Makefile.in (OBJS-common): Reformat, alphabetize, but put insn-*.o first.
* Makefile.in (OBJS-common): Reformat, alphabetize, but put
	insn-*.o first.
	(OBJS-archive): Reformat, alphabetize.
	(OBJS): Change out_object_file to OBJS-md.

From-SVN: r121081
2007-01-23 15:12:44 +00:00
Uros Bizjak 7656aee4d0 i386.md: Use REG_P...
* config/i386/i386.md: Use REG_P, MEM_P, CONST_INT_P, LABEL_P,
	JUMP_P and CALL_P predicates where applicable.
	* config/i386/i386.c: Ditto.
	* config/i386/i386.md: Ditto.
	* config/i386/mmx.md: Ditto.
	* config/i386/predicates.md: Ditto.

From-SVN: r121079
2007-01-23 08:14:26 +01:00
Andreas Schwab c8832aae41 * config/m68k/m68k.h: Fix comment.
From-SVN: r121063
2007-01-22 21:16:24 +00:00
Jan Hubicka 6ffa0491ad passes.c (init_optimization_passes): Do not rerun pass_early_warn_uninitialized.
* passes.c (init_optimization_passes): Do not rerun
	pass_early_warn_uninitialized.

From-SVN: r121060
2007-01-22 18:51:56 +00:00
Richard Guenther 2f397a93c0 re PR tree-optimization/30038 (Call to sin(x), cos(x) should be transformed to sincos(x))
2007-01-22  Richard Guenther  <rguenther@suse.de>

	PR tree-optimization/30038
	* tree-ssa-math-opts.c (maybe_record_sincos): New static helper
	function.
	(execute_cse_sincos_1): Likewise.
	(execute_cse_sincos): Likewise.
	(gate_cse_sincos): Likewise.
	(pass_cse_sincos): New pass CSEing sin() and cos() calls using
	the cexpi() canonicalization of sincos().
	* tree-pass.h (pass_cse_sincos): Declare.
	* passes.c (init_optimization_passes): New pass pas_cse_sincos.

	* gcc.dg/builtins-62.c: New testcase.

From-SVN: r121052
2007-01-22 11:11:00 +00:00
Eric Botcazou 64c9193063 re PR rtl-optimization/29329 (internal consistency failure)
PR rtl-optimization/29329
	* combine.c (replaced_rhs_insn): Rename to i2mod.
	(replaced_rhs_value): Rename to i2mod_new_rhs.
	(i2mod_old_rhs): New global variable.
	(combine_instructions): Adjust for above change.  Save a copy of
	the old RHS into i2mod_old_rhs when the contents of a REG_EQUAL
	note are substituted in the second instruction.
	(distribute_notes) <REG_DEAD>: Adjust for above change.  Do not
	ditch the note if it pertains to the second eliminated register
	and this register is mentioned in i2mod_old_rhs.

	Revert:
	2006-09-12  Eric Botcazou  <ebotcazou@libertysurf.fr>

	* combine.c (distribute_notes) <REG_DEAD>: Do not consider SETs past
	the insn to which the note was originally attached.

From-SVN: r121037
2007-01-21 22:32:39 +00:00
Jan Hubicka 7fa49e7be7 ipa-inline.c (inlining_mode): Comment, move up.
* ipa-inline.c (inlining_mode): Comment, move up.
	(cgraph_decide_inlining_incrementally): Do not perform inlining itself; fix
	handling of flattening of self recursive functions.
	(cgraph_find_cycles): Remove.
	(cgraph_flatten_node): Remove.
	(cgraph_decide_inlining): Use incremental inliner to handle flattening.
	(try_inline): New function.
	(cgraph_early_inlining): Update call of cgraph_decide_inlining_incrementally.
	Apply inlining here.
	(apply_inline): Update call of cgraph_decide_inlining_incrementally.

From-SVN: r121034
2007-01-21 18:35:27 +00:00
Dirk Mueller 1eb7b04904 re PR bootstrap/30511 (False array bound check causes gcc failed to boostrap)
2007-01-21  Dirk Mueller  <dmueller@suse.de>

        PR bootstrap/30511
        * tree-vrp.c (check_array_bounds): do not warn
        about ADDR_EXPR's of ARRAY_REF's which are immediately
        used in binary expressions.

From-SVN: r121032
2007-01-21 16:12:10 +00:00
Ira Rosen 6004caaf4d tree-vectorizer.h (struct _stmt_vec_info): Add new field read_write_dep and macros for its access.
* tree-vectorizer.h (struct _stmt_vec_info): Add new field
	read_write_dep and macros for its access.
	* tree-vectorizer.c (new_stmt_vec_info): Initialize the new field.
	* tree-vect-analyze.c (vect_analyze_data_ref_dependence): Remove
	argument, call vect_check_interleaving for every independent pair of
	data-refs. Mark loads that access the same memory location as a store
	in the loop.
	(vect_check_dependences): Remove.
	(vect_analyze_data_ref_dependences): Remove  vect_check_dependences
	call, fix the call to vect_analyze_data_ref_dependence.
	(vect_analyze_data_ref_access): For statements that access the same
	data-ref, check that they are not stores; for loads, check that there
	is no store that access the same location.

From-SVN: r121026
2007-01-21 09:22:56 +00:00
Roger Sayle 78681dbdee invoke.texi (-fdump-rtl-combine): Fix under/overfull hbox.
* doc/invoke.texi (-fdump-rtl-combine): Fix under/overfull hbox.
	(-fdump-rtl-stack): Likewise.
	(-fno-signed-zeros): Use @minus{} for a minus sign.  Correct typo.
	(-mcheck-zero-division, -mcpu): Fix under/overfull hbox.
	(-mpt-fixed): Use @minus{} for minus sign.
	(Using Precompiled Headers): Fix under/overfull hbox.


Co-Authored-By: Joseph Myers <joseph@codesourcery.com>

From-SVN: r121023
2007-01-21 03:54:41 +00:00
Jan Hubicka d48a05c3c4 tree-flow.h (struct stmt_ann_d): Move references_memory to proper place within annotation.
* tree-flow.h (struct stmt_ann_d): Move references_memory to proper
	place within annotation.

From-SVN: r121022
2007-01-21 02:54:43 +00:00
Basile Starynkevitch b153d3e1ca gcc/Changelog typos
From-SVN: r121006
2007-01-20 17:59:46 +00:00
John David Anglin 4c6d872614 pa.c (output_move_double): Change array size of xoperands to 4.
* pa.c (output_move_double): Change array size of xoperands to 4.

From-SVN: r121002
2007-01-20 16:27:06 +00:00
Jan Hubicka bbba68dd6b tree-tailcall.c (adjust_return_value): Do not use RESULT_DECL as temporary.
* tree-tailcall.c (adjust_return_value): Do not use RESULT_DECL
	as temporary.

From-SVN: r120999
2007-01-20 11:24:06 +00:00