2008-07-27 Victor Kaplansky <victork@il.ibm.com>
PR tree-optimization/35252
* tree-vect-analyze.c (vect_build_slp_tree): Make IMAGPART_EXPR and
REALPART_EXPR to be considered as same load operation.
testsuite
PR tree-optimization/35252
* gcc.dg/vect/vect-complex-1.c, gcc.dg/vect/vect-complex-2.c,
gcc.dg/vect/fast-math-vect-complex-3.c,
gcc.dg/vect/vect-complex-4.c: New tests.
From-SVN: r138198
PR tree-optimization/36830
* tree-ssa-sccvn.c (vn_reference_op_compute_hash): Hash operand #2.
(expressions_equal_p): Return false if only one operand is null.
From-SVN: r138191
2008-07-27 Paolo Carlini <paolo.carlini@oracle.com>
* decl.c (push_library_fn): Add a parameter for the exceptions that
the function may throw.
(push_void_library_fn, push_throw_library_fn, expand_static_init):
Adjust.
(build_library_fn): Change to static.
* cp-tree.h: Adjust declarations.
* except.c (declare_nothrow_library_fn): New.
(do_get_exception_ptr, do_begin_catch, do_free_exception,
do_allocate_exception): Use the latter, adjust the declarations
(ie, add empty exception-specification), consistently with the
actual implementation in libsupc++.
From-SVN: r138189
* collect2.c (symkind): New enum. Symbol kinds we care about.
(is_ctor_dtor): Return symkind instead of int. Adjust prototype,
code and head comment accordingly.
(scan_prog_file): Use symkind names instead of bare integers.
From-SVN: r138179
* cgraph.c (cgraph_function_possibly_inlined_p): Do not rely on DECL_INLINE.
* cgraphunit.c (record_cdtor_fn): Do not initialize DECL_INLINE
(cgraph_preserve_function_body_p): Do not rely on DECL_INLINE.
* dojump.c (clear_pending_stack_adjust): Likewise.
* print-tree.c (print_node): Ignore DECL_INLINE.
* tree-inline.c (inlinable_function_p): Likewise.
From-SVN: r138165
* typeck.c (inline_conversion): Remove.
(cp_build_function_call): Do not use inline_conversion.
* decl.c (duplicate_decls): Do not insist on inline being declared
early.
(start_cleanup_fn): Do not assume that INLINE flags prevent function
from being output. We now remove static functions always.
(finish_function): Do return warning on all static functions.
* call.c (build_over_call): Do not use inline_conversion.
* cp-tree.h (possibly_inlined_p): Declare.
(inline_conversion): Remove.
* pt.c (instantiate_decl): Use possibly_inlined_p predicate.
* decl2.c (cp_write_global_declarations): Likewise.
(mark_used): Likewise.
(possibly_inlined_p): New functions.
From-SVN: r138150
* config/sh/sh.h (OPTIMIZATION_OPTIONS): Set flag_omit_frame_pointer
to 2 instead of -1.
(OVERRIDE_OPTIONS): Check if flag_omit_frame_pointer is equal
to 2.
From-SVN: r138128
Implement defaulted/deleted functions as per N2346
* cp-tree.h (struct lang_decl_flags): Add defaulted_p bitfield.
(DECL_DELETED_FN): New macro.
(DECL_DEFAULTED_FN): New macro.
* class.c (user_provided_p): New fn.
(defaultable_fn_p): New fn.
(type_has_user_provided_constructor): New fn.
(type_has_user_provided_default_constructor): New fn.
(check_methods): A defaulted fn is still trivial.
(check_bases_and_members): Likewise.
* decl.c (grok_special_member_properties): Likewise.
(duplicate_decls): Complain about redeclaring a function as deleted.
(start_decl): initialized==2 means deleted.
(cp_finish_decl): Handle deleted/defaulted semantics.
* decl2.c (grokfield): Likewise.
(mark_used): Check DECL_DEFAULTED_FN instead of DECL_ARTIFICIAL.
Complain about using a deleted fn.
* init.c (build_value_init_1): Use type_has_user_provided_constructor.
(perform_member_init): Check for a user-provided default constructor
even if TYPE_NEEDS_CONSTRUCTING.
(build_new_1): Likewise.
* call.c (build_over_call): Don't call mark_used twice.
* method.c (implicitly_declare_fn): Set DECL_DEFAULTED_FN.
* search.c (check_final_overrider): Check for deleted mismatch.
* parser.c (cp_parser_init_declarator): Tell start_decl about =delete.
(cp_parser_pure_specifier): Handle =default and =delete.
* error.c (maybe_warn_cpp0x): Suggest -std=gnu++0x as well.
From-SVN: r138123
2008-07-24 Daniel Kraft <d@domob.eu>
PR fortran/33141
* lang.opt (Wnonstd-intrinsics): Removed option.
(Wintrinsics-std), (Wintrinsic-shadow): New options.
* invoke.texi (Option Summary): Removed -Wnonstd-intrinsics
from the list and added -Wintrinsics-std and -Wintrinsic-shadow.
(Error and Warning Options): Documented the new options and removed
the documentation for -Wnonstd-intrinsics.
* gfortran.h (gfc_option_t): New members warn_intrinsic_shadow and
warn_intrinsics_std, removed warn_nonstd_intrinsics.
(gfc_is_intrinsic): Renamed from gfc_intrinsic_name.
(gfc_warn_intrinsic_shadow), (gfc_check_intrinsic_standard): New.
* decl.c (match_procedure_decl): Replaced gfc_intrinsic_name by
the new name gfc_is_intrinsic.
(warn_intrinsic_shadow): New helper method.
(gfc_match_function_decl), (gfc_match_subroutine): Call the new method
warn_intrinsic_shadow to check the just-parsed procedure.
* expr.c (check_init_expr): Call new gfc_is_intrinsic to check whether
the function called is really an intrinsic in the selected standard.
* intrinsic.c (gfc_is_intrinsic): Renamed from gfc_intrinsic_name and
extended to take into account the selected standard settings when trying
to find out whether a symbol is an intrinsic or not.
(gfc_check_intrinsic_standard): Made public and extended.
(gfc_intrinsic_func_interface), (gfc_intrinsic_sub_interface): Removed
the calls to check_intrinsic_standard, this check now happens inside
gfc_is_intrinsic.
(gfc_warn_intrinsic_shadow): New method defined.
* options.c (gfc_init_options): Initialize new warning flags to false
and removed intialization of Wnonstd-intrinsics flag.
(gfc_post_options): Removed logic for Wnonstd-intrinsics flag.
(set_Wall): Set new warning flags and removed Wnonstd-intrinsics flag.
(gfc_handle_option): Handle the new flags and removed handling of the
old Wnonstd-intrinsics flag.
* primary.c (gfc_match_rvalue): Replaced call to gfc_intrinsic_name by
the new name gfc_is_intrinsic.
* resolve.c (resolve_actual_arglist): Ditto.
(resolve_generic_f), (resolve_unknown_f): Ditto.
(is_external_proc): Ditto.
(resolve_generic_s), (resolve_unknown_s): Ditto.
(resolve_symbol): Ditto and ensure for symbols declared INTRINSIC that
they are really available in the selected standard setting.
2008-07-24 Daniel Kraft <d@domob.eu>
PR fortran/33141
* gfortran.dg/intrinsic_shadow_1.f03: New test for -Wintrinsic-shadow.
* gfortran.dg/intrinsic_shadow_2.f03: Ditto.
* gfortran.dg/intrinsic_shadow_3.f03: Ditto.
* gfortran.dg/intrinsic_std_1.f90: New test for -Wintrinsics-std.
* gfortran.dg/intrinsic_std_2.f90: Ditto.
* gfortran.dg/intrinsic_std_3.f90: Ditto.
* gfortran.dg/intrinsic_std_4.f90: Ditto.
* gfortran.dg/warn_std_1.f90: Removed option -Wnonstd-intrinsics.
* gfortran.dg/warn_std_2.f90: Replaced -Wnonstd-intrinsics by
-Wintrinsics-std and adapted expected errors/warnings.
* gfortran.dg/warn_std_3.f90: Ditto.
* gfortran.dg/c_sizeof_2.f90: Adapted expected error/warning message.
* gfortran.dg/gamma_2.f90: Ditto.
* gfortran.dg/selected_char_kind_3.f90: Ditto.
* gfortran.dg/fmt_g0_2.f08: Call with -fall-intrinsics to allow abort.
From-SVN: r138122
2008-07-24 Daniel Kraft <d@domob.eu>
* match.c (gfc_match): Add assertion to catch wrong calls trying to
match upper-case characters.
From-SVN: r138120
2008-07-24 Kai Tietz <kai.tietz@onevision.com>
* config/i386/i386.c (get_dllimport_decl): Treat user_label_prefix for
imp symbol extension.
From-SVN: r138119
2008-07-24 Thomas Koenig <tkoenig@gcc.gnu.org>
PR fortran/29952
* gfortran.h: Add "warn_array_temp" to gfc_option_t.
* lang.opt: Add -Warray-temporaries.
* invoke.texi: Document -Warray-temporaries
* trans-array.h (gfc_trans_create_temp_array): Add argument of
type *locus.
(gfc_conv_loop_setup): Likewise.
* trans-array.c (gfc_trans_create_temp_array): If
-Warray-temporaries is given and locus is present, warn about
creation of array temporaries.
(gfc_trans_array_constructor_subarray): Add locus to call
of gfc_conv_loop_setup.
(gfc_trans_array_constructor): Add where argument. Pass where
argument to call of gfc_trans_create_temp_array.
(gfc_add_loop_ss_code): Add where argument. Pass where argument
to recursive call of gfc_add_loop_ss_code and to call of
gfc_trans_array_constructor.
(gfc_conv_loop_setup): Add where argument. Pass where argument
to calls to gfc_add_loop_ss_code and to gfc_trans_create_temp_array.
(gfc_conv_expr_descriptor): Pass location to call of
gfc_conv_loop_setup.
(gfc_conv_array_parameter): If -Warray-temporaries is given,
warn about creation of temporary arrays.
* trans-expr.c (gfc_conv_subref_array_arg): Add where argument
to call to gfc_conv_loop_setup.
(gfc_conv_function_call): Add where argument to call to
gfc_trans_creat_temp_array.
(gfc_trans_subarray_assign): Likewise.
(gfc_trans_assignment_1): Add where argument to call to
gfc_conv_loop_setup.
* trans-stmt.c (gfc_conv_elemental_dependencies): Add where
argument to call to gfc_trans_create_temp_array.
(gfc_trans_call): Add where argument to call to gfc_conv_loop_setup.
(generate_loop_for_temp_to_lhs): Likewise.
(generate_loop_for_rhs_to_temp): Likewise.
(compute_inner_temp_size): Likewise.
(gfc_trans-pointer_assign_need_temp): Likewise.
(gfc_evaluate_where_mask): Likewise.
(gfc_trans_where_assign): Likewise.
(gfc_trans_where_3): Likewise.
* trans-io.c (transfer_srray_component): Add where argument
to function. Add where argument to call to gfc_conv_loop_setup.
(transfer_expr): Add where argument to call to
transfer_array_component.
(gfc_trans_transfer): Add where expression to call to
gfc_conv_loop_setup.
* trans-intrinsic.c (gfc_conv_intrinsic_anyall): Add
where argument to call to gfc_conv_loop_setup.
(gfc_conv_intrinsic_count): Likewise.
(gfc_conv_intrinsic_arith): Likewise.
(gfc_conv_intrinsic_dot_product): Likewise.
(gfc_conv_intrinsic_minmaxloc): Likewise.
(gfc_conv_intrinsic_minmaxval): Likewise.
(gfc_conv_intrinsic_array_transfer): Warn about
creation of temporary array.
Add where argument to call to gfc_trans_create_temp_array.
* options.c (gfc_init_options): Initialize gfc_option.warn_array_temp.
(gfc_handle_option): Set gfc_option.warn_array_temp.
2008-07-24 Thomas Koenig <tkoenig@gcc.gnu.org>
PR fortran/29952
* gfortran.dg/array_temporaries_1.f90: New test case.
From-SVN: r138112
gcc/
* config/spu/spu-c.c (__vector_keyword): New variable.
(vector_keyword): Likewise.
(spu_categorize_keyword): New function.
(spu_macro_to_expand): Likewise.
(spu_cpu_cpp_builtins): Enable context-sensitive macros if not
compiling an ISO C dialect.
gcc/testsuite/
* gcc.target/spu/vector.c: New test.
* gcc.target/spu/vector-ansi.c: Likewise.
From-SVN: r138106
2008-07-23 Martin Jambor <mjambor@suse.cz>
* ipa-cp.c (ipcp_print_edge_profiles): Test for node->analyzed
rather than for DECL_SAVED_TREE.
* ipa-prop.c: Include diagnostic.h.
(ipa_check_stmt_modifications): Check LHS of GIMPLE_MODIFY_EXPRs
thoroughly.
(ipa_detect_param_modifications): Function rewritten from scratch.
(ipa_compute_jump_functions): Changed accesses to modification flags.
(ipa_free_node_params_substructures): Update flags destruction.
(ipa_node_duplication_hook): Update flags duplication.
(ipa_print_all_params_modified): Updated flag access.
* ipa-prop.h (struct ipa_param_flags): New structure.
(struct ipa_node_params): New field modification_analysis_done,
modified_flags changed into param_flags.
(ipa_is_ith_param_modified): Changed to use new flags.
* Makefile.in (ipa-prop.o): Add $(DIAGNOSTIC_H) to dependencies.
* ipa-prop.c (ipa_print_all_jump_functions): Moved here from
ipa-cp.c and split into two functions.
(ipa_print_node_jump_functions): New function.
(compute_scalar_jump_functions): New function.
(type_like_member_ptr_p): New function.
(compute_pass_through_member_ptrs): New function.
(fill_member_ptr_cst_jump_function): New function.
(determine_cst_member_ptr): New function.
(compute_cst_member_ptr_arguments): New function.
(ipa_compute_jump_functions): Complete rewrite.
* ipa-prop.h (enum jump_func_type): Make explicit that we depend
on IPA_UNKNOWN being zero. Added value IPA_CONST_MEMBER_PTR.
(struct ipa_member_ptr_cst): New structure.
(union jump_func_value): New field member_cst.
* ipa-cp.c (ipcp_lat_is_insertable): New function.
(ipcp_lattice_from_jfunc): Produces bottom lattices for unhandled
jump function types.
(ipcp_print_all_lattices): Slight fprintf rearrangement.
(ipcp_print_all_structures): Call ipa_print_all_jump_functions
instead of ipcp_print_all_jump_functions.
(ipcp_insert_stage): Use ipcp_lat_is_insertable, create replace maps
only for replacable scalars.
* doc/invoke.texi (Optimize options): Add description of
-findirect-inlining.
* common.opt (flag_indirect_inlining): New flag.
* opts.c (decode_options): Set flag_indirect_inlining when
optimize >= 3.
* ipa-inline.c: Include ipa-prop.h.
(inline_indirect_intraprocedural_analysis): New function.
(inline_generate_summary): Allocate parameter and argument info
structures, call inline_indirect_intraprocedural_analysis on each
node when doing indirect inlining and deallocate indirect inlining
data structures in the end.
* ipa-prop.c (ipa_create_param_decls_array): Return if already done.
(free_all_ipa_structures_after_iinln): New function.
(free_all_ipa_structures_after_ipa_cp): Checks whether iinln will be
done.
* Makefile.in (ipa-inline.o): Added $(IPA_PROP_H) to dependencies.
* cgraphbuild.c (compute_call_stmt_bb_frequency): New function.
(build_cgraph_edges): Call compute_call_stmt_bb_frequency instead
of computing the frequency separately.
(rebuild_cgraph_edges): Call compute_call_stmt_bb_frequency instead
of computing the frequency separately.
* ipa-cp.c (ipcp_print_all_structures): Replace a call to
ipa_print_all_param_modified with a call to ipa_print_all_param_flags.
* ipa-prop.c (ipa_get_member_ptr_load_param): New function.
(ipa_get_stmt_member_ptr_load_param): New function.
(ipa_is_ssa_with_stmt_def): New function.
(ipa_note_param_call): New function.
(ipa_analyze_call_uses): New function.
(ipa_analyze_stmt_uses): New function.
(ipa_analyze_params_uses): New function.
(ipa_free_node_params_substructures): Also free the param_calls linked
list.
(ipa_node_duplication_hook): Also duplicate the param_calls linked list.
(ipa_print_node_param_flags): New function.
(ipa_print_all_params_modified): Renamed to ipa_print_all_param_flags.
(ipa_print_all_param_flags): Calls ipa_print_node_param_flags.
* ipa-prop.h (struct ipa_param_flags): New field called.
(struct ipa_param_call_note): New structure.
(struct ipa_node_params): New fields param_calls and
uses_analysis_done.
(ipa_is_ith_param_called): New function.
* ipa-inline.c (inline_indirect_intraprocedural_analysis): Call
ipa_analyze_params_uses and dump parameter flags.
* ipa-inline.c (cgraph_decide_recursive_inlining): Call
ipa_propagate_indirect_call_infos if performing indirect inlining,
pass a new parameter new_edges to it.
(add_new_edges_to_heap): New fucntion.
(cgraph_decide_inlining_of_small_functions): New vector
new_indirect_edges for newly found indirect edges , call
ipa_propagate_indirect_call_infos after inlining.
(cgraph_decide_inlining): Call ipa_propagate_indirect_call_infos after
inlining if performing indirect inlining. Call
free_all_ipa_structures_after_iinln when doing so too.
(inline_generate_summary): Do not call
free_all_ipa_structures_after_iinln here.
* ipa-prop.c (update_jump_functions_after_inlining): New function.
(print_edge_addition_message): New function.
(update_call_notes_after_inlining): New function.
(propagate_info_to_inlined_callees): New function.
(ipa_propagate_indirect_call_infos): New function.
* ipa-prop.h: Include cgraph.h
(struct ipa_param_call_note): Fields reordered, new field processed.
* cgraph.h (cgraph_edge): Shrink loop_nest field to 31 bits, add a new
flag indirect_call.
* cgraphunit.c (verify_cgraph_node): Allow indirect edges not to have
rediscovered call statements.
* cgraph.c (cgraph_create_edge): Initialize indirect_call to zero.
(dump_cgraph_node): Dump also the indirect_call flag.
(cgraph_clone_edge): Copy also the indirect_call flag.
* tree-inline.c (copy_bb): Do not check for fndecls from call
expressions, check for edge availability when moving clones.
(get_indirect_callee_fndecl): New function.
(expand_call_inline): If callee declaration is not apprent from
the statement, try calling get_indirect_callee_fndecl. Do not
issue warnings or call sorry when not inlinings an indirect edge.
* Makefile.in (IPA_PROP_H): Added $(CGRAPH_H) to dependencies.
* ipa-prop.c (ipa_print_node_param_flags): Make the dump format a
bit more frandly to matching.
* testsuite/g++.dg/ipa/iinline-1.C: New testcase.
* testsuite/gcc.dg/ipa/iinline-1.c: New testcase.
* testsuite/gcc.dg/ipa/modif-1.c: New testcase.
From-SVN: r138092
2008-07-23 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
PR 35058
* diagnostic.c (pedwarn): Add opt parameter.
(pedwarn0): New.
* c-tree.h (pedwarn_init): Add opt parameter.
(pedwarn_c90): Likewise.
(pedwarn_c99): Likewise.
* c-errors.c (pedwarn_c99): Likewise.
(pedwarn_c90): Likewise.
* toplev.h (pedwarn): Update declaration.
(pedwarn0): Declare.
* c-lex.c: All calls to pedwarn changed.
* builtins.c: All calls to pedwarn changed.
* toplev.c: All calls to pedwarn changed.
* c-decl.c: All calls to pedwarn changed.
* c-typeck.c: All calls to pedwarn changed.
* c-common.c: All calls to pedwarn changed.
* c-parser.c: All calls to pedwarn changed.
cp/
* typeck.c: All calls to pedwarn changed.
* decl.c: All calls to pedwarn changed.
* call.c: All calls to pedwarn changed.
* error.c: All calls to pedwarn changed.
* typeck2.c: All calls to pedwarn changed.
* pt.c: All calls to pedwarn changed.
* name-lookup.c: All calls to pedwarn changed.
* parser.c: All calls to pedwarn changed.
fortran/
* f95-lang.c (gfc_mark_addressable): All calls to pedwarn changed.
testsuite/
* gcc.dg/Wdeclaration-after-statement-3.c: New.
* gcc/testsuite/gcc.dg/Wpointer-arith.c: New.
From-SVN: r138089