2015-11-26 Richard Biener <rguenther@suse.de>
PR tree-optimization/66721
* tree-vect-loop.c (vect_analyze_loop_2): Compute scalar
iteration cost earlier. Re-do analysis without SLP when
vectorization using SLP fails and without has a chance to succeed.
From-SVN: r230956
2015-11-26 Richard Biener <rguenther@suse.de>
* genmatch.c (dt_simplify::gen_1): For generic wrap all
multi-result-use captures in a SAVE_EXPR.
From-SVN: r230955
2015-11-26 Richard Biener <rguenther@suse.de>
PR testsuite/66799
* gcc.dg/vect/pr20122.c (main): Do not align Kernel, do not
vectorize init loop and adjust expected outcome.
From-SVN: r230943
2015-11-26 Richard Biener <rguenther@suse.de>
PR testsuite/67203
* g++.dg/tree-ssa/pr61034.C: Make expected optimization result
dependent on PUSH_ARGS_REVERSED. Drop optimization level and
also monitor final optimization result.
From-SVN: r230940
PR tree-optimization/68128
* tree.h (OMP_CLAUSE_SHARED_READONLY): Define.
* gimplify.c: Include gimple-walk.h.
(enum gimplify_omp_var_data): Add GOVD_WRITTEN.
(omp_notice_variable): Set flags to n->value if n already
exists in target region, but we need to jump to do_outer.
(omp_shared_to_firstprivate_optimizable_decl_p,
omp_mark_stores, omp_find_stores_op, omp_find_stores_stmt): New
functions.
(gimplify_adjust_omp_clauses_1): Set OMP_CLAUSE_SHARED_READONLY
on OMP_CLAUSE_SHARED if it is a scalar non-addressable that is
not modified in the body. Call omp_mark_stores for outer
contexts on OMP_CLAUSE_SHARED clauses if they could be written
in the body or on OMP_CLAUSE_LASTPRIVATE.
(gimplify_adjust_omp_clauses): Add body argument, call
omp_find_stores_{stmt,op} on the body through walk_gimple_seq.
Set OMP_CLAUSE_SHARED_READONLY
on OMP_CLAUSE_SHARED if it is a scalar non-addressable that is
not modified in the body. Call omp_mark_stores for outer
contexts on OMP_CLAUSE_SHARED clauses if they could be written
in the body or on OMP_CLAUSE_LASTPRIVATE or on OMP_CLAUSE_LINEAR
without OMP_CLAUSE_LINEAR_NO_COPYOUT or on OMP_CLAUSE_REDUCTION.
(gimplify_oacc_cache, gimplify_omp_parallel, gimplify_omp_task,
gimplify_omp_for, gimplify_omp_workshare, gimplify_omp_target_update,
gimplify_expr): Adjust gimplify_adjust_omp_clauses callers.
* tree-nested.c (convert_nonlocal_omp_clauses,
convert_local_omp_clauses): Clear OMP_CLAUSE_SHARED_READONLY on
non-local vars or local vars referenced from nested routines.
* omp-low.c (scan_sharing_clauses): For OMP_CLAUSE_SHARED_READONLY
attempt to optimize it into OMP_CLAUSE_FIRSTPRIVATE. Even for
TREE_READONLY, don't call use_pointer_for_field with non-NULL
second argument until we are sure we are keeping OMP_CLAUSE_SHARED.
* gcc.dg/gomp/pr68128-1.c: New test.
* gcc.dg/gomp/pr68128-2.c: New test.
From-SVN: r230932
2015-11-26 Paolo Bonzini <bonzini@gnu.org>
* doc/implement-c.texi (Integers Implementation): Make GCC's promises
about signed left shift stronger and clarify the cases when they're
broken.
From-SVN: r230931
2015-11-26 Kyrylo Tkachov <kyrylo.tkachov@arm.com>
Bernd Schmidt <bschmidt@redhat.com>
PR rtl-optimization/67226
* calls.c (store_one_arg): Take into account
crtl->args.pretend_args_size when checking for overlap between
arg->value and argblock + arg->locate.offset during sibcall
optimization.
* gcc.c-torture/execute/pr67226.c: New test.
Co-Authored-By: Bernd Schmidt <bernds@redhat.com>
From-SVN: r230929
PR c++/68508
* cp-tree.h (cp_ubsan_maybe_instrument_downcast): Add INTYPE argument.
* cp-ubsan.c (cp_ubsan_maybe_instrument_downcast): Likewise. Use
it instead of or in addition to TREE_TYPE (op). Use
is_properly_derived_from, return NULL_TREE if TREE_TYPE (intype) and
TREE_TYPE (type) are the same type minus qualifiers.
* typeck.c (build_static_cast_1): Adjust callers.
* g++.dg/ubsan/pr68508.C: New test.
From-SVN: r230928
gcc/cp
* pt.c (convert_template_argument): Make sure number of tree
operands is greater than zero before attempting to extract one.
gcc/testsuite/
* g++.dg/pr67876.C: New test.
From-SVN: r230924
PR go/61303
runtime: don't overallocate in select code
If we've already allocated an fd_set, don't allocate another one.
Also, don't bother to read from rdwake if it wasn't returned in select.
Fixes https://gcc.gnu.org/PR61303.
Reviewed-on: https://go-review.googlesource.com/17243
From-SVN: r230922
The patch adds close phi nodes to every outer loop exit, and to every loop
guard. For loop guards it computes an initial value that determines where we
stop inserting phi nodes. When the initial value is a constant, the initial
value is considered to be defined in the entry of the code gen region.
Co-Authored-By: Sebastian Pop <s.pop@samsung.com>
From-SVN: r230918
PR c/66516 - missing diagnostic on taking the address of a builtin function
* g++.dg/addr_builtin-1.C: New test (accidentally omitted from
initial commit).
* gcc.dg/addr_builtin-1.c: Same.
From-SVN: r230916
PR lto/67548
* lto-plugin.c (linker_output, linker_output_set): New statics.
(all_symbols_read_handler): Add -flinker-output option.
(onload): Record linker_output info.
* ipa-visibility.c (cgraph_externally_visible_p,
varpool_node::externally_visible_p): When doing incremental linking,
hidden symbols may be still used later.
(update_visibility_by_resolution_info): Do not drop weak during
incremental link.
(function_and_variable_visibility): Fix formating.
* flag-types.h (lto_linker_output): Declare.
* common.opt 9flag_incremental_link): New flag.
* lto-lang.c (lto_post_options): Process flag_lto_linker_output.
* lang.opt (lto_linker_output): New enum.
(flinker_output): New flag.
From-SVN: r230915
* lto-symtab.c: Include alias.h
(warn_type_compatibility_p): Replace types_compatible_p checks by
TBAA and size checks; set bit 2 if locations are TBAA incompatible.
(lto_symtab_merge): Compare DECL sizes.
(lto_symtab_merge_decls_2): Warn about TBAA in compatibility.
* gfortran.dg/lto/bind_c-6_0.f90: New testcase.
* gfortran.dg/lto/bind_c-6_1.c: New testcase.
From-SVN: r230911
2015-11-25 Tom de Vries <tom@codesourcery.com>
* tree-pass.h (make_pass_oacc_kernels, make_pass_oacc_kernels2):
Declare.
* tree-ssa-loop.c (gate_oacc_kernels): New static function.
(pass_data_oacc_kernels, pass_data_oacc_kernels2): New pass_data.
(class pass_oacc_kernels, class pass_oacc_kernels2): New pass.
(make_pass_oacc_kernels, make_pass_oacc_kernels2): New function.
From-SVN: r230906
2015-11-25 Vladimir Makarov <vmakarov@redhat.com>
PR rtl-optimization/67954
* lra-constraints.c (curr_insn_transform): Add check on scratch
pseudo when change class to NO_REGS. Add an assert.
From-SVN: r230894
/cp
2015-11-25 Markus Trippelsdorf <markus@trippelsdorf.de>
Paolo Carlini <paolo.carlini@oracle.com>
PR c++/68087
* constexpr.c (cxx_eval_array_reference): Use tree_fits_shwi_p before
tree_to_shwi to avoid ICEs.
/testsuite
2015-11-25 Markus Trippelsdorf <markus@trippelsdorf.de>
Paolo Carlini <paolo.carlini@oracle.com>
PR c++/68087
* g++.dg/cpp0x/constexpr-array13.C: New.
Co-Authored-By: Paolo Carlini <paolo.carlini@oracle.com>
From-SVN: r230886
2015-11-25 Eric Botcazou <ebotcazou@adacore.com>
* gnatlink.adb (Gnatlink): Do not reinstate -fsjlj for the linker
from the switches saved in the ALI file but from the exception
settings.
2015-11-25 Arnaud Charlet <charlet@adacore.com>
* lib-xref-spark_specific.adb
(Add_SPARK_Scope): Take entry families into account.
* a-exetim.ads, a-exetim-default.ads, a-exetim-mingw.ads (Clock,
Clock_For_Interrupts): preconditions added.
* a-extiin.ads (Clock): preconditions added.
* par-ch3.adb (P_Declarative_Items): In case of misplaced
aspect specifications, ensure that flag Done is properly set to
continue parsing.
From-SVN: r230879
2015-11-25 Arnaud Charlet <charlet@adacore.com>
* exp_util.adb (Remove_Side_Effects): Minimize extra temporaries
and use of 'Reference when needed.
2015-11-25 Doug Rupp <rupp@adacore.com>
* sigtramp-vxworks-target.inc (__x86_64__): Restore context for the
sake of uniformity.
* init.c (__gnat_inum_to_ivec): Add some casting to avoid
warnings when sizeof(long) != sizeof(int)
2015-11-25 Yannick Moy <moy@adacore.com>
* lib-xref-spark_specific.adb (SPARK_Entities): Add entries for
consideration.
(Add_SPARK_Scope): Take tasks into account.
(Detect_And_Add_SPARK_Scope): Take tasks into account.
(Enclosing_Subprogram_Or_Library_Package): Take tasks into account.
From-SVN: r230878
2015-11-25 Bob Duff <duff@adacore.com>
* sem_elab.adb (Check_Internal_Call_Continue): Code clean ups.
2015-11-25 Eric Botcazou <ebotcazou@adacore.com>
* sem_util.ads (Has_Compatible_Alignment): Add Layout_Done
parameter.
* sem_util.adb (Has_Compatible_Alignment): Likewise.
(Has_Compatible_Alignment_Internal): Likewise. Do not set the
result to Unknown for packed types if Layout_Done is true.
* checks.adb (Apply_Address_Clause_Check): Adjust call and
pass False to Has_Compatible_Alignment.
* sem_ch13.adb (Validate_Address_Clauses): Likewise but pass True.
From-SVN: r230877
2015-11-25 Vincent Celier <celier@adacore.com>
* gnatcmd.adb: When <target>-gnat is called with switch -P
and a GPR tool is invoked, invoke the GPR tool with switch
--target=<target>.
2015-11-25 Hristian Kirtchev <kirtchev@adacore.com>
* opt.adb, bcheck.adb: Minor reformatting.
From-SVN: r230876