PR tree-optimization/46107
* cfgloopmanip.c (loop_version): Set irred_flag back into entry->flags
if cfg_hook_duplicate_loop_to_header_edge failed.
* gcc.c-torture/compile/pr46107.c: New test.
From-SVN: r166234
ChangeLog:
2010-11-03 Ian Lance Taylor <iant@google.com>
Dave Korn <dave.korn.cygwin@gmail.com>
PR lto/46273
* configure.ac: Remove libelf tests. Build lto-plugin on ELF always
and on other supported platforms whenever LTO is enabled.
* configure: Rebuild.
gcc/ChangeLog:
2010-11-03 Ian Lance Taylor <iant@google.com>
PR lto/46273
* gcc/config.gcc: Don't set lto_binary_reader.
* doc/install.texi (Prerequisites): Remove libelf paragraphs.
(Configuration): Mention --disable-lto. Remove --with-libelf
paragraph.
lto-plugin/ChangeLog:
2010-11-03 Dave Korn <dave.korn.cygwin@gmail.com>
PR lto/46273
* lto-plugin.h: Delete.
* lto-plugin-elf.c: Likewise.
* lto-plugin-coff.c: Likewise.
* configure.ac: Don't use libelf, don't source config.gcc.
(LIBELFLIBS): Delete.
(LIBELFINC): Delete.
(LTO_FORMAT): Delete.
(SYM_STYLE): Add AC_DEFINE var, set based on $target.
(config.h): Add AC_CONFIG_HEADERS directive.
* Makefile.am (LIBELFLIBS): Delete.
(LIBELFINC): Delete.
(LTO_FORMAT): Delete.
(DEFS): Import.
(AM_CPPFLAGS): Use it. Don't use LIBELFINC.
(liblto_plugin_la_SOURCES): Don't use LTO_FORMAT, don't include
any object-format-specific source file in the link.
(liblto_plugin_la_LIBADD): Don't use LIBELFLIBS.
* config.h.in: Generate.
* configure: Regenerate.
* Makefile.in: Likewise.
* lto-plugin.c (O_BINARY): Definition moved here from lto-plugin.h.
(LTO_SEGMENT_NAME): New definition.
(LTO_SECTION_PREFIX): Definition moved here from lto-plugin.h.
(LTO_SECTION_PREFIX_LEN): New definition.
(struct sym_aux): Struct definition moved here from lto-plugin.h.
(struct plugin_symtab): Likewise.
(struct plugin_objfile): Likewise.
(struct plugin_objfile): New struct def.
(enum symbol_style): New enum type.
(add_symbols): Make static.
(claimed_files): Likewise.
(num_claimed_files): Likewise.
(sym_style): New global.
(check): Make static.
(parse_table_entry): Likewise. Respect sym_style when extracting
symbol from symtab entry.
(translate): Make static.
(resolve_conflicts): Likewise.
(process_symtab): New function, per-section callback version of
old object-format-specific handling from deleted lto-plugin-elf.c.
(claim_file_handler): Convert ELF-specific version from deleted
lto-plugin-elf.c to simple_object interface and move here.
(process_options): Allow new '-sym-style=' option.
(onload): Don't call deleted onload_format_checks hook.
From-SVN: r166233
PR rtl-optimization/46034
PR rtl-optimization/46212
PR rtl-optimization/46248
* combine.c (try_combine): If added_sets_2 where i0dest_in_i0src
and i0 feeds i1 and i1 feeds i2 or i0 feeds i2, make a copy of i1src
before i0dest -> i0src substitution and pass 1 instead of 0 as last
argument to subst on i2pat.
* gcc.c-torture/compile/pr46034.c: New test.
* gcc.c-torture/compile/pr46248.c: New test.
* gcc.dg/pr46212.c: New test.
From-SVN: r166231
* gcc-interface/gigi.h (add_stmt_force): Declare.
(add_stmt_with_node_force): Likewise.
* gcc-interface/trans.c (Attribute_to_gnu): Don't set TREE_SIDE_EFFECTS
on the SAVE_EXPR built for cached expressions of parameter attributes.
(Subprogram_Body_to_gnu): Force evaluation of the SAVE_EXPR built for
cached expressions of parameter attributes.
(add_stmt_force): New function.
(add_stmt_with_node_force): Likewise.
From-SVN: r166222
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