Commit Graph

32657 Commits

Author SHA1 Message Date
Uros Bizjak 69c553ef2a re PR target/32280 (_mm_srli_si128, heinous code for some shifts)
PR target/32280
	* config/i386/sse.md ("sse2_ashlti", "sse2_lshrti3"): Move ...
	* config/i386/i386.md ("sse2_ashlti", "sse2_lshrti3"): ... to here.

testsuite/ChangeLog:
	
	PR target/32280
	* gcc.target/i386/pr32280.c: New test.

From-SVN: r125615
2007-06-11 12:13:00 +02:00
Uros Bizjak f1da2df1e9 re PR middle-end/32279 (Fold 1.0/sqrt(x/y) to sqrt(y/x))
PR middle-end/32279
	* fold-const (fold_binary) [RDIV_EXPR]: Optimize a/sqrt(b/c)
	into a*sqrt(c/b) if flag_unsafe_math_optimizations is set.

testsuite/ChangeLog:

	PR middle-end/32279
	* gcc.dg/builtins-11.c: Also check folding of a/sqrt(b/c).

From-SVN: r125614
2007-06-11 11:09:24 +02:00
Jan Sjodin 51c0074eed lambda-code.c (remove_iv): New.
* lambda-code.c (remove_iv): New.
	(lambda_loopnest_to_gcc_loopnest): Use remove_iv.


Co-Authored-By: Sebastian Pop <sebpop@gmail.com>

From-SVN: r125605
2007-06-10 21:00:59 +00:00
Zdenek Dvorak 79f5e44262 tree-data-ref.c (dr_analyze_alias): Handle case smt is NULL.
* tree-data-ref.c (dr_analyze_alias): Handle case smt is NULL.
	* tree-predcom.c (mark_virtual_ops_for_renaming): Exported.
	* tree-ssa-loop-prefetch.c: Include optabs.h.
	(FENCE_FOLLOWING_MOVNT): New macro.
	(struct mem_ref): Add independent_p and storent_p fields.
	(record_ref): Initalize the new fields.
	(gather_memory_references_ref): Return true if the reference
	could be analysed.
	(gather_memory_references): Check whether all memory accesses
	in loop were recorded.
	(should_issue_prefetch_p): Return false for nontemporal stores.
	(nontemporal_store_p, mark_nontemporal_store, emit_mfence_after_loop,
	may_use_storent_in_loop_p, mark_nontemporal_stores): New functions.
	(determine_loop_nest_reuse): Detect independent memory references.
	(loop_prefetch_arrays): Call mark_nontemporal_stores.
	* tree-flow.h (mark_virtual_ops_for_renaming): Declare.
	* Makefile.in (tree-ssa-loop-prefetch.o): Add OPTABS_H dependency.
	* config/i386/i386.h (x86_mfence): Declare.
	(FENCE_FOLLOWING_MOVNT): Return x86_mfence.
	* config/i386/i386.c (x86_mfence): New variable.
	(ix86_init_mmx_sse_builtins): Initialize x86_mfence.

	* tree-pretty-print.c (dump_generic_node): Mark nontemporal stores.
	* optabs.c (init_optabs): Initialize storent_optab.
	* optabs.h (enum optab_index): Add OTI_storent.
	(storent_optab): Declare.
	* genopinit.c (optabs): Add initialization for storent_optab.
	* tree.h (MOVE_NONTEMPORAL): New macro.
	* expr.c (expand_assignment, store_expr, store_constructor_field,
	store_constructor, store_field, expand_expr_real_1): Propagate
	nontemporality of the expanded store.
	(emit_storent_insn): New function.
	* expr.h (expand_assignment, store_expr): Declaration changed.
	* function.c (assign_parm_setup_reg): Pass false as nontemporality
	to expand_assignment.
	* stmt.c (expand_asm_expr): Ditto.
	* calls.c (initialize_argument_information): Pass false as
	nontemporality to store_expr.
	* config/i386/sse.md (storentv4sf, storentv2df, storentv2di,
	storentsi): New.

	* gcc.dg/tree-ssa/prefetch-7.c: New test.

From-SVN: r125604
2007-06-10 20:39:22 +00:00
Daniel Berlin 6bdff197e6 tree-ssa-structalias.c (set_uids_in_ptset): Add is_deref'd parameter, use it.
2007-06-09  Daniel Berlin  <dberlin@dberlin.org>

	* tree-ssa-structalias.c (set_uids_in_ptset): Add is_deref'd
	parameter, use it.
	(find_what_p_points_to): Pass new parameter to set_uids_in_ptset.

From-SVN: r125603
2007-06-10 20:21:48 +00:00
Daniel Berlin 55edccf416 tree-data-ref.c (dr_may_alias_p): Check that decl_a != decl_b, and allow DECL_P here.
2007-06-09  Daniel Berlin  <dberlin@dberlin.org>

	* tree-data-ref.c (dr_may_alias_p): Check that decl_a != decl_b,
	and allow DECL_P here.

From-SVN: r125601
2007-06-10 14:13:18 +00:00
Zdenek Dvorak 9e824336e5 tree-scalar-evolution.c (follow_ssa_edge_in_rhs, [...]): Keep more precise track of the size of the expression.
* tree-scalar-evolution.c (follow_ssa_edge_in_rhs,
	follow_ssa_edge_in_condition_phi, follow_ssa_edge): Keep more precise
	track of the size of the expression.
	* cfghooks.c (merge_blocks): Remove block from loops structure only
	after call of the merge_blocks hook.

	* gcc.dg/tree-ssa/loop-28.c: New testcase.

From-SVN: r125595
2007-06-09 21:34:08 +00:00
Tom Tromey 0da300cde3 c-decl.c (grokdeclarator): Added 'deprecated_state' argument.
* c-decl.c (grokdeclarator): Added 'deprecated_state' argument.
	(deprecated_state): Removed.
	(start_decl): Update.
	(enum deprecated_states): Moved earlier.
	(groktypename): Update.
	(push_parm_decl): Likewise.
	(grokfield): Likewise.
	(start_function): Likewise.

From-SVN: r125593
2007-06-09 16:48:47 +00:00
Ian Lance Taylor 9c4ed267d6 re PR tree-optimization/32169 (Ice in set_value_range, at tree-vrp.c:326)
./:	PR tree-optimization/32169
	* tree-vrp.c (extract_range_from_unary_expr): For NOP_EXPR and
	CONVERT_EXPR, check whether min and max both converted to an
	overflow infinity representation.
testsuite/:
	PR tree-optimization/32169
	* gcc.c-torture/compile/pr32169.c: New test.

From-SVN: r125591
2007-06-09 16:28:31 +00:00
Eric Botcazou 36808d08a5 reload1.c (fixup_abnormal_edges): Clear bb field for insns not inserted on the edge.
* reload1.c (fixup_abnormal_edges): Clear bb field for insns
	not inserted on the edge.

From-SVN: r125582
2007-06-08 23:22:46 +00:00
Uros Bizjak 9510f6eb7d * ChangeLog fix * ChangeLog fix.
From-SVN: r125578
2007-06-08 22:55:46 +02:00
Bob Wilson 582711fee4 lib1funcs.asm (__udivsi3): Use hardware divide instructions if they are supported.
* config/xtensa/lib1funcs.asm (__udivsi3): Use hardware divide
	instructions if they are supported.
	(__divsi3, __umodsi3, __modsi3): Likewise.
	(__ashldi3, __ashrdi3, __lshrdi3): New.
	* config/xtensa/t-xtensa (LIB1ASMFUNCS): Add DImode shift functions.

From-SVN: r125577
2007-06-08 16:49:23 +00:00
Harsha Jagasia 792ed98bb7 extend.texi: Add fvect-cost-model flag.
gcc/ChangeLog:
2007-06-08  Harsha Jagasia <harsha.jagasia@amd.com>
            Tony Linthicum <tony.linthicum@amd.com>

	* doc/extend.texi: Add fvect-cost-model flag.
	* common.opt (fvect-cost-model): New flag.
	* tree-vectorizer.c (new_stmt_vec_info): Initialize inside and outside
	cost fields in stmt_vec_info struct for STMT.
	* tree-vectorizer.h (stmt_vec_info): Define inside and outside cost
	fields in stmt_vec_info struct and access functions for the same.
	(TARG_COND_BRANCH_COST): Define cost of conditional branch.
	(TARG_VEC_STMT_COST): Define cost of any vector operation, excluding
	load, store and vector to scalar operation.
	(TARG_VEC_TO_SCALAR_COST): Define cost of vector to scalar operation.
	(TARG_VEC_LOAD_COST): Define cost of aligned vector load.
	(TARG_VEC_UNALIGNED_LOAD_COST): Define cost of misasligned vector load.
	(TARG_VEC_STORE_COST): Define cost of vector store.
	(vect_estimate_min_profitable_iters): Define new function.
	* tree-vect-analyze.c (vect_analyze_operations): Add a compile-time
	check to evaluate if loop iterations are less than minimum profitable
	iterations determined by cost model or minimum vect loop bound defined
	by user, whichever is more conservative.
	* tree-vect-transform.c (vect_do_peeling_for_loop_bound): Add a
	run-time check to evaluate if loop iterations are less than minimum
	profitable iterations determined by cost model or minimum vect loop
	bound defined by user, whichever is more conservative.
	(vect_estimate_min_profitable_iterations): New function to estimate
	mimimimum iterartions required for vector version of loop to be
	profitable over scalar version.
        (vect_model_reduction_cost): New function.
	(vect_model_induction_cost): New function.
	(vect_model_simple_cost): New function.
	(vect_cost_strided_group_size): New function.
	(vect_model_store_cost): New function.
	(vect_model_load_cost): New function.
	(vectorizable_reduction): Call vect_model_reduction_cost during
	analysis phase.
	(vectorizable_induction): Call vect_model_induction_cost during
	analysis phase.
	(vectorizable_load): Call vect_model_load_cost during analysis phase.
	(vectorizable_store): Call vect_model_store_cost during analysis phase.
	(vectorizable_call, vectorizable_assignment, vectorizable_operation,
	vectorizable_promotion, vectorizable_demotion): Call 
	vect_model_simple_cost during analysis phase.

gcc/testsuite/ChangeLog:
2007-06-08  Harsha Jagasia <harsha.jagasia@amd.com>

	* gcc.dg/vect/costmodel: New directory.
	* gcc.dg/vect/costmodel/i386: New directory.
	* gcc.dg/vect/costmodel/i386/i386-costmodel-vect.exp: New testsuite.
	* gcc.dg/vect/costmodel/i386/costmodel-fast-math-vect-pr29925.c:
	New test.
	* gcc.dg/vect/costmodel/i386/costmodel-vect-31.c: New test.
	* gcc.dg/vect/costmodel/i386/costmodel-vect-33.c: New test.
	* gcc.dg/vect/costmodel/i386/costmodel-vect-68.c: New test.
	* gcc.dg/vect/costmodel/i386/costmodel-vect-reduc-1char.c: New test.
	* gcc.dg/vect/costmodel/x86_64: New directory.
	* gcc.dg/vect/costmodel/x86_64/x86_64-costmodel-vect.exp:
	New testsuite.	
	* gcc.dg/vect/costmodel/x86_64/costmodel-fast-math-vect-pr29925.c:
	New test.
	* gcc.dg/vect/costmodel/x86_64/costmodel-vect-31.c: New test.
	* gcc.dg/vect/costmodel/x86_64/costmodel-vect-33.c: New test.
	* gcc.dg/vect/costmodel/x86_64/costmodel-vect-68.c: New test.
	* gcc.dg/vect/costmodel/x86_64/costmodel-vect-reduc-1char.c: New test.
	* gcc.dg/vect/costmodel/x86_64/costmodel-pr30843.c: New test.

Co-Authored-By: Tony Linthicum <tony.linthicum@amd.com>

From-SVN: r125575
2007-06-08 16:30:49 +00:00
Simon Baldwin c8e2516ccf reg-stack.c (get_true_reg): Readability change.
* reg-stack.c (get_true_reg): Readability change.  Moved default case
label into direct switch statement scope.

From-SVN: r125574
2007-06-08 16:17:01 +00:00
Simon Baldwin 2c5cfd1fc6 tree-flow-inline.h (var_ann): Replaced erroneous '=' assignment in gcc_assert() with '==' comparison.
* tree-flow-inline.h (var_ann): Replaced erroneous '=' assignment
in gcc_assert() with '==' comparison.

From-SVN: r125573
2007-06-08 16:15:41 +00:00
Uros Bizjak 837a895482 i386.c (override_options): Merge TARGET_SSE4_2 and TARGET_ABM handling of x86_popcnt variable.
* config/i386/i386.c (override_options): Merge TARGET_SSE4_2 and
	TARGET_ABM handling of x86_popcnt variable.

From-SVN: r125570
2007-06-08 13:34:56 +02:00
Uros Bizjak 5513e23973 extend.texi (X86 Built-in Functions): Document __builtin_fabsq, __builtin_copysignq and __builtin_infq built-in functions.
* doc/extend.texi (X86 Built-in Functions): Document __builtin_fabsq,
	__builtin_copysignq and __builtin_infq built-in functions.

From-SVN: r125569
2007-06-08 13:22:44 +02:00
Uros Bizjak 291d9a2db0 extend.texi (X86 Built-in Functions): Add missing `@item's in SSE4.2 section.
* doc/extend.texi (X86 Built-in Functions): Add missing `@item's in
	SSE4.2 section.  Correct built-in function names in SSE4A section.

From-SVN: r125568
2007-06-08 13:08:12 +02:00
Uros Bizjak 459e691ae8 re PR tree-optimization/32243 (ICE in vectorizable_type_promotion, at tree-vect-transform.c:2890)
PR tree-optimization/32243
	* tree-vect-transform.c (vectorizable_type_promotion): Move check
	for ncopies after ratio check between nunits_out and nunits_in.
	(vectorizable_type_demotion): Remove single-use variable "scalar_type".

testsuite/ChangeLog:
	
	PR tree-optimization/32243
	* gcc.dg/vect/vect.exp: Add support for -O3 tests.  Reset default
	flags for -Os tests.
	* gcc.dg/vect/03-vect-pr32243.c: New test.

From-SVN: r125567
2007-06-08 11:06:46 +02:00
Dorit Nuzman 0d2665809f re PR tree-optimization/32224 (ICE in vect_analyze_operations, at tree-vect-analyze.c:374)
PR tree-optimization/32224
        * tree-vect-analyze.c (vect_determine_vectorization_factor): Fail
        vectorization upon a non GIMPLE_MODIFY_STMT.

From-SVN: r125566
2007-06-08 08:57:54 +00:00
Christian Bruel 4aa97413d3 re PR target/29953 ([SH-4] Perfomance regression in loops. cmp/eq used instead of dt)
PR target/29953
* config/sh/sh.md (doloop_end): New pattern and splitter.
* loop-iv.c (simple_rhs_p): Check for hardware registers.

From-SVN: r125564
2007-06-08 09:58:41 +02:00
Zdenek Dvorak 1fc3998daa re PR middle-end/32209 (Boot failure Comparing stages 2 and 3 with --disable-checking)
PR middle-end/32209
	* dominance.c (debug_dominance_tree, debug_dominance_tree_1): New
	functions.
	(verify_dominators): Do not change dominance tree.

From-SVN: r125563
2007-06-08 07:28:50 +00:00
Kaz Kojima 32a7ab3d80 constraints.md: New file.
* config/sh/constraints.md: New file.
	* config/sh/sh.c: Include tm-constrs.h.
	(reg_class_from_letter): Remove.
	(prepare_cbranch_operands): Use satisfies_constraint_*
	function instead of macro.
	(andcosts, broken_move, sh_secondary_reload): Likewise.
	* config/sh/predicates.md (trapping_target_operand): Likewise.
	(and_operand, arith_operand, arith_reg_or_0_operand,
	cmp_operand, logical_operand, target_operand,
	ua_address_operand, ua_offset, xor_operand): Likewise.
	* config/sh/sh.md: Include constraints.md.
	(*movsicc_t_false): Use satisfies_constraint_* function
	instead of macro.
	(*movsicc_t_true, ashlsi3_std, ashlhi3_k, lshrsi3_m,
	lshrsi3_k, movsi_const_16bit+2, *movhi_media+1,
	movdi_const_16bit+1, beq, bne, *ptb): Likewise.
	* config/sh/sh.h (reg_class_from_letter): Remove prototype.
	(OVERRIDE_OPTIONS): Don't modify reg_class_from_letter.
	(REG_CLASS_FROM_CONSTRAINT): Remove.
	(CONSTRAINT_LEN, CONST_OK_FOR_I20, CONST_OK_FOR_I,
	CONST_OK_FOR_J, CONST_OK_FOR_K16, CONST_OK_FOR_K,
	CONST_OK_FOR_P27, CONST_OK_FOR_P, CONST_OK_FOR_M,
	CONST_OK_FOR_N, CONST_OK_FOR_CONSTRAINT_P,
	CONST_DOUBLE_OK_FOR_LETTER_P): Likewise.
	(SECONDARY_INOUT_RELOAD_CLASS): Use satisfies_constraint_*
	function instead of macro.
	(SECONDARY_INPUT_RELOAD_CLASS): Likewise.
	(EXTRA_CONSTRAINT_Q, EXTRA_CONSTRAINT_A,
	EXTRA_CONSTRAINT_Bsc, EXTRA_CONSTRAINT_B,
	EXTRA_CONSTRAINT_Css, EXTRA_CONSTRAINT_Csu): Remove.
	(IS_PC_RELATIVE_LOAD_ADDR_P): New macro.
	(IS_LITERAL_OR_SYMBOLIC_S16_P): Likewise.
	(IS_LITERAL_OR_SYMBOLIC_U16_P): Likewise.
	(IS_NON_EXPLICIT_CONSTANT_P): Likewise.
	(EXTRA_CONSTRAINT_Csy, EXTRA_CONSTRAINT_Z, EXTRA_CONSTRAINT_W,
	EXTRA_CONSTRAINT_Cpg, EXTRA_CONSTRAINT_C,
	EXTRA_MEMORY_CONSTRAINT, EXTRA_CONSTRAINT_Sr0,
	EXTRA_CONSTRAINT_Sua, EXTRA_CONSTRAINT_S,
	EXTRA_CONSTRAINT_STR): Likewise.
	(GO_IF_LEGITIMATE_INDEX): Fix indentation.

From-SVN: r125561
2007-06-08 06:59:55 +00:00
Geoffrey Keating 2734e1c321 darwin.h (STACK_BOUNDARY): Define.
* config/i386/darwin.h (STACK_BOUNDARY): Define.

Co-Authored-By: Hui-May Chang <hm.chang@apple.com>

From-SVN: r125555
2007-06-08 03:22:56 +00:00
Simon Martin c1ae8be51f re PR c++/30759 (initializer-list accepted for object of non-POD type)
gcc/

2007-06-07  Simon Martin  <simartin@users.sourceforge.net>

	PR c++/30759
	* c-common.h (flag_cpp0x): Replaced by...
	(cxx_dialect): ... this new variable specifying the C++ dialect that
	is used.
	* c-common.c (flag_cpp0x): Removed.
	(cxx_dialect): Defined.
	* c-cppbuiltin.c (c_cpp_builtins): flag_cpp0x rewritten in terms of
	cxx_dialect.
	* c-opts.c (c_common_post_options): Likewise.
	(set_std_cxx98): Set cxx_dialect to cxx98.
	(set_std_cxx0x): Set cxx_dialect to cxx0x.

gcc/cp/

2007-06-07  Simon Martin  <simartin@users.sourceforge.net>

	PR c++/30759
	* decl.c (check_initializer): Report an error when a brace enclosed
	initializer is used for a non-aggregate type in C++98.
	(redeclaration_error_message): Rewrote flag_cpp0x in terms of
	cxx_dialect.
	(grokdeclarator): Likewise.
	(move_fn_p): Likewise.
	* typeck.c (check_return_expr): Likewise.
	* call.c (reference_binding): Likewise.
	* error.c (cp_cpp_error): Likewise.
	* pt.c (check_default_tmpl_args): Likewise.
	(tsubst): Likewise.
	* lex.c (init_reswords): Likewise.
	* parser.c (p_parser_primary_expression): Likewise.
	(TOKEN_PRECEDENCE): Likewise.
	(cp_parser_init_declarator): Likewise.
	(cp_parser_ptr_operator): Likewise.
	(cp_parser_parameter_declaration): Likewise.
	(cp_parser_enclosed_template_argument_list): Likewise.
	(cp_parser_skip_to_end_of_template_parameter_list): Likewise.
	(cp_parser_next_token_ends_template_argument_p): Likewise.

gcc/testsuite/

2007-06-07  Simon Martin  <simartin@users.sourceforge.net>

	PR c++/30759
	* g++.dg/init/brace6.C: New test.

From-SVN: r125539
2007-06-07 19:59:33 +00:00
Geoffrey Keating e46b55d038 Index: ChangeLog
2007-06-06  Geoffrey Keating  <geoffk@apple.com>
	    Hui-May Chang <hm.chang@apple.com>

	* doc/invoke.texi (Darwin Options): Update documentation for
	-mmacosx-version-min.
	* config.gcc (*-*-darwin*): Set extra_gcc_objs.
	* config/darwin-driver.c: New file.
	* config/darwin.h (GCC_DRIVER_HOST_INITIALIZATION): New.
	* config/t-darwin (darwin-driver.o): New rule.

	* config/darwin-c.c (version_as_macro): Ignore low digit.

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

	* gcc.dg/darwin-minversion-3.c: New.

Co-Authored-By: Hui-May Chang <hm.chang@apple.com>

From-SVN: r125537
2007-06-07 18:56:51 +00:00
Uros Bizjak edc5bbcd8f i386.md (standard sse constant splitter): Handle TFmode.
* config/i386/i386.md (standard sse constant splitter): Handle TFmode.
        (negtf2, abstf2, *absnegtf2_sse): New insn patterns.
        (CSGNMODE): New mode macro.
        (CSGNVMODE): New mode attribute.
        (copysign<mode>3): Rename from copysingsf3 and copysigndf3.  Macroize
        expander using CSGNMODE mode macro.  Handle TFmode.
        (copysign<mode>3_const): Rename from copysignsf3_const and
        copysigndf3_const.  Macroize pattern using CSGNMODE mode macro.
        Handle TFmode.
        (copysign<mode>3_var): Rename from copysignsf3_var and
        copysigndf3_var.  Macroize pattern using CSGNMODE mode macro.
        Handle TFmode.
        (copysign<mode>3_var splitter): Macroize pattern using CSGNMODE
        mode macro.  Handle TFmode.
        * config/i386/sse.md (andtf3, *andtf3, *nandtf3): New insn patterns.
        (iortf3, *iortf3): Ditto.
        (xortf3, *xortf3): Ditto.
        * config/i386/i386.c (ix86_build_signbit_mask): Create scalar
        TFmode and TImode masks.
        (ix86_expand_copysign): Expand TFmode copysign insn.
        (IX86_BUILTIN_INFQ): New.
        (IX86_BUILTIN_FABSQ): Ditto.
        (IX86_BUILTIN_COPYSIGNQ): Ditto.
        (ix86_init_mmx_sse_builtins) [__builtin_infq]: New builtin definition.
        [__builtin_fabsq]: Ditto.
        [__builtin_copysignq]: Ditto.
        (ix86_expand_builtin) [IX86_BUILTIN_INFQ]: Expand builtin.
        [IX86_BUILTIN_FABSQ]: Expand builtin using ix86_expand_unop_builtin().
        [IX86_BUILTIN_COPYSIGNQ]: Expand builtin using
        ix86_expand_unop_builtin().

testsuite/ChangeLog:
    
        * gcc.target/i386/builtin-copysign.c: New test.

From-SVN: r125535
2007-06-07 20:31:40 +02:00
Bob Wilson 125253d945 * config/xtensa/lib1funcs.asm: Clean up whitespace.
From-SVN: r125534
2007-06-07 18:27:42 +00:00
Steve Ellcey bb27eeda7d re PR target/31850 (gcc.c-torture/compile/limits-fnargs.c is slow at compiling for spu-elf)
PR target/31850
	* rtl.h (push_to_sequence2): New.
	* emit-rtl.c (push_to_sequence2): New.
	* function.c (assign_parm_data_all): Add new fields.
	(assign_parm_setup_block): Call push_to_sequence2 instead of 
	push_to_sequence.
	(assign_parm_setup_reg): Ditto.
	(assign_parm_setup_stack): Ditto.
	(assign_parms_unsplit_complex): Ditto.
	(assign_parms): Change field name.

From-SVN: r125532
2007-06-07 16:46:26 +00:00
Zdenek Dvorak 1b0cfaa6a8 re PR tree-optimization/32220 (internal compiler error: in eliminate_temp_copies, at tree-predcom.c:1937)
PR tree-optimization/32220
	* tree-predcom.c (eliminate_temp_copies): Handle the case that loop
	phi node is reached before defining statement.

	* gfortran.dg/predcom-2.f: New testcase.

From-SVN: r125531
2007-06-07 15:34:40 +00:00
Andrew Pinski 1344284efa re PR tree-optimization/32231 (Segfault in verify_ssa_name)
2007-06-06  Andrew Pinski  <andrew_pinski@playstation.sony.com>

        PR tree-opt/32231
        * tree-vect-transform.c (vectorizable_call): Call update_stmt
        after changing the right hand side of the assignment.

2007-06-06  Andrew Pinski  <andrew_pinski@playstation.sony.com>

        PR tree-opt/32231
        * gcc.target/i386/vectorize4.c: New test.

From-SVN: r125521
2007-06-06 19:12:31 -07:00
Eric Christopher 7a1eca8375 config.gcc (i?86-*-darwin*): Remove arch parameter.
2007-06-06  Eric Christopher  <echristo@apple.com>

	    * config.gcc (i?86-*-darwin*): Remove arch parameter.
	    (x86_64-*-darwin*): Ditto.
	    * config/i386/darwin.h (TARGET_SUBTARGET32_ISA_DEFAULT): Define.
	    (TARGET_SUBTARGET64_ISA_DEFAULT): Ditto.

From-SVN: r125508
2007-06-06 22:43:49 +00:00
Thomas Neumann c22940cd7c tree-ssa-alias-warnings.c (maybe_add_match): Cast according to the coding conventions.
* tree-ssa-alias-warnings.c (maybe_add_match): Cast according to the
	coding conventions.
	(add_key): Likewise.
	* tree-ssa.c (init_tree_ssa): Use type safe memory macros.
	* tree-ssa-ccp.c (ccp_fold_builtin): Avoid using C++ keywords as
	variable names.
	* tree-ssa-coalesce.c (find_coalesce_pair): Use type safe memory macros.
	(add_cost_one_coalesce): Likewise.
	* tree-ssa-copy.c (merge_alias_info): Avoid using C++ keywords as
	variable names. Rename orig to orig_name for consistency.
	* tree-ssa-dom.c (dom_thread_across_edge): Cast according to the coding
	conventions.
	(cprop_into_successor_phis): Avoid using C++ keywords as variable names.
	(record_equivalences_from_stmt): Likewise.
	* tree-ssa-dse.c (dse_initialize_block_local_data): Cast according to
	the coding conventions.
	(memory_ssa_name_same): Likewise.
	(dse_optimize_stmt): Likewise.
	(dse_record_phis): Likewise.
	(dse_finalize_block): Likewise.
	* tree-ssa-loop-im.c (outermost_invariant_loop_expr): Avoid using C++
	keywords as variable names.
	(may_move_till): Cast according to the coding conventions.
	(force_move_till_expr): Avoid using C++ keywords as variable names.
	(force_move_till): Cast according to the coding conventions.
	(memref_hash): Likewise.
	(memref_eq): Likewise.
	(gather_mem_refs_stmt): Likewise.
	* tree-ssa-loop-ivopts.c (contains_abnormal_ssa_name_p): Avoid using C++
	keywords as variable names.
	(idx_find_step): Cast according to the coding conventions.
	(idx_record_use): Likewise.
	(find_depends): Likewise.
	(prepare_decl_rtl): Likewise.
	(mbc_entry_hash): Likewise.
	(mbc_entry_eq): Likewise.
	* tree-ssa-loop-niter.c (SWAP): Use the correct the type for tmp.
	(simplify_replace_tree): Avoid using C++ keywords as variable names.
	(idx_infer_loop_bounds): Cast according to the coding conventions.
	* tree-ssa-loop-prefetch.c (idx_analyze_ref): Likewise.
	* tree-ssa-math-opts.c (occ_new ): Likwise.
	* tree-ssanames.c (duplicate_ssa_name_ptr_info): Use type safe memory
	macros.
	* tree-ssa-operands.c (add_def_op): Avoid using C++ keywords as variable
	names.
	(add_use_op): Likewise.
	(add_vop): Likewise.
	(add_vuse_op): Likewise.
	(add_vdef_op): Likewise.
	(get_expr_operands): Likewise.
	(push_stmt_changes): Use type safe memory macros.
	* tree-ssa-phiopt.c (replace_phi_edge_with_variable): Avoid using C++
	keywords as variable names.
	(conditional_replacement): Likewise.
	(minmax_replacement): Likewise.
	(abs_replacement): Likewise.
	* tree-ssa-pre.c (create_expression_by_pieces): Cast according to the
	coding conventions.
	(insert_fake_stores): Avoid using C++ keywords as variable names.
	* tree-ssa-reassoc.c (add_to_ops_vec): Cast according to the coding
	conventions.
	* tree-ssa-structalias.c (heapvar_lookup): Likewise.
	(heapvar_insert): Use type safe memory macros.
	(new_var_info): Cast according to the coding conventions.
	(new_constraint): Likewise.
	(remove_preds_and_fake_succs): Use type safe memory macros.
	* tree-ssa-threadupdate.c (thread_block): Cast according to the coding
	conventions.
	(thread_single_edge): Likewise.

From-SVN: r125504
2007-06-06 20:18:47 +00:00
Eric Christopher d6b0b376ea i386.c (override_options): Move handling of TARGET_SUBTARGET* earlier.
2007-06-06  Eric Christopher  <echristo@apple.com>

        * config/i386/i386.c (override_options): Move handling
        of TARGET_SUBTARGET* earlier.

From-SVN: r125497
2007-06-06 18:39:25 +00:00
Paolo Bonzini 7258e976ea genmodes.c (tagged_printf, [...]): Don't use %n on printf.
2007-06-06  Paolo Bonzini  <bonzini@gnu.org>

	* genmodes.c (tagged_printf, emit_insn_modes_h): Don't
	use %n on printf.

From-SVN: r125494
2007-06-06 15:43:29 +00:00
Zdenek Dvorak a7b87f730f haifa-sched.c (restore_bb_notes): Clear bb field of the notes emited outside of basic block.
* haifa-sched.c (restore_bb_notes): Clear bb field of the notes
	emited outside of basic block.
	* cfgbuild.c (find_bb_boundaries): Clear bb field for insns between
	the created blocks.
	* rtl.h (delete_insn_chain): Declaration changed.
	* cfgrtl.c (delete_insn_chain): Add option to clear bb field for
	non-removed insns.
	(rtl_delete_block, rtl_merge_blocks): Pass true to delete_insn_chain.
	(delete_insn_chain_and_edges, try_redirect_by_replacing_jump,
	rtl_tidy_fallthru_edge, cfg_layout_merge_blocks): Pass false 
	to delete_insn_chain.
	(rtl_verify_flow_info_1): Verify that the insns in header and footer
	do not have bb field set.
	(rtl_verify_flow_info): Verify that insns between basic blocks do not
	have bb field set.
	* recog.c (peephole2_optimize): Add argument to delete_insn_chain call.
	* cfgcleanup.c (try_optimize_cfg): Ditto.

From-SVN: r125492
2007-06-06 14:46:34 +00:00
Thomas Neumann 45222d4a3d lambda-code.c (struct lambda_lattice_s): Add a name to the struct.
* lambda-code.c (struct lambda_lattice_s): Add a name to the struct.
	(lambda_body_vector_new): Use type safe memory macros.
	(lambda_linear_expression_new): Likewise.
	(lambda_loopnest_new): Likewise.
	(lambda_lattice_new): Likewise.
	(replace_uses_equiv_to_x_with_y): Cast according to the coding
	conventions. Use type safe memory macros.
	* lambda.h (struct lambda_trans_matrix_s): Add a name to the struct.
	(lambda_body_vector_s): Likewise.
	* lambda-mat.c (lambda_matrix_new): Use type safe memory macros.
	* lambda-trans.c (lambda_trans_matrix_new): Likewise.

From-SVN: r125491
2007-06-06 14:33:57 +00:00
Richard Biener 68c834d087 tree-ssa-forwprop.c (forward_propagate_into_cond): Return 2 if we need to schedule cfg_cleanup.
2007-06-06  Richard Guenther  <rguenther@suse.de>

	* tree-ssa-forwprop.c (forward_propagate_into_cond): Return 2
	if we need to schedule cfg_cleanup.
	(tree_ssa_forward_propagate_single_use_vars): Do so.

From-SVN: r125490
2007-06-06 13:58:41 +00:00
Ian Lance Taylor 39ac2ffc71 fold-const.c (merge_ranges): If range_successor or range_predecessor fail, just return 0.
./:	* fold-const.c (merge_ranges): If range_successor or
	range_predecessor fail, just return 0.
testsuite/:
	* g++.dg/conversion/enum1.C: New test.

From-SVN: r125486
2007-06-06 13:56:00 +00:00
Uros Bizjak 9f106823dc re PR tree-optimization/32216 (ICE: verify_stmts failed (invalid reference prefix) with -ftree-vectorize)
PR tree-optimization/32216
	* tree-vectorizer.c (supportable_widening_operation): Determine
	signedness of FIX_TRUNC_EXPR from output operand.
	(supportable_narrowing_operation): Ditto.
	* tree-vect-generic.c (expand_vector_operations_1): Determine
	signedness of VEC_UNPACK_FLOAT_HI_EXPR and VEC_UNPACK_FLOAT_LO_EXPR
	from input operand.

testsuite/ChangeLog:
	
	PR tree-optimization/32216
	* gcc.dg/vect/pr32216.c: New test.

From-SVN: r125482
2007-06-06 14:12:32 +02:00
Thomas Neumann 9415ab7da8 i386.c (enum pta_flags): Move out of struct scope...
* config/i386/i386.c (enum pta_flags): Move out of struct scope...
	(struct pta): ...from here. Change flags to unsigned to avoid excessive
	casting (as it is used as a bit mask).
	(override_options): Add casts according to the coding convenventions.
	(x86_64_elf_unique_section): Likewise.
	(examine_argument): Avoid using C++ keywords as variable names.
	(construct_container): Likewise.
	(legitimize_pic_address): Likewise.
	(get_dllimport_decl): Cast according to the coding conventions. Use
	type safe memory macros.
	(legitimize_address): Cast according to the coding conventions.
	(emit_i387_cw_initialization): Corrected the type of slot to enum
	ix86_stack_slot.
	(ix86_init_machine_status): Use type safe memory macros.
	(bdesc_pcmpestr): Use UNKNOWN instead of integer 0.
	(bdesc_pcmpistr): Likewise.
	(bdesc_crc32): Likewise.
	(bdesc_sse_3arg): Likewise.
	(bdesc_2arg): Likewise.
	(bdesc_1arg): Likewise.
	(ix86_expand_sse_pcmpestr): Cast according to the coding conventions.
	(ix86_expand_sse_pcmpistr): Likewise.
	(ix86_expand_vec_set_builtin): Use EXPAND_NORMAL instead of integer 0.
	(ix86_builtin_vectorized_function): Change the type of fn to unsigned
	int to match the langhook definition.
	(ix86_builtin_conversion): Change the type of code to unsigned init to
	match the langhook definition.
	(ix86_preferred_reload_class): Avoid using C++ keywords as variable
	names.
	(ix86_preferred_output_reload_class): Likewise.
	(ix86_cannot_change_mode_class): Likewise.
	(ix86_memory_move_cost): Likewise.
	(ix86_rtx_costs): Cast the outer_code parameter to enum rtx_code to
	avoid excessive casting later on.
	(x86_output_mi_thunk): Avoid using C++ keywords as variable names.

From-SVN: r125357
2007-06-06 08:02:56 +00:00
Uros Bizjak f28eb39cee sse.md (sse4_2_pcmpestr_cconly): Prefer pcmpestrm as flags setting insn.
* config/i386/sse.md (sse4_2_pcmpestr_cconly): Prefer pcmpestrm
	as flags setting insn.
	(sse4_2_pcmpistr_cconly): Prefer pcmpistrm as flags setting insn.

	* config/i386/i386.md (UNSPEC_ROUNDP, UNSPEC_ROUNDS): Remove.
	(UNSPEC_ROUND): New.
	("sse4_1_round<mode>2"): New insn pattern.
	("rint<mode>2"): Expand using "sse4_1_round<mode>2" pattern for
	SSE4.1 targets.
	("floor<mode>2"): Rename from floordf2 and floorsf2.  Macroize
	expander using SSEMODEF mode macro.  Expand using
	"sse4_1_round<mode>2" pattern for SSE4.1 targets.
	("ceil<mode>2"): Rename from ceildf2 and ceilsf2.  Macroize
	expander using SSEMODEF mode macro.  Expand using
	"sse4_1_round<mode>2" pattern for SSE4.1 targets.
	("btrunc<mode>2"): Rename from btruncdf2 and btruncsf2.  Macroize
	expander using SSEMODEF mode macro.  Expand using
	"sse4_1_round<mode>2" pattern for SSE4.1 targets.
	* config/i386/sse.md ("sse4_1_roundpd", "sse4_1_roundps"): Use
	UNSPEC_ROUND instead of UNSPEC_ROUNDP.
	("sse4_1_roundsd", "sse4_1_roundss"): Use UNSPEC_ROUND instead of
	UNSPEC_ROUNDS.

From-SVN: r125356
2007-06-06 08:53:29 +02:00
Jan Sjodin 69f2880c76 lambda.h (build_linear_expr): New.
* lambda.h (build_linear_expr): New.
	* lambda-code.c (lbv_to_gcc_expression, lle_to_gcc_expression): 
	Use build_linear_expr, call fold and force_gimple_operand.
	(lambda_loopnest_to_gcc_loopnest): Check that there is
	something to insert.
	* testsuite/gcc.dg/tree-ssa/ltrans-6.c: New.


Co-Authored-By: Sebastian Pop <sebpop@gmail.com>

From-SVN: r125355
2007-06-06 06:08:58 +00:00
Joerg Wunsch f7fd775f02 re PR preprocessor/23479 (Implement binary constants with a "0b" prefix)
2007-06-05  Joerg Wunsch  <j.gnu@uriah.heep.sax.de>

	PR preprocessor/23479
gcc/
	* doc/extend.texi: Document the 0b-prefixed binary integer
	constant extension.

libcpp/
	* expr.c (cpp_classify_number): Implement 0b-prefixed binary
	integer constants.
	(append_digit): Likewise.
	* include/cpplib.h: Add CPP_N_BINARY, to be used for 0b-prefixed
	binary integer constants.

testsuite/
	* testsuite/gcc.dg/binary-constants-1.c: Add test suites for
	the 0b-prefixed binary integer constants.
	* testsuite/gcc.dg/binary-constants-2.c: Ditto.
	* testsuite/gcc.dg/binary-constants-3.c: Ditto.
	* testsuite/gcc.dg/binary-constants-4.c: Ditto.

From-SVN: r125346
2007-06-05 22:25:27 +00:00
Uros Bizjak 1a5f8b894c re PR tree-optimization/32215 (ICE in supportable_narrowing_operation, at tree-vectorizer.c:1907)
PR tree-optimization/32215
        * tree-vectorizer.c (supportable_widening_operation): Return false
        for unsupported FIX_TRUNC_EXPR tree code.
        (supportable_narrowing_operation): Ditto for FLOAT_EXPR tree code.

From-SVN: r125343
2007-06-05 22:23:58 +02:00
Nathan Froyd 52ff33d0eb rs6000.h (FIXED_SCRATCH): Use r0 as a scratch register on SPE targets.
* config/rs6000/rs6000.h (FIXED_SCRATCH): Use r0 as a scratch
	register on SPE targets.  Change documentation to reflect
	reality.
	* config/rs6000/rs6000.c (rs6000_conditional_register_usage):
	Change FIXED_SCRATCH to 14 and document why we're keeping r14
	out of the register allocation pool.
	(rs6000_reg_live_or_pic_offset_p): New function.
	(rs6000_emit_prologue): Move the actual saving of LR up to free
	r0 for holding r11.  Split saving of SPE 64-bit registers into
	its own case.  Ensure that offsets will always be in-range for
	'evstdd' by using r11 as a scratch register to point at the start
	of the SPE save area.  Save r11 if necessary, as it is the static
	chain register.
	(rs6000_emit_epilogue): Split restoring of SPE 64-bit registers
	into its own case.  Ensure that offsets will always be in-range
	for 'evldd' by using r11 as a scratch register to point at the
	start of the SPE save area.  Also adjust r11 when restoring
	the stack pointer to compensate for pre-loading r11.

From-SVN: r125340
2007-06-05 19:46:23 +00:00
Thomas Neumann 7fc40a9c9c typo
From-SVN: r125338
2007-06-05 16:16:23 +00:00
Thomas Neumann ae50c0cbc8 cfg.c (init_flow): Use type safe memory macros.
* cfg.c (init_flow): Use type safe memory macros.
	(alloc_block): Likewise.
	(unchecked_make_edge): Likewise.
	(dump_flow_info): Avoid using C++ keywords as variable names.
	(copy_original_table_clear): Cast according to the coding conventions.
	(copy_original_table_set): Likewise.
	* cfgexpand (label_rtx_for_bb): Likewise.
	(expand_gimüle_basic_block): Likewise.
	* cfghooks.c (dump_bb): Likewise.
	(lv_adjust_loop_header_phi): Avoid using C++ keywords as variable names.
	(lv_add_condition_to_bb): Likewise.
	* cfglayout (relink_block_chain): Cast according to the coding
	conventions.
	(fixup_reorder_chain): Likewise.
	(fixup_fallthru_exit_predecessor): Likewise.
	* cfgloop.c (glb_enum_p): Likewise.
	(get_exit_description): Likewise.
	(dump_recorded_exit): Likewise.
	* cfgloop.h (enum loop_estimation): Move out of struct scope...
	(struct loop): ... from here.
	* cfgloopmanip (rpe_enum_p): Cast according to the coding conventions.
	* cfgrtl.c (rtl_create_basic_block): Likewise.
	(rtl_split_block): Likewise.
	(rtl_dump_bb): Likewise.
	(cfg_layout_split_block): Likewise.
	(init_rtl_bb_info): Use typesafe memory macros.

	* graphds.h (struct graph_edge): Renamed edge to graph_edge.
	* graphds.h: Updated all usages of edge to graph_edge.
	* graphds.c: Likewise.
	* cfgloopanal.c: Likewise.

From-SVN: r125336
2007-06-05 15:41:04 +00:00
Ian Lance Taylor 3fe5bcaf11 tree-vrp.c (compare_values_warnv): Check TREE_NO_WARNING on a PLUS_EXPR or MINUS_EXPR node before setting...
./:	* tree-vrp.c (compare_values_warnv): Check TREE_NO_WARNING on a
	PLUS_EXPR or MINUS_EXPR node before setting *strict_overflow_p.
	(extract_range_from_assert): Set TREE_NO_WARNING when creating an
	expression.
	(test_for_singularity): Likewise.
testsuite/:
	* gcc.dg/Wstrict-overflow-19.c: New test.

From-SVN: r125334
2007-06-05 13:18:22 +00:00
H.J. Lu a176d60f9d constraints.md ("Y2"): Replaced by ...
2007-06-05  H.J. Lu  <hongjiu.lu@intel.com>

	* config/i386/constraints.md ("Y2"): Replaced by ...
	("Yt"): This.
	* config/i386/i386.md: Likewise.
	* config/i386/mmx.md: Likewise.
	* config/i386/sse.md: Likewise.

From-SVN: r125333
2007-06-05 05:54:41 -07:00