Commit Graph

32474 Commits

Author SHA1 Message Date
Uros Bizjak 8ecaacaf28 * PR rtl-optimization/31344 is actually middle-end bug.
From-SVN: r124826
2007-05-18 10:46:30 +02:00
Uros Bizjak 4bcc9de5fd re PR middle-end/31344 (bootstrap broken on i[345]86-linux)
PR rtl-optimization/31344
	* expr.c (emit_move_change_mode): Change mode of push operands here.

testsuite/ChangeLog:

	PR rtl-optimization/31344
	* gcc.dg/pr31344.c: New test.

From-SVN: r124825
2007-05-18 10:37:03 +02:00
Ian Lance Taylor b60b471172 re PR tree-optimization/31953 (ICE in set_value_range, at tree-vrp.c:305)
./:	PR tree-optimization/31953
	* tree-vrp.c (set_value_range_to_value): Add equiv parameter.
	Change all callers.
	(set_value_range_to_null): Call set_value_range_to_value.
	(extract_range_from_comparison): Likewise.
testsuite/:
	PR tree-optimization/31953
	* gcc.c-torture/compile/pr31953.c: New test.

From-SVN: r124823
2007-05-18 05:37:27 +00:00
Kaveh R. Ghazi 0968bb3d1d toplev.c (print_version): Output GMP/MPFR version info.
* toplev.c (print_version): Output GMP/MPFR version info.

From-SVN: r124822
2007-05-18 02:04:02 +00:00
Kaveh R. Ghazi bf460eec6f builtins.c (CASE_MATHFN_REENT): New macro.
* builtins.c (CASE_MATHFN_REENT): New macro.
	(mathfn_built_in): Use it.
	* builtins.def (BUILT_IN_GAMMA_R, BUILT_IN_GAMMAF_R,
	BUILT_IN_GAMMAL_R, BUILT_IN_LGAMMA_R, BUILT_IN_LGAMMAF_R,
	BUILT_IN_LGAMMAL_R): New.
	* doc/extend.texi: Document new builtins.

testsuite:
	* gcc.dg/builtins-1.c: Test reentrant gamma functions.

From-SVN: r124821
2007-05-18 01:42:15 +00:00
Kaveh R. Ghazi ea91f95764 re PR middle-end/31796 (Evaluate remquo/remainder/drem at compile-time)
PR middle-end/31796
	* builtins.c (do_mpfr_remquo): New.
	(fold_builtin_2): Handle BUILT_IN_DREM/BUILT_IN_REMAINDER.
	(fold_builtin_3): Handle BUILT_IN_REMQUO.

testsuite:
	* gcc.dg/torture/builtin-math-2.c: Add tests for remquo, remainder
	and drem.
	* gcc.dg/torture/builtin-math-4.c: Likewise.

From-SVN: r124820
2007-05-18 01:31:20 +00:00
Kaveh R. Ghazi fd2ef596b5 re PR middle-end/30251 (Evaluate bessel functions at compile-time)
PR middle-end/30251
	* builtins.c (fold_builtin_1): Handle y0, y1.
	(fold_builtin_2): Handle yn.

testsuite:
	* gcc.dg/torture/builtin-math-2.c: Test y0, y1, yn.
	* gcc.dg/torture/builtin-math-4.c: Likewise.

From-SVN: r124819
2007-05-18 01:15:28 +00:00
Kaveh R. Ghazi 550b318767 re PR middle-end/30251 (Evaluate bessel functions at compile-time)
PR middle-end/30251
	* builtins.c (do_mpfr_bessel_n): New.
	(fold_builtin_1): Handle BUILT_IN_J0 and BUILT_IN_J1.
	(fold_builtin_2): Handle BUILT_IN_JN.

testsuite:
	* gcc.dg/torture/builtin-math-4.c: New test.

From-SVN: r124818
2007-05-18 01:04:12 +00:00
Danny Smith a7d0b2d809 re PR target/31965 (_INTEGRAL_MAX_BITS defined incorrectly)
PR target/31965
	* config/i386/mingw32.h (_INTEGRAL_MAX_BITS): Define builtin as
	TYPE_PRECISION (intmax_type_node).

From-SVN: r124813
2007-05-17 22:51:05 +00:00
Steve Ellcey 0fa4cb7dd9 re PR target/31850 (gcc.c-torture/compile/limits-fnargs.c is slow at compiling for spu-elf)
PR target/31850
	* reload.c (subst_reloads): Remove checking.

From-SVN: r124810
2007-05-17 20:29:34 +00:00
Eric Botcazou 4eff80454b re PR rtl-optimization/31691 (optimized code taking the wrong branch)
PR rtl-optimization/31691
	* combine.c (simplify_set): Build a new src pattern instead of
	substituting its operands in the COMPARE case.

From-SVN: r124797
2007-05-17 13:29:10 +00:00
Zdenek Dvorak b02b9b53ec tree-vrp.c (finalize_jump_threads): Do not care about dominance info.
* tree-vrp.c (finalize_jump_threads): Do not care about dominance info.
	(execute_vrp): Preserve loops through jump threading.
	* tree-ssa-threadupdate.c (thread_single_edge,
	dbds_continue_enumeration_p, determine_bb_domination_status,
	thread_through_loop_header): New functions.
	(create_edge_and_update_destination_phis,
	create_edge_and_update_destination_phis): Set loops for the new blocks.
	(prune_undesirable_thread_requests): Removed.
	(redirect_edges): Do not pretend that redirect_edge_and_branch can
	create new blocks.
	(thread_block): Do not call prune_undesirable_thread_requests.
	Update loops.
	(mark_threaded_blocks): Select edges to thread here.
	(thread_through_all_blocks): Take may_peel_loop_headers argument.
	Thread edges through loop headers independently.
	* cfgloopmanip.c (create_preheader, mfb_keep_just): Export.
	* tree-pass.h (TODO_mark_first_instance): New.
	(first_pass_instance): Declare.
	* cfghooks.c (duplicate_block): Put the block to the original loop
	if copy is not specified.
	* tree-ssa-dom.c (tree_ssa_dominator_optimize): Preserve loops through
	jump threading.  Pass may_peel_loop_headers to
	thread_through_all_blocks according to first_pass_instance.
	* cfgloop.h (create_preheader): Declare.
	* tree-flow.h (thread_through_all_blocks): Declaration changed.
	* basic-block.h (mfb_keep_just, mfb_kj_edge): Declare.
	* passes.c (first_pass_instance): New variable.
	(next_pass_1): Set TODO_mark_first_instance.
	(execute_todo): Set first_pass_instance.

	* gcc.dg/tree-ssa/ssa-dom-thread-2.c: New test.
	* gcc.dg/vect/vect-102.c, gcc.dg/vect/vect-103.c,
	gcc.dg/vect/vect-104.c: Use more complex construction to prevent vectorizing.
	* gcc.dg/tree-ssa/pr21559.c: Update outcome.

From-SVN: r124786
2007-05-17 08:10:24 +00:00
Uros Bizjak d9987fb407 re PR tree-optimization/24659 (Conversions are not vectorized)
PR tree-optimization/24659
        * optabs.h (enum optab_index): Add OTI_vec_unpacks_float_hi,
	OTI_vec_unpacks_float_lo, OTI_vec_unpacku_float_hi,
	OTI_vec_unpacku_float_lo, OTI_vec_pack_sfix_trunc and
	OTI_vec_pack_ufix_trunc.
	(vec_unpacks_float_hi_optab): Define new macro.
	(vec_unpacks_float_lo_optab): Ditto.
	(vec_unpacku_float_hi_optab): Ditto.
	(vec_unpacku_float_lo_optab): Ditto.
	(vec_pack_sfix_trunc_optab): Ditto.
	(vec_pack_ufix_trunc_optab): Ditto.
	* genopinit.c (optabs): Implement vec_unpack[s|u]_[hi|lo]_optab
	and vec_pack_[s|u]fix_trunc_optab using
	vec_unpack[s|u]_[hi\lo]_* and vec_pack_[u|s]fix_trunc_* patterns
	* tree-vectorizer.c (supportable_widening_operation): Handle
	FLOAT_EXPR and CONVERT_EXPR.  Update comment.
	(supportable_narrowing_operation): New function.
	* tree-vectorizer.h (supportable_narrowing_operation): Prototype.
	* tree-vect-transform.c (vectorizable_conversion): Handle
	(nunits_in == nunits_out / 2) and (nunits_out == nunits_in / 2) cases.
	(vect_gen_widened_results_half): Move before vectorizable_conversion.
	(vectorizable_type_demotion): Call supportable_narrowing_operation()
	to check for target support.
	* optabs.c (optab_for_tree_code) Return vec_unpack[s|u]_float_hi_optab
	for VEC_UNPACK_FLOAT_HI_EXPR, vec_unpack[s|u]_float_lo_optab
	for VEC_UNPACK_FLOAT_LO_EXPR and vec_pack_[u|s]fix_trunc_optab
	for VEC_PACK_FIX_TRUNC_EXPR.
	(expand_binop): Special case mode of the result for
	vec_pack_[u|s]fix_trunc_optab.
	(init_optabs): Initialize vec_unpack[s|u]_[hi|lo]_optab and
	vec_pack_[u|s]fix_trunc_optab.

	* tree.def (VEC_UNPACK_FLOAT_HI_EXPR, VEC_UNPACK_FLOAT_LO_EXPR,
	VEC_PACK_FIX_TRUNC_EXPR): New tree codes.
	* tree-pretty-print.c (dump_generic_node): Handle
	VEC_UNPACK_FLOAT_HI_EXPR, VEC_UNPACK_FLOAT_LO_EXPR and
	VEC_PACK_FIX_TRUNC_EXPR.
	(op_prio): Ditto.
	* expr.c (expand_expr_real_1): Ditto.
	* tree-inline.c (estimate_num_insns_1): Ditto.
	* tree-vect-generic.c (expand_vector_operations_1): Ditto.

	* config/i386/sse.md (vec_unpacks_float_hi_v8hi): New expander.
	(vec_unpacks_float_lo_v8hi): Ditto.
	(vec_unpacku_float_hi_v8hi): Ditto.
	(vec_unpacku_float_lo_v8hi): Ditto.
	(vec_unpacks_float_hi_v4si): Ditto.
	(vec_unpacks_float_lo_v4si): Ditto.
	(vec_pack_sfix_trunc_v2df): Ditto.

	* doc/c-tree.texi (Expression trees) [VEC_UNPACK_FLOAT_HI_EXPR]:
	Document.
	[VEC_UNPACK_FLOAT_LO_EXPR]: Ditto.
	[VEC_PACK_FIX_TRUNC_EXPR]: Ditto.
	* doc/md.texi (Standard Names) [vec_pack_sfix_trunc]: Document.
	[vec_pack_ufix_trunc]: Ditto.
	[vec_unpacks_float_hi]: Ditto.
	[vec_unpacks_float_lo]: Ditto.
	[vec_unpacku_float_hi]: Ditto.
	[vec_unpacku_float_lo]: Ditto.

testsuite/ChangeLog:

	PR tree-optimization/24659
	* gcc.dg/vect/vect-floatint-conversion-2.c: New test.
	* gcc.dg/vect/vect-intfloat-conversion-1.c: Require vect_float,
	not vect_int target.
	* gcc.dg/vect/vect-intfloat-conversion-2.c: Require vect_float,
	not vect_int target.  Loop is vectorized for vect_intfloat_cvt
	targets.
	* gcc.dg/vect/vect-intfloat-conversion-3.c: New test.
	* gcc.dg/vect/vect-intfloat-conversion-4a.c: New test.
	* gcc.dg/vect/vect-intfloat-conversion-4b.c: New test.

From-SVN: r124784
2007-05-17 08:31:05 +02:00
Uros Bizjak 27735edb45 README: Update for new files.
* soft-fp/README: Update for new files.
        * soft-fp/floattisf.c: New file.
        * soft-fp/floattidf.c: New file.
        * soft-fp/floattitf.c: New file.
        * soft-fp/floatuntisf.c: New file.
        * soft-fp/floatuntidf.c: New file.
        * soft-fp/floatuntitf.c: New file.
        * soft-fp/fixsfti.c: New file.
        * soft-fp/fixdfti.c: New file.
        * soft-fp/fixtfti.c: New file.
        * soft-fp/fixunssfti.c: New file.
        * soft-fp/fixunsdfti.c: New file.
        * soft-fp/fixunstfti.c: New file.
        * soft-fp/extendxftf.c: New file.
        * soft-fp/trunctfxf.c: New file.

        * libgcc-std.ver (__extendxftf2): Added to GCC_4.3.0 section.
        (__trunctfxf2): Ditto.

        * config/i386/libgcc-x86_64-glibc.ver (__addtf3, __divtf3, __eqtf2,
        __extenddftf2, __extendsftf2, __fixtfdi, __fixtfsi, __fixtfti,
        __fixunstfdi, __fixunstfsi, __fixunstfti, __floatditf, __floatsitf,
        __floattitf, __floatunditf, __floatunsitf, __floatuntitf, __getf2,
        __letf2, __multf3, __negtf2, __subtf3, __trunctfdf2, __trunctfsf2,
        __unordtf2): Exclude and add to GCC_4.3.0 section for x86_64 targets.

        * config/i386/t-fprules-softfp64: New file.
        * config/i386/sfp-machine.h: New file.
        * config.gcc (x86_64-*-linux*, x86_64-*-kfreebsd*-gnu,
        x86_64-*-knetbsd*-gnu): Add i386/t-fprules-softfp64
        and soft-fp/t-softfp to tmake_file.
        (i[34567]86-*-linux*, i[34567]86-*-kfreebsd*-gnu,
        i[34567]86-*-knetbsd*-gnu): Ditto for --enable-targets=all.

        * config/i386/t-linux64 (softfp_wrap_start): New.
        (softfp_wrap_end): New.
        * config/i386/i386.c (ix86_scalar_mode_supported): TFmode is
        supported for TARGET_64BIT.

testsuite/ChangeLog:

        * gcc.dg/torture/fp-int-convert-float128.c: Do not xfail for i?86-*-*
        and x86_64-*-* targets.
        * gcc.dg/torture/fp-int-convert-float128-timode.c: Ditto.

From-SVN: r124775
2007-05-16 19:07:07 +02:00
Rafael Avila de Espindola c74a03d23e c-common.c (c_common_signed_or_unsigned_type): Emulate c_common_unsigned_type behavior.
2007-05-16  Rafael Avila de Espindola  <espindola@google.com>

       * c-common.c (c_common_signed_or_unsigned_type): Emulate
       c_common_unsigned_type behavior.

From-SVN: r124771
2007-05-16 16:26:21 +00:00
Paolo Bonzini 2d79fde8c2 i386.c (legitimize_tls_address): Mark __tls_get_addr calls as pure.
2007-05-16  Paolo Bonzini  <bonzini@gnu.org>

        * config/i386/i386.c (legitimize_tls_address): Mark __tls_get_addr
        calls as pure.

From-SVN: r124765
2007-05-16 09:23:21 +00:00
Eric Christopher 2b2c2fe51a rs6000.c (rs6000_emit_prologue): Move altivec register saving after stack push.
2007-05-16  Eric Christopher  <echristo@apple.com>

	* config/rs6000/rs6000.c (rs6000_emit_prologue): Move altivec register
        saving after stack push. Set sp_offset whenever we push.
        (rs6000_emit_epilogue): Move altivec register restore before stack push.

From-SVN: r124763
2007-05-16 08:30:10 +00:00
Richard Sandiford 748670c25b configure.ac: Allow sysroots to be relocated under $prefix as well as $exec_prefix.
gcc/
	* configure.ac: Allow sysroots to be relocated under $prefix as
	well as $exec_prefix.
	* configure: Regenerate.

From-SVN: r124762
2007-05-16 07:14:40 +00:00
Richard Sandiford 4ef2b6ed33 revert: configure.ac (gcc_gxx_include_dir): Use $(libsubdir_to_prefix).
gcc/
	Revert:

	2007-05-12  Richard Sandiford  <richard@codesourcery.com>

	* configure.ac (gcc_gxx_include_dir): Use $(libsubdir_to_prefix).
	(gcc_tooldir): Likewise.
	* configure: Regenerate.
	* Makefile.in (libsubdir_to_prefix): New variable, based on the
	old configure.ac gcc_tooldir setting.
	(prefix_to_exec_prefix): New variable.
	(DRIVER_DEFINES): Use $(libsubdir_to_prefix)$(prefix_to_exec_prefix)
	rather than $(unlibsubdir)/../ to derive TOOLDIR_BASE_PREFIX.

From-SVN: r124760
2007-05-16 06:43:36 +00:00
Janis Johnson 3bf6bfcc7e c-typeck.c (build_binary_op): Return early for error.
gcc/
	* c-typeck.c (build_binary_op): Return early for error.
gcc/testsuite/
	* gcc.dg/dfp/usual-arith-conv-bad.c: New test.

From-SVN: r124732
2007-05-14 23:49:36 +00:00
Zdenek Dvorak 9e2f83a5e8 tree-ssa-loop-niter.c (record_estimate): Use GGC_NEW to allocate struct nb_iter_bound.
* tree-ssa-loop-niter.c (record_estimate): Use GGC_NEW to allocate
	struct nb_iter_bound.
	(free_numbers_of_iterations_estimates_loop): Use ggc_free.
	* gengtype.c (open_base_files): Add cfhloop.h to the list of includes.
	* cfgloopmanip.c (place_new_loop): Vector larray is gc-allocated.
	* tree-scalar-evolution.c: Include gt-tree-scalar-evolution.h.
	(struct scev_info_str, scalar_evolution_info): Add GTY markers.
	(new_scev_info_str): Use GGC_NEW to allocate struct scev_info_str.
	(del_scev_info): Use ggc_free.
	(scev_initialize): Allocate scalar_evolution_info in gc memory.
	* loop-init.c: Include ggc.h.
	(loop_optimizer_init): Use GGC_CNEW to allocate struct loops.
	(loop_optimizer_finalize): Use ggc_free.
	* tree-ssa-loop.c (pass_tree_unswitch, pass_vectorize,
	pass_linear_transfom, pass_empty_loop, pass_complete_unroll,
	pass_iv_optimize): Add TODO_ggc_collect.
	* function.h (struct function): Remove skip marker from x_current_loops.
	* cfgloop.c: Include ggc.h.
	(flow_loops_free, flow_loop_free): Free the loop descriptions in gc
	memory.
	(establish_preds): Vector superloops is gc allocated.
	(alloc_loop): Allocate loop using GGC_CNEW.  Allocate head of
	loop->exits list.
	(flow_loops_find): Vector larray is gc allocated.
	(loop_exit_free): Use ggc_free.
	(rescan_loop_exit): Use GGC_NEW to allocate struct loop_exit.  Reflect
	that head of exits list is now not a part of struct loop.
	(record_loop_exits): Allocate exits table in gc memory.
	(get_loop_exit_edges, verify_loop_structure, single_exit): Reflect that
	head of exits list is now not a part of struct loop.
	* cfgloop.h (struct lpt_decision, struct nb_iter_bound,
	struct loop_exit): Add GTY marker.
	(struct loop): Add GTY marker.  Make superloops vector gc allocated.
	Add skip marker to aux field.  Make head of exits list a separate
	object.
	(struct loops): Add GTY marker.  Make larray vector gc allocated.
	Add param marker to exits table.
	(get_loops): Type changed.
	* Makefile.in (tree-scalar-evolution.o): Add gt-tree-scalar-evolution.h
	dependency.
	(cfgloop.o, loop-init.o): Add ggc.h dependency.
	(GTFILES): Add cfgloop.h and tree-scalar-evolution.c.
	* basic-block.h (struct basic_block_def): Remove skip marker from
	loop_father field.

From-SVN: r124727
2007-05-14 21:58:42 +00:00
Uros Bizjak 49452c070f builtins.c (expand_builtin_mathfn): Use EXPAND_NORMAL instead of 0 in the call to expand_expr().
* builtins.c (expand_builtin_mathfn): Use EXPAND_NORMAL instead
        of 0 in the call to expand_expr().
        (expand_builtin_mathfn_3): Ditto.
        (expand_builtin_interclass_mathfn): Ditto.
        (expand_builtin_cexpi): Ditto.
        (expand_builtin_int_roundingfn): Ditto.
        (expand_builtin_int_roundingfn_2): Ditto.
        (expand_builtin_pow): Ditto.
        (expand_builtin_powi): Ditto.
        (expand_builtin_bswap): Ditto.
        (expand_builtin_unop): Ditto.
        (expand_builtin_fabs): Ditto.
        (get_builtin_sync_mem): Use NULL_RTX instead of NULL in
        the call to expand_expr().
        (expand_builtin_sync_operation): Ditto.
        (expand_builtin_compare_and_swap): Ditto.
        (expand_builtin_lock_test_and_set): Ditto.
        * except.c (expand_builtin_eh_return_data_regno): Use EXPAND_NORMAL
        instead of 0 in the call to expand_expr().
        (expand_builtin_extract_return_addr): Ditto.
        (expand_builtin_eh_return): Ditto.
        (expand_eh_return): Ditto.
        * explow.c (expr_size): Ditto.
        * expr.c (optimize_bitfield_assignment_op): Ditto.
        (expand_assignement): Ditto.
        (store_expr): Ditto.
        (store_field): Ditto.
        (expand_expr_addr_expr_1): Use NULL_RTX instead of NULL in
        the call to expand_expr().
        (expand_expr_real_1) [COMPLEX_CST]: Use EXPAND_NORMAL instead of 0
        in the call to expand_expr().
        [CONSTRUCTOR, PLUS_EXPR, MINUS_EXPR, NEGATE_EXPR, ABS_EXPR,
        BIT_NOT_EXPR, LSHIFT_EXPR, LT_EXPR, TRUTH_NOT_EXPR]: Ditto.
        [VEC_UNPACK_HI_EXPR, VEC_UNPACK_LO]: Use expand_normal() instead
        of expand_expr().
        * optabs.c (expand_vec_shift_expr): Ditto.
        (expand_vec_cond_expr): Ditto.
        (vector_compare_rtx): Use EXPAND_STACK_PARM instead of 1 in the
        call to expand_expr().
        * stmt.c (expand_return): Use EXPAND_NORMAL instead of 0
        in the call to expand_expr().

From-SVN: r124722
2007-05-14 21:42:47 +02:00
Dave Korn 9c40feebdb genautomata.c (gen_regexp_el): Allocate correct size for regexp.
2007-05-14  Dave Korn  <dave.korn@artimi.com>

	* genautomata.c (gen_regexp_el):  Allocate correct size for regexp.

From-SVN: r124718
2007-05-14 16:46:44 +00:00
Rafael Avila de Espindola ca5ba2a3ea c-common.c (warnings_for_convert_and_check): Use unsigned_type_for instead of c_common_unsigned_type.
gcc/
       * c-common.c (warnings_for_convert_and_check): Use unsigned_type_for
       instead of c_common_unsigned_type.
       (c_common_unsigned_type): Remove.
       (shorten_compare): Use c_common_signed_or_unsigned_type instead of
       c_common_unsigned_type.
       (c_common_nodes_and_builtins): Use unsigned_type_for instead of
       c_common_unsigned_type.
       * c-common.h (c_common_unsigned_type): Remove.
       * c-decl.c (grokdeclarator): Use unsigned_type_for instead of
       c_common_unsigned_type.
       * c-format.c (check_format_types): Use unsigned_type_for instead of
       c_common_unsigned_type.
       * c-objc-common.h (LANG_HOOKS_UNSIGNED_TYPE): Remove.
       * c-typeck.c (convert_for_assignment): Use unsigned_type_for instead of
       c_common_unsigned_type.
       * convert.c (convert_to_integer): Use unsigned_type_for instead of
       lang_hooks.types.unsigned_type.
       * expmed.c (make_tree): Use unsigned_type_for instead of
       lang_hooks.types.unsigned_type.
       * fold-const.c (fold_negate_expr): Use unsigned_type_for instead of
       lang_hooks.types.unsigned_type.
       (build_range_check): Likewise.
       (fold_unary): Likewise.
       (fold_binary): Likewise.
       (fold_ternary): Likewise.
       * langhooks-def.h (LANG_HOOKS_UNSIGNED_TYPE): Remove.
       * langhooks.h (lang_hooks_for_types): Remove unsigned_type.
       * tree.c (get_unsigned_type): New.
       (unsigned_type_for): Use get_unsigned_type instead of
       lang_hooks.types.unsigned_type

gcc/ada
       * misc.c (LANG_HOOKS_UNSIGNED_TYPE): Remove.

gcc/cp
       * cp-objcp-common.h (LANG_HOOKS_UNSIGNED_TYPE): Remove.
       * decl.c (grokdeclarator): Use unsigned_type_for instead of
       c_common_unsigned_type.

gcc/fortran
       * f95-lang.c (LANG_HOOKS_UNSIGNED_TYPE): Remove.
       * trans-intrinsic.c (gfc_conv_intrinsic_ishft): Use unsigned_type_for
       instead of gfc_unsigned_type.
       * trans-stmt.c (gfc_trans_do): Use unsigned_type_for instead of
       gfc_unsigned_type.
       * trans-types.c (gfc_unsigned_type): Remove.
       * trans-types.h (gfc_unsigned_type): Remove.

gcc/java
       * expr.c (build_java_binop): Use unsigned_type_for instead of
       java_unsigned_type.
       * java-tree.h (java_unsigned_type): Remove.
       * lang.c (LANG_HOOKS_UNSIGNED_TYPE): Remove.
       * typeck.c (java_unsigned_type): Remove.

gcc/treelang
       * treetree.c (tree_lang_unsigned_type): Remove.
       (LANG_HOOKS_UNSIGNED_TYPE): Remove.

From-SVN: r124715
2007-05-14 14:37:17 +00:00
Kazu Hirata a424273720 m68k-protos.h: Rename m68k_interrupt_function_p to m68k_get_function_kind.
gcc/
	* config/m68k/m68k-protos.h: Rename m68k_interrupt_function_p
	to m68k_get_function_kind.  Update its prototype.
	* config/m68k/m68k.c (m68k_attribute_table): Add an entry for
	interrupt_thread.
	(m68k_interrupt_function_p): Return enum m68k_function_type
	instead of bool.  Rename to m68k_get_function_kind.
	(m68k_handle_fndecl_attribute): Reject interrupt_thread if the
	target is not fido.
	(m68k_compute_frame_layout): Don't mark any register for save
	if an interrupt_thread attribute is specified.
	(m68k_hard_regno_rename_ok): Update a use of
	m68k_interrupt_function_p.
	* config/m68k/m68k.h (EPILOGUE_USES): Update a use of
	m68k_interrupt_function_p.
	(m68k_function_type): New.
	* config/m68k/m68k.md (*return): Output a 'sleep' instruction
	for a function with an interrupt_thread attribute.
	* doc/extend.texi: Document the interrupt_thread attribute.

gcc/testsuite/
	* gcc.target/m68k/interrupt_thread-1.c,
	gcc.target/m68k/interrupt_thread-2.c,
	gcc.target/m68k/interrupt_thread-3.c: New.
	* gcc.target/m68k/m68k.exp: Accept fido.

From-SVN: r124713
2007-05-14 13:52:18 +00:00
Daniel Berlin 4076455d9b re PR tree-optimization/31911 (Short function (md4) takes very long to compile)
2007-05-13  Daniel Berlin  <dberlin@dberlin.org>

	Fix PR tree-optimization/31911
	* tree-ssa-pre.c (phi_translate): Make sure to cache results even
	if they didn't change the expression.

From-SVN: r124657
2007-05-13 21:52:10 +00:00
Zdenek Dvorak 3cb960c703 tree-scalar-evolution.c (resolve_mixers): Exported.
* tree-scalar-evolution.c (resolve_mixers): Exported.
	* tree-scalar-evolution.h (resolve_mixers): Declare.
	* tree-data-ref.c (object_analysis, ptr_decl_may_alias_p,
	ptr_ptr_may_alias_p, may_alias_p, record_ptr_differ_p,
	record_record_differ_p, record_array_differ_p, array_ptr_differ_p,
	base_object_differ_p, base_addr_differ_p, analyze_array_indexes,
	init_array_ref, init_pointer_ref, analyze_indirect_ref,
	strip_conversion, analyze_offset_expr, address_analysis,
	object_analysis, analyze_offset): Removed.
	(dr_analyze_innermost, dr_analyze_indices, dr_analyze_alias,
	split_constant_offset, canonicalize_base_object_address,
	object_address_invariant_in_loop_p, disjoint_objects_p,
	dr_may_alias_p, dr_address_invariant_p): New functions.
	(create_data_ref): Use dr_analyze_innermost, dr_analyze_indices
	and dr_analyze_alias.
	(initialize_data_dependence_relation): Use dr_may_alias_p
	and object_address_invariant_in_loop_p.
	(compute_self_dependence): Handle the case when DDR_ARE_DEPENDENT (ddr)
	is chrec_dont_know.
	(find_data_references_in_stmt): Restrict the analysis of data references
	to the given loop nest.
	(find_data_references_in_loop): Made static.  Pass loop nest to
	find_data_references_in_stmt.
	(compute_data_dependences_for_loop): Use DR_VOPS.
	(free_data_ref): Free DR_VOPS.
	* tree-data-ref.h (struct first_location_in_loop): Replaced by ...
	(struct innermost_loop_behavior): ... new.
	(struct base_object_info): Replaced by ...
	(struct indices): ... new.
	(struct dr_alias): New.
	(enum data_ref_type): Removed.
	(struct data_reference): Consist of struct innermost_loop_behavior,
	struct indices and struct dr_alias.
	(DR_SET_ACCESS_FNS, DR_FREE_ACCESS_FNS): Removed.
	(DR_MEMTAG): Renamed to ...
	(DR_SYMBOL_TAG): ... this.
	(find_data_references_in_loop): Declaration removed.
	* tree-vect-analyze.c (vect_compute_data_ref_alignment): Use DR_INIT
	instead of DR_OFFSET_MISALIGNMENT.  DR_ALIGNED_TO is never NULL.
	(vect_analyze_data_refs): Use DR_SYMBOL_TAG instead of DR_MEMTAG.
	* tree-vect-transform.c (vect_create_data_ref_ptr): Ditto.

	* gcc.dg/vect/no-section-anchors-vect-69.c: Fix outcome.
	* gcc.dg/tree-ssa/loop-30.c: New test.

From-SVN: r124655
2007-05-13 17:32:06 +00:00
Revital Eres 8a8b05f463 Extend dse
From-SVN: r124651
2007-05-13 07:49:47 +00:00
Steven Bosscher bae8b6b2c3 gcse.c (gcse_main): Do jump bypassing in CPROP2.
* gcse.c (gcse_main): Do jump bypassing in CPROP2.
	* passes.c (init_optimization_passes): Move pass_jump_bypass
	after loop2.

	* basic-block.h (bb_has_eh_pred): Fix style issue.

From-SVN: r124640
2007-05-12 18:15:38 +00:00
Steven Bosscher 7f6055d052 re PR rtl-optimization/31848 (Invalid loop optimization causes bootstrap failure in genautomata)
PR rtl-optimization/31848
	* loop-invariant.c (move_invariant_reg): If we move an insn
	with a REG_EQUAL note, and that insn is not always executed,
	remove the REG_EQUAL note.

From-SVN: r124639
2007-05-12 18:12:54 +00:00
Richard Guenther c4160806e1 re PR tree-optimization/31797 (infinite loop in tree-ssa-pre or ICE)
2007-05-12  Richard Guenther  <rguenther@suse.de>

	PR tree-optimization/31797
	* tree-ssa-forwprop.c (forward_propagate_addr_expr): Do not
	propagate into a stmt that has volatile ops.

	* gcc.c-torture/compile/pr31797.c: New testcase.

From-SVN: r124637
2007-05-12 17:21:43 +00:00
Richard Sandiford a747170836 configure.ac (gcc_gxx_include_dir): Use $(libsubdir_to_prefix).
gcc/
	* configure.ac (gcc_gxx_include_dir): Use $(libsubdir_to_prefix).
	(gcc_tooldir): Likewise.
	* configure: Regenerate.
	* Makefile.in (libsubdir_to_prefix): New variable, based on the
	old configure.ac gcc_tooldir setting.
	(prefix_to_exec_prefix): New variable.
	(DRIVER_DEFINES): Use $(libsubdir_to_prefix)$(prefix_to_exec_prefix)
	rather than $(unlibsubdir)/../ to derive TOOLDIR_BASE_PREFIX.

From-SVN: r124634
2007-05-12 08:00:12 +00:00
Silvius Rus 79bedddc8f Makefile.in (OBJS-common): Add tree-ssa-alias-warnings.o.
gcc/
        * Makefile.in (OBJS-common): Add tree-ssa-alias-warnings.o.
        * c-common.c (strict_aliasing_warning): Modify -Wstrict-aliasing logic.
        * c-common.h (strict_aliasing_warning): Change return type.
        * c-opts.c (c_common_handle_option): Add call to set_Wstrict_aliasing.
        * c-typeck.c (build_indirect_ref): Add call to strict_aliasing_warning.
        (build_c_cast): Condition call to strict_aliasing_warning.
        * doc/invoke.texi: Update description of -Wstrict-aliasing[=n].
        * flags.h (set_Wstrict_aliasing): Declare.
        * opts.c (set_Wstrict_alising): Define, add call to.
        * tree-flow.h (strict_aliasing_warning_backend): Declare.
        * tree-ssa-alias-warnings.c: New file.
        * tree-ssa-alias.c (compute_may_aliases): Add call to
        strict_aliasing_warning_backend.

gcc/cp
        * cp/typeck.c (build_indirect_ref): Add call to
        strict_aliasing_warning.
        (build_reinterpret_cast_1): Condition call to
        strict_aliasing_warning.

gcc/testsuite
        * gcc.dg/Wstrict-aliasing-bogus-const-ptr-nonconst-ptr.c: New test.
        * gcc.dg/Wstrict-aliasing-bogus-never-dereferenced.c: New test.
        * gcc.dg/Wstrict-aliasing-bogus-struct-included.c: New test.
        * gcc.dg/Wstrict-aliasing-converted-assigned.c: New test.
        * gcc.dg/Wstrict-aliasing-float-ptr-int-obj.c: New test.
        * gcc.dg/alias-1.c: Update option: -Wstrict-aliasing=2.
        * gcc.dg/alias-9.c: Update option: -Wstrict-aliasing=2.
        * g++.dg/warn/Wstrict-aliasing-7.C: Update option: -Wstrict-aliasing=2.
        * g++.dg/warn/Wstrict-aliasing-bogus-base-derived.C: New test.
        * g++.dg/warn/Wstrict-aliasing-bogus-char-1.C: New test.
        * g++.dg/warn/Wstrict-aliasing-bogus-const.C: New test.
        * g++.dg/warn/Wstrict-aliasing-bogus-nested-arrays.C: New test.
        * g++.dg/warn/Wstrict-aliasing-bogus-signed-unsigned.C: New test.
        * g++.dg/warn/Wstrict-aliasing-bogus-struct-included.C: New test.
        * g++.dg/warn/Wstrict-aliasing-bogus-union.C: New test.
        * g++.dg/warn/Wstrict-aliasing-float-ref-int-obj.C: New test.

From-SVN: r124622
2007-05-11 16:20:08 +00:00
Zdenek Dvorak 9ba025a2c1 tree-loop-linear.c (gather_interchange_stats, [...]): Use loop_depth and loop_outer accessor functions.
* tree-loop-linear.c (gather_interchange_stats, try_interchange_loops):
	Use loop_depth and loop_outer accessor functions.
	* tree-ssa-loop-im.c (outermost_invariant_loop, set_level,
	determine_invariantness_stmt, move_computations_stmt): Ditto.
	* cfgloopmanip.c (fix_bb_placement, fix_loop_placement, remove_path,
	add_loop, loopify, unloop, fix_loop_structure): Ditto.
	* tree-ssa-loop-manip.c (find_uses_to_rename_use): Ditto.
	* tree-scalar-evolution.c (interpret_loop_phi,
	compute_scalar_evolution_in_loop, analyze_scalar_evolution_in_loop,
	instantiate_parameters_1, scev_const_prop): Ditto.
	* cfghooks.c (make_forwarder_block): Ditto.
	* cfgloopanal.c (mark_irreducible_loops, mark_loop_exit_edges): Ditto.
	* modulo-sched.c (loop_canon_p): Ditto.
	* tree-vectorizer.c (slpeel_tree_duplicate_loop_to_edge_cfg,
	slpeel_can_duplicate_loop_p): Ditto.
	* lambda-code.c (invariant_in_loop_and_outer_loops): Ditto.
	* tree-cfg.c (tree_duplicate_sese_region): Ditto.
	* cfgloop.c (flow_loop_dump, flow_loop_nodes_find, rescan_loop_exit,
	cancel_loop, verify_loop_structure): Ditto.
	(flow_loop_nested_p, superloop_at_depth, flow_loop_free,
	add_bb_to_loop, remove_bb_from_loops, find_common_loop): Use the
	superloops vector instead of "pred" array.
	(establish_preds): Take father loop as an argument.  Initialize the
	superloops vector.
	(flow_loop_tree_node_add): Pass father loop to establish_preds.  Do not
	initialize loop->outer.
	(flow_loop_tree_node_remove): Truncate the superloops vector.
	* cfgloop.h (struct loop): Removed field "outer", fields "depth" and
	"pred" merged to "superloops" vector.
	(loop_depth, loop_outer): New.
	(fel_init): Use loop_outer.

From-SVN: r124619
2007-05-11 15:52:01 +00:00
Jan Hubicka 7be8227904 semantics.c (expand_or_defer_fn): Do not call c_record_cdtor_fn.
* semantics.c (expand_or_defer_fn): Do not call c_record_cdtor_fn.
	* decl2.c (start_objects): ctors and dtors are no longer public.
	(cp_write_global_declarations): Do not call c_build_cdtor_fns.

	* cgraphunit.c: Include gt-cgraphunit.h
	(static_ctors, static_dtors): New static vars.
	(record_cdtor_fn, build_cdtor, cgraph_build_cdtor_fns): New functions,
	based on implementation in c-common.c
	(cgraph_finalize_function): Call record_cdtor_fn.
	(cgraph_optimize): Call cgraph_build_cdtor_fns.
	* decl.c (finish_function): Do not call c_record_cdtor_fn.
	(c_write_global_declarations): Do not call c_build_cdtor_fns.
	* c-common.c (static_ctors, static_dtors, c_record_cdtor_fn,
	build_cdtor, c_build_cdtor_fns): Remove.
	* c-common.h (static_ctors, static_dtors, c_record_cdtor_fn,
	c_build_cdtor_fns): Remove prototype.

From-SVN: r124618
2007-05-11 12:18:17 +00:00
Paolo Carlini 2a5fce6d48 re PR other/31852 (Missing __builtin_memchr)
2007-05-11  Paolo Carlini  <pcarlini@suse.de>

	PR other/31852
	* builtin-types.def: Add BT_FN_PTR_CONST_PTR_INT_SIZE.
	* builtins.def: Add BUILT_IN_MEMCHR, use the latter.
	* builtins.c (fold_builtin_memchr): New.
	(expand_builtin_memchr): Call the latter.
	(expand_builtin, fold_builtin_3): Deal with BUILT_IN_MEMCHR.
	* doc/extend.texi ([Other built-in functions provided by GCC]):
	Document memchr.

/testsuite
2007-05-11  Paolo Carlini  <pcarlini@suse.de>

	PR other/31852
	* gcc.c-torture/execute/builtins/memchr.c: New.
	* gcc.c-torture/execute/builtins/memchr-lib.c: New.
	* gcc.c-torture/execute/builtins/lib/memchr.c: New.

From-SVN: r124617
2007-05-11 11:49:29 +00:00
Andreas Krebbel 35dd9a0e6d s390.md (GPR0_REGNUM, [...]): Constants added.
2007-05-11  Andreas Krebbel  <krebbel1@de.ibm.com>

	* config/s390/s390.md (GPR0_REGNUM, FPR0_REGNUM, FPR2_REGNUM,
	PFPO_CONVERT, PFPO_OP_TYPE_SF, PFPO_OP_TYPE_DF, PFPO_OP_TYPE_TF,
	PFPO_OP_TYPE_SD, PFPO_OP_TYPE_DD, PFPO_OP_TYPE_TD, PFPO_OP0_TYPE_SHIFT,
	PFPO_OP1_TYPE_SHIFT): Constants added.
	(DFP_ALL): Mode macro defined.
	("*trunc<BFP:mode><DFP_ALL:mode>2", "*trunc<DFP_ALL:mode><BFP:mode>2",
	"*extend<BFP:mode><DFP_ALL:mode>2", "*extend<DFP_ALL:mode><BFP:mode>2"):
	Insn definitions added.
	("trunc<BFP:mode><DFP_ALL:mode>2", "trunc<DFP_ALL:mode><BFP:mode>2",
	"extend<BFP:mode><DFP_ALL:mode>2", "extend<DFP_ALL:mode><BFP:mode>2"):
	Expanders added.

From-SVN: r124614
2007-05-11 08:40:52 +00:00
Zdenek Dvorak e71d7f88ba re PR tree-optimization/31885 (Not removing empty loop, scev not finding the correct result)
PR tree-optimization/31885
	* tree-chrec.c (chrec_contains_undetermined): Do not consider NULL_TREE
	to be undetermined.
	(automatically_generated_chrec_p): Return false for NULL.

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

From-SVN: r124602
2007-05-10 21:33:11 +00:00
Bernd Schmidt b548a9c2c2 bfin.h (MOVE_RATIO): Define.
* config/bfin/bfin.h (MOVE_RATIO): Define.

From-SVN: r124596
2007-05-10 13:07:24 +00:00
Richard Sandiford 1910440ea6 config.gcc (sparc-wrs-vxworks): New target.
gcc/
	* config.gcc (sparc-wrs-vxworks): New target.
	* config/sparc/vxworks.h, config/sparc/t-vxworks: New files.
	* config/sparc/sparc-protos.h (sparc_emit_call_insn): Declare.
	* config/sparc/sparc.h: Include vxworks-dummy.h.
	(PRINT_OPERAND_ADDRESS): Extend SYMBOL_REF handling to
	include LABEL_REFs too.
	* config/sparc/sparc.c (sparc_expand_move): Don't assume that
	_GLOBAL_OFFSET_TABLE_ - label_ref is a link-time constant on
	VxWorks.
	(legitimize_pic_address): Handle LABEL_REFs like SYMBOL_REFs
	on VxWorks.
	(load_pic_register): Use gen_vxworks_load_got for VxWorks.
	(sparc_emit_call_insn): New function.
	(sparc_function_ok_for_sibcall): Restrict sibcalls to locally-binding
	functions when generating VxWorks PIC.
	* config/sparc/sparc.md (vxworks_load_got): New pattern.
	(call, call_value): Use sparc_emit_call_insn instead of
	emit_call_insn.

libgcc/
	* config.host (sparc-wrs-vxworks): New target.

From-SVN: r124595
2007-05-10 11:15:07 +00:00
Bob Wilson 4575a800ef * config/xtensa/xtensa.c (xtensa_output_literal): Don't use #if.
From-SVN: r124579
2007-05-09 19:13:59 +00:00
Bob Wilson 74ed13f5c6 xtensa.c (xtensa_output_literal): Mask out high bits for floating-point values if HOST_BITS_PER_LONG > 32.
* config/xtensa/xtensa.c (xtensa_output_literal): Mask out high bits
	for floating-point values if HOST_BITS_PER_LONG > 32.  Use split_double
	instead of operand_subword.

From-SVN: r124578
2007-05-09 17:05:14 +00:00
Bernd Schmidt 520c62adcd bfin.h (LOCAL_ALIGNMENT): Define.
* config/bfin/bfin.h (LOCAL_ALIGNMENT): Define.
	* config/bfin/bfin.c (bfin_local_alignment): New function.
	* config/bfin/bfin-protos.h (bfin_local_alignment): Declare it.

From-SVN: r124570
2007-05-09 11:57:49 +00:00
Chao-ying Fu 14661f36f8 md.texi (msub@var{m}@var{n}4, [...]): Document.
* doc/md.texi (msub@var{m}@var{n}4, usub@var{m}@var{n}4): Document.
* optabs.h (OTI_smsub_widen, OTI_umsub_widen): New optab_indexes.
(smsub_widen_optab, umsub_widen_optab): Define.
* optabs.c (init_optabs): Initialize smsub_widen_optab and
umsub_widen_optab.
* genopinit.c (optabs): Fill in smsub_widen_optab and
umsub_widen_optab.
* expr.c (expand_expr_real_1): Try to use smsub_widen_optab
and umsub_widen_optab to implement multiply-subtract sequences.
* config/mips/mips.md (*msac<u>_di): Rename to...
(<u>msubsidi4): ...this.  Extend condition to include
GENERATE_MADD_MSUB and TARGET_DSPR2.  Change the constraint
of operand 0 to "ka" and use the three-operand form of msub<u>
for TARGET_DSPR2.
* config/mips/mips-dspr2.md (mips_msub, mips_msubu): Convert
to define_expands.

From-SVN: r124558
2007-05-08 22:51:14 +00:00
Kaz Kojima 10050f74a3 re PR rtl-optimization/28011 ([SH] g++ generates wrong code, if '-fno-exceptions' and '-O' options are specified)
PR rtl-optimization/28011
	* reload.c (push_reload): Set dont_share if IN appears in OUT
	also when IN is a PLUS rtx.
	(reg_overlap_mentioned_for_reload_p): Return true if X and IN
	are same PLUS rtx.

From-SVN: r124557
2007-05-08 22:22:49 +00:00
Kazu Hirata b4aaa77b1f emit-rtl.c (unshare_all_rtl_1): Don't copy DECL_RTL.
* emit-rtl.c (unshare_all_rtl_1): Don't copy DECL_RTL.  Don't
	call unshare_all_decls.
	(unshare_all_rtl): Adjust the call to unshare_all_rtl_1.
	(unshare_all_decls): Remove.

From-SVN: r124556
2007-05-08 21:26:29 +00:00
Simon Martin bfa64d0e60 re PR tree-optimization/31847 (Printing to dump file broken)
2007-05-08  Simon Martin  <simartin@users.sourceforge.net>

	PR 31847
	* tree-dump.c (dump_options): Don't use TDF_DIAGNOSTIC in "*-all" tree
	dumps.

From-SVN: r124551
2007-05-08 15:33:56 +00:00
Sandra Loosemore e8ab09c1bd mips.h (MAX_FPRS_PER_FMT): Renamed from FP_INC.
2007-05-08  Sandra Loosemore  <sandra@codesourcery.com>
            Nigel Stephens  <nigel@mips.com>

	gcc/
	* config/mips/mips.h (MAX_FPRS_PER_FMT): Renamed from FP_INC.
	Update comments and all uses.
	(MIN_FPRS_PER_FMT): Define.
	* config/mips/mips.c (function_arg): Fix to correctly handle
	the -mips32r2 -mfp64 -mabi=32 case.
	(override_options): Enable use of odd-numbered registers for
	SFmode values on MIPS32.
	(mips_save_reg_p): Save whole floating-point register pair if
	either half is used.
	(compute_frame_size): Fix comment.

Co-Authored-By: Nigel Stephens <nigel@mips.com>

From-SVN: r124545
2007-05-08 08:44:21 -04:00
Jie Zhang 28f601ff8a bfin-protos.h (enum bfin_cpu): Add BFIN_CPU_BF534, BFIN_CPU_BF536 and BFIN_CPU_BF561.
* config/bfin/bfin-protos.h (enum bfin_cpu): Add
	BFIN_CPU_BF534, BFIN_CPU_BF536 and BFIN_CPU_BF561.
	* config/bfin/bfin.c (bfin_handle_option): Handle
	-mcpu=bf534, -mcpu=bf536 and -mcpu=bf561.
	* config/bfin/bfin.h (TARGET_CPU_CPP_BUILTINS):
	Support bf534, bf536 and bf561.
	* doc/invoke.texi (Blackfin Options): Document -mcpu and -msim.

From-SVN: r124544
2007-05-08 12:33:23 +00:00
Jie Zhang 1f9e4ca180 bfin-protos.h (bfin_expand_epilogue): Add a third argument of type bool.
* config/bfin/bfin-protos.h (bfin_expand_epilogue): Add a third
	argument of type bool.
	* config/bfin/bfin.c (add_to_reg): Add epilogue_p as a fourth
	argument. Safely select temporary P register according to it.
	(do_link): Change call site of add_to_reg accordingly.
	(do_unlink): Add epilogue_p as a fourth argument and pass it
	to add_to_reg.
	(expand_interrupt_handler_epilogue): Change call of do_unlink
	accordingly.
	(bfin_expand_prologue): Add a third argument sibcall_p.
	* config/bfin/bfin.md (epilogue): Change call of
	bfin_expand_epilogue accordingly.
	(sibcall_epilogue): Likewise.
	(eh_return_internal): Likewise.

From-SVN: r124542
2007-05-08 11:59:08 +00:00