PR tree-optimization/50604
* builtins.c (fold_builtin_strcpy, fold_builtin_stpcpy,
fold_builtin_strncpy, fold_builtin_stxcpy_chk): Ensure
last argument to memcpy has size_type_node type instead of
ssizetype.
* tree-ssa-strlen.c (handle_builtin_memcpy): Use size_type_node
instead of TREE_TYPE (len) as type for newlen.
* gcc.dg/pr50604.c: New test.
From-SVN: r179508
Currently when reading in LTO sections from ld -r files they can
get randomly reordered based on hash tables and random IDs.
This causes reordering later when the final code is generated and
also makes crashes harder to reproduce.
This patch maintains explicit lists based on the input order and uses
those lists to preserve that order when starting the rest of the
LTO passes.
This is the first step to working -fno-toplevel-reorder for
LTO. But this needs more changes because the LTO partitioner
can still reorder.
This add two lists: one for the section and another one for
the file_decl_datas. This is needed because the sections are
walked twice through different data structures.
In addition some code becomes slightly cleaner because we don't need
to pass state through abstract callbacks anymore, but
can just use direct type safe calls.
gcc/lto/:
2011-10-02 Andi Kleen <ak@linux.intel.com>
* lto-object.c (lto_obj_add_section_data): Add list.
(lto_obj_add_section): Fill in list.
(ltoobj_build_section_table): Pass through list.
* lto.c (file_data_list): Declare.
(create_subid_section_table): Pass arguments directly.
Fill in list of file_datas.
(lwstate): Delete.
(lto_create_files_from_ids): Pass in direct arguments.
Don't maintain list.
(lto_file_read): Use explicit section and file data lists.
(lto_read_all_file_options): Pass in section_list.
* lto.h (lto_obj_build_section_table): Add list.
(lto_section_slot): Add next.
(lto_section_list): Declare.
From-SVN: r179505
* fold-const.c (fold_unary_loc): Don't optimize
POINTER_PLUS_EXPR casted to TYPE_RESTRICT pointer by
casting the inner pointer if it isn't TYPE_RESTRICT.
* tree-ssa-forwprop.c (forward_propagate_addr_expr_1): Don't through
casts from non-TYPE_RESTRICT pointer to TYPE_RESTRICT pointer.
* gcc.dg/tree-ssa/restrict-4.c: New test.
From-SVN: r179500
2011-10-04 Artem Shinkarov <artyom.shinkaroff@gmail.com>
* gcc.c-torture/execute/vector-compare-1.c: Fix trailing white
spaces.
(main): Use __typeof to get result type of comparison.
From-SVN: r179497
* lto-streamer.h (lto_input_toplevel_asms): Add order_base parameter.
* lto-streamer-in.c (lto_input_toplevel_asms): Stream in order.
* lto-streamer-out.c (lto_output_toplevel_asms): Stream out order.
* lto-cgraph.c (order_base): New static var.
(lto_output_node): Stream in order.
(lto_output_varpool_node): Stream out order.
(input_node): Stream in order.
(input_varpool_node): Stream out order.
(input_cgraph_1): Initialize order base; update call of
lto_input_toplevel_asms.
From-SVN: r179496
2011-10-04 Andreas Krebbel <Andreas.Krebbel@de.ibm.com>
* longlong.h (smul_ppmm, sdiv_qrnnd): Add underscores to the local
variables. Fix second operand of DR. Swap inputs for sdiv_qrnnd.
From-SVN: r179491
(check_effective_target_vect_multiple_sizes):
Make et_vect_multiple_sizes_saved global.
(check_effective_target_vect64): Make et_vect64_saved global.
From-SVN: r179490
* config/sparc/sparc.md (fpack16_vis, fpackfix_vis, fpack32_vis): Make
GSR_REG an input operand to UNSPEC instead of a parallel USE.
(faligndata<V64I:mode>_vis): Likewise and use DI mode.
(alignaddrsi_vis, alignaddrdi_vis, alignaddrlsi_vis, alignaddrldi_vis):
Reference GSR_REG in DI mode, simplify convoluted expressions by using
zero_extract.
(bshuffle<V64I:mode>_vis): Reference GSR_REG in DI mode.
From-SVN: r179489
* godump.c (go_output_typedef): Support printing enum values that
don't fit in a signed HOST_WIDE_INT.
Co-Authored-By: Ian Lance Taylor <iant@google.com>
From-SVN: r179477
* config/sparc/sparc.md (bmask<P:mode>_vis): Split into explicit 'di'
and 'si' patterns which describe the GSR changes explicitly in the
RTL using zero_extract.
(bshuffle<V64I:mode>_vis): Put the GSR use inside of the unspec.
From-SVN: r179465
* config/sparc/sparc.md (ashlsi3, *ashldi3_sp64): Remove
conditional insn type setting, we always emit a shift.
(*ashlsi3_extend, *lshrsi3_extend0): New patterns.
(*lshrsi3_extend): Rename to *lshrsi3_extend1.
Co-Authored-By: David S. Miller <davem@davemloft.net>
From-SVN: r179441
PR c++/35722
Implement N2555 (expanding pack expansion to fixed parm list)
* pt.c (coerce_template_parms): Allow expanding a pack expansion
to a fixed-length argument list.
(unify_pack_expansion): Handle explicit args properly.
(unify) [TREE_VEC]: Handle pack expansions here.
[TYPE_ARGUMENT_PACK]: Not here.
(tsubst_pack_expansion): Don't try to do partial substitution.
(pack_deducible_p): New.
(fn_type_unification): Use it.
(find_parameter_packs_r): Take the TYPE_MAIN_VARIANT
of a type parameter.
(check_non_deducible_conversion): Split from type_unification_real.
(unify_one_argument): Split from type_unification_real...
(unify_pack_expansion): ...and here. Drop call_args_p parm.
(type_unification_real, unify, more_specialized_fn): Adjust.
From-SVN: r179436
gcc/testsuite/
PR target/50579
* gcc.target/mips/mips.exp (mips_long32_abi_p, mips_long64_abi_p):
New procedures.
(mips-dg-options): Force an ABI option if the current ABI is
incompatible with the required -mlong setting. Likewise force
a long setting if the current one is incompatible with the
chosen ABI. Keep abi_test_option_p, abi and eabi_p updated
throughout procedure.
* gcc.target/mips/abi-o64-long64.c: Require -mno-abicalls
instead of addressing=absolute.
From-SVN: r179433
gcc/
* config/mips/mips.c (mips_frame_barrier): New function.
(mips_expand_prologue): Call it after allocating stack space.
(mips_deallocate_stack): New function.
(mips_expand_epilogue): Call mips_frame_barrier and
mips_deallocate_stack.
gcc/testsuite/
* gcc.target/mips/stack-1.c: New test.
From-SVN: r179432
* ipa-inline-analysis.c (reset_inline_edge_summary): New function.
(reset_inline_summary): New function.
(compute_inline_parameters, inline_node_removal_hook,
inline_edge_removal_hook): Use it.
(inline_free_summary): Reset holders correctly.
(inline_generate_summary): Free summary before computing it.
From-SVN: r179427