2010-11-02 Richard Guenther <rguenther@suse.de>
PR tree-optimization/46216
* tree-ssa-forwprop.c (tree_ssa_forward_propagate_single_use_vars):
Check if we can propagate from a POINTER_PLUS_EXPR before doing so.
* gcc.dg/torture/pr46216.c: New testcase.
From-SVN: r166203
* config/i386/i386-protos.h (struct ix86_first_cycle_multipass_data_):
New type to hold target-specific data for multipass scheduling.
(TARGET_SCHED_FIRST_CYCLE_MULTIPASS_DATA_T): Define.
* config/i386/i386.c (ia32_multipass_dfa_lookahead): Update for
Core 2/i7.
(core2i7_secondary_decoder_max_insn_size,)
(core2i7_secondary_ifetch_block_size, core2i7_ifetch_block_max_insns):
New static variables.
([const_]ix86_first_cycle_multipass_data_t): New typedefs.
([_]ix86_first_cycle_multipass_data): New static variable.
(core2i7_first_cycle_multipass_init, core2i7_dfa_poast_advance_cycle):
Implement targetm.sched hooks.
(core2i7_first_cycle_multipass_filter_ready_try): New static subroutine
of ...
(core2i7_first_cycle_multipass_{begin, issue, backtrack, end, fini}):
Implement new targetm.sched hooks.
(ix86_sched_init_global, TARGET_SCHED_INIT_GLOBAL): Define
targetm.sched hook to install multipass scheduling hooks on demand.
* doc/tm.texi.in: Document new targetm.sched hooks.
* doc/tm.texi: Regenerate.
* haifa-sched.c (TARGET_SCHED_FIRST_CYCLE_MULTIPASS_DATA_T): Define.
(first_cycle_multipass_data_t): New typedef.
(struct choice_entry: target_data): New field.
(max_issue): Add first_cycle_insn_p parameter. Call new target hooks
to allow target model restrictions not represented in DFA.
(choose_ready, schedule_block): Update.
(sched_extend_ready_list, sched_finish_ready_list): Call new target
hooks to initialize target-specific data for multipass scheduling.
* sched-int.h (max_issue): Update declaration.
* sel-sched.c (choose_best_insn): Update.
* target.def (first_cycle_multipass_{begin, issue, backtrack},)
(first_cycle_multipass_{init, fini}): Define and document new
targetm.sched hooks.
From-SVN: r166196
2010-11-02 Paolo Carlini <paolo.carlini@oracle.com>
* include/std/bitset (_Base_bitset<>_Base_bitset(unsigned long long)):
Convert __val to _WordT.
From-SVN: r166195
2010-11-02 Richard Guenther <rguenther@suse.de>
PR tree-optimization/46184
* tree-vect-loop.c (vectorizable_reduction): Try to obtain the
input vector type from the reduction operand as well.
* gcc.dg/pr46184.c: New testcase.
From-SVN: r166194
2010-11-02 Martin Jambor <mjambor@suse.cz>
PR middle-end/46120
* tree.c (get_binfo_at_offset): Bail out on artificial
fields. Identify primary bases according to their offsets.
* testsuite/g++.dg/ipa/ivinline-9.C: New test.
From-SVN: r166192
2010-11-02 Martin Jambor <mjambor@suse.cz>
PR tree-optimization/45875
* gimple-fold.c (get_first_base_binfo_with_virtuals): Removed.
(gimple_get_relevant_ref_binfo): Detect primary bases according to
their field offset.
* testsuite/g++.dg/torture/pr45875.C: New test.
From-SVN: r166190
* config/microblaze/microblaze-protos.h (function_arg): Delete.
(function_arg_advance): Delete.
* config/microblaze/microblaze.h (FUNCTION_ARG_ADVANCE): Delete.
(FUNCTION_ARG): Delete.
* config/microblaze/microblaze.c (function_arg_advance): Rename to...
(microblaze_function_arg_advance): ...this. Make static. Take a
const_tree and a bool.
(function-arg): Rename to...
(microblaze_function_arg): ...this. Make static. Take a const_tree
and a bool.
(microblaze_expand_prologue): Call targetm.calls.function_arg and
targetm.calls.function_arg_advance.
(TARGET_FUNCTION_ARG, TARGET_FUNCTION_ARG_ADVANCE): Define.
From-SVN: r166188
gcc:
Merge from FSF "apple/trunk" branch.
* config/rs6000/darwin.opt (mdynamic-no-pic): move from here ...
* config/darwin.opt: .. to here.
(matt-stubs): New option.
* config/i386/darwin.opt: Delete.
* config/i386/i386.h (MACHOPIC_ATT_STUB): New.
(MACHO_DYNAMIC_NO_PIC_P): New.
(MACHOPIC_INDIRECT): New.
(MACHOPIC_PURE): New.
* config/i386/darwin.h (DARWIN_X86) Define to 1.
(MACHOPIC_ATT_STUB): New.
(CC1_SPEC): Do not remove mdynamic-no-pic.
Move HOT_TEXT_SECTION_NAME: move to config/darwin.h
UNLIKELY_EXECUTED_TEXT_SECTION_NAME: Likewise.
(FUNCTION_PROFILER): Correct over-length line.
(SUBTARGET_OVERRIDE_OPTIONS): New.
(MACHOPIC_NL_SYMBOL_PTR_SECTION): New.
* config/i386/i386.c (config/i386/i386.c): Darwin has no PLT.
(legitimate_constant_p): Handle mdynamic-no-pic.
(ix86_legitimate_address_p): Likewise.
(ix86_legitimize_address): Likewise.
(ix86_expand_move): Likewise.
(machopic_output_stub): Update for ATT-style stubs and
mdynamic-no-pic.
* config/darwin-protos.h (machopic_symbol_defined_p): New.
* config/rs6000/darwin.h (DARWIN_PPC): Define to 1.
TARGET_DYNAMIC_NO_PIC: Remove.
Move HOT_TEXT_SECTION_NAME: move to config/darwin.h
UNLIKELY_EXECUTED_TEXT_SECTION_NAME: Likewise.
* config/rs6000/rs6000.c (darwin_rs6000_override_options):
Remove handling of mdynamic-no-pic.
* config/darwin.c (HAVE_lo_sum, gen_macho_high, gen_macho_low):
Define if required.
(machopic_symbol_defined_p): Do not try to use current_function_decl
when generating _get_pc thunks within stubs.
(machopic_indirect_data_reference): Rework for direct conditionals
rather than #ifdefs, add x86 mdynamic-no-pic
(machopic_legitimize_pic_address): Update to use HAVE_lo_sum with a
defined value.
(darwin_override_options): Handle mdynamic-no-pic here.
* config/darwin-sections.def (machopic_lazy_symbol_ptr2_section): New.
(machopic_lazy_symbol_ptr3_section): New.
(machopic_picsymbol_stub2_section): New.
(machopic_picsymbol_stub3_section): New.
* config/darwin.h (DARWIN_X86, DARWIN_PPC): Define to 0.
(MACHOPIC_NL_SYMBOL_PTR_SECTION): New.
(HOT_TEXT_SECTION_NAME, UNLIKELY_EXECUTED_TEXT_SECTION_NAME):
Moved common definition from x86 and rs6000.
(MACHO_DYNAMIC_NO_PIC_P): Override value.
(MACHOPIC_INDIRECT): Likewise.
(MACHOPIC_PURE): Likewise.
* config.gcc (x86-darwin-*): Remove darwin.opt.
From-SVN: r166184
This patch restores canonical type comparison for dependent types and
then dependent typedefs. After this patch, two template type
parameters T are equal if they have the same index, level, *and*
number of sibling parameters. The novelty is to take in account the
number of sibling parameters.
To do this we first build the template parameters w/o taking in
account their number of siblings. When we know the number of template
parameters we fix up each template parameter with the number of
slibling parameters and we build the appropriate canonical types
accordingly. The patch fixes the fallouts deemed necessary.
This fixes PR c++/45606 but actually fixes all the previous bugs
related to dependent typedef comparison we had since we started to
properly representing dependent typedefs.
gcc/cp/ChangeLog:
PR c++/45606
* cp-tree.h (TEMPLATE_TYPE_PARM_SIBLING_PARMS): Remove.
(struct template_parm_index_s)<num_siblings>: New field.
(TEMPLATE_PARM_NUM_SIBLINGS): New accessor.
(process_template_parm): Extend the API to accept the number of
template parms in argument.
(cp_set_underlying_type): Remove this.
* class.c (build_self_reference): Require canonical type equality
back on the self reference of class.
* decl2.c (grokfield): Require canonical type equality back on
typedef class fields.
* name-lookup.c (pushdecl_maybe_friend): Require canonical type
equality back on typedefs.
* parser.c (cp_parser_template_parameter_list): Do not require
canonical type equality on dependent types created during
template parameters parsing.
* pt.c (fixup_template_type_parm_type, fixup_template_parm_index)
(fixup_template_parm, fixup_template_parms): New private
functions.
(current_template_args): Declare this.
(process_template_parm): Pass the total number of template parms
to canonical_type_parameter.
(build_template_parm_index): Add a new argument to carry the total
number of template parms.
(reduce_template_parm_level, process_template_parm, make_auto): Adjust.
(current_template_args): Fix this for template template
parameters.
(tsubst_template_parm): Split out of ...
(tsubst_template_parms): ... this.
(reduce_template_parm_level): Don't loose
TEMPLATE_PARM_NUM_SIBLINGS when cloning a TEMPLATE_PARM_INDEX.
(template_parm_to_arg): Extracted this function from
current_template_args. Make it represent invalid template parms
with an error_mark_node instead of a LIST_TREE containing an
error_mark_node.
(current_template_args): Use template_parm_to_arg.
(dependent_template_arg_p): Consider an invalid template argument
as dependent.
(end_template_parm_list): Do not update template sibling parms
here anymore. Use fixup_template_parms instead.
(process_template_parm): Pass the number of template parms to
canonical_type_parameter.
(make_auto): Require structural equality on auto
TEMPLATE_TYPE_PARM for now.
(unify)<BOUND_TEMPLATE_TEMPLATE_PARM>: Coerce template parameters
using all the arguments deduced so far.
(tsubst)<TEMPLATE_TYPE_PARM>: Pass the number of sibling parms to
canonical_type_parameter.
* tree.c (cp_set_underlying_type): Remove.
* typeck.c (get_template_parms_of_dependent_type)
(incompatible_dependent_types_p): Remove.
(structural_comptypes): Do not call incompatible_dependent_types_p
anymore.
(comp_template_parms_position): Re-organized. Take the length of
template parms list in account.
gcc/testsuite/ChangeLog:
PR c++/45606
* g++.dg/template/typedef36.C: New test.
* gcc/testsuite/g++.dg/template/canon-type-9.C: Likewise.
* g++.dg/template/canon-type-10.C: Likewise.
* g++.dg/template/canon-type-11.C: Likewise.
* g++.dg/template/canon-type-12.C: Likewise.
* g++.dg/template/canon-type-13.C: Likewise.
From-SVN: r166179
* i386.c (ix86_option_override_internal): Add entry for corei7, use
generic tuning. Use generic32 when compiling for 32-bit ABI.
Co-Authored-By: H.J. Lu <hjl.tools@gmail.com>
Co-Authored-By: Maxim Kuvyrkov <maxim@codesourcery.com>
From-SVN: r166176
gcc:
* config/darwin.c (darwin_asm_named_section): Check for __DWARF
sections and call darwin_asm_dwarf_section() to handle them.
(darwin_asm_dwarf_section): New.
(darwin_file_start): Remove code emitting dwarf section symbols.
testsuite:
* g++.dg/debug/dwarf2/pubnames-1.C: Amend to check for only one instance
of debug_pubnames on darwin.
From-SVN: r166174
* Makefile.in (LIBGCC2_CFLAGS): Add -fno-stack-protector, to
explicitly disable stack protection when building libgcc.
(CRTSTUFF_CFLAGS): Same, for crtbegin/end.
From-SVN: r166173
* decl2.c (decl_constant_var_p): New fn.
(decl_maybe_constant_var_p): New fn.
(mark_used): Rework instantiation of things needed for constant
expressions.
* cp-tree.h: Declare new fns.
* pt.c (instantiate_decl): Handle cp_unevaluated_operand.
(always_instantiate_p): Use decl_maybe_constant_var_p.
(instantiate_decl): Don't defer constexpr functions.
* repo.c (repo_emit_p): Use decl_maybe_constant_var_p.
* semantics.c (finish_id_expression): Use decl_constant_var_p.
Check for valid name in constant expr after mark_used.
From-SVN: r166164
In gcc/c-family/:
2010-11-01 Nicola Pero <nicola.pero@meta-innovation.com>
Implemented format and noreturn attributes for Objective-C methods.
* c-common.c (handle_noreturn_attribute): Recognize 'noreturn'
attribute for Objective-C methods.
In gcc/objc/:
2010-11-01 Nicola Pero <nicola.pero@meta-innovation.com>
Implemented format and noreturn attributes for Objective-C methods.
* objc-act.c (objc_start_method_definition): If method attributes
are specified emit a warning and ignore them.
(build_objc_method_call): Moved deprecation warnings from here ...
(objc_finish_message_expr): to here. Do not emit deprecation
warnings if the receiver is of type 'id'.
(really_start_method): Install 'deprecation' and 'noreturn'
attributes.
(objc_decl_method_attributes): Carefully filter out the list of
attributes, allowing only "noreturn", "format", "sentinel" and
"deprecated". In the case of "format", adjust the arguments.
Always process the attributes in the same way no matter if
"sentinel" is in the list or not.
In gcc/testsuite/:
2010-11-01 Nicola Pero <nicola.pero@meta-innovation.com>
Implemented format and noreturn attributes for Objective-C methods.
* objc.dg/attributes/method-attribute-2.m: Updated warnings.
* objc.dg/attributes/method-deprecated-1.m: New.
* objc.dg/attributes/method-deprecated-2.m: New.
* objc.dg/attributes/method-deprecated-3.m: New.
* objc.dg/attributes/method-noreturn-1.m: New.
* objc.dg/attributes/method-sentinel-1.m: New.
* objc.dg/attributes/method-format-1.m: New.
* obj-c++.dg/attributes/method-attribute-2.mm: Updated warnings.
* obj-c++.dg/attributes/method-deprecated-1.mm: New.
* obj-c++.dg/attributes/method-deprecated-2.mm: New.
* obj-c++.dg/attributes/method-deprecated-3.mm: New.
* obj-c++.dg/attributes/method-noreturn-1.mm: New.
* obj-c++.dg/attributes/method-sentinel-1.mm: New.
* obj-c++.dg/attributes/method-format-1.mm: New.
From-SVN: r166153