2014-04-15 Richard Biener <rguenther@suse.de>
* alias.c (ncr_compar): New function.
(nonoverlapping_component_refs_p): Re-implement in O (n log n).
From-SVN: r209413
* gcc-interface/decl.c (gnat_to_gnu_entity) <object>: Create a mere
scalar constant instead of a reference for renaming of scalar literal.
Do not create a new object for constant renaming except for a function
call. Make sure a VAR_DECL is created for the renaming pointer.
* gcc-interface/trans.c (constant_decl_with_initializer_p): New.
(fold_constant_decl_in_expr): New function.
(Identifier_to_gnu): Use constant_decl_with_initializer_p.
For a constant renaming, try to fold a constant DECL in the result.
(lvalue_required_p) <N_Object_Renaming_Declaration>: Always return 1.
(Identifier_to_gnu): Reference the renamed object of constant renaming
pointers directly.
(Case_Statement_to_gnu): Do not re-fold the bounds of integer types.
Assert that the case values are constant.
* gcc-interface/utils.c (invalidate_global_renaming_pointers): Do not
invalidate constant renaming pointers.
Co-Authored-By: Pierre-Marie de Rodat <derodat@adacore.com>
From-SVN: r209411
* gcc-interface/utils.c (type_for_vector_element_p): New predicate.
(build_vector_type_for_size): New function.
(build_vector_type_for_array): Likewise.
(unchecked_convert): Build an intermediate vector type to convert
from a generic array type to a vector type.
(handle_vector_size_attribute): Reimplement.
(handle_vector_type_attribute): Likewise.
From-SVN: r209410
* gcc-interface/decl.c (prepend_one_attribute_pragma): Call
Is_OK_Static_Expression in lieu of Is_Static_Expression to
detect valid arguments.
From-SVN: r209409
2014-04-15 Richard Biener <rguenther@suse.de>
* tree.c (iterative_hash_expr): Use enum tree_code_class
to store TREE_CODE_CLASS.
(tree_block): Likewise.
(tree_set_block): Likewise.
* tree.h (fold_build_pointer_plus_loc): Use
convert_to_ptrofftype_loc.
From-SVN: r209406
PR plugins/59335
* Makefile.in (PLUGIN_HEADERS): Add various headers that have been
added in 4.9.
* Make-lang.h (CP_PLUGIN_HEADERS): Add type-utils.h.
From-SVN: r209404
Since fixuns_trunc<mode>si2 expander checks optimize_insn_for_size_p
before generating *fixuns_trunc<mode>_1, we should use
optimize_insn_for_speed_p in *fixuns_trunc<mode>_1 for consistency.
PR target/60827
* config/i386/i386.md (*fixuns_trunc<mode>_1): Check
optimize_insn_for_speed_p instead of
optimize_function_for_speed_p.
From-SVN: r209383
* include/bits/stl_vector.h (_Vector_base::_Vector_impl,
_Vector_base::_M_allocate): NullablePointer requirements do not
include initialization from literal zero, use value-initialization.
* include/bits/vector.tcc (vector::_M_insert_aux,
vector::_M_explace_back_aux): Likewise for assignment.
From-SVN: r209377
* snames.ads-tmpl (Name_Ivdep): New pragma-related name.
* sem_prag.adb (Analyze_Pragma) <Pragma_Loop_Optimize>: Add support
for Ivdep hint.
* gnat_rm.texi (Implementation Defined Pragmas): Document new Ivdep
hint for Loop_Optimize.
* gnat_ugn.texi (Vectorization of loops): Mention new Ivdep hint.
* gcc-interface/trans.c (Pragma_to_gnu) <Pragma_Loop_Optimize>: Deal
with new Ivdep hint.
* gcc-interface/ada-tree.h (LOOP_STMT_IVDEP): New macro.
* gcc-interface/trans.c (Pragma_to_gnu) <Pragma_Loop_Optimize>: Deal
with new Ivdep hint.
(gnat_gimplify_stmt) <LOOP_STMT>: Propagate the loop hints.
From-SVN: r209375
2014-04-14 Richard Biener <rguenther@suse.de>
PR tree-optimization/60042
* tree-ssa-pre.c (inhibit_phi_insertion): Remove.
(insert_into_preds_of_block): Do not prevent PHI insertion
for REFERENCE exprs here ...
(eliminate_dom_walker::before_dom_children): ... but prevent
their use here under similar conditions when applied to the
IL after PRE optimizations.
From-SVN: r209374
2014-04-14 Richard Biener <rguenther@suse.de>
* tree-ssa-forwprop.c (simplify_gimple_switch): Enhance
check for which sign-changes we allow when forwarding
a converted value into a switch.
* g++.dg/tree-ssa/forwprop-switch.C: New testcase.
From-SVN: r209372
* opt.ads (Suppress_Back_Annotation): Remove as unused.
* fe.h (Back_Annotate_Rep_Info): Likewise.
(Global_Discard_Names): Likewise.
(List_Representation_Info): Declare.
* types.h (Uint_Minus_1): Likewise.
* repinfo.ads: Document back-annotation change.
* gcc-interface/gigi.h (init_gnat_decl): Declare.
(destroy_gnat_decl): Likewise.
* gcc-interface/decl.c (annotate_value): Do not create the cache of
annotated values here but...
<CALL_EXPR>: Only inline the call if -gnatR3 is specified or we are
in ASIS mode.
(init_gnat_decl): ...here instead. New function.
(destroy_gnat_decl): Likewise.
* gcc-interface/trans.c (gigi): Call {init|destroy}_gnat_decl.
* gcc-interface/utils.c (init_gnat_utils): Minor reformatting.
Co-Authored-By: Robert Dewar <dewar@adacore.com>
From-SVN: r209371
* stor-layout.c (place_field): Finalize non-constant offset for the
field, if any.
ada/
* gcc-interface/decl.c (create_field_decl_from): Finalize non-constant
offset for the field, if any.
From-SVN: r209369
2014-04-14 Richard Biener <rguenther@suse.de>
Marc Glisse <marc.glisse@inria.fr>
PR c/60819
c-family/
* c-common.c (convert_vector_to_pointer_for_subscript): Properly
apply may-alias the scalar pointer type when applicable.
* gcc.target/i386/vec-may_alias.c: New testcase.
Co-Authored-By: Marc Glisse <marc.glisse@inria.fr>
From-SVN: r209365
2014-04-14 Richard Biener <rguenther@suse.de>
* tree-switch-conversion.c (lshift_cheap_p): Get speed_p
as argument.
(expand_switch_using_bit_tests_p): Likewise.
(process_switch): Compute and pass on speed_p based on the
switch stmt.
* tree-ssa-math-opts.c (gimple_expand_builtin_pow): Use
optimize_bb_for_speed_p.
From-SVN: r209364
2014-04-14 Richard Biener <rguenther@suse.de>
PR lto/60720
* lto-streamer-out.c (wrap_refs): New function.
(lto_output): Wrap symbol references in global initializes in
type-preserving MEM_REFs.
* gcc.dg/lto/pr60720_0.c: New testcase.
* gcc.dg/lto/pr60720_1.c: Likewise.
From-SVN: r209359
2014-04-14 Richard Biener <rguenther@suse.de>
PR tree-optimization/59817
PR tree-optimization/60453
* graphite-scop-detection.c (graphite_can_represent_scev): Complete
recursion to catch all CHRECs in the scalar evolution and restrict
the predicate for the remains appropriately.
* gfortran.dg/graphite/pr59817.f: New testcase.
* gcc.dg/graphite/pr59817-1.c: Likewise.
* gcc.dg/graphite/pr59817-2.c: Likewise.
From-SVN: r209355
2014-04-13 Paul Thomas <pault@gcc.gnu.org>
PR fortran/58085
PR fortran/60717
* trans.h: Add 'use_offset' bitfield to gfc_se.
* trans-array.c (gfc_conv_expr_descriptor): Use 'use_offset'
as a trigger to unconditionally recalculate the offset for
array slices and constant arrays.
trans-expr.c (gfc_conv_intrinsic_to_class): Use it.
trans-stmt.c (trans_associate_var): Ditto.
(gfc_conv_procedure_call): Ditto.
2014-04-13 Paul Thomas <pault@gcc.gnu.org>
PR fortran/60717
* gfortran.dg/unlimited_polymorphic_17.f90: New test.
PR fortran/58085
* gfortran.dg/associate_15.f90: New test.
From-SVN: r209347
gcc/c-family/
PR middle-end/60467
* cilk.c (cilk_set_spawn_marker): Remove FUNCTION_DECL
as possible argument for Cilk_spawn.
gcc/testsuite/
PR middle-end/60467
* c-c++-common/cilk-plus/CK/invalid_spawns.c: Add new invalid
case to check.
From-SVN: r209337