Commit Graph

37515 Commits

Author SHA1 Message Date
Eric Botcazou ca80e52b01 c-common.c (c_common_truthvalue_conversion): Use LOCATION to build NE_EXPR operations as well.
* c-common.c (c_common_truthvalue_conversion): Use LOCATION to build
	NE_EXPR operations as well.
	* c-parser.c (c_parser_condition): Do not set location information on
	the condition.
	(c_parser_conditional_expression): Likewise.
	(c_parser_binary_expression): Set location information on operators.
	* c-typeck.c (build_unary_op) <TRUTH_NOT_EXPR>: Reset the location if
	TRUTH_NOT_EXPR has been folded.
	* fold-const.c (fold_truth_not_expr): Copy location information from
	the incoming expression to the outgoing one.
	* gimplify.c (shortcut_cond_r): Add locus parameter.  Pass it to
	recursive calls on the LHS of the operator but pass that of the
	operator to recursive calls on the RHS of the operator.  Set it
	on the COND_EXPR.
	(shortcut_cond_expr): Set the locus of the operator on the second
	COND_EXPR and that of the expression on the first in degenerate cases.
	Pass the locus of the expression to calls to shortcut_cond_r.
	Set the locus of the 'then' block on the associated jump, if any.
	(gimplify_boolean_expr): Add locus parameter.  Set it on the COND_EXPR.
	(gimplify_expr) <TRUTH_ANDIF_EXPR>: Pass the locus of the outer
	expression to call to gimplify_boolean_expr.
ada/
	* gcc-interface/trans.c (gnat_to_gnu): Do not overwrite location info.

From-SVN: r146532
2009-04-21 17:17:13 +00:00
Kai Tietz 350916301f config.gcc: Add additional configuration for i686-w64-mingw* and x86_64-w64-mingw* triplet.
2009-04-21  Kai Tietz  <kai.tietz@onevision.com>

        * config.gcc: Add additional configuration for
        i686-w64-mingw* and x86_64-w64-mingw* triplet.
        * config/i386/mingw-w64.h: New mingw-w64 specific header.
        (CPP_SPEC): Redefine for allowing -municode option.
        (STARTFILE_SPEC): Likewise.
        * config/i386/t-mingw-w64: New.
        * config/i386/mingw-w64.opt: New.
        (municode): Add new target option.
        * doc/invoke.texi (municode): Add documentation for new option.

From-SVN: r146529
2009-04-21 18:41:14 +02:00
Ian Lance Taylor 0267afc48d rs6000-c.c (altivec_resolve_overloaded_builtin): Correct test for number of arguments.
* config/rs6000/rs6000-c.c (altivec_resolve_overloaded_builtin):
	Correct test for number of arguments.
	* config/spu/spu-c.c (spu_resolve_overloaded_builtin): Likewise.

From-SVN: r146526
2009-04-21 13:59:28 +00:00
Andreas Schwab 2ba9daa701 linux.h (FINALIZE_TRAMPOLINE): Use enum for second argument of emit_library_call.
* config/m68k/linux.h (FINALIZE_TRAMPOLINE): Use enum for second
argument of emit_library_call.

From-SVN: r146525
2009-04-21 13:50:36 +00:00
Richard Guenther ad8a1ac09d re PR tree-optimization/39829 (ICE with some code that produces VCE)
2009-04-21  Richard Guenther  <rguenther@suse.de>

	PR middle-end/39829
	* gimple.c (walk_stmt_load_store_addr_ops): Catch addresses
	inside VIEW_CONVERT_EXPRs.

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

From-SVN: r146521
2009-04-21 12:42:24 +00:00
Martin Jambor 7156c8abaf tree-switch-conversion.c (build_constructors): Split a long line.
2009-04-21  Martin Jambor  <mjambor@suse.cz>

	* tree-switch-conversion.c (build_constructors): Split a long line.
	(constructor_contains_same_values_p): New function.
	(build_one_array): Create assigns of constants if possible, do not call
	mark_sym_for_renaming, call update_stmt.
	(build_arrays): Call make_ssa_name (create_tmp_var ()) instead of
	make_rename_temp.  Do not call mark_symbols_for_renaming, call
	update_stmt.
	(gen_def_assigns): Do not call mark_symbols_for_renaming or
	find_new_referenced_vars, call update_stmt.
	(gen_inbound_check): Use create_tmp_var and create ssa names manually
	instead of calling make_rename_temp.  Do not call
	find_new_referenced_vars or mark_symbols_for_renaming, call
	update_stmt.

	* testsuite/gcc.dg/tree-ssa/cswtch-2.c: New test.

From-SVN: r146517
2009-04-21 13:55:41 +02:00
Richard Guenther 2970ccb3bb re PR middle-end/39827 (ICE (segfault) when compiling gcc/varasm.c (in notice_global_symbol))
2009-04-21  Richard Guenther  <rguenther@suse.de>

	PR tree-optimization/39827
	* tree-ssa-phiprop.c (propagate_with_phi): Check SSA_NAME
	is in range.
	(tree_ssa_phiprop): Pass the correct array size.

From-SVN: r146515
2009-04-21 09:58:38 +00:00
Uros Bizjak 47f402d18f alpha.md (tune): Add cast to enum attr_tune.
* config/alpha/alpha.md (tune): Add cast to enum attr_tune.

From-SVN: r146484
2009-04-21 10:44:25 +02:00
Manuel López-Ibáñez 1e4ae551dd re PR c/16202 (The -Wsequence-point warning misses many important instances)
2009-04-21  Manuel López-Ibáñez  <manu@gcc.gnu.org>

	PR 16202
	* c-typeck.c (lvalue_p): Move declaration ...
	* c-common.h (lvalue_p): ... to here.
	* c-common.c (candidate_equal_p): New.
	(add_tlist): Use it.
	(merge_tlist): Use it.
	(warn_for_collisions_1): Likewise.
	(warning_candidate_p): Accept more candidates.
	(verify_tree): A warning candidate can be an expression. Use
	candidate_equal_p.
cp/
	* tree.c (lvalue_p_1): Use const_tree.
	Use CONST_CAST_TREE to avoid warning.
	(lvalue_p): Returns bool, receives const_tree.
testsuite/
	* gcc.dg/sequence-pt-1.c: Remove XFAILs.
	* gcc.dg/sequence-pt-2.c: New.
	* gcc.dg/sequence-pt-3.c: New.
	* g++.dg/warn/sequence-pt-1.C: Remove XFAILs.
	* g++.dg/warn/sequence-pt-2.c: New.
	* g++.dg/warn/sequence-pt-3.c: New.

From-SVN: r146472
2009-04-21 07:47:13 +00:00
Ben Elliston 244609a618 re PR target/5267 (invoke.texi "RS/6000 and PowerPC Options" list needs cleanup)
PR target/5267
	* doc/invoke.texi (RS/6000 and PowerPC Options): Add documentation
	for -mcall-eabi, -mcall-aixdesc, -mcall-freebsd and -mcall-openbsd
	options.  Remove -mcall-solaris documentation.

From-SVN: r146463
2009-04-21 09:55:53 +10:00
Andrew Pinski f28a61ab11 Fix misspelling of process_init_element.
From-SVN: r146462
2009-04-20 16:13:17 -07:00
Manuel López-Ibáñez 9c650d90ab re PR c++/13358 (long long and C++ do not mix well)
2009-04-21  Manuel Lopez-Ibanez  <manu@gcc.gnu.org>

	PR c++/13358
	* doc/invoke.texi (-Wlong-long): Update description.
	* c-lex (interpret_integer): Only warn if there was no previous
	overflow and -Wlong-long is enabled.
	* c-decl.c (declspecs_add_type): Drop redundant flags.
	* c.opt (Wlong-long): Init to -1.
	* c-opts.c (sanitize_cpp_opts): Synchronize cpp's warn_long_long
	and front-end warn_long_long. Wlong-long only depends on other
	flags if it is uninitialized.
	* c-parser.c (disable_extension_diagnostics): warn_long_long is
	the same for CPP and FE.
	(restore_extension_diagnostics): Likewise.
libcpp/
	* init.c (cpp_create_reader): Wlong_long is disabled by default.
	* expr.c (cpp_classify_number): Give different messages for C and
	C++ front-ends.
cp/
	* parser.c (cp_parser_check_decl_spec): Drop redundant flags.
	* error.c (pedwarn_cxx98): New.
	* cp-tree.h (pedwarn_cxx98): Declare.
testsuite/
	* gcc.dg/wtr-int-type-1.c: Use two dg-warning to match two
	messages. Test for "long long" in system headers.
	* gcc.dg/c99-longlong-2.c: New.
	* g++.dg/warn/pr13358.C: New.
	* g++.dg/warn/pr13358-2.C: New.
	* g++.dg/warn/pr13358-3.C: New.
	* g++.dg/warn/pr13358-4.C: New.

From-SVN: r146459
2009-04-20 22:12:52 +00:00
Ian Lance Taylor bbbbb16a88 Fix enum conversions which are invalid in C++:
gcc/:
	Fix enum conversions which are invalid in C++:
	* auto-inc-dec.c (attempt_change): Change 0 to SET in function
	call.
	* calls.c (store_one_arg): Change 0 to EXPAND_NORMAL in function
	call.
	* cse.c (hash_rtx_cb): Change 0 to VOIDmode in function call.
	* dbgcnt.c (dbg_cnt_set_limit_by_name): Add cast to enum type.
	* dbxout.c (dbxout_symbol): Change 0 to VOIDmode in function
	call.
	(dbxout_parms): Likewise.
	* df-core.c (df_set_flags): Change changeable_flags parameter to
	int.
	(df_clear_flags): Likewise.
	* df-problems.c (df_rd_bb_local_compute_process_def): Change
	top_flag parameter to int.
	(df_chain_create_bb_process_use): Likewise.
	(df_chain_add_problem): Change chain_flags parameter to unsigned
	int.  Remove cast.
	* df-scan.c (df_ref_create): Change ref_flags parameter to int.
	(df_ref_create_structure, df_def_record_1): Likewise.
	(df_defs_record, df_uses_record, df_get_call_refs): Likewise.
	(df_notes_rescan): Change 0 to VOIDmode in function call.
	(df_get_call_refs, df_insn_refs_collect): Likewise.
	(df_bb_regs_collect): Likewise.
	(df_entry_block_defs_collect): Likewise.
	(df_exit_block_uses_collect): Likewise.
	* df.h: Update declarations.
	* double-int.c (double_int_divmod): Add cast to enum type.
	* dse.c (replace_inc_dec): Reverse parameters to gen_int_mode.
	* dwarf2out.c (new_reg_loc_descr): Add casts to enum type.
	(based_loc_descr): Likewise.
	(loc_descriptor_from_tree_1): Change first_op and second_op to
	enum dwarf_location_atom.  Add cast to enum type.
	* expmed.c (init_expmed): Change 0 to SET in function call.
	* expr.c (init_expr_target): Change 0 to VOIDmode in function
	call.
	(expand_expr_real_1): Change 0 to EXPAND_NORMAL in function call.
	(do_store_flag): Likewise.
	* fixed-value.h (struct fixed_value): Change mode to enum
	machine_mode.
	* function.c (assign_parms): Change 0 to VOIDmode in function
	call.
	* genautomata.c (insert_automaton_decl): Change 1 to INSERT in
	function call.
	(insert_insn_decl, insert_decl, insert_state): Likewise.
	(automata_list_finish): Likewise.
	* genrecog.c (process_define_predicate): Add cast to enum type.
	* gensupport.c (init_predicate_table): Add cast to enum type.
	* gimple.c (gimple_build_return): Change 0 to ERROR_MARK in
	function call.
	(gimple_build_call_1, gimple_build_label): Likewise.
	(gimple_build_goto, gimple_build_asm_1): Likewise.
	(gimple_build_switch_1, gimple_build_cdt): Likewise.
	* gimple.h (GIMPLE_CHECK): Change 0 to ERROR_MARK in function
	call.
	(enum fallback): Rename from enum fallback_t.
	(fallback_t): Typedef as int.
	* gimple-low.c (lower_builtin_setjmp): Change TSI_SAME_STMT to
	GSI_SAME_STMT in function call.
	* ira.c (setup_class_subset_and_memory_move_costs): Add casts to
	enum type.
	(setup_reg_class_relations): Likewise.
	(setup_reg_class_nregs): Change cl to int.  Add casts to enum
	type.
	(setup_prohibited_class_mode_regs): Add cast to enum type.
	(setup_prohibited_mode_move_regs): Likewise.
	* ira-costs.c (record_reg_classes): Change rclass to enum
	reg_class.
	(record_address_regs): Change i to enum reg_class.
	* lists.c (alloc_EXPR_LIST): Add cast to enum type.
	* machmode.h (GET_MODE_CLASS): Cast value to enum mode_class.
	(GET_MODE_WIDER_MODE): Cast value to enum machine_mode.
	(GET_MODE_2XWIDER_MODE): Likewise.
	(GET_CLASS_NARROWEST_MODE): Likewise.
	* omp-low.c (expand_omp_for): Add cast to enum type.
	* optabs.c (debug_optab_libfuncs): Add casts to enum type.
	* opts.c (enable_warning_as_error): Change kind to diagostic_t.
	* postreload.c (reload_cse_simplify_operands): Change rclass local
	to enum reg_class.
	* predict.c (combine_predictions_for_insn): Change best_predictor
	and predictor to enum br_predictor.
	(combine_predictions_for_bb): Likewise.
	(build_predict_expr): Change assignment to PREDICT_EXPR_OUTCOME to
	use SET_PREDICT_EXPR_OUTCOME.
	* real.c (real_arithmetic): Change icode to code in function
	call.
	* reginfo.c (init_move_cost): Add casts to enum type.
	(init_reg_sets_1, init_fake_stack_mems): Likewise.
	* regmove.c (regclass_compatible_p): Change class0 and class1 to
	enum reg_class.
	* reload.c (find_valid_class): Add casts to enum type.
	(push_reload): Change 0 to NO_REGS in function call.
	(find_reloads): Change this_alternative to array of enum
	reg_class.  Remove some now-unnecessary casts.
	(make_memloc): Change 0 to VOIDmode in function call.
	* reload1.c (reload): Change 0 to VOIDmode in function call.
	(eliminate_regs_1, elimination_effects): Likewise.
	(eliminate_regs_in_insn): Likewise.
	(emit_input_reload_insns): Add cast to enum type.
	(delete_output_reload): Change 0 to VOIDmode in function call.
	* reorg.c (insn_sets_resource_p): Convert include_delayed_effects
	to enum type in function call.
	* tree.h (PREDICT_EXPR_OUTCOME): Add cast to enum type.
	(SET_PREDICT_EXPR_OUTCOME): Define.
	* tree-dump.c (get_dump_file_info): Change phase parameter to
	int.
	(get_dump_file_name, dump_begin, dump_enabled_p): Likewise.
	(dump_initialized_p, dump_flag_name, dump_end): Likewise.
	(dump_function): Likewise.
	* tree-dump.h: Update declarations.
	* tree-pass.h: Update declarations.
	* varasm.c (assemble_integer): Change mclass to enum mode_class.
	* config/arm/arm.c (thumb_legitimize_reload_address): Add cast to
	enum type.
	(arm_rtx_costs_1): Correct parenthesization.
	(arm_rtx_costs): Add casts to enum type.
	(adjacent_mem_locations): Reverse arguments to const_ok_for_op.
	(vfp_emit_fstmd): Use add_rg_note.
	(emit_multi_reg_push, emit_sfm): Likewise.
	(thumb_set_frame_pointer): Likewise.
	(arm_expand_prologue): Likewise.
	(arm_regno_class): Change return type to enum reg_class.
	(thumb1_expand_prologue): Use add_reg_note.
	* config/arm/arm-protos.h (arm_regno_class): Update declaration.
	* config/arm/arm.h (INITIALIZE_TRAMPOLINE): Change 0 to LCT_NORMAL
	in function call.
	* config/arm/gentune.sh: Add cast to enum type.
	* config/arm/arm-tune.md: Rebuild.
	* config/i386/i386.c (ix86_expand_prologue): Use add_reg_note.
	(ix86_split_fp_branch, predict_jump): Likewise.
	(ix86_expand_multi_arg_builtin): Change sub_code from enum
	insn_code to enum rtx_code.
	(ix86_builtin_vectorized_function): Add cast to enum type.
	* config/i386/i386.md (truncdfsf2): Change slot to enum
	ix86_stack_slot.
	(truncxf<mode>2, isinf<mode>2): Likewise.
	* config/i386/i386-c.c (ix86_pragma_target_parse): Add cast to
	enum type.
	* config/ia64/ia64.c (ia64_split_tmode_move): Use add_reg_note.
	(spill_restore_mem, do_spill, ia64_expand_prologue): Likewise.
	(insert_bundle_state): Change 1 to INSERT in function call.
	(ia64_add_bundle_selector_before): Likewise.
	* config/ia64/ia64.md (cpu attr): Add cast to enum type.
	(save_stack_nonlocal): Change 0 to LCT_NORMAL in function call.
	(restore_stack_nonlocal): Likewise.
	* config/mips/mips.h (MIPS_ICACHE_SYNC): Change 0 to LCT_NORMAL in
	function call.
	* config/mips/mips.c (mips_binary_cost): Change 0 to SET in
	function call.
	(mips_rtx_costs): Likewise.
	(mips_override_options): Add casts to enum type.
	* config/mips/sdemtk.h (MIPS_ICACHE_SYNC): Change 0 to LCT_NORMAL
	in function call.
	* config/pa/pa.c (legitimize_pic_address): Use add_reg_note.
	(store_reg, set_reg_plus_d): Likewise.
	(hppa_expand_prologue, hppa_profile_hook): Likewise.
	* config/rs6000/rs6000.c (rs6000_init_hard_regno_mode_ok): Add
	cast to enum type.
	(altivec_expand_vec_set_builtin): Change 0 to EXPAND_NORMAL in
	function call.
	(emit_unlikely_jump): Use add_reg_note.
	(rs6000_emit_allocate_stack): Likewise.
	(rs6000_frame_related, rs6000_emit_prologue): Likewise.
	(output_toc): Change 1 to INSERT in function call.
	(output_profile_hook): Change 0 to LCT_NORMAL in function call.
	(rs6000_initialize_trampoline): Likewise.
	(rs6000_init_dwarf_reg_sizes_extra): Change 0 to EXPAND_NORMAL in
	function call.
	* config/s390/s390.c (s390_rtx_costs): Add cast to enum type.
	(s390_expand_movmem): Change 0 to OPTAB_DIRECT in function call.
	(s390_expand_setmem, s390_expand_cmpmem): Likewise.
	(save_gprs): Use add_reg_note.
	(s390_emit_prologue): Likewise.
	(s390_expand_builtin): Change 0 to EXPAND_NORMAL in function
	call.
	* config/sparc/sparc.c (sparc_expand_prologue): Use add_reg_note.
	(sparc_fold_builtin): Add cast to enum type.
	* config/spu/spu.c (spu_emit_branch_or_set): Change ior_code to
	enum insn_code.
	(spu_expand_prologue): Use add_reg_note.
	(expand_builtin_args): Change 0 to EXPAND_NORMAL in function
	call.

	* c-parser.c (c_parser_attributes): Change VEC back to tree list.
	(c_parser_postfix_expression_after_primary): Get VEC for list of
	arguments.  Get original types of arguments.  Call
	build_function_call_vec.
	(cached_expr_list_1, cached_expr_list_2): New static variables.
	(c_parser_expr_list): Change return type to VEC *.  Add
	p_orig_types parameter.  Change all callers.
	(c_parser_release_expr): New static function.
	(c_parser_vec_to_tree_list): New static function.
	* c-typeck.c (build_function_call): Rewrite to build a VEC and
	call build_function_call_vec.
	(build_function_call_vec): New function, based on old
	build_function_call.
	(convert_arguments): Remove nargs and argarray parameters.  Change
	values to a VEC.  Add origtypes parameter.
	(build_modify_expr): Add rhs_origtype parameter.  Change all
	callers.
	(convert_for_assignment): Add origtype parameter.  Change all
	callers.  If warn_cxx_compat, check for conversion to an enum
	type when calling a function.
	(store_init_value): Add origtype parameter.  Change all callers.
	(digest_init): Likewise.
	(struct init_node): Add origtype field.
	(add_pending_init): Add origtype parameter.  Change all callers.
	(output_init_element): Likewise.
	(output_pending_init_elements): Pass origtype from init_node to
	output_init_element.
	(process_init_elemnt): Pass origtype from c_expr to
	output_init_element.
	(c_finish_return): Add origtype parameter.  Change all callers.
	* c-common.c (sync_resolve_size): Change params to VEC *.  Change
	caller.
	(sync_resolve_params): Likewise.
	(sync_resolve_return): Change params to first_param.  Change
	caller.
	(resolve_overloaded_builtins): Change params to VEC *.  Change
	callers.   Save first parameter around call to
	build_function_call_vec.
	* c-decl.c (finish_decl): Add origtype parameter.  Change all
	callers.  Call build_function_call_vec rather than
	build_function_call for cleanup.
	* c-tree.h: Update declarations.
	* c-common.h: Update declarations.
	* stub-objc.c (objc_rewrite_function_call): Change parameter from
	params to first_param.
	* target.h (struct gcc_target): Change resolve_overloaded_builtin
	params parameter from tree to void *.
	* config/rs6000/rs6000-c.c (altivec_resolve_overloaded_builtin):
	Change arglist parameter to have type void *, and to be a pointer
	to a VEC.
	* config/rs6000/rs6000-protos.h
	(altivec_resolve_overloaded_builtin): Update declaration.
	* config/spu/spu-c.c (spu_resolved_overloaded_builtin): Change
	fnargs parameter to have type void *, and to be a pointer to a
	VEC.  Call build_function_call_vec instead of
	build_function_call.
	* config/spu/spu-protos.h (spu_expand_builtin): Update
	declaration.

gcc/cp/:
	* typeck.c (build_function_call_vec): New function.
	(cp_build_function_call): Only pass first parameter to
	objc_rewrite_function_call.
	(build_modify_expr): Add rhs_origtype parameter.  Change all
	callers.
	* decl.c (finish_decl): Add origtype parameter.  Change all
	callers.
	* semantics.c (finish_call_expr): Pass VEC to
	resolve_overloaded_builtin.

gcc/objc:
	* objc-act.c (objc_rewrite_function_call): Change parameter from
	params to first_param.  Change all callers.

gcc/testsuite:
	* gcc.dg/Wcxx-compat-3.c: New testcase.

From-SVN: r146451
2009-04-20 19:35:00 +00:00
Joey Ye 6ff078d4f4 atom.md: Add bypasses with ix86_dep_by_shift_count.
2009-04-20  Joey Ye  <joey.ye@intel.com>
	    Xuepeng Guo <xuepeng.guo@intel.com>
	    H.J. Lu  <hongjiu.lu@intel.com>

	* config/i386/atom.md: Add bypasses with ix86_dep_by_shift_count.

	* config/i386/i386.c (LEA_SEARCH_THRESHOLD): New macro.
	(IX86_LEA_PRIORITY): Likewise.
	(distance_non_agu_define): New function.
	(distance_agu_use): Likewise.
	(ix86_lea_for_add_ok): Likewise.
	(ix86_dep_by_shift_count): Likewise.

	* config/i386/i386.md: Call ix86_lea_for_add_ok to decide we
	should split for LEA.

	* config/i386/i386-protos.h (ix86_lea_for_add_ok): Declare new
	function.
	(ix86_dep_by_shift_count): Likewise.

Co-Authored-By: H.J. Lu <hongjiu.lu@intel.com>
Co-Authored-By: Xuepeng Guo <xuepeng.guo@intel.com>

From-SVN: r146443
2009-04-20 10:09:25 -07:00
Richard Guenther 87a5b4cc3c expr.c (handled_component_p): Move ...
2009-04-20  Richard Guenther  <rguenther@suse.de>

	* expr.c (handled_component_p): Move ...
	* tree.h (handled_component_p): ... here.
	* tree.def: Re-order BIT_FIELD_REF, COMPONENT_REF,
	ARRAY_REF, ARRAY_RANGE_REF, VIEW_CONVERT_EXPR, IMAGPART_EXPR
	and REALPART_EXPR to be in one group.

From-SVN: r146427
2009-04-20 14:11:34 +00:00
Richard Guenther 438c239d76 basic-block.h (get_all_dominated_blocks): Declare.
2009-04-20  Richard Guenther  <rguenther@suse.de>

	* basic-block.h (get_all_dominated_blocks): Declare.
	* dominance.c (get_all_dominated_blocks): New function.
	* tree-cfg.c (get_all_dominated_blocks): Remove.
	(remove_edge_and_dominated_blocks): Adjust.
	* tree-ssa-phiprop.c (tree_ssa_phiprop_1): Fold in ...
	(tree_ssa_phiprop): ... here.  Use get_all_dominated_blocks
	instead of recursing.

From-SVN: r146425
2009-04-20 14:01:52 +00:00
Doug Kwan fed5ae113c cgraph.h (cgraph_node_ptr): New type for vector functions.
* cgraph.h (cgraph_node_ptr): New type for vector functions.
	(struct cgraph_node_set_def): New type.
	(cgraph_node_set) New type. Also declare vector functions.
	(struct cgraph_node_set_element_def): New type.
	(cgraph_node_set_element): Ditto.
	(cgraph_node_set_iterator): New iterator type.
	(cgraph_node_set_new, cgraph_node_set_find, cgraph_node_set_add,
	cgraph_node_set_remove, dump_cgraph_node_set,
	debug_cgraph_node_set): New prototypes.
	(csi_end_p, csi_next, csi_node, csi_start, cgraph_node_in_set_p,
	cgraph_node_set_size): New inlines.
	* tree-pass.h (struct cgraph_node_set_def): New decl to avoid
	including cgraph.h.
	(struct ipa_opt_pass): Add struct cgraph_node_set_def
	argument to function 'write_summary'.
	* ipa.c: Include ggc.h.
	(hash_cgraph_node_set_element,
	eq_cgraph_node_set_element, cgraph_node_set_new,
	cgraph_node_set_add, cgraph_node_set_remove,
	cgraph_node_set_find, dump_cgraph_node_set,
	debug_cgraph_node_set): New functions.
	* Makefile.in (ipa.o): Add dependency on GGC_H.

From-SVN: r146418
2009-04-20 09:27:15 -04:00
Ira Rosen c4551b28a7 re PR tree-optimization/39675 (ICE in vect_get_vec_def_for_operand, at tree-vect-transform.c:1999)
PR tree-optimization/39675
	* tree-vect-loop.c (vect_transform_loop): Remove currently redundant 
	check of the return code of vect_schedule_slp. Check that stmt_vec_info
	still exists for the statement, before checking its vectorization type.

From-SVN: r146399
2009-04-20 11:26:18 +00:00
Michael Matz 21a495fba4 * Makefile.in (generated_files): Take out $(simple_generated_c).
From-SVN: r146381
2009-04-20 09:20:33 +00:00
Dave Korn 8e208874c7 cygwin-stdint.h (INTPTR_TYPE): Remove "long".
* config/i386/cygwin-stdint.h (INTPTR_TYPE):  Remove "long".
	(UINTPTR_TYPE):  Likewise.

From-SVN: r146360
2009-04-19 21:15:01 +00:00
Joseph Myers a45e580b25 re PR c/37481 (-pedantic accepts flexible array member = "string" initialization)
PR c/37481
	* c-typeck.c (digest_init): Check for initializing an array with a
	string literal.

testsuite:
	* gcc.dg/c99-flex-array-7.c: New test.

From-SVN: r146359
2009-04-19 21:38:53 +01:00
Joseph Myers 20845d3582 re PR c/19771 (VLA deallocation)
PR c/19771
	* c-semantics.c (pop_stmt_list): Propagate
	STATEMENT_LIST_HAS_LABEL to parent statement list.

testsuite:
	* gcc.c-torture/execute/vla-dealloc-1.c: New test.

From-SVN: r146358
2009-04-19 21:19:54 +01:00
Adam Nemet 28143fdd2f mips.h (mips_tune_attr): New macro.
* config/mips/mips.h (mips_tune_attr): New macro.
	* config/mips/mips.md (cpu): Use it.

From-SVN: r146357
2009-04-19 19:56:14 +00:00
Joseph Myers da377db901 re PR c/38243 (Restrict constraint violation not an error with -pedantic-errors)
PR c/38243
	* c-decl.c (shadow_tag_warned): Diagnose use of restrict when
	declaring a tag.

testsuite:
	* gcc.dg/c99-restrict-3.c: New test.

From-SVN: r146356
2009-04-19 19:25:07 +01:00
Diego Novillo 3baf459d85 toplev.c (compile_file): Move call to coverage_finish ...
* toplev.c (compile_file): Move call to coverage_finish ...
	* cgraphunit.c (ipa_passes): ... here.
	Call cgraph_process_new_functions.
	* ipa-utils.c (get_base_var): Handle CONSTRUCTOR.
	* Makefile.in (cgraphunit.o): Add dependency on COVERAGE_H.

From-SVN: r146354
2009-04-19 13:52:03 -04:00
Jan Hubicka b6fa5b0101 cgraph.c (cgraph_create_edge, [...]): Set proper cfun.
* cgraph.c (cgraph_create_edge, cgraph_set_call_stmt): Set proper cfun.
	(dump_cgraph_node): Dump can throw external flag.
	* ipa-pure-const.c (propagate): Fix propagation of nothrow flags.

From-SVN: r146349
2009-04-19 13:27:28 +00:00
Manuel López-Ibáñez ca409efd92 re PR c/32061 ((Wlogical-op) wording of warning of constant logicials need improvement)
2009-04-19  Manuel López-Ibáñez  <manu@gcc.gnu.org>

	PR c/32061
	PR c++/36954
	* doc/invoke.texi: Add -Wlogical-op to -Wextra.
	* common.opt (Wlogical-op): Move from here...
	* c.opt (Wlogical-op): ... to here.
	* c-typeck.c (parser_build_binary_op): Update call to
	warn_logical_operator.
	* c-opts.c (c_common_post_options): Enable warn_logical_op with
	extra_warnings.
	* c-common.c (warn_logical_op): Update.
	* c-common.h (warn_logical_op): Update declaration.
cp/
	* call.c (build_new_op): Save the original codes of operands
	before folding.
	
testsuite/
	* gcc.dg/pr32061.c: New.
	* gcc.dg/Wlogical-op-1.c: Update.
	* g++.dg/warn/Wlogical-op-1.C: Update.
	* g++.dg/warn/pr36954.C: New.

From-SVN: r146344
2009-04-19 11:04:13 +00:00
Eric Botcazou 9db4cdd334 * tree.c (protected_set_expr_location): Fix formatting.
From-SVN: r146340
2009-04-19 08:39:05 +00:00
Joseph Myers f37acdf9b1 re PR c/27676 (gcc is overly strict in assignment to read-only data)
PR c/27676
	* c-typeck.c (readonly_warning): new.
	(build_unary_op, build_modify_expr): Use readonly_warning for
	storing into something readonly but not const-qualified.

testsuite:
	* gcc.dg/lvalue-5.c: New test.

From-SVN: r146336
2009-04-19 00:21:34 +01:00
Joseph Myers 2b4b70360f re PR c/22367 (constraints on '&' not fully implemented)
PR c/22367
	* c-typeck.c (build_unary_op): Check for taking address of
	expression of type void.

testsuite:
	* gcc.dg/lvalue-6.c, gcc.dg/lvalue-7.c: New tests.

From-SVN: r146332
2009-04-18 23:34:10 +01:00
Joseph Myers 3ce6296587 re PR c/35210 (gcc incorrectly allows calling function returning "const void")
PR c/35210
	* c-typeck.c (build_function_call): Check for calling a function
	with qualified void return types.  Call require_complete_type when
	generating a trap.

testsuite:
	* gcc.dg/call-diag-2.c: New test.

From-SVN: r146324
2009-04-18 21:02:47 +01:00
Jan Hubicka 2505c5edca cgraph.c (cgraph_make_edge, [...]): Set nothrow flag.
* cgraph.c (cgraph_make_edge, dump_cgraph_node, cgraph_set_call_stmt):
	Set nothrow flag.
	* cgraph.h (struct function): Reduce loop_nest to 30 bits; add
	can_throw_external flag.
	* ipa-reference.c (ipa_utils_reduced_inorder): Update call.
	* ipa-pure-const.c (ignore_edge): New function.
	(propagate): Compute order for NOTHROW computation; set NOTHROWs
	only over can_throw_external edges.
	(local_pure_const): Add nothrow flag.
	* ipa-utils.c (searchc): Add ignore_edge callback.
	(ipa_utils_reduced_inorder): Add ignore_edge callback.
	* ipa-utils.h (ipa_utils_reduced_inorder): Update prototype.
	(set_nothrow_function_flags): Update cgraph.
	* tree-cfg.c (verify_stmt): Relax nothrow checking when in IPA mode.

From-SVN: r146322
2009-04-18 18:39:52 +00:00
Richard Guenther 2586ba4bda re PR tree-optimization/39804 (internal compiler error: in propagate_necessity, at tree-ssa-dce.c:754)
2009-04-18  Richard Guenther  <rguenther@suse.de>

	PR middle-end/39804
	* tree-ssa-ccp.c (fold_stmt_1): New function factored from ...
	(fold_stmt): ... this and ...
	(fold_stmt_inplace): ... this.
	(fold_stmt_1): Fold references in calls and asms.
	* tree-cfg.c (remove_useless_stmts_cond): Use fold_stmt.

	* gcc.target/i386/pr39804.c: New testcase.

From-SVN: r146314
2009-04-18 13:02:00 +00:00
Kazu Hirata 1eefab17a5 tree-vrp.c (ssa_name_nonzero_p): Remove.
* tree-vrp.c (ssa_name_nonzero_p): Remove.
	* tree.h: Remove the prototype for ssa_name_nonzero_p.

From-SVN: r146313
2009-04-18 11:49:20 +00:00
Kazu Hirata aa424b01a1 tree.c (function_args_count): Remove.
* tree.c (function_args_count): Remove.
	* tree.h: Remove the prototype for function_args_count.

From-SVN: r146312
2009-04-18 11:48:19 +00:00
Kazu Hirata 613a896b58 tree-iterator.c (expr_only): Remove.
* tree-iterator.c (expr_only): Remove.
	* tree.h: Remove the prototype for expr_only.

From-SVN: r146311
2009-04-18 11:47:22 +00:00
Kazu Hirata 579e694c11 reginfo.c (cannot_change_mode_set_regs): Remove.
* reginfo.c (cannot_change_mode_set_regs): Remove.
	* rtl.h: Remove the prototype for cannot_change_mode_set_regs.

From-SVN: r146310
2009-04-18 11:45:08 +00:00
Anatoly Sokolov ee7e3ad3d1 avr.md (*rotlsi3_8, [...]): Check whether operands 0 and 1 overlaps.
* config/avr/avr.md (*rotlsi3_8, *rotlsi3_16, *rotlsi3_24 ): Check
	whether operands 0 and 1 overlaps.

From-SVN: r146309
2009-04-18 15:16:37 +04:00
Manuel López-Ibáñez 92ef7fb19a re PR middle-end/36902 (Array bound warning with dead code after optimization)
2009-04-18  Manuel López-Ibáñez  <manu@gcc.gnu.org>

	PR middle-end/36902
	* tree-vrp.c (check_array_ref): Pass a location_t instead of a
	pointer. Use warning_at instead of warning.
	(search_for_addr_array): Likewise.
	(check_array_bounds): Likewise.
	(check_all_array_refs): Check that the incoming edge is not in the
	list of edges to be removed.
	(check_all_array_refs): Avoid the temporal pointer.
	(vrp_visit_cond_stmt): Fix typo.
	(simplify_switch_using_ranges): Handle the case where the switch
	index is an integer constant.
testsuite/
	* gcc.dg/pr36902.c: New.

From-SVN: r146305
2009-04-18 09:24:45 +00:00
Adam Nemet 0e097268ba * config/mips/mips.c (mips_final_postscan_insn): Make it static.
From-SVN: r146304
2009-04-18 07:44:39 +00:00
Kazu Hirata c782f1dda4 * doc/extend.texi, doc/invoke.texi: Fix typos.
From-SVN: r146303
2009-04-18 02:10:37 +00:00
Cary Coutant 668fb0e80c * tree-flow-inline.h (get_lineno): Fix inverted test.
From-SVN: r146299
2009-04-17 16:58:12 -07:00
Diego Novillo 4d4014c1cd tree-ssa-pre.c (create_expression_by_pieces): Remove assertion for AVAIL_OUT.
* tree-ssa-pre.c (create_expression_by_pieces): Remove
	assertion for AVAIL_OUT.

From-SVN: r146298
2009-04-17 18:28:51 -04:00
Mike Frysinger 2984e1b612 re PR target/38627 (SuperH libgcc.a lacks .note.GNU-stack markings in math funcs)
PR target/38627
	* config/sh/lib1funcs.asm [__ELF__ && __linux__]: Add .note.GNU-stack.
	* config/sh/linux-atomic.asm: Likewise.

From-SVN: r146297
2009-04-17 22:20:40 +00:00
Diego Novillo 9994a182c8 except.c (debug_eh_tree): New.
* except.c (debug_eh_tree): New.
	(struct eh_region, struct eh_status): Move ...
	* except.h: ... here.
	(add_type_for_runtime): Declare extern.
	(lookup_type_for_runtime): Likewise.
	(debug_eh_tree): Declare.
	* Makefile.in (GTFILES): List except.h before except.c

From-SVN: r146296
2009-04-17 18:05:09 -04:00
Diego Novillo 07485407e1 omp-low.c (create_omp_child_function): Set DECL_CONTEXT for DECL.
* omp-low.c (create_omp_child_function): Set DECL_CONTEXT
	for DECL.
	* cgraphunit.c (cgraph_build_static_cdtor): Likewise.
	* tree-dfa.c (find_referenced_vars_in): Factor out of ...
	(find_vars_r): ... here.
	* tree-flow.h (find_referenced_vars_in): Declare.
	* tree-ssa-pre.c (create_expression_by_pieces): Assert
	that AVAIL_OUT exists for BLOCK.
	* Makefile.in (CGRAPH_H): Add dependency on cif-code.def
	(tree-loop-distribution.o): Fix dependency on TREE_VECTORIZER_H.
	(tree-parloops.o): Likewise.

testsuite/ChangeLog

	* gcc.c-torture/execute/builtins/strlen-3.c: Fix ODR
	violation for variable 'inside_main'.

From-SVN: r146295
2009-04-17 17:45:56 -04:00
Simon Baldwin 4e53d196cc toplev.c (default_tree_printer): Add handling for %E format.
2009-04-17  Simon Baldwin  <simonb@google.com>

	* toplev.c (default_tree_printer): Add handling for %E format.

From-SVN: r146294
2009-04-17 17:30:22 -04:00
Diego Novillo 413d3aa89d tree-pretty-print.c (dump_generic_node): Add break after TREE_BINFO handler.
* tree-pretty-print.c (dump_generic_node): Add break
	after TREE_BINFO handler.
	Handle COMPLEX_TYPE, REAL_TYPE and FIXED_POINT_TYPE
	Handle NULL TREE_TYPEs.
	Handle METHOD_TYPE and FUNCTION_TYPE together.
	Call print_struct_decl when printing structures and
	TDF_SLIM is not given.
	(print_struct_decl): Fix logic for detecting recursion.

From-SVN: r146293
2009-04-17 17:28:01 -04:00
Rafael Avila de Espindola 5a691e9862 re PR other/31567 (cc1, cc1plus, etc. don't support @file mechanism)
PR 31567
	* gcc.c (create_at_file): New.
	(compile_input_file_p): New.
	(do_spec_1): Use @args files for %i. Use create_at_file for %o.
	* main.c (main): Update call to toplev_main.
	* toplev.c (toplev_main): Change signature. Call expandargv.
	* toplev.h (toplev_main): Change signature.

From-SVN: r146292
2009-04-17 17:11:46 -04:00
Eric Botcazou 9eacf7a62a dwarf2out.c (field_byte_offset): Use the type size as the field size if the latter is not constant.
* dwarf2out.c (field_byte_offset): Use the type size as the field size
	if the latter is not constant.

From-SVN: r146291
2009-04-17 20:42:16 +00:00