Commit Graph

40560 Commits

Author SHA1 Message Date
Eric Botcazou 8478130d94 Uniquization of constants at the Tree level
Uniquization of constants at the Tree level
	* tree.h (DECL_IN_CONSTANT_POOL): New macro
	(tree_decl_with_vis): Add in_constant_pool bit, move shadowed_for_var_p
	bit to the end.
	(tree_output_constant_def): Declare.
	* gimplify.c (gimplify_init_constructor): When using block copy,
	uniquize the constant constructor on the RHS.
	* lto-streamer-in.c (unpack_ts_decl_with_vis_value_fields): Deal
	with DECL_IN_CONSTANT_POOL flag.
	* lto-streamer-out.c (pack_ts_decl_with_vis_value_fields): Likewise.
	* varasm.c (make_decl_rtl): Deal with variables belonging to the
	global constant pool.
	(assemble_variable): Deal with symbols belonging to the tree constant
	pool.
	(get_constant_section): Add ALIGN parameter and simplify.
	(build_constant_desc): Build a VAR_DECL and attach it to the symbol.
	(assemble_constant_contents): Use the expression of the VAR_DECL.
	(output_constant_def_contents): Use the alignment of the VAR_DECL.
	(tree_output_constant_def): New global function.
	(mark_constant): Use the expression of the VAR_DECL.
	(place_block_symbol): Use the alignment of the VAR_DECL and the size
	of its expression.
	(output_object_block): Likewise and assemble the expression.
ada/
	* gcc-interface/trans.c (gnat_gimplify_expr) <ADDR_EXPR>: Uniquize
	constant constructors before taking their address.

From-SVN: r158838
2010-04-28 19:11:50 +00:00
Eric Botcazou 331c7fcdd0 lto-streamer.c [...] (tree_htab, [...]): New tree hash table.
* lto-streamer.c [LTO_STREAMER_DEBUG] (tree_htab, tree_hash_entry,
	hash_tree, eq_tree): New tree hash table.
	(lto_streamer_init) [LTO_STREAMER_DEBUG]: Initialize it.
	[LTO_STREAMER_DEBUG] (lto_orig_address_map, lto_orig_address_get,
	lto_orig_address_remove): Reimplement.

From-SVN: r158836
2010-04-28 19:01:00 +00:00
Xinliang David Li 34f97b9407 predicate aware uninitialized analysis
From-SVN: r158835
2010-04-28 17:41:31 +00:00
Uros Bizjak 85fac79c20 elf.h (ASM_DECLARE_OBJECT_NAME): Use gnu_unique_object type if available.
* config/alpha/elf.h (ASM_DECLARE_OBJECT_NAME): Use gnu_unique_object
	type if available.

From-SVN: r158834
2010-04-28 18:56:24 +02:00
Rainer Orth 902a51a10d re PR target/22224 (Several Tru64 UNIX testsuite failures: Length of .lcomm was less than 1)
PR target/22224
	* config/alpha/osf5.h (ASM_OUTPUT_LOCAL): Redefine.

From-SVN: r158831
2010-04-28 16:24:28 +00:00
Martin Jambor e33c6cd6af cgraph.h (struct cgraph_node): New field indirect_calls.
2010-04-28  Martin Jambor  <mjambor@suse.cz>

	* cgraph.h (struct cgraph_node): New field indirect_calls.
	(struct cgraph_indirect_call_info): New type.
	(struct cgraph_edge): Removed field indirect_call. New fields
	indirect_info, indirect_inlining_edge and indirect_unknown_callee.
	(cgraph_create_indirect_edge): Declare.
	(cgraph_make_edge_direct): Likewise.
	(enum LTO_cgraph_tags): New item LTO_cgraph_indirect_edge.
	* ipa-prop.h (struct ipa_param_call_note): Removed.
	(struct ipa_node_params): Removed field param_calls.
	(ipa_create_all_structures_for_iinln): Declare.
	* cgraph.c: Described indirect edges and uids in initial comment.
	(cgraph_add_edge_to_call_site_hash): New function.
	(cgraph_edge): Search also among the indirect edges, use
	cgraph_add_edge_to_call_site_hash to add edges to the call site hash.
	(cgraph_set_call_stmt): Possibly turn an indirect edge into a direct
	one, use cgraph_add_edge_to_call_site_hash to add edges to the call
	site hash.
	(initialize_inline_failed): Assign a reason to indirect edges.
	(cgraph_create_edge_1): New function.
	(cgraph_create_edge): Moved some functionality to
	cgraph_create_edge_1.
	(cgraph_create_indirect_edge): New function.
	(cgraph_edge_remove_callee): Add an assert checking for
	non-indirectness.
	(cgraph_edge_remove_caller): Special-case indirect edges.
	(cgraph_remove_edge): Likewise.
	(cgraph_set_edge_callee): New function.
	(cgraph_redirect_edge_callee): Use cgraph_set_edge_callee.
	(cgraph_make_edge_direct): New function.
	(cgraph_update_edges_for_call_stmt_node): Do nothing only when also
	the declaration of the call statement matches.
	(cgraph_node_remove_callees): Special-case indirect edges.
	(cgraph_clone_edge): Likewise.
	(cgraph_clone_node): Clone also the indirect edges.
	(dump_cgraph_node): Dump indirect_inlining_edge flag instead of
	indirect_call, dump count of indirect_calls edges.
	* ipa-prop.c (iinlining_processed_edges): New variable.
	(ipa_note_param_call): Create indirect edges instead of
	creating notes.  New parameter node.
	(ipa_analyze_call_uses): New parameter node, pass it on to
	ipa_note_param_call.
	(ipa_analyze_stmt_uses): Likewise.
	(ipa_analyze_params_uses): Pass node to ipa_analyze_stmt_uses.
	(print_edge_addition_message): Work on edges rather than on notes.
	(update_call_notes_after_inlining): Likewise, renamed to
	update_indirect_edges_after_inlining.
	(ipa_create_all_structures_for_iinln): New function.
	(ipa_free_node_params_substructures): Do not free notes.
	(ipa_edge_duplication_hook): Propagate bits within
	iinlining_processed_edges bitmap.
	(ipa_node_duplication_hook): Do not duplicate notes.
	(free_all_ipa_structures_after_ipa_cp): Renamed to
	ipa_free_all_structures_after_ipa_cp.
	(free_all_ipa_structures_after_iinln): Renamed to
	ipa_free_all_structures_after_iinln.g
	(ipa_write_param_call_note): Removed.
	(ipa_read_param_call_note): Removed.
	(ipa_write_indirect_edge_info): New function.
	(ipa_read_indirect_edge_info): Likewise.
	(ipa_write_node_info): Do not stream notes, do stream information
	in indirect edges.
	(ipa_read_node_info): Likewise.
	(lto_ipa_fixup_call_notes): Removed.
	* ipa-cp.c (pass_ipa_cp): Set stmt_fixup to NULL.
	* ipa-inline.c (pass_ipa_inline): Likewise.
	* cgraphunit.c (verify_cgraph_node): Check also indirect edges.
	* cif-code.def (INDIRECT_UNKNOWN_CALL): New reason.
	* tree-inline.c (copy_bb): Removed an unnecessary double check for
	is_gimple_call.
	* tree-inline.c (get_indirect_callee_fndecl): Do not consider indirect
	edges.
	* lto-cgraph.c (output_outgoing_cgraph_edges): New function.
	(output_cgraph): Stream also indirect edges.
	(lto_output_edge): Added capability to stream indirect edges.
	(input_edge): Likewise.
	(input_cgraph_1): Likewise.

	* testsuite/gcc.dg/lto/20091209-1_0.c: New testcase.

From-SVN: r158827
2010-04-28 16:05:54 +02:00
Richard Guenther 18abb35edf re PR tree-optimization/43879 (-fipa-pta causes various miscompilations)
2010-04-28  Richard Guenther  <rguenther@suse.de>

	PR tree-optimization/43879
	PR tree-optimization/43909
	* tree-ssa-structalias.c (struct variable_info): Add
	only_restrict_pointers flag.
	(new_var_info): Initialize it.  Increment stats.total_vars here.
	(create_function_info_for): Do not increment stats.total_vars
	here.
	(get_function_part_constraint): Fix build with C++.
	(insert_into_field_list): Remove.
	(push_fields_onto_fieldstack): Properly merge fields.
	(create_variable_info_for): Split and simplify.
	(create_variable_info_for_1): New piece.
	(intra_create_variable_infos): Properly make restrict constraints
	from parameters.

	* gcc.dg/ipa/ipa-pta-14.c: Adjust.

From-SVN: r158825
2010-04-28 11:51:31 +00:00
Richard Guenther c718820a97 re PR middle-end/43880 (internal compiler error: in make_decl_rtl)
2010-04-28  Richard Guenther  <rguenther@suse.de>

	PR c++/43880
	* tree-inline.c (copy_bind_expr): Also copy bind expr vars
	value-exprs.

	* g++.dg/torture/pr43880.C: New testcase.

From-SVN: r158824
2010-04-28 10:28:24 +00:00
Manuel López-Ibáñez 5dc16b1952 invoke.texi (-Wsuggest-attribute=const, [...]): Document.
2010-04-27  Manuel López-Ibáñez  <manu@gcc.gnu.org>
	    Jan Hubicka <hubicka@ucw.cz>

	* doc/invoke.texi (-Wsuggest-attribute=const,
	-Wsuggest-attribute=pure): Document.
	* ipa-pure-const.c: Include toplev.h, intl.h and opts.h.
	(function_always_visible_to_compiler_p,
	suggest_attribute, warn_function_pure, warn_function_const):
	New functions.
	(check_call): Improve debug info.
	(analyze_function): Do not check availability.
	(add_new_function): Check availability.
	(propagate): Output warnings.
	(skip_function_for_local_pure_const): New function.
	(local_pure_const): Use it; output warnings.
	* common.opt (Wsuggest-attribute=const,
	Wsuggest-attribute=pure): New.

testsuite/
	* gcc.dg/pure-2.c: New testcase.
	* gcc.dg/const-1.c: New testcase.

Co-Authored-By: Jan Hubicka <hubicka@ucw.cz>

From-SVN: r158803
2010-04-27 20:22:54 +00:00
Jakub Jelinek 78b41ae280 dwarf2out.c (def_cfa_1): After DW_CFA_def_cfa_expression force using DW_CFA_def_cfa instead of...
* dwarf2out.c (def_cfa_1): After DW_CFA_def_cfa_expression
	force using DW_CFA_def_cfa instead of DW_CFA_def_cfa_register
	or DW_CFA_def_cfa_offset{,_sf}.

From-SVN: r158793
2010-04-27 20:12:32 +02:00
Eric Botcazou 6210710649 * tree.h: Fix truncated long macros.
From-SVN: r158792
2010-04-27 17:56:52 +00:00
Kai Tietz ad21109137 collect2.c (TARGET_64BIT): Redefine to target's default.
2010-04-27  Kai Tietz  <kai.tietz@onevision.com>

        * collect2.c (TARGET_64BIT): Redefine to target's default.
        * tlink.c: Likewise.
        * config/i386/cygming.h (USER_LABEL_PREFIX): Define
        dependent to TARGET_64BIT and USE_MINGW64_LEADING_UNDERSCORES.
        * config/i386/i386.h (CRT_CALL_STATIC_FUNCTION): Use
        for underscoring __USER_LABEL_PREFIX__.
        * config/i386/mingw-w64.h (SUB_LINK_ENTRY): New macro.
        (SUB_LINK_ENTRY32): New.
        (SUB_LINK_ENTRY64): New.
        (LINK_SPEC): Replace entry point spec by
        SUB_LINK_ENTRY.
        * config/i386/mingw32 (SUB_LINK_ENTRY32): New.
        (SUB_LINK_ENTRY64): New.
        (SUB_LINK_ENTRY): New.
        (LINK_SPEC): Use SUB_LINK_ENTRY instead of hard-coded entry-point.
        (DWARF2_UNWIND_INFO): Error out for use of dw2 unwind when
        x64 target is choosen.
        * config.in (USE_MINGW64_LEADING_UNDERSCORES): New.
        * configure: Regenerated.
        * configure.ac (leading-mingw64-underscores): Option added.

From-SVN: r158791
2010-04-27 19:48:58 +02:00
Jan Hubicka e65bb9be49 invoke.texi (-fipa-profile): Document.
* doc/invoke.texi (-fipa-profile): Document.
	* opts.c (decode_options): Enable ipa-profile at -O1.
	* timevar.def (TV_IPA_PROFILE): Define.
	* common.opt (fipa-profile): Add.
	* cgraph.c (cgraph_clone_node): Set local flag and clear vtable method flag
	for clones.
	(cgraph_propagate_frequency): Handle only local ones.
	* tree-pass.h (pass_ipa_profile): Declare.
	* ipa-profile.c (gate_profile): Use flag_ipa_profile.
	(pass_ipa_profile): Use TV_IPA_PROFILE.
	* ipa.c (ipa_profile): New function.
	(gate_ipa_profile): Likewise.
	(pass_ipa_profile): New global variable.
	* passes.c (pass_ipa_profile): New.

From-SVN: r158788
2010-04-27 14:56:33 +00:00
Nathan Froyd 8606c81dce * config/arm/arm.c (arm_expand_builtin): Remove redundant declaration.
From-SVN: r158783
2010-04-27 12:48:39 +00:00
Martin Jambor 78eaf7bf18 re PR middle-end/43812 (compiling .cc file with -fwhole-program results in ICE, in ipcp_iterate_stage, at ipa-cp.c:760)
2010-04-27  Martin Jambor  <mjambor@suse.cz>

	PR middle-end/43812
	* ipa.c (dissolve_same_comdat_group_list): New function.
	(function_and_variable_visibility): Call
	dissolve_same_comdat_group_list when comdat group contains external or
	newly local nodes.
	* cgraphunit.c (verify_cgraph_node): Verify that same_comdat_group
	lists are circular and that they contain only DECL_ONE_ONLY nodes.

	* testsuite/g++.dg/ipa/pr43812.C: New test.

From-SVN: r158777
2010-04-27 12:07:47 +02:00
Eric Botcazou 5b56d3bbca varasm.c (decode_addr_const): Handle special case of INDIRECT_REF.
* varasm.c (decode_addr_const): Handle special case of INDIRECT_REF.
	(const_hash_1) <VECTOR_CST>: New case.
	(compare_constant) <VECTOR_CST>: Likewise.
	<ADDR_EXPR>: Deal with LABEL_REFs.
	(copy_constant) <VECTOR_CST>: New case.

From-SVN: r158776
2010-04-27 09:47:13 +00:00
Jan Hubicka fa5f5e275f cgraph.c (cgraph_propagate_frequency): New function.
* cgraph.c (cgraph_propagate_frequency): New function.
	* cgraph.h (cgraph_propagate_frequency): Declare.
	* ipa-inline.c (cgraph_clone_inlined_nodes): Call
	cgraph_propagate_frequency.

	* testsuite/gcc.dg/ipa/iinline-1.c (main): Rename to...
	(test): ... this one.

From-SVN: r158775
2010-04-27 09:44:30 +00:00
Jakub Jelinek 934f5b4225 * unwind-dw2.c (_Unwind_DebugHook): Add used and noclone attributes.
From-SVN: r158773
2010-04-27 11:40:46 +02:00
Bernd Schmidt cb751cbd75 re PR target/40657 (allocate local variables with fewer instructions)
PR target/40657
	* config/arm/arm.c (thumb1_extra_regs_pushed): New function.
	(thumb1_expand_prologue, thumb1_output_function_prologue): Call it
	here to determine which regs to push and how much stack to reserve.

	PR target/40657
	* gcc.target/arm/thumb-stackframe.c: New test.

From-SVN: r158771
2010-04-27 09:34:08 +00:00
Jie Zhang a502783080 gimple.texi (gimple_statement_with_ops): Remove addresses_taken field.
* doc/gimple.texi (gimple_statement_with_ops): Remove
	addresses_taken field.
	(gimple_statement_with_memory_ops): Likewise.

From-SVN: r158770
2010-04-27 09:15:11 +00:00
Jan Hubicka d89488ec13 tree-inline.c (eni_inlining_weights): Remove.
* tree-inline.c (eni_inlining_weights): Remove.
	(estimate_num_insns): Special case more builtins.

From-SVN: r158766
2010-04-27 05:41:33 +00:00
Shujing Zhao 637f14555e re PR c/32207 (missing warnings about address of 'x'.)
gcc/
2010-04-27  Shujing Zhao  <pearly.zhao@oracle.com>

        PR c/32207
        * c-typeck.c (build_binary_op): Move forward check for comparison
        pointer with null pointer constant and adjust the diagnostic message.

gcc/testsuite/
2010-04-27  Shujing Zhao  <pearly.zhao@oracle.com>

        PR c/32207
        * gcc.dg/pr32207.c: New test.
        * gcc.dg/misc-column.c: Adjust expected warning.
        * gcc.dg/Walways-true-1.c: Likewise.
        * gcc.dg/Walways-true-2.c: Likewise.
        * gcc.dg/warn-addr-cmp.c: Likewise.

From-SVN: r158765
2010-04-27 02:40:19 +00:00
Dave Korn f042307864 Missing changelog from last commit!
ChangeLog:

2010-04-27  Dave Korn  <dave.korn.cygwin@gmail.com>

	PR lto/42776
	* configure.ac (--enable-lto): Refactor handling so libelf tests
	are only performed inside then-clause of ACX_ELF_TARGET_IFELSE,
	and allow LTO to be explicitly enabled on non-ELF platforms that
	are known to support it inside else-clause.
	* configure: Regenerate.

gcc/ChangeLog


2010-04-27  Dave Korn  <dave.korn.cygwin@gmail.com>

	PR lto/42776
	* configure.ac (gcc_cv_as_section_has_align): Set if installed
	binutils supports extended .section directive needed by LTO, or
	warn if older binutils found.
	(LTO_BINARY_READER): New AC_SUBST'd variable.
	(LTO_USE_LIBELF): Likewise.
	* gcc/config.gcc (lto_binary_reader): New target-specific configure
	variable.
	* gcc/Makefile.in (LTO_BINARY_READER): Import AC_SUBST'd autoconf var.
	(LTO_USE_LIBELF): Likewise.
	* configure: Regenerate.

	* collect2.c (is_elf): Rename from this ...
	(is_elf_or_coff): ... to this, and recognize and allow i386 COFF
	 object files in addition to ELF-formatted ones.
	(scan_prog_file): Caller updated.  Also allow for LTO info marker
	symbol to be prefixed or not by an extra underscore.

	* config/i386/t-cygming (winnt.o): Also depend on LTO_STREAMER_H.
	* config/i386/winnt.c: Also #include lto-streamer.h
	(i386_pe_asm_named_section): Specify 1-byte section alignment for
	LTO named sections.
	(i386_pe_asm_output_aligned_decl_common): Add comment.
	(i386_pe_maybe_record_exported_symbol): Allow decl arg to be NULL.

From-SVN: r158764
2010-04-27 02:24:51 +00:00
Hans-Peter Nilsson 45c384e375 re PR target/43889 (mmix-knuth-mmixware gcc.c-torture/execute/arith-rand.c -O3 -fomit-frame-pointer -funroll-loops)
PR target/43889
	* config/mmix/mmix.md ("*divdi3_nonknuth", "*moddi3_nonknuth"):
	Add missing earlyclobber for second alternative.

From-SVN: r158760
2010-04-27 00:56:41 +00:00
Hans-Peter Nilsson 68e87fc9c5 mmix.md ("*divdi3_nonknuth", [...]): Add missing earlyclobber for second alternative.
* config/mmix/mmix.md ("*divdi3_nonknuth", "*moddi3_nonknuth"):
	Add missing earlyclobber for second alternative.

From-SVN: r158759
2010-04-27 00:55:30 +00:00
Bernd Schmidt 823ff7b434 df-problems.c (df_simulate_initialize_forwards): Set, don't clear, bits for artificial defs at the top of the block.
* df-problems.c (df_simulate_initialize_forwards): Set, don't clear,
	bits for artificial defs at the top of the block.
	* fwprop.c (single_def_use_enter_block): Don't call it.

From-SVN: r158750
2010-04-26 21:17:17 +00:00
Mike Stump 1637c2e1ba Update the date to date of checkin.
From-SVN: r158749
2010-04-26 20:49:37 +00:00
Jack Howarth 9ec69d2ee7 re PR target/43715 (configure option --enable-plugin fails on darwin)
2010-04-26  Jack Howarth <howarth@bromo.med.uc.edu>

	PR 43715
	* gcc/configure.ac: Use "$gcc_cv_nm -g" on darwin
	instead of "$gcc_cv_objdump -T".
	Use "-undefined dynamic_lookup" on darwin.

From-SVN: r158748
2010-04-26 20:48:35 +00:00
Jakub Jelinek b83a701b0f re PR c/43893 (Error: Invalid controlling predicate with -fopenmp)
PR c/43893
	* c-omp.c (c_finish_omp_for): Handle also EQ_EXPR.

	* testsuite/libgomp.c/pr43893.c: New test.
	* testsuite/libgomp.c++/pr43893.C: New test.

From-SVN: r158745
2010-04-26 22:07:10 +02:00
Nathan Froyd 8415f31724 c-parser.c (struct c_token): Move location field up.
* c-parser.c (struct c_token): Move location field up.
	* c-tree.h (struct c_typespec): Move expr_const_operands field up.
	(struct c_declspecs): Convert typespec_word, storage_class, and
	default_int_p into bitfields.
	(struct c_declarator): Move loc field up.

From-SVN: r158744
2010-04-26 19:10:17 +00:00
Nathan Froyd 448f65dba3 cfgloop.h (struct loop): Move can_be_parallel field up.
* cfgloop.h (struct loop): Move can_be_parallel field up.
	* ipa-prop.h (struct ip_node_params): Move bitfields up.
	* tree-ssa-loop-ivopts.c (struct version_info): Move inv_id field
	down.
	(struct iv_cand): Convert pos field into a bitfield.
	* tree-vectorizer.h (struct _loop_vec_info): Move loop_line_number
	field up.
	(struct _stmt_vec_info): Shuffle fields for better packing.

From-SVN: r158743
2010-04-26 18:21:17 +00:00
Eric Botcazou 736865e102 varasm.c (IN_NAMED_SECTION): Remove guard.
* varasm.c (IN_NAMED_SECTION): Remove guard.
	* config/arm/unknown-elf.h (IN_NAMED_SECTION): Rename to...
	(IN_NAMED_SECTION_P): ...this.
	(ASM_OUTPUT_ALIGNED_BSS): Adjust for above renaming.
	(ASM_OUTPUT_ALIGNED_DECL_LOCAL): Likewise.

From-SVN: r158738
2010-04-26 16:39:24 +00:00
Eric Botcazou 06ec59e614 gimplify.c (gimplify_cond_expr): Use THEN_ and ELSE_ local variables.
* gimplify.c (gimplify_cond_expr): Use THEN_ and ELSE_ local variables.
	Use VOID_TYPE_P for all void type tests.  Adjust TYPE variable instead
	of shadowing it.  Fix comments.

From-SVN: r158737
2010-04-26 16:32:45 +00:00
Jan Hubicka 5fefcf92fa cgraph.c (cgraph_create_node): Set node frequency to normal.
* cgraph.c (cgraph_create_node): Set node frequency to normal.
	(cgraph_clone_node): Copy function frequency.
	* cgraph.h (node_frequency): New enum
	(struct cgraph_node): Add.
	* final.c (rest_of_clean_state): Update.
	* lto-cgraph.c (lto_output_node): Output node frequency.
	(input_overwrite_node): Input node frequency.
	* tre-ssa-loop-ivopts (computation_cost): Update.
	* lto-streamer-out.c (output_function): Do not output function frequency.
	* predict.c (maybe_hot_frequency_p): Update and handle functions executed once.
	(cgraph_maybe_hot_edge_p): Likewise; use cgraph frequency instead of
	attribute lookup.
	(probably_never_executed_bb_p, optimize_function_for_size_p): Update.
	(compute_function_frequency): Set noreturn functions to be executed once.
	(choose_function_section): Update.
	* lto-streamer-in.c (input_function): Do not input function frequency.
	* function.c (allocate_struct_function): Do not initialize function frequency.
	* function.h (function_frequency): Remove.
	(struct function): Remove function frequency.
	* ipa-profile.c (CGRAPH_NODE_FREQUENCY): Remove.
	(try_update): Update.
	* tree-inline.c (initialize_cfun): Do not update function frequency.
	* passes.c (pass_init_dump_file): Update.
	* i386.c (ix86_compute_frame_layout): Update.
	(ix86_pad_returns): Update.

From-SVN: r158732
2010-04-26 13:33:24 +00:00
Jie Zhang 330af32c06 re PR tree-optimization/43833 (false warning: array subscript is above array bounds with -O3)
PR tree-optimization/43833
	* tree-vrp.c (range_int_cst_p): New.
	(range_int_cst_singleton_p): New.
	(extract_range_from_binary_expr): Optimize BIT_AND_EXPR case
	when both operands are constants.  Use range_int_cst_p in
	BIT_IOR_EXPR case.

	testsuite/
	PR tree-optimization/43833
	gcc.dg/Warray-bounds-8.c: New test case.

From-SVN: r158727
2010-04-26 10:59:34 +00:00
Jan Hubicka ae2b08888a * cgraphunit.c (cgraph_copy_node_for_versioning): Fix profile updating.
From-SVN: r158724
2010-04-26 09:52:05 +00:00
Richard Guenther 98b2dfbb6d re PR c++/43080 (ICE with anonymous union and -flto)
2010-04-26  Richard Guenther  <rguenther@suse.de>

	PR lto/43080
	* gimple.c (gimple_decl_printable_name): Deal gracefully
	with a NULL DECL_NAME.

	* g++.dg/lto/20100423-3_0.C: New testcase.

From-SVN: r158723
2010-04-26 09:19:24 +00:00
Richard Guenther 1ae3075b79 re PR debug/42425 (ICE declaring local class)
2010-04-26  Richard Guenther  <rguenther@suse.de>

	PR lto/42425
	* tree.c (free_lang_data_in_type): Do not free TYPE_CONTEXT
	if emitting debug information and it is either a function
	or a namespace decl.

	* g++.dg/lto/20100423-2_0.C: New testcase.

From-SVN: r158722
2010-04-26 09:13:00 +00:00
Ira Rosen 4b5caab771 tree-vectorizer.h (struct _stmt_vec_info): Add new field to determine if the statement is vectorizable...
* tree-vectorizer.h (struct _stmt_vec_info): Add new field to 
	determine if the statement is vectorizable, and a macro to 
	access it.
	* tree-vect-data-refs.c (vect_analyze_data_ref_dependence): 
	Skip statements that can't be vectorized. If the analysis 
	fails, mark the statement as unvectorizable if vectorizing 
	basic block.
	(vect_compute_data_refs_alignment): Likewise.
	(vect_verify_datarefs_alignment): Skip statements marked as 
	unvectorizable. Add print.
	(vect_analyze_group_access): Skip statements that can't be 
	vectorized. If the analysis fails, mark the statement as 
	unvectorizable if vectorizing basic block.
	(vect_analyze_data_ref_accesses, vect_analyze_data_refs): 
	Likewise.
	* tree-vect-stmts.c (vectorizable_store): Fix the number of 
	generated stmts for SLP.
	(new_stmt_vec_info): Initialize the new field.
	* tree-vect-slp.c (vect_build_slp_tree): Fail to vectorize 
	statements marked as unvectorizable.

From-SVN: r158719
2010-04-26 06:39:27 +00:00
Joseph Myers 2778d7667c c-common.c (flag_isoc1x): New.
gcc:
	* c-common.c (flag_isoc1x): New.
	(flag_isoc99): Update comment.
	* c-common.h (flag_isoc1x): New.
	(flag_isoc99): Update comment.
	* c-cppbuiltin.c (builtin_define_float_constants): Also define
	__<type>_DECIMAL_DIG__.
	* c-opts.c (set_std_c1x): New.
	(c_common_handle_option): Handle -std=c1x and -std=gnu1x.
	(set_std_c89, set_std_c99): Also set flag_isoc1x to 0.
	* c.opt (-std=c1x, -std=gnu1x): New options.
	* doc/cpp.texi: Mention -std=c1x.
	* doc/cppopts.texi (-std=c1x, -std=gnu1x): Document.
	* doc/extend.texi: Mention -std=c1x and -std=gnu1x.
	* doc/invoke.texi (-std=c1x, -std=gnu1x): Document.
	* doc/standards.texi: Mention C1X.
	* ginclude/float.h (FLT_DECIMAL_DIG, DBL_DECIMAL_DIG,
	LDBL_DECIMAL_DIG, FLT_HAS_SUBNORM, DBL_HAS_SUBNORM,
	LDBL_HAS_SUBNORM, FLT_TRUE_MIN, DBL_TRUE_MIN, LDBL_TRUE_MIN):
	Define for C1X.

gcc/testsuite:
	* gcc.dg/c90-float-1.c: Also test that C1X macros are not defined.
	* gcc.dg/c99-float-1.c: Also test that C1X macros are not defined.
	* gcc.dg/c1x-float-1.c: New test.

libcpp:
	* include/cpplib.h (enum c_lang): Add CLK_GNUC1X and CLK_STDC1X.
	* init.c (lang_defaults): Add entries for new language variants.
	(cpp_init_builtins): Define __STDC_VERSION__ to 201000L for C1X
	variants.

From-SVN: r158711
2010-04-25 22:54:22 +01:00
Uros Bizjak 3d416346cf gmon-sol2.c (_mcleanup): Change format string placeholder from 0x%x to %#x.
* config/i386/gmon-sol2.c (_mcleanup): Change format string
	placeholder from 0x%x to %#x.
	* config/i386/i386elf.h (ASM_OUTPUT_ASCII): Ditto.
	* config/i386/i386-interix.h (ASM_OUTPUT_ASCII): Ditto.
	* config/i386/att.h (ASM_OUTPUT_ASCII): Ditto.
	* config/i386/sysv4.h (ASM_OUTPUT_ASCII): Ditto.
	* config/i386/i386.c (ix86_target_string): Ditto.
	(output_pic_addr_const): Ditto.
	(print_operand): Ditto.

From-SVN: r158699
2010-04-25 10:11:46 +02:00
Paolo Bonzini 910ed7dc70 combine.c (find_split_point): Add third argument.
2010-04-25  Paolo Bonzini  <bonzini@gnu.org>

	* combine.c (find_split_point): Add third argument.  Use it
	to find nested multiply-accumulate instructions.  Adjust calls.
	(try_combine): Adjust call to find_split_point.

testsuite:
2010-04-25  Paolo Bonzini  <bonzini@gnu.org>

	* gcc.target/arm/mla-1.c: New test.

From-SVN: r158698
2010-04-25 07:52:43 +00:00
Gerald Pfeifer 423b279996 * doc/contrib.texi (Contributors): Add Dodji Seketeli.
From-SVN: r158690
2010-04-24 19:34:52 +00:00
Bernd Schmidt 27d0d96a8f re PR tree-optimization/41442 (missed optimization for boolean expression)
gcc/
	PR tree-optimization/41442
	* fold-const.c (merge_truthop_with_opposite_arm): New function.
	(fold_binary_loc): Call it.

gcc/testsuite/
	PR tree-optimization/41442
	* gcc.target/i386/pr41442.c: New test.

From-SVN: r158689
2010-04-24 18:53:47 +00:00
Manuel López-Ibáñez c7d0de89bb toplev.c (general_init): Set default for fdiagnostics-show-option.
2010-04-23  Manuel López-Ibáñez  <manu@gcc.gnu.org>

	* toplev.c (general_init): Set default for
	fdiagnostics-show-option.
	* opts.c (common_handle_option): Allow disabling it.
	* common.opt (fdiagnostics-show-option): Add Var. Enabled by
	default.
testsuite/	
	* gcc.dg/Wconversion-integer.c: Update.

From-SVN: r158676
2010-04-23 17:14:27 +00:00
Eric Botcazou 915f592197 expr.c (expand_expr_real_1): Only use conversion between modes if both types are integral.
* expr.c (expand_expr_real_1) <VIEW_CONVERT_EXPR>: Only use conversion
	between modes if both types are integral.

From-SVN: r158675
2010-04-23 16:16:50 +00:00
Richard Guenther 4e708ff754 re PR tree-optimization/43572 (FAIL: gfortran.dg/PR19872.f execution test; formatted read - wrong numbers)
2010-04-23  Richard Guenther  <rguenther@suse.de>

	PR tree-optimization/43572
	* tree-tailcall.c (find_tail_calls): Allow PARM_DECL uses.

From-SVN: r158671
2010-04-23 15:46:23 +00:00
Richard Guenther 8fd8a06f0e re PR lto/43455 (ICE in fold_convert_loc, at fold-const.c:2670 with -O2 -flto)
2010-04-23  Richard Guenther  <rguenther@suse.de>

	PR lto/43455
	* tree-inline.c (tree_can_inline_p): Also check compatibility
	of return types.

	* gcc.dg/lto/20100423-1_0.c: New testcase.
	* gcc.dg/lto/20100423-1_1.c: Likewise.

From-SVN: r158669
2010-04-23 15:18:24 +00:00
Martin Jambor 7762001162 re PR tree-optimization/43846 (array vs members, total scalarization issues)
2010-04-23  Martin Jambor  <mjambor@suse.cz>

	PR tree-optimization/43846
	* tree-sra.c (struct access): New flag grp_assignment_read.
	(build_accesses_from_assign): Set grp_assignment_read.
	(sort_and_splice_var_accesses): Propagate grp_assignment_read.
	(enum mark_read_status): New type.
	(analyze_access_subtree): Propagate grp_assignment_read, create
	accesses also if both direct_read and root->grp_assignment_read.

	* testsuite/gcc.dg/tree-ssa/sra-10.c: New test.

From-SVN: r158668
2010-04-23 16:52:06 +02:00
Martin Jambor 5c20baf14a re PR middle-end/43835 (IPA-SRA doesn't rewrite attributes)
2010-04-23  Martin Jambor  <mjambor@suse.cz>

	PR middle-end/43835
	* tree-sra.c (ipa_sra_preliminary_function_checks): Check that the
	function does not have type attributes.

	* testsuite/gcc.c-torture/execute/pr43835.c: New test.

From-SVN: r158667
2010-04-23 16:43:10 +02:00