2007-09-10 Ed Schonberg <schonberg@adacore.com>
* sem_aggr.adb (Build_Record_Aggr_Code): If an aggregate component is
given a box association, the type of the component is discriminated,
and the value of the discriminant is the discriminant of the enclosing
type, retrieve its value from the aggregate itself, where it must have
been supplied.
* sem_ch4.adb (Analyze_One_Call): Further refinement to previous fix,
to remove other spurious ambiguities on arithmetic operations involving
literals and addresses, on systems where Address is a visible integer
type, when the operator is called in functional notation.
(Try_Primitive_Operation): Within an instance, a call in prefixed form
is legal when the types match, even if the operation is currently
hidden.
From-SVN: r128337
2007-09-10 Gary Dismukes <dismukes@adacore.com>
Thomas Quinot <quinot@adacore.com>
* exp_ch3.adb (Predef_Spec_Or_Body): When the type is abstract, only
create an abstract subprogram in the case of 'Input. For 'Output we now
create a real spec/body when the type is abstract, since it can
potentially be called.
(Predefined_Primitive_Bodies): Now allow the creation of a predefined
body for 'Output when the type is abstract (only the creation of the
body for 'Input is excluded when the type is abstract).
(Stream_Operation_OK): Add an additional condition in the return
statement, so that False will be returned for TTS_Stream_Input if the
associated tagged type is an abstract extension. Add comments for
return statement.
(Expand_N_Object_Declaration): For the case of a shared passive
variable, insert init proc call only after the shared variable
procedures have been processed, because the IP call needs to undergo
shared passive variable reference expansion, which requires these
procedures to be available (and elaborated).
From-SVN: r128335
2007-09-10 Andreas Krebbel <krebbel1@de.ibm.com>
* config/s390/s390.md ("fixuns_trunc<BFP:mode><GPR:mode>2"):
Change mode macro in the last real_2expN parameter to uppercase.
From-SVN: r128326
2007-09-10 Paul Thomas <pault@gcc.gnu.org>
PR fortran/33370
* trans-expr.c (copyable_array_p): Add tests that expression
is a variable, that it has no subreferences and that it is a
full array.
(gfc_trans_assignment): Change conditions to suit modifications
to copyable_array_p.
2007-09-10 Paul Thomas <pault@gcc.gnu.org>
PR fortran/33370
* gfortran.dg/array_memcpy_5.f90: New test.
From-SVN: r128325
* tree-pass.h (pass_cselim): Declare new pass.
* passes.c (init_optimization_passes): Link in pass_cselim.
* tree-ssa-phiopt.c (tree_ssa_phiopt_worker): Renamed from
tree_ssa_phiopt; add do_store_elim parameter, handle it by calling
cond_store_replacement.
(condstoretemp): New static variable.
(cond_store_replacement): New function.
(tree_ssa_phiopt, tree_ssa_cs_elim): New wrappers around
tree_ssa_phiopt_worker.
(struct name_to_bb): New.
(get_non_trapping, name_to_bb_hash, name_to_bb_eq, add_or_mark_expr,
nt_init_block, nt_fini_block): New static functions.
(seen_ssa_names, nontrap_set): New static variables.
(gate_cselim, pass_cselim): Define new pass.
* common.opt (ftree-cselim): New flag.
* toplev.c (process_options): Set flag_tree_cselim if required.
From-SVN: r128324
2007-09-09 Andreas Tobler <a.tobler@schweiz.org>
PR libgcj/33326
* testsuite/lib/libjava.exp (libjava_arguments): Append the test spec
only for linux targets.
From-SVN: r128302
2007-09-09 Richard Guenther <rguenther@suse.de>
* tree-ssa-operands.c (add_virtual_operand): Only mark
stores as has_volatile_ops if alias information is not available.
* gcc.c-torture/compile/20070906-1.c: New testcase.
From-SVN: r128300
* tree-vectorizer.h (stmt_vinfo_set_inside_of_loop_cost,
stmt_vinfo_set_outside_of_loop_cost): New functions.
* tree-vect-transform.c (vect_get_cost_fields): Remove.
(vect_model_simple_cost): Call
stmt_vinfo_set_inside/outside_of_loop_cost to set the relevant cost
field instead of calling vect_get_cost_fields.
(vect_model_store_cost, vect_model_load_cost): Likewise.
From-SVN: r128294
* tree-vectorizer.h (enum vect_def_type): Start enumeration from 1.
(struct _slp_tree, struct _slp_instance): Define new data structures
along macros for their access.
(struct _loop_vec_info): Define new fields: strided_stores,
slp_instances, and slp_unrolling_factor along macros for their access.
(enum slp_vect_type): New.
(struct _stmt_vec_info): Define new field, slp_type, and macros for its
access.
(STMT_VINFO_STRIDED_ACCESS): New macro.
(vect_free_slp_tree): Declare.
(vectorizable_load): Add an argument of type slp_tree.
(vectorizable_store, vectorizable_operation, vectorizable_conversion,
vectorizable_assignment): Likewise.
(vect_model_simple_cost, vect_model_store_cost, vect_model_load_cost):
Declare (make extern).
* tree-vectorizer.c (new_stmt_vec_info): Initiliaze the new field.
(new_loop_vec_info): Likewise.
(destroy_loop_vec_info): Free memory allocated for SLP structures.
* tree-vect-analyze.c: Include recog.h.
(vect_update_slp_costs_according_to_vf): New.
(vect_analyze_operations): Add argument for calls to vectorizable_ ()
functions. For not pure SLP stmts with strided access check that the
group size is power of 2. Update the vectorization factor according to
SLP. Call vect_update_slp_costs_according_to_vf.
(vect_analyze_group_access): New.
(vect_analyze_data_ref_access): Call vect_analyze_group_access.
(vect_free_slp_tree): New functions.
(vect_get_and_check_slp_defs, vect_build_slp_tree, vect_print_slp_tree,
vect_mark_slp_stmts, vect_analyze_slp_instance, vect_analyze_slp,
vect_make_slp_decision, vect_detect_hybrid_slp_stmts,
vect_detect_hybrid_slp): Likewise.
(vect_analyze_loop): Call vect_analyze_slp, vect_make_slp_decision
and vect_detect_hybrid_slp.
* tree-vect-transform.c (vect_estimate_min_profitable_iters): Take
SLP costs into account.
(vect_get_cost_fields): New function.
(vect_model_simple_cost): Make extern, add SLP parameter and handle
SLP.
(vect_model_store_cost, vect_model_load_cost): Likewise.
(vect_get_constant_vectors): New function.
(vect_get_slp_vect_defs, vect_get_slp_defs,
vect_get_vec_defs_for_stmt_copy, vect_get_vec_defs_for_stmt_copy,
vect_get_vec_defs): Likewise.
(vectorizable_reduction): Don't handle SLP for now.
(vectorizable_call): Don't handle SLP for now. Add argument to
vect_model_simple_cost.
(vectorizable_conversion): Handle SLP (call vect_get_vec_defs to
get SLPed and vectorized defs). Fix indentation and spacing.
(vectorizable_assignment): Handle SLP.
(vectorizable_induction): Don't handle SLP for now.
(vectorizable_operation): Likewise.
(vectorizable_type_demotion): Add argument to
vect_model_simple_cost.
(vectorizable_type_promotion): Likewise.
(vectorizable_store, vectorizable_load): Handle SLP.
(vectorizable_condition): Don't handle SLP for now.
(vect_transform_stmt): Add a new argument for SLP. Check that there is
no SLP transformation required for unsupported cases. Add SLP
argument for supported cases.
(vect_remove_stores): New function.
(vect_schedule_slp_instance, vect_schedule_slp): Likewise.
(vect_transform_loop): Schedule SLP instances.
* Makefile.in: (tree-vect-analyze.o): Depend on recog.h.
From-SVN: r128289
* doc/rtl.texi (Insns): Specify when a label_ref makes a jump_insn.
Similar for what label_refs can go in the JUMP_TARGET field. Split
REG_LABEL documentation into REG_LABEL_TARGET and REG_LABEL_OPERAND.
* reload.c (find_reloads): Generate REG_LABEL_OPERAND, not
REG_LABEL when replacing an operand with a LABEL_REF for a
non-jump insn.
(subst_reloads): When replacing a LABEL_REG with a register,
instead of generating a REG_LABEL note, assert that there already
is one or that the label is a known target for the insn.
* rtlanal.c (computed_jump_p): Instead of looking for a REG_LABEL
note, check the JUMP_LABEL field. Remove "else" after return.
* reorg.c (emit_delay_sequence): Replace case for REG_LABEL with
cases for REG_LABEL_OPERAND and REG_LABEL_TARGET.
(fill_slots_from_thread): Handle both REG_LABEL_OPERAND and
REG_LABEL_TARGET notes, including the JUMP_TARGET field on JUMP_P
insns. Iterate over all notes; don't assume there's only one.
* cse.c (recorded_label_ref): Adjust comment to refer to
REG_LABEL_OPERAND.
(cse_extended_basic_block): Do LABEL_REF check for all INSN_P
insns, not just NONJUMP_INSN_P.
(check_for_label_ref): For JUMP_P insns, check that the LABEL_REF
isn't a jump target.
* jump.c (rebuild_jump_labels): Adjust head comment.
(init_label_info): Ditto. Remove REG_LABEL_OPERAND notes only;
don't reset REG_LABEL_TARGET notes, including the JUMP_LABEL field.
(mark_all_labels): For JUMP_P insns without a target, check if the
the target is noted on the previous nonjump insn.
(mark_jump_label_1): New function, guts from mark_jump_label.
<case IF_THEN_ELSE>: Handle first operand as a non-target when
marking jump target labels.
<case LABEL_REF>: Adjust for whether to generate a
REG_LABEL_TARGET or a REG_LABEL_OPERAND note.
For 'E' format rtl, iterate in descending element order.
(delete_related_insns): Handle both REG_LABEL_TARGET and
REG_LABEL_OPERAND notes. For JUMP_P insns with labels with zero
reference count, delete and fallthrough. Move finding-next-
non-deleted insn last in the function. Look at all INSN_P insns
for REG_LABEL_OPERAND notes.
(redirect_jump_2): Assert that OLABEL equals the old JUMP_LABEL of
JUMP.
* print-rtl.c (print_rtx): For JUMP_P insns and a non-NULL
JUMP_LABEL, output the INSN_UID of it.
* gcse.c: Adjust comments as appropriate to say REG_LABEL_OPERAND
and/or REG_LABEL_TARGET.
(add_label_notes): Only add REG_LABEL_OPERAND notes. Put in line
with jump.c copy by only adding notes for labels actually
referenced in the insn.
* emit-rtl.c (try_split): Don't assume only NONJUMP_INSN_P need
usage count increment; handle all INSN_P trial insns.
(emit_copy_of_insn_after): Change to not copy REG_LABEL_OPERAND
notes.
* rtl.h (struct rtx_def) <volatil>: Adjust to mention
REG_LABEL_TARGET and REG_LABEL_OPERAND.
(LABEL_REF_NONLOCAL_P): Allow REG_LABEL_TARGET and
REG_LABEL_OPERAND.
* combine.c (distribute_notes): Adjust for REG_LABEL_TARGET on
JUMP_P insns and REG_LABEL_OPERAND everywhere.
* sched-rgn.c (is_cfg_nonregular): Check for REG_LABEL_OPERANDS
on all INSN_P insns.
* reg-notes.def (LABEL_TARGET, LABEL_OPERAND): Split from LABEL.
* cfgrtl.c (delete_insn): Adjust to handle REG_LABEL_TARGET and
REG_LABEL_OPERAND notes.
* reload1.c (calculate_needs_all_insns): Adjust comments.
(set_label_offsets): Adjust to look for REG_LABEL_OPERAND notes.
* config/alpha/alpha.md (split for load of an address into a
four-insn sequence on Unicos/Mk): Adjust to use
REG_LABEL_OPERAND.
* config/sh/sh.md (sh_reorg, final_prescan_insn): Ditto.
From-SVN: r128287
Revert:
2007-09-05 Laurynas Biveinis <laurynas.biveinis@gmail.com>
* regrename.c (copyprop_hardreg_forward_1): New variable next. Use
FOR_BB_INSNS_SAFE instead of for loop.
* cse.c (cse_extended_basic_block): Likewise.
* postreload.c (reload_cse_regs_1): New variable next. Make sure
that the for loop does not invoke NEXT_INSN on a deleted insn.
* function.c (instantiate_virtual_regs): Likewise.
* lower-subreg.c (remove_retval_note): Likewise.
(decompose_multiword_subregs): Use FOR_BB_INSNS_SAFE instead of
FOR_BB_INSNS.
* emit-rtl.c (remove_insn): Set NEXT_INSN and PREV_INSN to NULL on
a deleted insn.
* cfgrtl.c (delete_insn): Set JUMP_LABEL to NULL on a deleted
insn, if it's a jump.
(try_redirect_by_replacing_jump): New variable jump_p. Call
tablejump_p before delete_insn_chain.
* reload1.c (reload): New variable next. Make sure that the for
loop does not invoke NEXT_INSN on a deleted insn.
(fixup_eh_region_note): Make the loop terminate if i becomes NULL.
(delete_output_reload): New variable prev. Make sure the the for
loops do not invoke PREV_INSN on a deleted insn.
From-SVN: r128284