Commit Graph

7829 Commits

Author SHA1 Message Date
Mark Mitchell 48ffd0efe9 re PR c++/29518 (rejects valid template argument, enums vs templates)
PR c++/29518
	* pt.c (coerce_template_parms): Do not skip_evaluation while
	substituting template arguments.
	PR c++/29518
	* g++.dg/template/static28.C: New test.

From-SVN: r118768
2006-11-13 17:49:43 +00:00
Carlos O'Donell f4c0a30368 gcc.c: Organize search path variables into $prefix relative, and well-known native.
gcc/

2006-11-13  Carlos O'Donell  <carlos@codesourcery.com>
	    Mark Mitchell  <mark@codesourcery.com>

	* gcc.c: Organize search path variables into $prefix relative,
	and well-known native. Add comments.
	(add_sysrooted_prefix): Add comment.
	(process_command): If !gcc_exec_prefix add $prefix based paths.
	If *cross_compile == '0', add native well-known paths.
	Assert tooldir_base_prefix is always relative.
	(main): If print_search_dirs, and if gcc_exec_prefix is set,
	use this value for 'install:' path.
	* Makefile.in: Add GCC_EXEC_PREFIX to generated site.exp.

gcc/testsuite/

2006-11-13  Carlos O'Donell  <carlos@codesourcery.com>

	* lib/c-torture.exp: Use target-libpath.exp.
	* lib/target-libpath.exp (set_ld_library_path_env_vars): If present,
	set GCC_EXEC_PREFIX env var from global variable of same name.


Co-Authored-By: Mark Mitchell <mark@codesourcery.com>

From-SVN: r118765
2006-11-13 17:25:59 +00:00
Andrew Pinski 3e806a3df4 re PR fortran/26994 (Scalar TRANSFER - error: invalid operand to unary operator)
2006-11-12  Andrew Pinski  <andrew_pinski@playstation.sony.com>

        PR fortran/26994
        * gfortran.fortran-torture/compile/transfer-1.f90:
        New testcase.

2006-11-12  Andrew Pinski  <andrew_pinski@playstation.sony.com>

        PR fortran/26994
        * trans-expr.c (gfc_conv_expr_reference): Set TREE_STATIC on the
        new CONST_DECL.

From-SVN: r118761
2006-11-13 06:36:09 -08:00
H.J. Lu 5da10ac71f re PR tree-optimization/29680 (Misscompilation of spec2006 gcc)
PR tree-optimization/29680
	* tree-ssa-operands.c (access_can_touch_variable): Revert fix for
	PR 14784.

	* gcc.dg/alias-11.c: New test.


Co-Authored-By: Zdenek Dvorak <dvorakz@suse.cz>

From-SVN: r118754
2006-11-13 12:37:29 +00:00
Roger Sayle 3b279c7ae7 re PR rtl-optimization/29797 (Miscompiles bit test / set in OpenOffice)
2006-11-12  Michael Matz  <matz@suse.de>
	    Roger Sayle  <roger@eyesopen.com>

	PR rtl-optimization/29797
	* ifcvt.c (noce_try_bitop): Correct calculation of bitnum on
	BITS_BIG_ENDIAN targets.

	* gcc.c-torture/execute/pr29797-1.c: New test case.

From-SVN: r118740
2006-11-13 00:41:53 +00:00
Kaveh R. Ghazi 5c5b21550c builtins.c (fold_builtin_cosh): New.
* builtins.c (fold_builtin_cosh): New.
	(fold_builtin_1): Use it.
	* fold-const.c (negate_mathfn_p): Add llround, lround, round,
	trunc to the list of "odd" functions.  Also add llrint, lrint,
	rint and nearbyint when flag_rounding_math is false.

testsuite:
	* gcc.dg/torture/builtin-symmetric-1.c: Add more cases.

From-SVN: r118733
2006-11-12 23:51:36 +00:00
Zdenek Dvorak 911b3fdbe3 tree-ssa-loop-prefetch.c (schedule_prefetches): Cleanup and improve comments.
* tree-ssa-loop-prefetch.c (schedule_prefetches): Cleanup and improve
	comments.
	(issue_prefetch_ref): Move assignment to write_p out of loop.
	(determine_unroll_factor): Do not take PARAM_MAX_UNROLL_TIMES and
	SIMULTANEOUS_PREFETCHES into account.
	(loop_prefetch_arrays): Do not pass ahead to determine_unroll_factor.
	* lambda-code.c (lcm): Renamed to ...
	(least_common_multiple): ... and exported.
	* tree-flow.h (least_common_multiple): Declare.

From-SVN: r118730
2006-11-12 20:05:49 +00:00
Roger Sayle 015e23f400 re PR tree-optimization/13827 ((a & b) != (c & b) should be transformed to ((a^c) & b) !=0)
PR tree-optimization/13827
	* fold-const.c (fold_binary) <EQ_EXPR, NE_EXPR>: Fold (X&C) op (Y&C)
	as ((X^Y)&C) op 0.

	* gcc.dg/fold-eqand-1.c: New test case.

From-SVN: r118727
2006-11-12 18:41:31 +00:00
Paul Thomas 41f1662296 Correcting ChangeLog errors
From-SVN: r118721
2006-11-12 10:15:04 +00:00
Andrew Pinski afa8f0fb33 re PR rtl-optimization/28812 (RTL aliasing vs may_alias and structs)
2006-11-11  Andrew Pinski  <andrew_pinski@playstation.sony.com>

        PR rtl-opt/28812
        * alias.c (fixed_scalar_and_varying_struct_p): Don't return a
        non null value if the struct memory access is in the 0th
        aliasing set.

2006-11-11  Andrew Pinski  <andrew_pinski@playstation.sony.com>

        PR rtl-opt/28812
        * gcc.c-torture/execute/mayalias-3.c: New test.

From-SVN: r118716
2006-11-11 17:10:56 -08:00
Richard Sandiford 6d40c48924 re PR middle-end/27528 (compiling linux kernels 2.6.16.14/15 2.6.17-rc3 on powerpc (7450) get error on long exixting code)
gcc/
	PR middle-end/27528
	* stmt.c (expand_asm_operands): Use EXPAND_INITIALIZER if the
	constraints accept neither registers or memories.

gcc/testsuite/
	PR middle-end/27528
	* gcc.c-torture/compile/pr27528.c: New test.
	* gcc.dg/pr27528.c: Likewise.

From-SVN: r118689
2006-11-11 09:47:35 +00:00
Kaveh R. Ghazi b81e7144aa builtins.c (fold_builtin_cos): Use fold_strip_sign_ops().
* builtins.c (fold_builtin_cos): Use fold_strip_sign_ops().
	(fold_builtin_hypot): Likewise.
	* fold-const.c (fold_strip_sign_ops): Handle "odd" builtins.
	
testsuite:
	* gcc.dg/builtins-20.c: Add more cases for stripping sign ops.

From-SVN: r118683
2006-11-11 04:05:14 +00:00
Kaveh R. Ghazi 345768ef3f fold-const.c (negate_mathfn_p): Add BUILT_IN_ERF.
* fold-const.c (negate_mathfn_p): Add BUILT_IN_ERF.

testsuite:
	* gcc.dg/torture/builtin-symmetric-1.c: New test.

From-SVN: r118682
2006-11-11 04:01:42 +00:00
Paul Thomas d8d8121add re PR fortran/29758 (Runtime segfault in RESHAPE with insufficient elements in SOURCE)
2006-11-10 Paul Thomas <pault@gcc.gnu.org>

   PR fortran/29758
   * check.c (gfc_check_reshape): Check that there are enough
   elements in the source array as to be able to fill an array
   defined by shape, when pad is absent.


2006-11-10 Paul Thomas <pault@gcc.gnu.org>

   PR fortran/29758
   * gfortran.dg/reshape_source_size_1.f90: New test.

From-SVN: r118664
2006-11-10 21:06:42 +00:00
Paul Thomas 95fe073894 re PR fortran/29315 (error passing an array derived from type element)
2006-11-10 Paul Thomas <pault@gcc.gnu.org>

	PR fortran/29315
	* trans-expr.c (is_aliased_array): Treat correctly the case where the
	component is itself and array or array reference.


2006-11-10 Paul Thomas <pault@gcc.gnu.org>

	PR fortran/29315
	* gfortran.dg/aliasing_dummy_4.f90: New test.

From-SVN: r118659
2006-11-10 17:21:57 +00:00
Uros Bizjak 0e9dac9e16 re PR tree-optimization/29777 (missed optimization: model missing widen_mult* idioms for SSE)
PR target/29777
	* config/i386/sse.md (smulv8hi3_highpart): Change from define_insn
	to define_expand.
	(umulv8hi3_highpart): Ditto.
	(vec_widen_smult_hi_v8hi): New expander.
	(vec_widen_smult_lo_v8hi): Ditto.

testsuite/ChangeLog:

	PR target/29777
        * lib/target-supports.exp (vect_widen_mult_hi_to_si): Add i?86-*-*
	and x86_64-*-* targets.

From-SVN: r118649
2006-11-10 09:45:47 +01:00
Kaveh R. Ghazi e61e5ddcce builtins.c (do_mpfr_arg3): New.
* builtins.c (do_mpfr_arg3): New.
	(fold_builtin_1): Handle builtins fma, fmin and fmax.

testsuite:
	* gcc.dg/torture/builtin-math-2.c: Test builtin fma.
	* gcc.dg/torture/builtin-math-3.c (CKSGN_F, CKSGN, CKSGN_L):
	New macros. Use them in exact tests.
	(TESTIT3): New macro.
	Add tests for fmin, fmax and fma.

From-SVN: r118648
2006-11-10 04:26:31 +00:00
Paul Thomas 012019922e re PR fortran/29431 (Not Implemented: complex character array constructors)
2006-11-09 Paul Thomas <pault@gcc.gnu.org>

	PR fortran/29431
	* trans-array.c    (get_array_ctor_strlen): If we fall through to
	default, use a constant character length if it is available.

2006-11-09 Paul Thomas <pault@gcc.gnu.org>

	PR fortran/29431
	* gfortran.dg/array_constructor_13.f90: New test.

From-SVN: r118631
2006-11-09 22:49:12 +00:00
Paul Thomas ff883a9572 re PR fortran/29744 (Type renaming crashes gfortran with excessive memory usage)
2006-11-09 Paul Thomas <pault@gcc.gnu.org>

	PR fortran/29744
	* trans-types.c (gfc_get_derived_type): Ensure that the
	proc_name namespace is not the same as the owner namespace and
	that identical derived types in the same namespace share the
	same backend_decl.

2006-11-09 Paul Thomas <pault@gcc.gnu.org>

	PR fortran/29744
	* gfortran.dg/used_types_12.f90: New test.

From-SVN: r118627
2006-11-09 20:22:19 +00:00
Serge Belyshev 0ad12cd3b5 re PR middle-end/29726 (invalid folding of ((X >> C1) & C2) != 0 or "M-x is undefined" in emacs)
2006-11-09  Serge Belyshev  <belyshev@depni.sinp.msu.ru>

	PR middle-end/29726
	* fold-const.c (fold_binary) <EQ_EXPR>: Fix typo in variable name.

	* gcc.dg/fold-eqandshift-1.c (test5): Uncomment function.
	(test6): Ditto.
	(dg-final): Add scan-tree-dump-times patterns for test5 and test6.
	* gcc.dg/fold-eqandshift-3.c: New test case.

From-SVN: r118625
2006-11-09 19:24:32 +00:00
Paul Thomas 7114edca02 re PR fortran/29699 (ICE in trans-decl.c)
2006-11-09 Paul Thomas <pault@gcc.gnu.org>

	PR fortran/29699
	* trans-array.c (structure_alloc_comps): Detect pointers to
	arrays and use indirect reference to declaration.
	* resolve.c (resolve_fl_variable): Tidy up condition.
	(resolve_symbol): The same and only add initialization code if
	the symbol is referenced.
	* trans-decl.c (gfc_trans_deferred_vars): Call gfc_trans_
	deferred_array before gfc_trans_auto_array_allocation.

	PR fortran/21730
	* symbol.c (check_done): Remove.
	(gfc_add_attribute): Remove reference to check_done and remove
	the argument attr_intent.
	(gfc_add_allocatable, gfc_add_dimension, gfc_add_external,
	gfc_add_intrinsic, gfc_add_optional, gfc_add_pointer,
	gfc_add_cray_pointer, gfc_add_cray_pointee, gfc_add_result,
	gfc_add_target, gfc_add_in_common, gfc_add_elemental,
	gfc_add_pure, gfc_add_recursive, gfc_add_procedure,
	gfc_add_type): Remove references to check_done.
	* decl.c (attr_decl1): Eliminate third argument in call to
	gfc_add_attribute.
	* gfortran.h : Change prototype for gfc_add_attribute.



2006-11-09 Paul Thomas <pault@gcc.gnu.org>

	PR fortran/29699
	* gfortran.dg/alloc_comp_auto_array_1.f90: New test.

	PR fortran/21730
	* gfortran.dg/change_symbol_attributes_1.f90: New test.

From-SVN: r118624
2006-11-09 18:42:28 +00:00
Andreas Krebbel d82a02fa4f simplify-rtx.c (avoid_constant_pool_reference): Avoid calling simplify_subreg with BLKmode outer mode.
2006-11-09  Andreas Krebbel  <krebbel1@de.ibm.com>

	* simplify-rtx.c (avoid_constant_pool_reference): Avoid calling 
	simplify_subreg with BLKmode outer mode.

2006-11-09  Andreas Krebbel  <krebbel1@de.ibm.com>

	* gcc.dg/20061109-1.c: New testcase.

From-SVN: r118622
2006-11-09 17:56:04 +00:00
Kaveh R. Ghazi 282530ce36 builtins-20.c: Use fabs, not __builtin_fabs.
* gcc.dg/builtins-20.c: Use fabs, not __builtin_fabs.

From-SVN: r118621
2006-11-09 14:42:19 +00:00
Tobias Burnus 0b154c5558 io_constraints_3.f90: Fixed by using -fmax-errors.
2006-11-09  Tobias Burnus  <burnus@net-b.de>

       * gfortran.dg/io_constraints_3.f90: Fixed by using -fmax-errors.
       * gfortran.dg/gomp/reduction1.f90: Fixed by using -fmax-errors.

From-SVN: r118619
2006-11-09 11:26:10 +01:00
Zdenek Dvorak 106dec717f re PR tree-optimization/29738 (Missed constant propagation into loops)
PR tree-optimization/29738
	* tree-ssa-ccp.c: Remove UNKNOWN_VAL from comments.
	(ccp_lattice_t): Remove UNKNOWN_VAL.
	(dump_lattice_value, ccp_lattice_meet, ccp_visit_phi_node):
	Do not handle UNKNOWN_VAL.
	(get_default_value): Set initial value of virtual operands to
	VARYING.
	(get_value): Always use get_default_value on uninitialized
	operands.
	(set_value_varying, surely_varying_stmt_p): New functions.
	(set_lattice_value): Do not pass argument to get_value.
	Do not handle UNKNOWN_VAL.
	(likely_value): Follow the semantics described in the comment.
	(ccp_initialize): Use surely_varying_stmt_p.  Do not mark
	phi nodes DONT_SIMULATE_AGAIN.
	(ccp_fold): Do not pass argument to get_value.
	(fold_const_aggregate_ref, visit_assignment): Ditto.  Do not
	handle UNKNOWN_VAL.

	* gcc.dg/tree-ssa/ssa-ccp-14.c: New test.
	* gcc.dg/tree-ssa/ssa-ccp-15.c: New test.

From-SVN: r118602
2006-11-09 00:09:43 +00:00
Kaveh R. Ghazi 5e3c2d4c68 builtin-math-3.c: Add more sincos tests.
* gcc.dg/torture/builtin-math-3.c: Add more sincos tests.

From-SVN: r118600
2006-11-08 21:53:02 +00:00
Dorit Nuzman 89d67ccabb [multiple changes]
2006-11-08  Dorit Nuzman  <dorit@il.ibm.com>

        * tree-vect-analyze.c (vect_mark_relevant, vect_stmt_relevant_p): Take
        enum argument instead of bool.
        (vect_analyze_operations): Call vectorizable_type_promotion.
        * tree-vectorizer.h (type_promotion_vec_info_type): New enum
        stmt_vec_info_type value.
        (supportable_widening_operation, vectorizable_type_promotion): New
        function declarations.
        * tree-vect-transform.c (vect_gen_widened_results_half): New function.
        (vectorizable_type_promotion): New function.
        (vect_transform_stmt): Call vectorizable_type_promotion.
        * tree-vect-analyze.c (supportable_widening_operation): New function.
        * tree-vect-patterns.c (vect_recog_dot_prod_pattern):
        Add implementation.
        * tree-vect-generic.c (expand_vector_operations_1): Consider correct
        mode.

        * tree.def (VEC_WIDEN_MULT_HI_EXPR, VEC_WIDEN_MULT_LO_EXPR):
        (VEC_UNPACK_HI_EXPR, VEC_UNPACK_LO_EXPR): New tree-codes.
        * tree-inline.c (estimate_num_insns_1): Add cases for above new
        tree-codes.
        * tree-pretty-print.c (dump_generic_node, op_prio): Likewise.
        * expr.c (expand_expr_real_1): Likewise.
        * optabs.c (optab_for_tree_code): Likewise.
        (init_optabs): Initialize new optabs.
        * genopinit.c (vec_widen_umult_hi_optab, vec_widen_smult_hi_optab,
        vec_widen_smult_hi_optab, vec_widen_smult_lo_optab,
        vec_unpacks_hi_optab, vec_unpacks_lo_optab, vec_unpacku_hi_optab,
        vec_unpacku_lo_optab): Initialize new optabs.
        * optabs.h (OTI_vec_widen_umult_hi, OTI_vec_widen_umult_lo):
        (OTI_vec_widen_smult_h, OTI_vec_widen_smult_lo, OTI_vec_unpacks_hi,
        OTI_vec_unpacks_lo, OTI_vec_unpacku_hi, OTI_vec_unpacku_lo): New
        optab indices.
        (vec_widen_umult_hi_optab, vec_widen_umult_lo_optab):
        (vec_widen_smult_hi_optab, vec_widen_smult_lo_optab):
        (vec_unpacks_hi_optab, vec_unpacku_hi_optab, vec_unpacks_lo_optab):
        (vec_unpacku_lo_optab): New optabs.
        * doc/md.texi (vec_unpacks_hi, vec_unpacks_lo, vec_unpacku_hi):
        (vec_unpacku_lo, vec_widen_umult_hi, vec_widen_umult_lo):
        (vec_widen_smult_hi, vec_widen_smult_lo): New.
        * doc/c-tree.texi (VEC_LSHIFT_EXPR, VEC_RSHIFT_EXPR):
        (VEC_WIDEN_MULT_HI_EXPR, VEC_WIDEN_MULT_LO_EXPR, VEC_UNPACK_HI_EXPR):
        (VEC_UNPACK_LO_EXPR, VEC_PACK_MOD_EXPR, VEC_PACK_SAT_EXPR): New.

        * config/rs6000/altivec.md (UNSPEC_VMULWHUB, UNSPEC_VMULWLUB):
        (UNSPEC_VMULWHSB, UNSPEC_VMULWLSB, UNSPEC_VMULWHUH, UNSPEC_VMULWLUH):
        (UNSPEC_VMULWHSH, UNSPEC_VMULWLSH): New.
        (UNSPEC_VPERMSI, UNSPEC_VPERMHI): New.
        (vec_vperm_v8hiv4si, vec_vperm_v16qiv8hi): New patterns used to
        implement the unsigned unpacking patterns.
        (vec_unpacks_hi_v16qi, vec_unpacks_hi_v8hi, vec_unpacks_lo_v16qi):
        (vec_unpacks_lo_v8hi): New signed unpacking patterns.
        (vec_unpacku_hi_v16qi, vec_unpacku_hi_v8hi, vec_unpacku_lo_v16qi):
        (vec_unpacku_lo_v8hi): New unsigned unpacking patterns.
        (vec_widen_umult_hi_v16qi, vec_widen_umult_lo_v16qi):
        (vec_widen_smult_hi_v16qi, vec_widen_smult_lo_v16qi):
        (vec_widen_umult_hi_v8hi, vec_widen_umult_lo_v8hi):
        (vec_widen_smult_hi_v8hi, vec_widen_smult_lo_v8hi): New widening
        multiplication patterns.

        * target.h (builtin_mul_widen_even, builtin_mul_widen_odd): New.
        * target-def.h (TARGET_VECTORIZE_BUILTIN_MUL_WIDEN_EVEN):
        (TARGET_VECTORIZE_BUILTIN_MUL_WIDEN_ODD): New.
        * config/rs6000/rs6000.c (rs6000_builtin_mul_widen_even): New.
        (rs6000_builtin_mul_widen_odd): New.
        (TARGET_VECTORIZE_BUILTIN_MUL_WIDEN_EVEN): Defined.
        (TARGET_VECTORIZE_BUILTIN_MUL_WIDEN_ODD): Defined.
        * tree-vectorizer.h (enum vect_relevant): New enum type.
        (_stmt_vec_info): Field relevant chaned from bool to enum
        vect_relevant.
        (STMT_VINFO_RELEVANT_P): Updated.
        (STMT_VINFO_RELEVANT): New.
        * tree-vectorizer.c (new_stmt_vec_info): Use STMT_VINFO_RELEVANT
        instead of STMT_VINFO_RELEVANT_P.
        * tree-vect-analyze.c (vect_mark_relevant, vect_stmt_relevant_p):
        Replace calls to STMT_VINFO_RELEVANT_P with STMT_VINFO_RELEVANT,
        and boolean variable with enum vect_relevant.
        (vect_mark_stmts_to_be_vectorized): Likewise + update documentation.
        * doc/tm.texi (TARGET_VECTORIZE_BUILTIN_MUL_WIDEN_EVEN): New.
        (TARGET_VECTORIZE_BUILTIN_MUL_WIDEN_ODD): New.

        2006-11-08  Richard Henderson  <rth@redhat.com>

        * config/i386/sse.md (vec_widen_umult_hi_v8hi,
        vec_widen_umult_lo_v8hi): New.
        (vec_widen_smult_hi_v4si, vec_widen_smult_lo_v4si,
        vec_widen_umult_hi_v4si, vec_widen_umult_lo_v4si): New.

        * config/i386/i386.c (ix86_expand_sse_unpack): New.
        * config/i386/i386-protos.h (ix86_expand_sse_unpack): New.
        * config/i386/sse.md (vec_unpacku_hi_v16qi, vec_unpacks_hi_v16qi,
        vec_unpacku_lo_v16qi, vec_unpacks_lo_v16qi, vec_unpacku_hi_v8hi,
        vec_unpacks_hi_v8hi, vec_unpacku_lo_v8hi, vec_unpacks_lo_v8hi,
        vec_unpacku_hi_v4si, vec_unpacks_hi_v4si, vec_unpacku_lo_v4si,
        vec_unpacks_lo_v4si): New.

        2006-11-08  Dorit Nuzman  <dorit@il.ibm.com>

        * tree-vect-transform.c (vectorizable_type_demotion): New function.
        (vect_transform_stmt): Add case for type_demotion_vec_info_type.
        (vect_analyze_operations): Call vectorizable_type_demotion.
        * tree-vectorizer.h (type_demotion_vec_info_type): New enum
        stmt_vec_info_type value.
        (vectorizable_type_demotion): New function declaration.
        * tree-vect-generic.c (expand_vector_operations_1): Consider correct
        mode.

        * tree.def (VEC_PACK_MOD_EXPR, VEC_PACK_SAT_EXPR): New tree-codes.
        * expr.c (expand_expr_real_1): Add case for VEC_PACK_MOD_EXPR and
        VEC_PACK_SAT_EXPR.
        * tree-iniline.c (estimate_num_insns_1): Likewise.
        * tree-pretty-print.c (dump_generic_node, op_prio): Likewise.
        * optabs.c (optab_for_tree_code): Likewise.

        * optabs.c (expand_binop): In case of vec_pack_*_optabs the mode
        compared against the predicate of the result is not 'mode' (the input
        to the function) but a mode with half the size of 'mode'.
        (init_optab): Initialize new optabs.
        * optabs.h (OTI_vec_pack_mod, OTI_vec_pack_ssat, OTI_vec_pack_usat):
        New optab indices.
        (vec_pack_mod_optab, vec_pack_ssat_optab,  vec_pack_usat_optab): New
        optabs.
        * genopinit.c (vec_pack_mod_optab, vec_pack_ssat_optab):
        (vec_pack_usat_optab): Initialize new optabs.
        * doc/md.texi (vec_pack_mod, vec_pack_ssat, vec_pack_usat): New.
        * config/rs6000/altivec.md (vec_pack_mod_v8hi, vec_pack_mod_v4si): New.

        2006-11-08  Richard Henderson  <rth@redehat.com>

        * config/i386/sse.md (vec_pack_mod_v8hi, vec_pack_mod_v4si):
        (vec_pack_mod_v2di, vec_interleave_highv16qi, vec_interleave_lowv16qi):
        (vec_interleave_highv8hi, vec_interleave_lowv8hi):
        (vec_interleave_highv4si, vec_interleave_lowv4si):
        (vec_interleave_highv2di, vec_interleave_lowv2di): New.

        2006-11-08  Dorit Nuzman  <dorit@il.ibm.com>

        * tree-vect-transform.c (vectorizable_reduction): Support multiple
        datatypes.
        (vect_transform_stmt): Removed redundant code.

        2006-11-08  Dorit Nuzman  <dorit@il.ibm.com>

        * tree-vect-transform.c (vectorizable_operation): Support multiple
        datatypes.

        2006-11-08  Dorit Nuzman  <dorit@il.ibm.com>

        * tree-vect-transform.c (vect_align_data_ref): Removed.
        (vect_create_data_ref_ptr): Added additional argument - ptr_incr.
        Updated function documentation. Return the increment stmt in ptr_incr.
        (bump_vector_ptr): New function.
        (vect_get_vec_def_for_stmt_copy): New function.
        (vect_finish_stmt_generation): Create a stmt_info to newly created
        vector stmts.
        (vect_setup_realignment): Call vect_create_data_ref_ptr with additional
        argument.
        (vectorizable_reduction, vectorizable_assignment): Not supported yet if
        VF is greater than the number of elements that can fit in one vector
        word.
        (vectorizable_operation, vectorizable_condition): Likewise.
        (vectorizable_store, vectorizable_load): Support the case that the VF
        is greater than the number of elements that can fit in one vector word.
        (vect_transform_loop): Don't fail in case of multiple data-types.
        * tree-vect-analyze.c (vect_determine_vectorization_factor): Don't fail
        in case of multiple data-types; the smallest type determines the VF.
        (vect_analyze_data_ref_dependence): Don't record datarefs as same_align
        if they are of different sizes.
        (vect_update_misalignment_for_peel): Compare misalignments in terms of
        number of elements rather than number of bytes.
        (vect_enhance_data_refs_alignment): Fix/Add dump printouts.
        (vect_can_advance_ivs_p): Fix a dump printout

From-SVN: r118577
2006-11-08 07:32:44 +00:00
Eric Christopher 6300f037d0 libgcc2.c (__bswapdi2): Rename from bswapDI2.
2006-11-07  Eric Christopher  <echristo@apple.com>

        * libgcc2.c (__bswapdi2): Rename from bswapDI2.
        (__bswapsi2): Ditto.
        * libgcc2.h: Remove transformation of bswap routines.
        * config/i386/i386.md (bswapsi2): New.
        (bswapdi2): Ditto.

2006-11-07  Eric Christopher  <echristo@apple.com>

        * gcc.target/i386/builtin-bswap-1.c: Rewrite for 64-bit.
        Test using scan-assembler-not.

From-SVN: r118576
2006-11-08 02:24:26 +00:00
Jakub Jelinek 4eb7fd8398 c-common.c (c_common_attributes): Add gnu_inline attribyte.
* c-common.c (c_common_attributes): Add gnu_inline attribyte.
	(handle_gnu_inline_attribute): New function.
	* c-decl.c (diagnose_mismatched_decls): Handle gnu_inline attribute.
	(merge_decls, start_decl, start_function): Likewise.
	* doc/extend.texi: Document gnu_inline attribute.

	* gcc.dg/inline-17.c: New test.

From-SVN: r118567
2006-11-08 00:01:23 +01:00
Steve Ellcey a7f02c2d27 re PR other/25028 (TImode-to-floating conversions broken)
PR other/25028
	* config/ia64/t-hpux (LIB1ASMFUNCS):  Filter out _fixtfdi,
	_fixunstfdi, and  _floatditf
	* gcc.dg/torture/fp-int-convert-float128-timode.c:  Do not XFAIL
	on HP-UX.

From-SVN: r118565
2006-11-07 19:14:27 +00:00
Paul Thomas 8f81c3c650 re PR fortran/29539 (ICE in variable_decl)
2006-11-07 Paul Thomas <pault@gcc.gnu.org>

	PR fortran/29539
	PR fortran/29634
	* decl.c (variable_decl): Add test for presence of proc_name.
	* error.c (gfc_error_flag_test): New function.
	* gfortran.h : Prototype for gfc_error_flag_test.

2006-11-07 Paul Thomas <pault@gcc.gnu.org>

	PR fortran/29539
	* gfortran.dg/gfortran.dg/blockdata_3.f90: New test.

	PR fortran/29634
	* gfortran.dg/gfortran.dg/derived_function_interface_1.f90: New
	test.

From-SVN: r118553
2006-11-07 15:17:17 +00:00
Tobias Burnus 775e6c3a7b re PR fortran/29601 (VOLATILE attribute and statement)
fortran/
2006-11-06  Tobias Burnus  <burnus@net-b.de>

    PR fortran/29601
    * symbol.c (check_conflict, gfc_add_volatile): Add volatile support.
    * decl.c (match_attr_spec, gfc_match_volatile): Add volatile support.
    * gfortran.h (symbol_attribute): Add volatile_ to struct.
    * resolve.c (was_declared): Add volatile support.
    * trans-decl.c (gfc_finish_var_decl): Add volatile support.
    * match.h: Declare gfc_match_volatile.
    * parse.c (decode_statement): Recognize volatile.
    * modules.c (ab_attribute, attr_bits, mio_symbol_attribute):
      Add volatile support.
    * dump-parse-tree.c (gfc_show_attr): Add volatile support.


testsuite/
2006-11-06  Tobias Burnus  <burnus@net-b.de>

    PR fortran/29601
    * gfortran.dg/volatile.f90: Add.
    * gfortran.dg/volatile2.f90: Add.
    * gfortran.dg/volatile3.f90: Add.
    * gfortran.dg/volatile4.f90: Add.
    * gfortran.dg/volatile5.f90: Add.
    * gfortran.dg/volatile6.f90: Add.
    * gfortran.dg/volatile7.f90: Add.

From-SVN: r118545
2006-11-07 14:27:53 +01:00
Tobias Burnus aa4183d8a5 decl.c (match_attr_spec, [...]): Unify gfc_notify_std message for GFC_STD_F2003.
fortran/
2006-11-06  Tobias Burnus  <burnus@net-b.de>

       * decl.c (match_attr_spec, gfc_match_enum): Unify gfc_notify_std
         message for GFC_STD_F2003.
       * array.c (gfc_match_array_constructor): Unify gfc_notify_std
         message for GFC_STD_F2003.
       * io.c (check_io_constraints): Unify gfc_notify_std message for
         GFC_STD_F2003.
       * resolve.c (resolve_actual_arglist): Unify gfc_notify_std message
         for GFC_STD_F2003.

testsuite/
2006-11-06  Tobias Burnus  <burnus@net-b.de>

       * gfortran.dg/io_constraints_2.f90: Adjust pattern
         for matching error messages.
       * gfortran.dg/specifics_3.f90: Adjust pattern
         for matching error messages.

From-SVN: r118542
2006-11-07 10:11:08 +01:00
Janis Johnson d6682e2189 sourcebuild.texi (Test Directives): Add output-exists and output-exists-not.
gcc/

2006-11-06  Janis Johnson  <janis187@us.ibm.com>

	* gcc/doc/sourcebuild.texi (Test Directives): Add output-exists
	and output-exists-not.

gcc/testsuite/

2006-11-06  Janis Johnson  <janis187@us.ibm.com
	    Bernhard Fischer  <aldot@gcc.gnu.org>

	* lib/gcc-dg.exp (output-exists): New proc.
	(output-exists-not): New proc.
	* gcc.test-framework/test-framework.awk: Support new directives.
	* gcc.test-framework/dg-outexistsnot-exp-F.c: New test.
	* gcc.test-framework/dg-outexistsnot-exp-P.c: New test.
	* gcc.test-framework/dg-outexists-exp-F.c: New test.
	* gcc.test-framework/dg-outexists-exp-XP.c: New test.
	* gcc.test-framework/dg-outexistsnot-exp-XF.c: New test.
	* gcc.test-framework/dg-outexists-exp-P.c: New test.

From-SVN: r118531
2006-11-07 00:08:32 +00:00
Erik Edelmann abe601c7cb re PR fortran/29630 ("Unclassifiable statement" with vector subscripts in initialization)
fortran/
2006-11-06  Erik Edelmann  <eedelman@gcc.gnu.org>

        PR fortran/29630
        PR fortran/29679
        * expr.c (find_array_section): Support vector subscripts.  Don't
        add sizes for dimen_type == DIMEN_ELEMENT to the shape array.


testsuite/
2006-11-06  Erik Edelmann  <eedelman@gcc.gnu.org>

        PR fortran/29630
        PR fortran/29679
        * gfortran.dg/initialization_2.f90: Test PRs 29630 and 29679 too.
        * gfortran.dg/initialization_3.f90: New.

From-SVN: r118528
2006-11-06 22:18:54 +00:00
Jerry DeLisle 25825b21a3 re PR libfortran/25545 (internal file and dollar edit descriptor)
2006-11-05  Jerry DeLisle  <jvdelisle@gcc.gnu.org>

	PR libgfortran/25545
	* gfortran.dg/dollar_edit_descriptor-2.f: New test.

From-SVN: r118507
2006-11-05 17:40:42 +00:00
Jakub Jelinek 789e604dfa re PR middle-end/29695 (Folding breaks (a & 0x80) ? 0x80 : 0 for unsigned char or unsigned short a)
PR middle-end/29695
	* fold-const.c (fold_ternary): Fix A < 0 ? <sign bit of A> : 0
	simplification.

	* gcc.c-torture/execute/pr29695-1.c: New test.
	* gcc.c-torture/execute/pr29695-2.c: New test.

From-SVN: r118497
2006-11-05 13:13:46 +01:00
Paul Thomas 58b6e04789 2006-11-05 Francois-Xavier Coudert <fxcoudert@gcc.gnu,org>
Paul Thomas  <pault@gcc.gnu.org>

	PR fortran/24518
	* trans-intrinsic.c (gfc_conv_intrinsic_mod): Use built_in fmod
	for both MOD and MODULO, if it is available.

	PR fortran/29565
	* trans-expr.c (gfc_conv_aliased_arg): For an INTENT(OUT), save
	the declarations from the unused loops by merging the block
	scope for each; this ensures that the temporary is declared.

2006-11-05  Paul Thomas  <pault@gcc.gnu.org>

	PR fortran/29565
	* gfortran.dg/gfortran.dg/aliasing_dummy_3.f90: New test.

From-SVN: r118492
2006-11-05 06:27:48 +00:00
Brooks Moses cb60c134e2 error.c (show_locus): Add trailing colon in error messages.
* fortran/error.c (show_locus): Add trailing colon in error messages.
(error_print): Avoid leading space in error lines.
* testsuite/lib/gfortran-dg.exp (gfortran-dg-test): Adjust pattern
for matching error messages.

From-SVN: r118491
2006-11-04 16:28:08 -08:00
Uros Bizjak 2e1f15bd25 re PR target/26915 (missed sized opt returning -1.0)
PR target/26915
        * config/i386/i386.c (standard_80387_constant_p): Treat -0.0 and -1.0
        as a valid 80387 constant.
        (standard_80387_constant_opcode): Return "#" for -0.0 and -1.0.
        * config/i386/i386.md (unnamed splitter): Split the load of
        constant -0.0 or -1.0  into the load of 0.0 or 1.0, followed
        by negation.

testsuite/ChangeLog:

        PR target/26915
        * gcc.target/i386/387-12.c: New test.
~

From-SVN: r118484
2006-11-05 00:12:16 +01:00
Francois-Xavier Coudert d6910bb551 re PR fortran/29713 (ICE in gfc_set_constant_character_len decl.c:762)
PR fortran/29713

	* expr.c (gfc_simplify_expr): Correct memory allocation.

	* gfortran.dg/pr29713.f90: New test.

From-SVN: r118483
2006-11-04 20:58:26 +00:00
J"orn Rennecke 78d310c2c1 crt1.asm: Fix #ifdef indent.
gcc:

2006-11-03  J"orn Rennecke  <joern.rennecke@st.com>

	* config/sh/crt1.asm: Fix #ifdef indent.

2006-11-03  J"orn Rennecke  <joern.rennecke@st.com>
	Merged from STMicroelectronics sources:
	2006-10-06  Andrew Stubbs  <andrew.stubbs@st.com>
	  * config/sh/crt1.asm (vbr_600): Add missing #if.
	2006-08-03  J"orn Rennecke  <joern.rennecke@st.com>
	  * sh.opt (mfused-madd): New option.
	  * sh.md (mac_media, macsf3): Make conditional on TARGET_FMAC.
	2006-07-04  Andrew Stubbs  <andrew.stubbs@st.com>
	  * config/sh/crt1.asm (vbr_start): Move to new section .test.vbr.
	  Remove pointless handler at VBR+0.
	  (vbr_200, vbr_300, vbr_500): Remove pointless handler.
	  (vbr_600): Save and restore mach and macl, fpul and fpscr and fr0 to
	  fr7. Make sure the timer handler is called with the correct FPU
	  precision setting, according to the ABI.
	2006-06-14  J"orn Rennecke <joern.rennecke@st.com>
	  * config/sh/sh.opt (m2a-single, m2a-single-only): Fix Condition.
	  * config/sh/sh.h (SUPPORT_SH2A_NOFPU): Fix condition.
	  (SUPPORT_SH2A_SINGLE_ONLY, SUPPORT_SH2A_SINGLE_ONLY): Likewise.
	2006-06-09  J"orn Rennecke <joern.rennecke@st.com>
	  * sh.md (cmpgeusi_t): Change into define_insn_and_split.  Accept
	  zero as second operand.
	2006-04-28  J"orn Rennecke <joern.rennecke@st.com>
	  * config/sh/divtab-sh4-300.c, config/sh/lib1funcs-4-300.asm:
	  Fixed some bugs related to negative values, in particular -0
	  and overflow at -0x80000000.
	  * config/sh/divcost-analysis: Added sh4-300 figures.
	2006-04-27  J"orn Rennecke <joern.rennecke@st.com>
	  * config/sh/t-sh (MULTILIB_MATCHES): Add -m4-300* / -m4-340 options.
	2006-04-26  J"orn Rennecke <joern.rennecke@st.com>
	  * config/sh/t-sh (OPT_EXTRA_PARTS): Add libgcc-4-300.a.
	  ($(T)div_table-4-300.o, $(T)libgcc-4-300.a): New rules.
	  * config/sh/divtab-sh4-300.c, config/sh/lib1funcs-4-300.asm:
	New files.
	  * config/sh/embed-elf.h (LIBGCC_SPEC): Use -lgcc-4-300 for -m4-300* /
	  -m4-340.
	2006-04-24  J"orn Rennecke <joern.rennecke@st.com>
	  SH4-300 scheduling description & fixes to SH4-[12]00 description:
	  * sh.md: New instruction types: fstore, movi8, fpscr_toggle, gp_mac,
	  mac_mem, mem_mac, dfp_mul, fp_cmp.
	  (insn_class, dfp_comp, any_fp_comp): Update.
	  (push_fpul, movsf_ie, fpu_switch, toggle_sz, toggle_pr): Update type.
	  (cmpgtsf_t, "cmpeqsf_t, cmpgtsf_t_i4, cmpeqsf_t_i4): Likewise.
	  (muldf3_i): Likewise.
	  (movsi_i): Split rI08 alternative into two separate alternatives.
	  Update type.
	  (movsi_ie, movsi_i_lowpart): Likewise.
	  (movqi_i): Split ri alternative into two separate alternatives.
	  Update type.
	  * sh1.md (sh1_load_store, sh1_fp): Update.
	  * sh4.md (sh4_store, sh4_mac_gp, fp_arith, fp_double_arith): Update.
	  (mac_mem, sh4_fpscr_toggle): New insn_reservations.
	  * sh4a.md (sh4a_mov, sh4a_load, sh4a_store, sh4a_fp_arith): Update.
	  (sh4a_fp_double_arith): Likewise.
	  * sh4-300.md: New file.
	  * sh.c (sh_handle_option): Handle m4-300* options.
	  (sh_adjust_cost): Fix latency of auto-increments.
	  Handle SH4-300 differently than other SH4s.  Check for new insn types.
	  * sh.h (OVERRIDE_OPTIONS): Initilize sh_branch_cost if it has not
	  been set by an option.
	  * sh.opt (m4-300, m4-100-nofpu, m4-200-nofpu): New options.
	  (m4-300-nofpu, -m4-340, m4-300-single, m4-300-single-only): Likewise.
	  (mbranch-cost=): Likewise.
	  * superh.h (STARTFILE_SPEC): Take -m4-340 into account.

	  * sh.md (mulsf3): Remove special expansion code.
	  (mulsf3_ie): Now a define_insn_and_split.
	  (macsf3): Allow for TARGET_SH4.

	  * sh.md (cbranchsi4, cbranchdi4, cbranchdi4_i): New patterns.
	  * sh.c (prepare_cbranch_operands, expand_cbranchsi4): New functions.
	  (expand_cbranchdi4): Likewise.
	  (sh_rtx_costs): Give lower cost for certain CONST_INT values and for
	  CONST_DOUBLE if the outer code is COMPARE.
	  * sh.h (OPTIMIZATION_OPTIONS): If not optimizing for size, set
	  TARGET_CBRANCHDI4 and TARGET_EXPAND_CBRANCHDI4.
	  (OVERRIDE_OPTIONS): For TARGET_SHMEDIA, clear TARGET_CBRANCHDI4.
	  (LEGITIMATE_CONSTANT_P): Also allow DImode and VOIDmode CONST_DOUBLEs.
	  Remove redundant fp_{zero,one}_operand checks.
	  * sh.opt (mcbranchdi, mexpand-cbranchdi, mcmpeqdi): New options.
	  * sh-protos.h (prepare_cbranch_operands, expand_cbranchsi4): Declare.
	  (expand_cbranchdi4): Likewise.
	2006-04-20  J"orn Rennecke <joern.rennecke@st.com>
	  * sh.h (LOCAL_ALIGNMENT): Use DATA_ALIGNMENT.

gcc/testsuite:

2006-11-03  J"orn Rennecke  <joern.rennecke@st.com>

	* testsuite/gcc.c-torture/execute/arith-rand-ll.c:
	Also test for bogus rest sign.

From-SVN: r118458
2006-11-03 14:52:19 +00:00
Francois-Xavier Coudert 47c07d96b1 re PR libfortran/27895 (problem with RESHAPE and zero-sized arrays)
PR libfortran/27895

	* intrinsics/reshape_generic.c (reshape_internal): Fix so that it
	works correctly for zero-sized arrays.
	* m4/reshape.m4: Likewise.
	* generated/reshape_r16.c: Regenerate.
	* generated/reshape_c4.c: Regenerate.
	* generated/reshape_i4.c: Regenerate.
	* generated/reshape_c16.c: Regenerate.
	* generated/reshape_r10.c: Regenerate.
	* generated/reshape_r8.c: Regenerate.
	* generated/reshape_c10.c: Regenerate.
	* generated/reshape_c8.c: Regenerate.
	* generated/reshape_i8.c: Regenerate.
	* generated/reshape_i16.c: Regenerate.
	* generated/reshape_r4.c: Regenerate.

	* gcc/testsuite/gfortran.dg/zero_sized_1.f90: Uncomment checks
	for RESHAPE.

From-SVN: r118455
2006-11-03 11:51:09 +00:00
Brooks Moses 5d7de335d7 error.c (show_locus): Remove "In file" from error messages.
* fortran/error.c (show_locus): Remove "In file" from error messages.
* testsuite/lib/gfortran-dg.exp (gfortran-dg-test): Remove expected "In file" from error 
messages.

From-SVN: r118450
2006-11-02 21:07:59 -08:00
Mike Stump a6f07cc35d * obj-c++.dg/const-str-9.mm: Don't run on 64-bit.
From-SVN: r118433
2006-11-02 22:01:36 +00:00
Mike Stump b654d3320b * g++.old-deja/g++.abi/align.C: Enable for darwin.
From-SVN: r118431
2006-11-02 21:06:40 +00:00
Eric Botcazou 55fc9e87b2 re PR other/29639 (ext/bitmap_allocator/check_allocate_max_size.cc execution test)
PR other/29639
	* except.c (switch_to_exception_section): Do not cache the section
	if named sections are supported and HAVE_LD_EH_GC_SECTIONS is defined
	and flag_function_sections is set.

From-SVN: r118422
2006-11-02 18:40:54 +00:00
Kaveh R. Ghazi b68bcfff54 re PR middle-end/29335 (transcendental functions with constant arguments should be resolved at compile-time)
PR middle-end/29335
	* builtins.c (do_mpfr_sincos): New.
	(fold_builtin_1): Use it to fold builtin sincos.

testsuite:
	* gcc.dg/torture/builtin-math-3.c: Fix semicolons.
	(TESTIT_2P, TESTIT_2P_R): New macros.  Test sincos.

From-SVN: r118409
2006-11-02 03:20:49 +00:00
Adam Nemet 293be7fd22 fold-mod-1.c: Match the leading 0x for the hexadecimal value.
* gcc.dg/fold-mod-1.c: Match the leading 0x for the
	hexadecimal value.
	* gcc.dg/tree-prof/val-prof-2.c: Likewise.
	* gcc.dg/pr14796-2.c: Likewise.

From-SVN: r118394
2006-11-01 19:22:02 +00:00
Eric Botcazou 36c90fd27a 20061101-1.c: New test.
* gcc.c-torture/execute/20061101-1.c: New test.

From-SVN: r118377
2006-11-01 12:09:25 +00:00
Eric Botcazou cb953056bb Fix asm string.
From-SVN: r118374
2006-11-01 11:58:18 +00:00
Richard Guenther 7e35fcb30e i386.c (ix86_expand_rint): Fix issues with signed zeros.
2006-11-01  Richard Guenther  <rguenther@suse.de>

	* config/i386/i386.c (ix86_expand_rint): Fix issues with
	signed zeros.
	(ix86_expand_floorceildf_32): Likewise.
	(ix86_expand_floorceil): Likewise.
	(ix86_expand_trunc): Likewise.

	* testsuite/gcc.target/i386/fpprec-1.c: New testcase.

From-SVN: r118373
2006-11-01 11:38:06 +00:00
Kaveh R. Ghazi e35ae5fe4e builtins.def (gamma, lgamma): Use ATTR_MATHFN_FPROUNDING_STORE.
* builtins.def (gamma, lgamma): Use ATTR_MATHFN_FPROUNDING_STORE.
	
testsuite:
	* gcc.dg/torture/builtin-attr-1.c: Don't test gamma/lgamma.
	* gcc.dg/torture/builtin-convert-1.c: Don't test lgamma.

From-SVN: r118366
2006-11-01 05:38:21 +00:00
Geoffrey Keating 58182de357 In gcc/: PR 23067
In gcc/:
	PR 23067
	* c-decl.c (start_struct): Don't create self-containing
	structures.
	* config/rs6000/rs6000.c (darwin_rs6000_special_round_type_align):
	New.
	* config/rs6000/rs6000-protos.h
	(darwin_rs6000_special_round_type_align): New.
	* config/rs6000/darwin.h (ADJUST_FIELD_ALIGN): Rewrite.
	(ROUND_TYPE_ALIGN): Use darwin_rs6000_special_round_type_align.
In gcc/testsuite/:
	PR 23067
	* gcc.target/powerpc/darwin-abi-3.c: Remove XFAIL.
	* gcc.target/powerpc/darwin-abi-6.c: Remove XFAIL.
	* gcc.target/powerpc/darwin-abi-7.c: Remove XFAIL.
	* gcc.target/powerpc/darwin-abi-8.c: Remove XFAIL.
	* gcc.target/powerpc/darwin-abi-9.c: Remove XFAIL.
	* gcc.target/powerpc/darwin-abi-10.c: Remove XFAIL.
	* gcc.target/powerpc/darwin-abi-11.c: Remove XFAIL.
In libobjc/:
	* encoding.c (darwin_rs6000_special_round_type_align): New.
In libffi/:
	* src/powerpc/ffi_darwin.c (darwin_adjust_aggregate_sizes): New.
	(ffi_prep_cif_machdep): Call darwin_adjust_aggregate_sizes for
	Darwin.
	* testsuite/libffi.call/nested_struct4.c: Remove Darwin XFAIL.
	* testsuite/libffi.call/nested_struct6.c: Remove Darwin XFAIL.

From-SVN: r118365
2006-11-01 05:28:41 +00:00
Eric Christopher 0e7e09dc1e builtin-bswap-1.c: New.
2006-10-31  Eric Christopher  <echristo@apple.com>
	    Falk Hueffner  <falk@debian.org>

	* gcc.dg/builtin-bswap-1.c: New.
	* gcc.dg/builtin-bswap-2.c: New.
	* gcc.dg/builtin-bswap-3.c: New.
	* gcc.dg/builtin-bswap-4.c: New.
	* gcc.dg/builtin-bswap-5.c: New.
	* gcc.target/i386/builtin-bswap-1.c: New.

Co-Authored-By: Falk Hueffner <falk@debian.org>

From-SVN: r118364
2006-11-01 05:20:05 +00:00
Geoffrey Keating 71113fcd70 re PR c/16622 ([C99] extern inline is handled wrong in C99 mode)
* c-decl.c (grokdeclarator): Don't set DECL_EXTERNAL on
	inline static functions in c99 mode.

	PR 16622
	* doc/extend.texi (Inline): Update.
	* c-tree.h (struct language_function): Remove field 'extern_inline'.
	* c-decl.c (current_extern_inline): Delete.
	(pop_scope): Adjust test for an undefined nested function.
	Add warning about undeclared inline function.
	(diagnose_mismatched_decls): Update comments.  Disallow overriding
	of inline functions in a translation unit in C99.  Allow inline
	declarations in C99 at any time.
	(merge_decls): Boolize variables.  Handle C99 'extern inline'
	semantics.
	(grokdeclarator): Set DECL_EXTERNAL here for functions.  Handle
	C99 inline semantics.
	(start_function): Don't clear current_extern_inline.  Don't set
	DECL_EXTERNAL.
	(c_push_function_context): Don't push current_extern_inline.
	(c_pop_function_context): Don't restore current_extern_inline.

	PR 11377
	* c-typeck.c (build_external_ref): Warn about static variables
	used in extern inline functions.
	* c-decl.c (start_decl): Warn about static variables declared
	in extern inline functions.

From-SVN: r118356
2006-11-01 04:47:30 +00:00
Roger Sayle 682d039597 re PR middle-end/23470 (a*a (for floats) is not considered always postive (-ffast-math only))
PR middle-end/23470
	* tree.h (tree_expr_nonnegative_p): Return "bool" instead of "int".
	* fold-const.c (tree_expr_nonnegative_p): Likewise.  Consider
	pow(x,y) and powi(x,y) to be nonnegative if either x is nonnegative
	or y is an even integer.

	* gcc.dg/pr23470-1.c: New test case.

From-SVN: r118355
2006-11-01 02:56:45 +00:00
Bernhard Fischer 4143349751 re PR fortran/29537 (ICE in gfc_match_common for blank common in BLOCK DATA unit)
fortran/ChangeLog:
2006-11-01  Bernhard Fischer  <aldot@gcc.gnu.org>

        PR fortran/29537
        * trans-common.c (gfc_trans_common): If the blank common is
        in a procedure or program without a name then proc_name is null, so use
        the locus of the common.
        (gfc_sym_mangled_common_id): Fix whitespace.
        * match.c (gfc_match_common): Emit warning about blank common in
        block data.

testsuite/ChangeLog:
2006-11-01  Bernhard Fischer  <aldot@gcc.gnu.org>

        PR fortran/29537
        * gfortran.dg/blockdata_1.f90: Add warning about blank common in block
	data.
        * gfortran.dg/blockdata_2.f90: New testcase.

From-SVN: r118347
2006-11-01 00:38:58 +01:00
Thomas Koenig 8a7f7fb6de re PR libfortran/29627 ([4.1 only] partial unformatted reads shouldn't succeed)
2006-10-31  Thomas Koenig  <Thomas.Koenig@online.de>

	PR libfortran/29627
	* libgfortran.h: Add ERROR_SHORT_RECORD
	* runtime/error.c (translate_error): Add case
	for ERROR_SHORT_RECORD.
	* io/transfer.c (read_block_direct):  Separate codepaths
	for stream and record unformatted I/O.  Remove unneeded
	tests for standard input, padding and formatted I/O.
	If the record is short, read in as much data as possible,
	then raise the error.

2006-10-31  Thomas Koenig  <Thomas.Koenig@online.de>

	PR libfortran/29627
	* gfortran.dg/unf_short_record_1.f90:  New test.

From-SVN: r118341
2006-10-31 20:58:26 +00:00
Francois-Xavier Coudert 150675a88b re PR fortran/29067 (gfc_resolve_expr(): Bad expression type)
PR fortran/29067

	* decl.c (gfc_set_constant_character_len): NULL-terminate the
	character constant string.
	* data.c (create_character_intializer): Likewise.
	* expr.c (gfc_simplify_expr): NULL-terminate the substring
	character constant.
	* primary.c (match_hollerith_constant): NULL-terminate the
	character constant string.

	* gfortran.dg/pr29067.f: New test.

From-SVN: r118338
2006-10-31 20:15:22 +00:00
Joseph Myers c03b92063a target-supports.exp (get_compiler_messages): Append options as a single list element.
2006-10-31  Joseph Myers  <joseph@codesourcery.com>
            Richard Sandiford  <richard@codesourcery.com>

	* lib/target-supports.exp (get_compiler_messages): Append options
	as a single list element.
	(check_effective_target_arm_vfp_ok): New.
	* gcc.dg/arm-vfp1.c: Use arm_vfp_ok.

Co-Authored-By: Richard Sandiford <richard@codesourcery.com>

From-SVN: r118334
2006-10-31 19:58:21 +00:00
Paul Thomas dd5797cc36 re PR fortran/29387 (ICE on character array function of variable length)
2006-10-31  Paul Thomas  <pault@gcc.gnu.org>

	PR fortran/29387
	* trans-intrinsic.c (gfc_conv_intrinsic_len): Rearrange to have
	a specific case for EXPR_VARIABLE and, in default, build an ss
	to call gfc_conv_expr_descriptor for array expressions..

	PR fortran/29490
	* trans-expr.c (gfc_set_interface_mapping_bounds): In the case
	that GFC_TYPE_ARRAY_LBOUND is not available, use descriptor
	values for it and GFC_TYPE_ARRAY_UBOUND.

	PR fortran/29641
	* trans-types.c (gfc_get_derived_type): If the derived type
	namespace has neither a parent nor a proc_name, set NULL for
	the search namespace.


2006-10-31  Paul Thomas  <pault@gcc.gnu.org>

	PR fortran/29387
	* gfortran.dg/intrinsic_actual_2.f90: New test.

	PR fortran/29490
	* gfortran.dg/actual_array_interface_1.f90: New test.

	PR fortran/29641
	* gfortran.dg/used_types_11.f90: New test.

From-SVN: r118220
2006-10-31 06:03:24 +00:00
Dirk Mueller 95220fdfba eichin01a.C (main): Fix prototype.
2006-10-30  Dirk Mueller  <dmueller@suse.de>

       * g++.old-deja/g++.pt/eichin01a.C (main): Fix prototype.
       * g++.old-deja/g++.pt/eichin01b.C (main): Same.
       * g++.old-deja/g++.pt/eichin01.C (main): Same.
       * g++.old-deja/g++.mike/net25.C (main): Same.
       * g++.dg/lookup/exception1.C (main): Same.
       * g++.dg/parse/parens2.C (main): Same.

From-SVN: r118204
2006-10-30 22:25:07 +00:00
Roger Sayle 771e6d83c9 pr27827.c: Explicitly specify -mfpmath=387.
* gcc.target/i386/pr27827.c: Explicitly specify -mfpmath=387.

From-SVN: r118201
2006-10-30 21:31:19 +00:00
Kaveh R. Ghazi 61fb309f70 re PR middle-end/29335 (transcendental functions with constant arguments should be resolved at compile-time)
PR middle-end/29335
	* builtins.c (fold_builtin_1): Evaluate tgamma using MPFR.

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

From-SVN: r118200
2006-10-30 20:21:59 +00:00
Tobias Burnus 9aceacac92 re PR fortran/29452 (Keyword check for specifiers in WRITE and READ)
fortran/
2006-10-30  Tobias Burnus  <burnus@net-b.de>

       	PR fortran/29452
       	* io.c (check_io_constraints): Fix keyword string comparison.

libgfortran/
2006-10-30  Tobias Burnus  <burnus@net-b.de>

       	PR fortran/29452
	* runtime/string.c (compare0): Check whether string lengths match.

testsuite/
2006-10-30  Tobias Burnus  <burnus@net-b.de>

	PR fortran/29452
	* gfortran.dg/write_check.f90: Check run-time keyword checking.
	* gfortran.dg/write_check2.f90: Check compile-time keyword checking

From-SVN: r118191
2006-10-30 19:22:47 +01:00
Andrew Pinski 0e69739965 re PR fortran/29410 ([4.2 only] bug with TRANSFER() and -O2)
2006-10-30  Andrew Pinski  <pinskia@gmail.com>

        PR fortran/29410
        * trans-intrinsic.c (gfc_conv_intrinsic_array_transfer):
        Change over to create VIEW_CONVERT_EXPR instead of using an
        ADDR_EXPR, a cast and then an indirect reference
2006-10-30  Andrew Pinski  <pinskia@gmail.com>

        PR Fortran/29410
        * gfortran.fortran-torture/execute/transfer1.f90: New test.

From-SVN: r118186
2006-10-30 08:15:09 -08:00
Joseph Myers 709e1a1a8a default.exp (${tool}_target_compile): Use v3_target_compile.
libstdc++-v3:
	* testsuite/config/default.exp (${tool}_target_compile): Use
	v3_target_compile.

gcc/testsuite:
	* lib/target-supports.exp (check_function_available): Declare
	function before calling.

From-SVN: r118182
2006-10-30 14:03:05 +00:00
Jakub Jelinek cc59abbf35 re PR tree-optimization/29637 (Endless recursion in make_vector_type)
PR tree-optimization/29637
	* tree.c (make_vector_type): Don't recurse if TYPE_MAIN_VARIANT
	of the innertype is the innertype itself.

	* gcc.dg/pr29637.c: New test.

From-SVN: r118175
2006-10-30 09:01:28 +01:00
Roger Sayle 00f5f722bf fold-compare-1.c: Update to reflect recent changes in tree canonicalization.
* gcc.dg/fold-compare-1.c: Update to reflect recent changes in
	tree canonicalization.

From-SVN: r118170
2006-10-30 02:46:11 +00:00
Kaveh R. Ghazi 012c53688f builtins.c (fold_builtin_hypot): Rearrange recursive transformation before others, and also do ABS_EXPR.
* builtins.c (fold_builtin_hypot): Rearrange recursive
	transformation before others, and also do ABS_EXPR.  When
	necessary, check flag_unsafe_math_optimizations.  When necessary,
	add fabs.

testsuite:
	* gcc.dg/builtins-20.c: Add more hypot tests.

From-SVN: r118160
2006-10-29 23:08:23 +00:00
Roger Sayle c159ffe706 fold-const.c (fold_comparison): Fold ~X op ~Y as Y op X.
* fold-const.c (fold_comparison): Fold ~X op ~Y as Y op X.
	Fold ~X op C as X op' ~C, where op' is the swapped comparison.
	(fold_binary): ~X eq/ne C is now handled in fold_comparison.
	Fold -X eq/ne -Y as X eq/ne Y.

	* gcc.dg/fold-compare-1.c: New test case.

From-SVN: r118158
2006-10-29 21:41:48 +00:00
Dirk Mueller 0958b0d31d re PR c++/16307 (-Wchar-subscripts does not warn on pointers)
2006-10-29  Dirk Mueller  <dmueller@suse.de>

        PR c++/16307
        * typeck.c (build_array_ref): Warn for char subscriptions
        on pointers.

        * g++.dg/warn/Wchar-subscripts-2.C: New testcase.

From-SVN: r118154
2006-10-29 18:38:26 +00:00
Roger Sayle f8ed9a1c65 re PR tree-optimization/15458 (Combine ~ and ^.)
PR tree-optimization/15458
	* fold-const.c (fold_binary): Optimize ~X ^ C as X ^ ~C, where C
	is a constant.

	* gcc.dg/fold-xornot-1.c: New test case.

From-SVN: r118152
2006-10-29 17:51:07 +00:00
Richard Guenther 044928d612 i386-protos.h (ix86_expand_trunc): Declare.
2006-10-29  Richard Guenther  <rguenther@suse.de>

	* config/i386/i386-protos.h (ix86_expand_trunc): Declare.
	(ix86_expand_truncdf_32): Likewise.
	* config/i386/i386.c (ix86_expand_trunc): New function expanding
	trunc inline for SSE math and -fno-trapping-math and if not
	optimizing for size.
	(ix86_expand_truncdf_32): Same for DFmode on 32bit archs.
	* config/i386/i386.md (btruncsf2, btruncdf2): Adjust expanders
	for expanding btrunc inline for SSE math.

	* gcc.target/i386/math-torture/trunc.c: New testcase.

From-SVN: r118148
2006-10-29 16:43:21 +00:00
Richard Guenther 097f296422 i386-protos.h (ix86_expand_round): Declare.
2006-10-29  Richard Guenther  <rguenther@suse.de>

	* config/i386/i386-protos.h (ix86_expand_round): Declare.
	(ix86_expand_rounddf_32): Likewise.
	* config/i386/i386.c (ix86_expand_round): New function expanding
	round inline for SSE math and -fno-trapping-math and if not
	optimizing for size.
	(ix86_expand_rounddf_32): Same for DFmode on 32bit archs.
	* config/i386/i386.md (rounddf2, roundsf2): New pattern expanding
	round via ix86_expand_round.

	* gcc.target/i386/math-torture/round.c: New testcase.

From-SVN: r118146
2006-10-29 16:33:36 +00:00
Richard Guenther d096ecdd96 i386-protos.h (ix86_expand_floorceil): Declare.
2006-10-29  Richard Guenther  <rguenther@suse.de>

	* config/i386/i386-protos.h (ix86_expand_floorceil): Declare.
	(ix86_expand_floorceildf_32): Likewise.
	* config/i386/i386.c (ix86_expand_sse_compare_mask): New
	static helper function.
	(ix86_expand_floorceil): Expander for floor and ceil to SSE
	math.
	(ix86_expand_floorceildf_32): Same for DFmode on 32bit archs.
	* config/i386/i386.md (floordf2): Adjust to enable floor
	expansion via ix86_expand_floorceil if TARGET_SSE_MATH and
	-fno-trapping-math is enabled and if not optimizing for size.
	(floorsf2, ceildf2, ceilsf2): Likewise.
	* config/i386/sse.md (sse_maskcmpsf3): New insn.
	(sse2_maskcmpdf3): Likewise.

	* gcc.target/i386/math-torture/ceil.c: New testcase.
	* gcc.target/i386/math-torture/floor.c: Likewise.

From-SVN: r118145
2006-10-29 16:28:40 +00:00
Richard Guenther c7d32ff619 builtins.c (expand_builtin_mathfn): Expand nearbyint as rint in case -fno-trapping-math is enabled.
2006-10-29  Richard Guenther  <rguenther@suse.de>

	* builtins.c (expand_builtin_mathfn): Expand nearbyint as
	rint in case -fno-trapping-math is enabled.
	* config/i386/i386-protos.h (ix86_expand_rint): Declare.
	* config/i386/i386.c (ix86_gen_TWO52): New static helper function.
	(ix86_expand_sse_fabs): Likewise.
	(ix86_expand_rint): New function expanding rint to x87 or SSE math.
	* config/i386/i386.md (rintdf2): Enable for SSE math if
        -fno-trapping-math is enabled, use ix86_expand_rint for expansion.
	(rintsf2): Likewise.

	* gcc.target/i386/math-torture/rint.c: New testcase.
	* gcc.target/i386/math-torture/nearbyint.c: Likewise.

From-SVN: r118144
2006-10-29 15:25:52 +00:00
Richard Guenther c3a4177fe1 genopinit.c (optabs): Change lfloor_optab and lceil_optab to conversion optabs.
2006-10-29  Richard Guenther  <rguenther@suse.de>

	* genopinit.c (optabs): Change lfloor_optab and lceil_optab
	to conversion optabs.
	* optabs.c (init_optabs): Initialize lfloor_optab and lceil_optab
	as conversion optab.
	* optabs.h (enum optab_index): Remove OTI_lfloor and OTI_lceil.
	(enum convert_optab_index): Add COI_lfloor and COI_lceil.
	(lfloor_optab, lceil_optab): Adjust defines.
	* builtins.c (expand_builtin_int_roundingfn): Adjust for
	lfloor and lceil optabs now being conversion optabs.
	* config/i386/i386-protos.h (ix86_expand_lfloorceil): Declare.
	* config/i386/i386.c (ix86_expand_sse_compare_and_jump):
	New static helper function.
	(ix86_expand_lfloorceil): New function to expand lfloor and
	lceil inline.
	* config/i386/i386.md (lfloor<mode>2): Split into ...
	(lfloorxf<mode>2): ... x87 variant
	(lfloor<mode>di2, lfloor<mode>si2): ... and SSE variants
	using ix86_expand_lfloorceil.
	(lceil<mode>2, lceilxf<mode>2, lceil<mode>di2, lceil<mode>si2):
	Likewise.
	* doc/md.texi (lfloorMN, lceilMN): Document.

	* gcc.target/i386/math-torture/lfloor.c: New testcase.
	* gcc.target/i386/math-torture/lceil.c: Likewise.

From-SVN: r118143
2006-10-29 15:18:24 +00:00
Tobias Burnus 98c58757e6 re PR libfortran/24313 (complex sqrt function does not return principal value)
2006-10-28  Tobias Burnus  <burnus@net-b.de>

       PR libgfortran/24313
       * gfortran.dg/csqrt_2.f: Remove xfail *-*-linux-gnu.

From-SVN: r118142
2006-10-29 12:56:56 +01:00
Kazu Hirata ec4178c957 20020118-1.c, [...]: Fix comment typos.
* gcc.c-torture/execute/20020118-1.c,
	gcc.c-torture/execute/builtins/strlen.c,
	gcc.c-torture/execute/pr23135.c, lib/fortran-torture.exp: Fix
	comment typos.

From-SVN: r118132
2006-10-29 04:43:45 +00:00
Kaveh R. Ghazi 4413d881d0 re PR middle-end/29335 (transcendental functions with constant arguments should be resolved at compile-time)
PR middle-end/29335
	* builtins.c (do_mpfr_arg2, fold_builtin_hypot): New.
	(fold_builtin_pow): Evaluate constant arguments at compile-time
	using MPFR.
	(fold_builtin_1): Handle BUILT_IN_ATAN2 and BUILT_IN_HYPOT.
	(do_mpfr_ckconv): New helper function.
	(do_mpfr_arg1): Use do_mpfr_ckconv.
	(do_mpfr_arg2): New.

testsuite:
	* gcc.dg/builtins-20.c: Add tests for hypot.
	* gcc.dg/torture/builtin-math-2.c (TESTIT2): New.  Add tests for
	two-argument builtins.
	* gcc.dg/torture/builtin-math-3.c (TESTIT_R): Renamed from
	TESTIT2.  Update all callers.
	(TESTIT2, TESTIT2_R): New helper macros.
	Add testcases for pow, hypot and atan2.

From-SVN: r118129
2006-10-29 02:02:10 +00:00
Andrew Pinski 857d325a64 re PR c++/29295 (++ operator with bool typedef increments or operator -- with bool typedef)
2006-10-28  Andrew Pinski  <andrew_pinski@playstation.sony.com>

        PR C++/29295
        * typeck.c (build_unary_op): Use same_type_p when comparing to
        boolean type.

2006-10-28  Andrew Pinski  <andrew_pinski@playstation.sony.com>

        PR C++/29295
        * g++.dg/expr/bool1.C: New test.
        * g++.dg/expr/bool2.C: New test.

From-SVN: r118118
2006-10-28 16:01:59 -07:00
Tobias Burnus f1827a8c69 re PR fortran/28224 (gfortran should support namelist (nml) for internal file units)
fortran/
2006-10-28  Tobias Burnus  <burnus@net-b.de>

	PR fortran/28224
	* io.c (check_io_constraints): Allow namelists
	  for internal files for Fortran 2003.

testsuite/
2006-10-28  Tobias Burnus  <burnus@net-b.de>

	PR fortran/28224
	* gfortran.dg/io_constraints_2.f90: Use -std=f95.
	* gfortran.dg/namelist_internal.f90: New test.

From-SVN: r118113
2006-10-28 23:59:20 +02:00
Tobias Burnus 0a3a2b91a5 re PR fortran/29625 (Octal edit descriptors allow real variables, even with -std=f95)
2006-10-28  Tobias Burnus  <burnus@net-b.de>

	PR fortran/29625
	* gfortran.dg/io_real_boz.f90: Add.
	* gfortran.dg/io_real_boz2.f90: Add.

From-SVN: r118112
2006-10-28 23:07:19 +02:00
Richard Guenther e73dbcaefc re PR middle-end/26899 (Fold does not fold (i0 > i1 + 1) || (i1 < i0 - 1))
2006-10-28  Richard Guenther  <rguenther@suse.de>

	PR middle-end/26899
	* fold-const.c (maybe_canonicalize_comparison_1): Helper
	for maybe_canonicalize_comparison.
	(maybe_canonicalize_comparison): New function for canonicalizing
	comparison trees.
	(fold_comparison): Call it to canonicalize comparisons with
	constants involved.

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

From-SVN: r118106
2006-10-28 18:03:21 +00:00
Richard Guenther 4d81bf8435 re PR target/28806 (lround is not expanded inline to SSE conversion sequence)
2006-10-28  Richard Guenther  <rguenther@suse.de>

	PR target/28806
	* builtins.c (expand_builtin_int_roundingfn_2): Expand
	BUILT_IN_LROUND and BUILT_IN_LLROUND from here.
	(expand_builtin): Adjust likewise.
	* genopinit.c (optabs[]): Add lround optab.
	* optabs.c (init_optabs): Initialize lround_optab.
	* optabs.h (enum convert_optab_index): Add COI_lround.
	(lround_optab): Define.
	* config/i386/i386-protos.h (ix86_expand_lround): Declare.
	* config/i386/i386.c (ix86_sse_copysign_to_positive): New
	static function.
	(ix86_expand_lround): New function.
	* config/i386/i386.md (lround<mode>di2, lround<mode>si2):
	New expanders.
	* doc/md.texi (lroundMN2): Document.

	* gcc.target/i386/math-torture/lround.c: New testcase.

From-SVN: r118105
2006-10-28 11:30:41 +00:00
Kaz Kojima 2810ec2fd5 builtins-43.c: Add -fno-finite-math-only.
* gcc.dg/builtins-43.c: Add -fno-finite-math-only.
	* gcc.dg/builtins-44.c: Likewise.
	* gcc.dg/builtins-45.c: Likewise.
	* gcc.dg/pr28796-2.c: Likewise.
	* gcc.dg/unordered-3.c: Likewise.

From-SVN: r118089
2006-10-27 22:04:35 +00:00
Jerry DeLisle ef4a3e6410 PR libgfortran/27954 Fix type in changelog, pr number
2006-10-27  Jerry DeLisle  <jvdelisle@gcc.gnu.org>

	PR libgfortran/27954  Fix type in changelog, pr number
	* gfortran.dg/error_recovery_2.f90: New test.

From-SVN: r118086
2006-10-27 20:54:54 +00:00
Jerry DeLisle ee7b3e9ab1 re PR fortran/29563 (Internal read loses data.)
2006-10-27  Jerry DeLisle  <jvdelisle@gcc.gnu.org>

	PR libgfortran/29563
	* gfortran.dg/error_recovery_2.f90: New test.

From-SVN: r118085
2006-10-27 20:50:15 +00:00
Richard Guenther 4bab2b2301 i386.exp: Use glob, not find to collect tests.
2006-10-26  Richard Guenther  <rguenther@suse.de>

	* gcc.target/i386/i386.exp: Use glob, not find to collect
	tests.  Avoids recursing into subdirectories.
	* gcc.target/i386/math-torture/math-torture.exp: Torture
	for interesting ia32 math options.
	* gcc.target.i386/math-torture/lrint.c: New testcase.

From-SVN: r118065
2006-10-26 08:23:19 +00:00
Jerry DeLisle 9a3da65a38 re PR fortran/29563 (Internal read loses data.)
2006-10-26  Jerry DeLisle  <jvdelisle@gcc.gnu.org>

	PR libgfortran/29563
	* gfortran.dg/arrayio_9.f90: Update test.
	* gfortran.dg/arrayio_19.f90: New test.

From-SVN: r118064
2006-10-26 07:19:49 +00:00
Andreas Krebbel 20f04e65e3 s390.c (s390_init_frame_layout): Check positive frame_size.
2006-10-26  Andreas Krebbel  <krebbel1@de.ibm.com>

	* config/s390/s390.c (s390_init_frame_layout): Check positive
	frame_size.

2006-10-26  Andreas Krebbel  <krebbel1@de.ibm.com>

	* gcc.dg/20061026.c: New testcase.

From-SVN: r118062
2006-10-26 06:58:29 +00:00
Jerry DeLisle ac2de15d44 re PR fortran/29563 (Internal read loses data.)
2006-10-26  Jerry DeLisle  <jvdelisle@gcc.gnu.org>

	PR libgfortran/29563
	* gfortran.dg/arrayio_9.f90: New test.

From-SVN: r118060
2006-10-26 04:41:55 +00:00
Ben Elliston 377d876f81 strlen.c: Do not use strcpy.
* gcc.c-torture/execute/builtins/strlen.c: Do not use strcpy.
	Copy the strings manually, as strcpy may call strlen.

From-SVN: r118045
2006-10-26 08:58:27 +10:00
Kaveh R. Ghazi cf1491f0e5 re PR middle-end/29335 (transcendental functions with constant arguments should be resolved at compile-time)
PR middle-end/29335
	* builtins.c (fold_builtin_cbrt, fold_builtin_logarithm):
	Calculate compile-time constants using MPFR.
	(fold_builtin_1): Likewise handle BUILT_IN_ERF, BUILT_IN_ERFC,
	BUILT_IN_EXPM1 and BUILT_IN_LOG1P.
	
testsuite:
	* gcc.dg/torture/builtin-math-2.c (TESTIT): Use new helper macro.
	Add checks for log, log2, log10 and log1p.

	* gcc.dg/torture/builtin-math-3.c: Add checks for -0.0 everywhere
	we already test 0.0.  Add checks for expm1, log, log2, log10,
	log1p, cbrt, erf and erfc.

From-SVN: r118042
2006-10-25 20:44:09 +00:00
Steve Ellcey 29f7d34e1f * gcc.dg/pthread-init-2.c: Define _POSIX_C_SOURCE on ia64 HP-UX.
From-SVN: r118035
2006-10-25 16:32:30 +00:00
Uros Bizjak 17b982699f optabs.h (enum optab_index): Rename OTI_drem to OTI_remainder.
* optabs.h (enum optab_index): Rename OTI_drem to OTI_remainder.
        (remainder_optab): Define corresponding macro.
        (drem_optab): Remove.
        * optabs.c (init_optabs): Initialize remainder_optab.  Remove
        drem_optab initialization.
        * genopinit.c (optabs): Implement remainder_optab using
        remainder?f3 patterns.  Remove drem_optab.
        * builtins.c (expand_builtin_mathfn_2): Handle
        BUILT_IN_REMAINDER{,F,L} using remainder_optab.
        (expand_builtin): Expand BUILT_IN_REMAINDER{,F,L} using
        expand_builtin_mathfn_2.

        (expand_builtin) [BUILT_IN_FMOD, BUILT_IN_DREM]: Do not
        depend on flag_unsafe_math_optimizations.

        * config/i386/i386.md ("remaindersf3", "remainderdf3")
        ("remainderxf3"): Renamed from "drem{s,d,x}f3" expanders.
        Do not depend on flag_unsafe_math_optimizations.  Use
        truncxf?f expander instead of truncxf?f_i387_noop.

        ("fpremxf4", "fprem1xf4"): Do not depend on
        flag_unsafe_math_optimizations.
        ("fmodsf3", "fmoddf3", "fmodxf3"): Do not depend on
        flag_unsafe_math_optimizations.  Use truncxf?f expander
        instead of truncxf?f_i387_noop.

        * doc/md.texi (fmod, remainder): Document standard named pattern.

testsuite/ChangeLog:

        * gcc.dg/builtins-40.c: Also check remainder(), remainderf()
        and remainderl() built-in functions.  Remove -ffast-math from
        dg-options.

From-SVN: r118024
2006-10-25 08:36:49 +02:00
Kaveh R. Ghazi e4ef58afd4 builtin-math-2.c: Add checks for asin, acos, acosh and atanh.
* gcc.dg/torture/builtin-math-2.c: Add checks for asin, acos,
	acosh and atanh.
	
	* gcc.dg/torture/builtin-math-3.c (TESTIT): Append 'F' and 'L'
	floating point modifiers to arguments passed to float and long
	double functions respectively.  Update all callers to use floating
	point numbers, not integers.  Add tests for exp, exp2 and
	exp10/pow10.

From-SVN: r118012
2006-10-24 21:52:51 +00:00
Kaveh R. Ghazi b53fed5636 re PR middle-end/29335 (transcendental functions with constant arguments should be resolved at compile-time)
PR middle-end/29335
	* builtins.c (fold_builtin_sin, fold_builtin_atan): Remove.
	(do_mpfr_arg1): Add `min', `max' and `inclusive' arguments.
	Update all callers.
	(BUILT_IN_SIN, BUILT_IN_ATAN): Handle in main switch.
	(BUILT_IN_ASIN, BUILT_IN_ACOS, BUILT_IN_ATAN, BUILT_IN_ASINH,
	BUILT_IN_ACOSH, BUILT_IN_ATANH, BUILT_IN_SINH, BUILT_IN_COSH,
	BUILT_IN_TANH): Calculate compile-time arguments using MPFR.

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

From-SVN: r118009
2006-10-24 17:44:36 +00:00