* combine-stack-adjust.c (maybe_move_args_size_note): Add after
parameter; use it to decide whether to merge two notes.
(combine_stack_adjustments_for_block): Use maybe_move_args_size_note
for the deallocation case as well.
* a-cihase.adb, a-ciorma.adb: Avoid accessibility checks in container
references.
2011-10-06 Matthew Heaney <heaney@adacore.com>
* a-cuprqu.ads, a-cuprqu.adb, a-cbprqu.ads, a-cbprqu.adb
(Dequeue_Only_High_Priority): Protected procedure now implemented.
2011-10-06 Vincent Celier <celier@adacore.com>
* g-trasym.adb: Replace old implementation with the default
implementation that returns list of addresses as "0x...".
* g-trasym.ads: Update the list of platforms with the full
capability. Indicate that there is a default implementation
for other platforms.
* g-trasym-unimplemented.ads, g-trasym-unimplemented.adb: Remove.
* gcc-interface/Makefile.in: Remove g-trasym-unimplemented, as there
is now a default implementation for all platforms without the full
capability.
David S. Miller [Thu, 6 Oct 2011 19:15:39 +0000 (19:15 +0000)]
Correct errors in sparc SImode popcount/clz patterns when 64-bit.
* config/sparc/sparc.md (popcount<mode>2, clz<mode>2): Split up into...
(popcountdi2, popcountsi2, clzdi2, clzsi2): Explicit expanders, in the
SI mode 64-bit code gen case explicitly zero-extend and truncate.
(*popcount<mode>_sp64): Split up into...
(*popcountdi_sp64, *popcountsi_64): Explicit instantiations, and in the
SImode case use truncate.
(*clzsi_sp64): Rewrite to use truncate, and let the expander emit the
subtract so the compiler can optimize it.
(SIDI): Remove unused mode iterator.
Jakub Jelinek [Thu, 6 Oct 2011 17:49:36 +0000 (19:49 +0200)]
re PR tree-optimization/50596 (Problems in vectorization of condition expression)
PR tree-optimization/50596
* tree-vectorizer.h (vect_is_simple_cond): New prototype.
(NUM_PATTERNS): Change to 6.
* tree-vect-patterns.c (vect_recog_mixed_size_cond_pattern): New
function.
(vect_vect_recog_func_ptrs): Add vect_recog_mixed_size_cond_pattern.
(vect_mark_pattern_stmts): Don't create stmt_vinfo for def_stmt
if it already has one, and don't set STMT_VINFO_VECTYPE in it
if it is already set.
* tree-vect-stmts.c (vect_mark_stmts_to_be_vectorized): Handle
COND_EXPR in pattern stmts.
(vect_is_simple_cond): No longer static.
* lib/target-supports.exp (check_effective_target_vect_cond_mixed):
New.
* gcc.dg/vect/vect-cond-8.c: New test.
Jakub Jelinek [Thu, 6 Oct 2011 16:50:23 +0000 (18:50 +0200)]
tree-vect-patterns.c (vect_pattern_recog_1): Use vect_recog_func_ptr typedef for the first argument.
* tree-vect-patterns.c (vect_pattern_recog_1): Use
vect_recog_func_ptr typedef for the first argument.
(vect_pattern_recog): Rename vect_recog_func_ptr variable
to vect_recog_func, use vect_recog_func_ptr typedef for it.
Jakub Jelinek [Thu, 6 Oct 2011 16:38:29 +0000 (18:38 +0200)]
re PR tree-optimization/49279 (Optimization incorrectly presuming constant variable inside loop in g++ 4.5 and 4.6 with -O2 and -O3 for x86_64 targets)
Bernd Schmidt [Thu, 6 Oct 2011 15:59:53 +0000 (15:59 +0000)]
function.c (thread_prologue_and_epilogue_insns): Build a vector of unconverted simple return blocks rather than trying to...
* function.c (thread_prologue_and_epilogue_insns): Build a vector
of unconverted simple return blocks rather than trying to
recompute them later based on bb_flags bitmap tests.
Jakub Jelinek [Thu, 6 Oct 2011 14:36:44 +0000 (16:36 +0200)]
tree-vect-patterns.c (vect_handle_widen_mult_by_const): For lhs don't set SSA_NAME_DEF_STMT that has been already set by...
* tree-vect-patterns.c (vect_handle_widen_mult_by_const): For lhs
don't set SSA_NAME_DEF_STMT that has been already set by
gimple_build_assign_with_ops.
(vect_recog_pow_pattern, vect_recog_widen_sum_pattern,
vect_operation_fits_smaller_type, vect_recog_over_widening_pattern):
Likewise.
Jakub Jelinek [Thu, 6 Oct 2011 14:34:48 +0000 (16:34 +0200)]
tree.h (avoid_folding_inline_builtin): New prototype.
* tree.h (avoid_folding_inline_builtin): New prototype.
* builtins.c (avoid_folding_inline_builtin): No longer static.
* gimple-fold.c (gimple_fold_builtin): Give up if
avoid_folding_inline_builtin returns true.
Ulrich Weigand [Thu, 6 Oct 2011 11:50:26 +0000 (11:50 +0000)]
re PR target/50305 (Inline asm reload failure when building Linux kernel)
gcc/
PR target/50305
* config/arm/arm.c (arm_legitimize_reload_address): Recognize
output of a previous pass through legitimize_reload_address.
Do not attempt to optimize addresses if the base register is
equivalent to a constant.
gcc/testsuite/
PR target/50305
* gcc.target/arm/pr50305.c: New test.
Andreas Krebbel [Thu, 6 Oct 2011 11:44:51 +0000 (11:44 +0000)]
function.c (thread_prologue_and_epilogue_insns): Mark last_bb_active as possibly unused.
2011-10-06 Andreas Krebbel <Andreas.Krebbel@de.ibm.com>
* function.c (thread_prologue_and_epilogue_insns): Mark
last_bb_active as possibly unused. It is unused for targets which
do neither have "return" nor "simple_return" expanders.
* tree-vect-patterns.c (vect_pattern_recog_1): Add stmts_to_replace
argument, truncate it at the beginning instead of allocating there
and freeing at the end.
(vect_pattern_recog): Allocate stmts_to_replace here and free at end,
pass its address to vect_pattern_recog_1.
David S. Miller [Thu, 6 Oct 2011 06:28:35 +0000 (06:28 +0000)]
Add support for lzd and popc instructions on sparc.
gcc/
* config/sparc/sparc.opt (POPC): New option.
* doc/invoke.texi: Document it.
* config/sparc/sparc.c (sparc_option_override): Enable MASK_POPC by
default on Niagara-2 and later.
* config/sparc/sparc.h (CLZ_DEFINED_VALUE_AT_ZERO): Define.
* config/sparc/sparc.md (SIDI): New mode iterator.
(ffsdi2): Delete commented out pattern and comments.
(popcount<mode>2, clz<mode>2): New expanders.
(*popcount<mode>_sp64, popcountsi_v8plus, popcountdi_v8plus,
*clzdi_sp64, clzdi_v8plus, *clzsi_sp64, clzsi_v8plus): New insns.
gcc/testsuite/
* gcc.target/sparc/lzd.c: New test.
* gcc.target/sparc/popc.c: New test.
Jakub Jelinek [Wed, 5 Oct 2011 18:09:56 +0000 (20:09 +0200)]
re PR tree-optimization/50613 (ICE: tree check: expected ssa_name, have addr_expr in find_equal_ptrs, at tree-ssa-strlen.c:712 with -foptimize-strlen -fno-tree-ccp)
PR tree-optimization/50613
* tree-ssa-strlen.c (find_equal_ptrs): If CASE_CONVERT
operand is ADDR_EXPR, fallthru into ADDR_EXPR handling,
and if it is neither that not SSA_NAME, give up.
1: Handle TARGET_XOP.
2: Reduce code duplication.
3: Use ASHIFT instead of MULT for scaling.
4: Fix errors in building convert-to-v16qi indicies.
5: Handle v2di without sse4.1.
Bernd Schmidt [Wed, 5 Oct 2011 17:17:12 +0000 (17:17 +0000)]
re PR bootstrap/50621 (Bootstrap failure)
PR bootstrap/50621
* config/i386/i386.c (ix86_add_cfa_restore_note): Omit notes only
if the function was not shrink-wrapped.
(ix86_expand_epilogue): Ensure queued cfa_adjust notes are attached
to an insn.
* function.c (thread_prologue_and_epilogue_insns): Make sure the
shrink_wrapped flag is set even if there is no dump file.
DJ Delorie [Wed, 5 Oct 2011 15:07:21 +0000 (11:07 -0400)]
rx.opt (mpid): Define.
* config/rx/rx.opt (mpid): Define.
* config/rx/t-rx (MULTILIB_OPTIONS): Add -mpid
(MULTILIB_DIRNAMES): Add pid.
* config/rx/rx.c (rx_gp_base_regnum_val, rx_pid_base_regnum_val)
(rx_num_interrupt_regs): New variable.
(rx_gp_base_regnum): New function. Returns the number of the
small data area register.
(rx_pid_base_regnum): New function. Returns the number of the pid
base register.
(rx_decl_for_addr): New function. Returns the symbolic part of a
MEM.
(rx_pid_data_operand): New function. Returns whether an object is
in the position independent data area.
(rx_legitimize_address): New function. Puts undecided PID
objects in the PID data area.
(rx_is_legitimate_address): Add support for PID operands.
(rx_print_operand_address): Likewise.
(rx_print_operand): Likewise.
(rx_maybe_pidify_operand): New function. Determine if an operand
is suitable for PID addressing.
(rx_gen_move_template): Add PID support.
(rx_conditional_register_usage): Likewise.
(rx_option_override): Initialise rx_num_interrupt_regs.
(rx_is_legitimate_constant): Add support for PID constants.
(TARGET_LEGITIMIZE_ADDRESS): Define.
* config/rx/constraints.md (Rpid): Define.
(Rpda): Define.
* config/rx/rx.md (UNSPEC_PID_ADDR): Define.
(tablejump): Add PID support.
(mov<>): Likewise.
(mov<>_internal): Likewise.
(addsi3): Convert to an expander. Add PID support.
(pid_addr): New pattern.
* config/rx/rx.h (CPP_SPEC): Define.
(ASM_SPEC): Pass -mpid and -mint-register on to assembler.
(CASE_VECTOR_PC_RELATIVE): Define.
(JUMP_TABLES_IN_TEXT_SECTION): Enable for PID mode.
* config/rx/rx-protos.h (rx_maybe_pidify_operand): Prototype.
* doc/invoke.texi (RX Options): Document -mpid command line
option.
Co-Authored-By: Nick Clifton <nickc@redhat.com>
From-SVN: r179558
Bernd Schmidt [Wed, 5 Oct 2011 12:59:23 +0000 (12:59 +0000)]
invoke.texi (-fshrink-wrap): Document.
* doc/invoke.texi (-fshrink-wrap): Document.
* opts.c (default_options_table): Add it.
* common.opt (fshrink-wrap): Add.
* function.c (emit_return_into_block): Remove useless declaration.
(record_hard_reg_uses_1, record_hard_reg_uses, frame_required_for_rtx,
requires_stack_frame_p, gen_return_pattern): New static functions.
(emit_return_into_block): New arg simple_p. All callers changed.
Use gen_return_pattern.
(thread_prologue_and_epilogue_insns): Implement shrink-wrapping.
* config/i386/i386.md (return): Expand into a simple_return.
(simple_return): New expander):
(simple_return_internal, simple_return_internal_long,
simple_return_pop_internal_long, simple_return_indirect_internal):
Renamed from return_internal, return_internal_long,
return_pop_internal_long and return_indirect_internal; changed to use
simple_return.
* config/i386/i386.c (ix86_expand_epilogue): Adjust to expand
simple returns.
(ix86_pad_returns): Likewise.
* function.h (struct rtl_data): Add member shrink_wrapped.
* cfgcleanup.c (outgoing_edges_match): If shrink-wrapped, edges that
are not jumps or sibcalls can't be compared.
gimple-fold.c (gimple_fold_stmt_to_constant_1): For ternary ops with an embedded expression valueize and fold that as well.
2011-10-05 Richard Guenther <rguenther@suse.de>
* gimple-fold.c (gimple_fold_stmt_to_constant_1): For
ternary ops with an embedded expression valueize and fold
that as well.
* tree-ssa-sccvn.c (try_to_simplify): Also allow SSA name
results from gimple_fold_stmt_to_constant_1.
Uros Bizjak [Wed, 5 Oct 2011 08:05:14 +0000 (10:05 +0200)]
i386.c (ix86_emit_binop): New static function.
* config/i386/i386.c (ix86_emit_binop): New static function.
(ix86_split_lea_for_addr): Use ix86_emit_binop to emit add and shl
instructions.
(x86_output_mi_thunk): Use ix86_emit_binop to emit add instructions.
Jakub Jelinek [Tue, 4 Oct 2011 15:25:53 +0000 (17:25 +0200)]
re PR middle-end/50604 (verify_gimple failed: type mismatch in binary expression)
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.
Andi Kleen [Tue, 4 Oct 2011 14:12:37 +0000 (14:12 +0000)]
Maintain order of LTO sections
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.
Jakub Jelinek [Tue, 4 Oct 2011 12:34:06 +0000 (14:34 +0200)]
fold-const.c (fold_unary_loc): Don't optimize POINTER_PLUS_EXPR casted to TYPE_RESTRICT pointer by casting the...
* 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.
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.
* 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.
re PR target/50566 ([avr]: Add support for better logging similar to -mdeb)
PR target/50566
* config/avr/avr-protos.h (avr_legitimize_reload_address): New
prototype.
* config/avr/avr.h (LEGITIMIZE_RELOAD_ADDRESS): Copy worker code
from here...
* config/avr/avr.c (avr_legitimize_reload_address) ...to this new
function. Log if avr_log.legitimize_reload_address.
Ira Rosen [Tue, 4 Oct 2011 07:21:46 +0000 (07:21 +0000)]
* lib/target-supports.exp
(check_effective_target_vect_multiple_sizes):
Make et_vect_multiple_sizes_saved global.
(check_effective_target_vect64): Make et_vect64_saved global.
David S. Miller [Tue, 4 Oct 2011 06:34:22 +0000 (06:34 +0000)]
More consistent access to sparc %ger register.
* 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.
David S. Miller [Mon, 3 Oct 2011 16:41:07 +0000 (16:41 +0000)]
Minor fixups to the sparc bmask/bshuffle patterns.
* 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.