2008-01-17 Paul Thomas <pault@gcc.gnu.org>
PR fortran/34429
PR fortran/34431
PR fortran/34471
* decl.c : Remove gfc_function_kind_locus and
gfc_function_type_locus. Add gfc_matching_function.
(match_char_length): If matching a function and the length
does not match, return MATCH_YES and try again later.
(gfc_match_kind_spec): The same.
(match_char_kind): The same.
(gfc_match_type_spec): The same for numeric and derived types.
(match_prefix): Rename as gfc_match_prefix.
(gfc_match_function_decl): Except for function valued character
lengths, defer applying kind, type and charlen info until the
end of specification block.
gfortran.h (gfc_statement): Add ST_GET_FCN_CHARACTERISTICS.
parse.c (decode_specification_statement): New function.
(decode_statement): Call it when a function has kind = -1. Set
and reset gfc_matching function, as function statement is being
matched.
(match_deferred_characteristics): Simplify with a single call
to gfc_match_prefix. Do appropriate error handling. In any
case, make sure that kind = -1 is reset or corrected.
(parse_spec): Call above on seeing ST_GET_FCN_CHARACTERISTICS.
Throw an error if kind = -1 after last specification statement.
parse.h : Prototype for gfc_match_prefix.
2008-01-17 Paul Thomas <pault@gcc.gnu.org>
PR fortran/34429
* gfortran.dg/function_charlen_1.f90: New test.
PR fortran/34431
* gfortran.dg/function_types_1.f90: New test.
* gfortran.dg/function_types_2.f90: New test.
PR fortran/34471
* gfortran.dg/function_kinds_4.f90: New test.
* gfortran.dg/function_kinds_5.f90: New test.
* gfortran.dg/defined_operators_1.f90: Errors now at function
declarations.
* gfortran.dg/private_type_4.f90: The same.
* gfortran.dg/interface_15.f90: The same.
* gfortran.dg/elemental_args_check_2.f90: The same.
* gfortran.dg/auto_internal_assumed.f90: The same.
From-SVN: r131592
PR rtl-optimization/33796
* sparseset.c (sparseset_alloc): Use xcalloc rather than xmalloc.
Co-Authored-By: Peter Bergner <bergner@vnet.ibm.com>
From-SVN: r131589
2008-01-16 Richard Guenther <rguenther@suse.de>
PR middle-end/32628
* fold-const.c (fold_convert_const_int_from_int): Do not
set overflow if that occured only because of a sign extension
change when converting from/to a sizetype with the same
precision and signedness.
* gcc.dg/overflow-warn-7.c: New testcase.
From-SVN: r131579
2008-01-16 Sebastian Pop <sebastian.pop@amd.com>
* lambda-code.c (lambda_transform_legal_p): Handle the case of
no dependences in the dependence_relations vector.
From-SVN: r131577
* gcc.c (LINK_COMMAND_SPEC): Add includes and link options for
libgomp when compiling with ftree-parallelize-loops.
(GOMP_SELF_SPECS): Add -pthread for ftree-parallelize-loops.
From-SVN: r131574
2008-01-16 Richard Guenther <rguenther@suse.de>
PR tree-optimization/34769
* tree-data-ref.c (initialize_matrix_A): Revert fix for PR34458.
* tree.c (int_cst_value): Instead make this function more
permissive in what it accepts as valid input. Document this
function always sign-extends the value.
From-SVN: r131573
2008-01-16 Jakub Jelinek <jakub@redhat.com>
Richard Guenther <rguenther@suse.de>
PR c/34668
* gimplify.c (fold_indirect_ref_rhs): Rename to ...
(gimple_fold_indirect_ref_rhs): ... this.
(gimple_fold_indirect_ref): New function with foldings
that preserve lvalueness.
(gimplify_modify_expr_rhs): Call gimple_fold_indirect_ref_rhs.
* tree-flow.h (gimple_fold_indirect_ref): Declare.
* tree-inline.c (copy_body_r): Use gimple_fold_indirect_ref
to fold an INDIRECT_REF, fall back to the old use of
fold_indirect_ref_1.
* gcc.dg/pr34668-1.c: New test.
* gcc.dg/pr34668-2.c: Likewise.
Co-Authored-By: Richard Guenther <rguenther@suse.de>
From-SVN: r131572
2008-01-16 Richard Guenther <rguenther@suse.de>
PR c++/33819
* typeck.c (is_bitfield_expr_with_lowered_type): Recurse
for conversions to type variants.
* g++.dg/torture/pr33819.C: New testcase.
From-SVN: r131569
2008-01-16 Richard Guenther <rguenther@suse.de>
PR c/34768
* c-typeck.c (common_pointer_type): Do not merge inconsistent
type qualifiers for function types.
* gcc.c-torture/execute/pr34768-1.c: New testcase.
* gcc.c-torture/execute/pr34768-2.c: Likewise.
From-SVN: r131568
2008-01-16 Steven Bosscher <steven@gcc.gnu.org>
PR libfortran/34669
* mk-kinds-h.sh: Compile with -S to avoid calling the assembler,
to avoid piping the -fdump-parse-tree output to the assembler
when configuring with -pipe.
* mk-sik-inc.sh: Likewise.
* mk-srk-inc.sh: Likewise.
From-SVN: r131567
2008-01-15 Jerry DeLisle <jvdelisle@gcc.gnu.org>
* tree-parloops.c (gen_parallel_loop): Fix ommision of declaration for
loop_iterator li from previous commit.
From-SVN: r131563
2008-01-15 Sebastian Pop <sebastian.pop@amd.com>
* f95-lang.c (gfc_init_builtin_functions): Initialize GOMP builtins
for flag_tree_parallelize_loops.
From-SVN: r131556
2008-01-15 Douglas Gregor <doug.gregor@gmail.com>
PR c++/34399
* friend.c (do_friend): Don't query TYPE_BEING_DEFINED unless we
know we have a class type.
2008-01-15 Douglas Gregor <doug.gregor@gmail.com>
PR c++/34399
* g++.dg/cpp0x/vt-34399.C: New.
* g++.dg/template/friend50.C: New.
From-SVN: r131552
2008-01-15 Douglas Gregor <doug.gregor@gmail.com>
PR c++/34751
* pt.c (coerce_template_parameter_pack): When substituting into
the type of a non-type template parameter pack. use the
deduced/substituted arguments.
* parser.c (declarator_can_be_parameter_pack): A pointer-to-member
can be a parameter pack with the ellipsis following it. When we
have an erroneous declaration, allow it to be a parameter pack.
(cp_parser_template_parameter): Complain about default
arguments on non-type template parameter packs, and parse them
using the new cp_parser_default_argument.
(cp_parser_parameter_declaration): Complain about parameter packs
with default arguments. Move parsing of default arguments into a
new function, cp_parser_default_argument.
(cp_parser_default_argument): New; extracted from
cp_parser_parameter_declaration.
2008-01-15 Douglas Gregor <doug.gregor@gmail.com>
PR c++/34751
* g++.dg/cpp0x/vt-34751.C: New.
From-SVN: r131548
2008-01-15 Douglas Gregor <doug.gregor@gmail.com>
PR c++/34051
PR c++/34055
PR c++/34102
PR c++/34103
* typeck.c (check_return_expr): If there are bare parameter packs
in the return value, set it to error_mark_node.
* tree.c (cp_walk_subtrees): Walk USING_DECL nodes.
* pt.c (find_parameter_packs_r): Look at the type of
IDENTIFIER_NODEs (e.g., for user-defined conversions).
(check_for_bare_parameter_packs): Flip the result: now returns
TRUE when there were bare parameter packs, FALSE otherwise.
(push_template_decl_real): Deal with flipped result of
check_for_bare_parameter_packs.
* semantics.c (finish_cond): If there are bare parameter packs in
the conditional, set it to error_mark_node.
(finish_expr_stmt): If there are bare parameter packs in the
expression, set it to error_mark_node.
(finish_for_expr): Ditto.
(finish_switch_cond): If there are bare parameter packs in
the conditional, set it to error_mark_node.
(finish_mem_initializers): If there are bare parameter packs in
the member initializer, set it to error_mark_node.
(finish_member_declaration): Check the attributes of the
declaration for bare parameter packs, and remove the attributes if
any have bare parameter packs.
* parser.c (cp_parser_using_declaration): Check the using
declaration for bare parameter packs.
(cp_parser_base_clause): If there are bare parameter packs in a
base specifier, don't add it to the chain.
2008-01-15 Douglas Gregor <doug.gregor@gmail.com>
PR c++/34051
PR c++/34055
PR c++/34102
PR c++/34103
* g++.dg/cpp0x/vt-34051-2.C: New.
* g++.dg/cpp0x/vt-34102.C: New.
* g++.dg/cpp0x/vt-34051.C: New.
* g++.dg/cpp0x/vt-34055.C: New.
* g++.dg/cpp0x/vt-34103.C: New.
From-SVN: r131547
2008-01-15 Douglas Gregor <doug.gregor@gmail.com>
PR c++/34314
* error.c (dump_simple_decl): Display ellipsis for template
non-type parameter packs.
(dump_decl): Display ellipsis for template type parameter packs.
(dump_template_decl): Display ellipsis for template template
parameter packs.
* pt.c (redeclare_class_template): When redeclaring a class
template, check for collisions between template parameters and
template parameter packs.
2008-01-15 Douglas Gregor <doug.gregor@gmail.com>
PR c++/34314
* g++.dg/cpp0x/vt-34314.C: New.
* g++.dg/cpp0x/variadic79.C: Fix the error message to reflect
reality (the error message was wrong previously).
From-SVN: r131546
2008-01-15 Douglas Gregor <doug.gregor@gmail.com>
PR c++/33964
* pt.c (process_partial_specialization): Don't mark template
parameters that occur in non-deduced contexts.
(struct pair_fn_data): Add include_nondeduced_p.
(for_each_template_parm_r): Only visit non-deduced contexts if
include_nondeduced_p is set.
(for_each_template_parm): Added parameter include_nondeduced_p,
which states whether template parameters found in non-deduced
contexts should be visited.
(uses_template_parms): Visit all template parameters, even those
in non-deduced contexts.
2008-01-15 Douglas Gregor <doug.gregor@gmail.com>
PR c++/33964
* g++.dg/cpp0x/vt-33964.C: New.
* g++.dg/template/partial5.C: New.
From-SVN: r131544
2008-01-15 Douglas Gregor <doug.gregor@gmail.com>
PR c++/34052
* pt.c (check_default_tmpl_args): Check for parameter packs that
aren't at the end of a primary template.
(push_template_decl_real): Remove check for parameter packs that
aren't at the end of a primary template; that now happens in
check_default_tmpl_args.
* semantics.c (finish_template_template_parm): Use
check_default_tmpl_args to check for errors in the template
parameter list.
2008-01-15 Douglas Gregor <doug.gregor@gmail.com>
PR c++/34052
* g++.dg/cpp0x/vt-34052.C: New.
* g++.dg/template/ttp26.C: New.
From-SVN: r131543
* decl.c (gnat_to_gnu_entity) <object>: Process renamings
before converting the expression to the type of the object.
* trans.c (maybe_stabilize_reference) <CONSTRUCTOR>: New case.
Stabilize constructors for special wrapping types.
From-SVN: r131531
PR rtl-optimization/31944
* cse.c (remove_pseudo_from_table): New function.
(merge_equiv_classes): Use above function to remove pseudo-registers.
(invalidate): Likewise.
From-SVN: r131522