2007-10-31 Jerry DeLisle <jvdelisle@gcc.gnu.org>
PR fortran/33162
* interface.c (compare_intr_interfaces): New function to check intrinsic
function arguments against formal arguments. (compare_interfaces): Fix
logic in comparison of function and subroutine attributes.
(compare_parameter): Use new function for intrinsic as argument.
* resolve.c (resolve_actual_arglist): Allow an intrinsic without
function attribute to be checked further. Set function attribute if
intrinsic symbol is found, return FAILURE if not.
From-SVN: r129798
2007-10-31 Sebastian Pop <sebastian.pop@amd.com>
PR tree-optimization/32377
* tree-data-ref.c (compute_overlap_steps_for_affine_univar): Make it
work also for unknown number of iterations.
(analyze_subscript_affine_affine): Clean up. Don't fail when the
number of iterations is not known.
* gfortran.dg/vect/pr32377.f90: New.
From-SVN: r129797
2007-10-31 Paul Thomas <pault@gcc.gnu.org>
PR fortran/33897
* decl.c (gfc_match_entry): Do not make ENTRY name
global for contained procedures.
* parse.c (gfc_fixup_sibling_symbols): Fix code for
determining whether a procedure is external.
2007-10-31 Paul Thomas <pault@gcc.gnu.org>
PR fortran/33897
* gfortran.dg/contained_3.f90: New.
From-SVN: r129795
* doc/invoke.texi (Option Summary): Add -fdce and -fdse to list of
optimization options.
(Optimize Options): Add -fdce and -fdse to the list of optimizations
enabled by -O. Document -fdce and -fdse.
From-SVN: r129786
PR c++/33709
* fold-const.c (fold_binary): If one argument is COMPOUND_EXPR,
convert second operand of COMPOUND_EXPR to the original type of
that argument.
* g++.dg/opt/compound1.C: New test.
From-SVN: r129785
PR c++/33616
* decl2.c (build_offset_ref_call_from_tree): Call
build_non_dependent_expr on object prior to building ADDR_EXPR from it
if FN is DOTSTAR_EXPR.
* g++.dg/template/ptrmem18.C: New test.
From-SVN: r129784
PR fortran/33596
* trans-intrinsic.c (gfc_conv_intrinsic_isnan): Strip NOP_EXPR
from the result of build_call_expr.
* gfortran.dg/isnan_2.f90: New test.
From-SVN: r129782
2007-10-30 Douglas Gregor <doug.gregor@gmail.com>
PR c++/31993
PR c++/32252
* pt.c (find_parameter_packs_r): Fix typo in comment.
(convert_template_argument): Look at the pattern of a pack
expansion to determine what kind of entity we're converting.
(coerce_template_parameter_pack): When we have coerced a non-type
template parameter pack, substitute into the type of that pack.
(tsubst_pack_expansion): When our substitution of a parameter pack
is a "trivial" substitution of itself, just substitute into the
pack expansion rather than actually expanding.
2007-10-30 Douglas Gregor <doug.gregor@gmail.com>
PR c++/31993
PR c++/32252
* g++.dg/cpp0x/pr31993.C: New
* g++.dg/cpp0x/pr32252.C: New
From-SVN: r129773
2007-10-30 Richard Guenther <rguenther@suse.de>
* tree-ssa-operands.c (add_vars_for_offset): Fix exit test
of loop adding SFTs as virtual operands.
* gcc.c-torture/execute/20071030-1.c: New testcase copied from
gcc.target/i386/loop-3.c.
From-SVN: r129770
PR testsuite/24841
* doc/sourcebuild.texi (Test Directives): Document that dg-require
directives must come before dg-additional-sources.
From-SVN: r129744
PR tree-optimization/33723
* c-gimplify.c (c_gimplify_expr): Optimize INIT_EXPR or
MODIFY_EXPR with non-addressable COMPOUND_LITERAL_EXPR as source.
* gcc.c-torture/execute/20071029-1.c: New test.
* gcc.dg/tree-ssa/pr33723.c: New test.
From-SVN: r129743
gcc/
PR tree-optimization/33614
* gimplify.c (gimplify_init_constructor): Gimplify vector constructors
if they can't be reduced to VECTOR_CSTs and aren't legitimate
initializer constants.
gcc/testsuite/
PR tree-optimization/33614
* gcc.c-torture/compile/pr33614.c: New test.
From-SVN: r129739
2007-10-29 Richard Guenther <rguenther@suse.de>
PR tree-optimization/33870
* tree-ssa-operands.c (add_vars_for_offset): Remove mpt_vars parameter.
(add_virtual_operand): Do not recurse into MPTs looking for pointed-to
SFTs.
* gcc.c-torture/execute/pr33870.x: XFAIL testcase for -O2 and -Os.
From-SVN: r129738
PR tree-optimization/33757
* gcc.dg/tree-ssa/ssa-fre-4.c: Run on selected TARGET_PROMOTE_PROTOTYPES
true architectures instead of having a big dg-skip-if.
From-SVN: r129737
PR c++/33841
* class.c (check_bitfield_decl): Don't set field's type to error_mark_node
for non-integral type bitfields. Return true if bitfield is correct, false
error has been diagnosed.
(check_field_decls): If check_bitfield_decl returned false, call also
check_field_decl.
* g++.dg/other/bitfield3.C: New test.
From-SVN: r129736
2007-10-29 Richard Guenther <rguenther@suse.de>
* tree-flow-inline.h (get_subvar_at): Use binary search.
(get_first_overlapping_subvar): New function to binary search
for the first overlapping subvar.
* tree-ssa-operands.c (add_vars_for_offset): Strip down to
just handle adding subvars for a pointed-to subvar. Optimize
and use get_first_overlapping_subvar.
(add_vars_for_bitmap): Fold into single caller.
(add_virtual_operand): Streamline, inherit add_vars_for_bitmap
and non pointed-to bits of add_vars_for_offset.
From-SVN: r129727
2007-10-29 Paul Thomas <pault@gcc.gnu.org>
PR fortran/31217
PR fortran/33811
PR fortran/33686
* trans-array.c (gfc_conv_loop_setup): Send a complete type to
gfc_trans_create_temp_array if the temporary is character.
* trans-stmt.c (gfc_trans_assign_need_temp): Do likewise for
allocate_temp_for_forall_nest.
(forall_replace): New function.
(forall_replace_symtree): New function.
(forall_restore): New function.
(forall_restore_symtree): New function.
(forall_make_variable_temp): New function.
(check_forall_dependencies): New function.
(cleanup_forall_symtrees): New function.
gfc_trans_forall_1): Add and initialize pre and post blocks.
Call check_forall_dependencies to check for all dependencies
and either trigger second forall block to copy temporary or
copy lval, outside the forall construct and replace all
dependent references. After assignment clean-up and coalesce
the blocks at the end of the function.
* gfortran.h : Add prototypes for gfc_traverse_expr and
find_forall_index.
expr.c (gfc_traverse_expr): New function to traverse expression
and visit all subexpressions, under control of a logical flag,
a symbol and an integer pointer. The slave function is caller
defined and is only called on EXPR_VARIABLE.
(expr_set_symbols_referenced): Called by above to set symbols
referenced.
(gfc_expr_set_symbols_referenced): Rework of this function to
use two new functions above.
* resolve.c (find_forall_index): Rework with gfc_traverse_expr,
using forall_index.
(forall_index): New function used by previous.
* dependency.c (gfc_check_dependency): Use gfc_dep_resolver for
all references, not just REF_ARRAY.
(gfc_dep_resolver): Correct the logic for substrings so that
overlapping arrays are handled correctly.
2007-10-29 Paul Thomas <pault@gcc.gnu.org>
PR fortran/31217
PR fortran/33811
* gfortran.dg/forall_12.f90: New test.
PR fortran/33686
* gfortran.dg/forall_13.f90: New test.
From-SVN: r129720
Automatic parallelization reduction tests.
* testsuite/gcc.dg/tree-ssa/reduc-1.c: New test.
* testsuite/gcc.dg/tree-ssa/reduc-1char.c: New test.
* testsuite/gcc.dg/tree-ssa/reduc-1short.c: New test.
* testsuite/gcc.dg/tree-ssa/reduc-2.c: New test.
* testsuite/gcc.dg/tree-ssa/reduc-2char.c: New test.
* testsuite/gcc.dg/tree-ssa/reduc-2short.c: New test.
* testsuite/gcc.dg/tree-ssa/reduc-3.c: New test.
* testsuite/gcc.dg/tree-ssa/reduc-6.c: New test.
* testsuite/gcc.dg/tree-ssa/reduc-7.c: New test.
* testsuite/gcc.dg/tree-ssa/reduc-8.c: New test.
* testsuite/gcc.dg/tree-ssa/reduc-9.c: New test.
From-SVN: r129718
Zdenek Dvorak
OMP_ATOMIC Changes,
Reduction support for automatic parallelization.
* expr.c (expand_expr_real_1): Add cases for OMP_ATOMIC_LOAD,
OMP_ATOMIC_STORE.
* Makefile.in: Add dependencies to expr.o, tree-parloops.o, omp-low.o
* tree-pretty-print.c (dump_generic_node): Add OMP_ATOMIC_LOAD
and OMP_ATOMIC_STORE.
* tree.h (OMP_DIRECTIVE_P): Add OMP_ATOMIC_LOAD,
OMP_ATOMIC_STORE.
* gimple-low.c (lower_stmt): Same.
* gimplify.c (gimplify_expr): Same.
(gimplify_omp_atomic_fetch_op, gimplify_omp_atomic_pipeline,
gimplify_omp_atomic_mutex): Remove.
(gimplify_omp_atomic): Change it to simply gimplify the
statement instead of expanding it.
* omp-low.c: Add includes to optabs.h, cfgloop.h.
(expand_omp_atomic, expand_omp_atomic_pipeline,
goa_stabilize_expr, expand_omp_atomic_mutex,
expand_omp_atomic_fetch_op): New functions to implement
expansion of OMP_ATOMIC.
(expand_omp, build_omp_regions_1): Add support for
OMP_ATOMIC_LOAD/OMP_ATOMIC_STORE.
* tree-cfg.c (make_edges): add case for OMP_ATOMIC_LOAD,
OMP_ATOMIC_STORE.
* tree-gimple.c (is_gimple_stmt): Add OMP_ATOMIC_LOAD,
OMP_ATOMIC_STORE.
* tree-parloops.c: add include to tree-vectorizer.h.
(reduction_info): New structure for reduction.
(reduction_list): New list to represent list of reductions
per loop.
(struct data_arg): New helper structure for reduction.
(reduction_info_hash, reduction_info_eq, reduction_phi,
initialize_reductions,
create_call_for_reduction, create_phi_for_local_result,
create_call_for_reduction_1, create_loads_for_reductions,
create_final_loads_for_reduction): New functions.
(loop_parallel_p): Identify reductions, add reduction_list parameter.
(separate_decls_in_loop_name): Support reduction variables.
(separate_decls_in_loop): Add reduction_list and ld_st_data arguments,
call create_loads_for_reduction for each reduction.
(canonicalize_loop_ivs): Identify reductions, add reduction_list
parameter.
(transform_to_exit_first_loop): Add reduction support, add
reduction_list parameter.
(gen_parallel_loop): Add reduction_list parameter. Add call
separate_decls_in_loop with
the new argument. Traverse reductions and call
initialize_reductions, create_call_for_reduction.
(parallelize_loops): Create and delete the reduction list.
(add_field_for_name): Change use of data parameter. Add fields for
reductions.
* tree-vectorizer.h (vect_analyze_loop_form): Add declaration.
* tree-vect-analyze.c (vect_analyze_loop_form): export it.
* tree.def: Add definitions for OMP_ATOMIC_LOAD,
OMP_ATOMIC_STORE.
* tree-inline.c (estimate_num_insns_1): add cases for
OMP_ATOMIC_LOAD, OMP_ATOMIC_STORE.
* tree-cfg.c (make_edges): Add OMP_ATOMIC_LOAD,
OMP_ATOMIC_STORE.
* tree-ssa-operands.c (get_addr_dereference_operands):
New function. Subroutine of get_indirect_ref_operands.
(get_indirect_ref_operands): Call get_addr_dereference_operands.
(get_expr_operands): Support OMP_ATOMIC_LOAD, OMP_ATOMIC_STORE.
From-SVN: r129716
* config/cris/cris.c: Include df.h.
(cris_address_cost): Add gcc_assert for canonicalization
assumptions. For PLUS with MULT or register, correct
test for register in other arm. Tweak comments.
From-SVN: r129713