PR tree-optimization/44485
* calls.c (flags_from_decl_or_type): For const or pure
noreturn functions return ECF_LOOPING_CONST_OR_PURE|ECF_NORETURN
together with ECF_CONST resp. ECF_PURE.
* builtins.c (expand_builtin): Use flags_from_decl_or_type
instead of querying flags directly.
* tree-ssa-loop-niter.c (finite_loop_p): Likewise.
* tree-ssa-dce.c (find_obviously_necessary_stmts): Likewise.
* gcc.dg/pr44485.c: New test.
From-SVN: r163568
2010-08-26 Richard Guenther <rguenther@suse.de>
PR tree-optimization/45255
* tree.c (decl_address_invariant_p): DECL_DLLIMPORT_P
statics and externals are also invariant.
From-SVN: r163565
PR rtl-optimization/44858
* combine.c (try_combine): If recog_for_combine added CLOBBERs to
newi2pat, make sure they don't affect newpat.
* gcc.c-torture/execute/pr44858.c: New test.
From-SVN: r163552
PR rtl-optimization/45400
* combine.c (simplify_shift_const_1) <case SUBREG>: Only use
SUBREG_REG if both modes are of MODE_INT class.
* g++.dg/other/i386-8.C: New test.
From-SVN: r163551
2010-08-25 Richard Guenther <rguenther@suse.de>
* alias.c (get_alias_set): Assign a single alias-set to
all pointers.
* gimple.c (gimple_get_alias_set): Remove special handling
for pointers.
c-family/
* c-common.c (c_common_get_alias_set): Remove special
handling for pointers.
* gcc.dg/alias-8.c: Adjust.
From-SVN: r163549
* trans-decl.c (gfc_build_intrinsic_function_decls): Set
TREE_NOTHROW on fndecls that can't throw. Set
TREE_READONLY on gfor_fndecl_math_ishftc{4,8,16}.
(gfc_build_builtin_function_decls): Set TREE_NOTHROW on
gfor_fndecl_associated.
From-SVN: r163548
* combine.c (find_split_point): Undo canonicalization of multiply-add
to (minus x (mult)) when it seems likely that this will increase the
chances of a split.
* gcc.target/i386/combine-mul.c: New test.
From-SVN: r163547
2010-08-25 Richard Guenther <rguenther@suse.de>
PR lto/44562
* lto-streamer.c (lto_record_common_node): Do not mess with
TYPE_CANONICAL when not in lto.
* gimple.c (gimple_register_type): Likewise.
* gcc.dg/graphite/id-27.c: New testcase.
* gcc.dg/lto/20100825-1_0.c: Likewise.
From-SVN: r163545
2010-08-25 Richard Guenther <rguenther@suse.de>
PR tree-optimization/45393
* tree-ssa-math-opts.c (execute_cse_sincos_1): Properly transfer
and clean EH info. Avoid SSA update.
(execute_cse_sincos): Cleanup the CFG if it has changed.
* g++.dg/torture/pr45393.C: New testcase.
From-SVN: r163541
PR tree-optimization/45059
* tree-ssa-reassoc.c (eliminate_redundant_comparison): Strip useless
type conversions from newop{1,2}. Assert t is a comparison and
newop{1,2} after the stripping are gimple vals.
* gcc.c-torture/compile/pr45059.c: New test.
From-SVN: r163539
For Tejas Belagod
2010-08-25 Tejas Belagod <tejas.belagod@arm.com>
* lib/target-supports.exp (check_effective_target_vect_unpack):
Set vect_unpack supported flag to true for neon.
* config/arm/iterators.md (VU, SE, V_widen_l): New.
(V_unpack, US): New.
* config/arm/neon.md (vec_unpack<US>_hi_<mode>): Expansion for
vmovl.
(vec_unpack<US>_lo_<mode>): Likewise.
(neon_vec_unpack<US>_hi_<mode>): Instruction pattern for vmovl.
(neon_vec_unpack<US>_lo_<mode>): Likewise.
(vec_widen_<US>mult_lo_<mode>): Expansion for vmull.
(vec_widen_<US>mult_hi_<mode>): Likewise.
(neon_vec_<US>mult_lo_<mode>"): Instruction pattern for vmull.
(neon_vec_<US>mult_hi_<mode>"): Likewise.
(neon_unpack<US>_<mode>): Widening move intermediate step for
vectorizing without -mvectorize-with-neon-quad.
(neon_vec_<US>mult_<mode>): Widening multiply intermediate step
for vectorizing without -mvectorize-with-neon-quad.
* config/arm/predicates.md (vect_par_constant_high): Check for
high-half lanes of a vector.
(vect_par_constant_low): Check for low-half lanes of a vector.
From-SVN: r163538
This patch speeds up the ifcvt_memrefs_wont_trap computation by
caching the results of the computations in the data references ->aux
fields.
* tree-if-conv.c (struct ifc_dr): New.
(IFC_DR): New.
(DR_WRITTEN_AT_LEAST_ONCE): New.
(DR_RW_UNCONDITIONALLY): New.
(memref_read_or_written_unconditionally): Use the cached values
when possible.
(write_memref_written_at_least_once): Same.
(if_convertible_loop_p): Initialize and free DR->aux fields.
From-SVN: r163532
This patch relaxes the checks from gimple_could_trap_p in order to
allow the flag_loop_if_convert_stores to if-convert more loops
in which it is possible to prove that:
- the accesses to an array in a loop do not trap (more than the
original non-if-converted loop). This is true when the memory
accesses are executed at every iteration of the if-converted loop.
- the writes to memory occur on arrays that are not const qualified.
This is true when there exists at least one unconditional write to
the array in the analyzed program. In this patch this analysis is
limited to the loop to be if-converted.
* gimple.c (gimple_could_trap_p_1): Not static anymore.
Pass an extra bool parameter include_mem.
(gimple_could_trap_p): Adjust call to gimple_could_trap_p_1.
(gimple_assign_rhs_could_trap_p): Same.
* gimple.h (gimple_could_trap_p_1): Declared.
* tree-data-ref.h (same_data_refs_base_objects): New.
(same_data_refs): New.
* tree-if-conv.c (memrefs_read_or_written_unconditionally): New.
(write_memrefs_written_at_least_once): New.
(ifcvt_memrefs_wont_trap): New.
(operations_could_trap): New.
(ifcvt_could_trap_p): New.
(if_convertible_gimple_assign_stmt_p): Call ifcvt_could_trap_p.
Gets a vector of data refs.
(if_convertible_stmt_p): Same.
(if_convertible_loop_p_1): New.
(if_convertible_loop_p): Call if_convertible_loop_p_1.
* gcc.dg/tree-ssa/ifc-5.c: New.
From-SVN: r163531
This patch adds a flag that controls the replacement of the memory
writes that are in predicated basic blocks with a full write:
for (...)
if (cond)
A[i] = foo
is replaced with:
for (...)
A[i] = cond ? foo : A[i]
In order to do this, we have to call gimple_could_trap_p instead of
gimple_assign_rhs_could_trap_p, as we have to also check that the LHS
of assign stmts does not trap.
* common.opt (ftree-loop-if-convert-stores): New flag.
* doc/invoke.texi (ftree-loop-if-convert-stores): Documented.
* tree-if-conv.c (ifc_temp_var): Pass an extra parameter GSI. Insert
the created statement before GSI.
(if_convertible_phi_p): Allow virtual phi nodes when
flag_loop_if_convert_stores is set.
(if_convertible_gimple_assign_stmt_p): Allow memory reads and writes
Do not handle types that do not match is_gimple_reg_type.
Remove loop and bb parameters. Call gimple_could_trap_p instead of
when flag_loop_if_convert_stores is set, as LHS can contain
memory refs.
(if_convertible_stmt_p): Remove loop and bb parameters. Update calls
to if_convertible_gimple_assign_stmt_p.
(if_convertible_loop_p): Update call to if_convertible_stmt_p.
(replace_phi_with_cond_gimple_assign_stmt): Renamed
predicate_scalar_phi. Do not handle virtual phi nodes.
(ifconvert_phi_nodes): Renamed predicate_all_scalar_phis.
Call predicate_scalar_phi.
(insert_gimplified_predicates): Insert the gimplified predicate of a BB
just after the labels for flag_loop_if_convert_stores, otherwise
insert the predicate in the end of the BB.
(predicate_mem_writes): New.
(combine_blocks): Call predicate_all_scalar_phis. When
flag_loop_if_convert_stores is set, call predicate_mem_writes.
(tree_if_conversion): Call mark_sym_for_renaming when
flag_loop_if_convert_stores is set.
(main_tree_if_conversion): Return TODO_update_ssa_only_virtuals when
flag_loop_if_convert_stores is set.
* gcc.dg/tree-ssa/ifc-4.c: New.
* gcc.dg/tree-ssa/ifc-7.c: New.
From-SVN: r163530
* tree-flow.h (may_be_nonaddressable_p): New definition. Make the
existing static function global.
*tree-ssa-loop-ivopts.c (may_be_nonaddressable_p): This function
is changed to global.
*tree-ssa-loop-prefetch.c (gather_memory_references_ref): Call
may_be_nonaddressable_p on base, and don't collect this reference
if the address of the base could not be taken.
From-SVN: r163475
2010-08-23 Janus Weil <janus@gcc.gnu.org>
PR fortran/45366
* resolve.c (resolve_procedure_interface): New function split off from
'resolve_symbol'.
(resolve_formal_arglist): Call it here ...
(resolve_symbol): ... and here.
2010-08-23 Janus Weil <janus@gcc.gnu.org>
PR fortran/45366
* gfortran.dg/proc_ptr_29.f90: New.
From-SVN: r163468