platform/upstream/gcc.git
7 years agoFix Unwind support on DragonFly BSD after sigtramp move
John Marino [Wed, 19 Jul 2017 15:55:11 +0000 (15:55 +0000)]
Fix Unwind support on DragonFly BSD after sigtramp move

2017-07-19  John Marino  <gnugcc@marino.st>

* config/i386/dragonfly-unwind.h: Handle sigtramp relocation.

From-SVN: r250354

7 years agoFix indentation in std::basic_filebuf member functions
Jonathan Wakely [Wed, 19 Jul 2017 15:46:04 +0000 (16:46 +0100)]
Fix indentation in std::basic_filebuf member functions

* include/bits/fstream.tcc (basic_filebuf::xsgetn)
(basic_filebuf::xsputn, basic_filebuf::seekoff): Fix indentation.

From-SVN: r250353

7 years agoFix assert in gimple_phi_set_arg
Tom de Vries [Wed, 19 Jul 2017 15:33:50 +0000 (15:33 +0000)]
Fix assert in gimple_phi_set_arg

2017-07-19  Tom de Vries  <tom@codesourcery.com>

* gimple.h (gimple_phi_set_arg): Make assert more strict.

From-SVN: r250352

7 years agoFix assert in gimple_phi_arg
Tom de Vries [Wed, 19 Jul 2017 15:33:40 +0000 (15:33 +0000)]
Fix assert in gimple_phi_arg

2017-07-19  Tom de Vries  <tom@codesourcery.com>

* gimple.h (gimple_phi_arg): Make assert more strict.

From-SVN: r250351

7 years agoNow adding the mmintrin.h intrinsic headers. The DG tests will follow.
Steven Munroe [Wed, 19 Jul 2017 15:24:42 +0000 (15:24 +0000)]
Now adding the mmintrin.h intrinsic headers. The DG tests will follow.

2017-07-19  Steven Munroe  <munroesj@gcc.gnu.org>

* config.gcc (powerpc*-*-*): Add mmintrin.h.
* config/rs6000/mmintrin.h: New file.
* config/rs6000/x86intrin.h [__ALTIVEC__]: Include mmintrin.h.

From-SVN: r250350

7 years agoFix indentation in libstdc++ testsuite utils
Jonathan Wakely [Wed, 19 Jul 2017 14:49:00 +0000 (15:49 +0100)]
Fix indentation in libstdc++ testsuite utils

* testsuite/util/testsuite_iterators.h: Fix indentation.

From-SVN: r250349

7 years agoclass.c (add_implicitly_declared_members): Use classtype_has_move_assign_or_move_ctor_p.
Nathan Sidwell [Wed, 19 Jul 2017 13:28:21 +0000 (13:28 +0000)]
class.c (add_implicitly_declared_members): Use classtype_has_move_assign_or_move_ctor_p.

* class.c (add_implicitly_declared_members): Use
classtype_has_move_assign_or_move_ctor_p.
(classtype_has_move_assign_or_move_ctor,
classtype_has_user_move_assign_or_move_ctor_p): Merge into ...
(classtype_has_move_assign_or_move_ctor_p): ... this new function.
* cp-tree.h (classtype_has_user_move_assign_or_move_ctor_p):
Replace with ...
(classtype_has_move_assign_or_move_ctor_p): ... this.
* method.c (maybe_explain_implicit_delete, lazily_declare_fn): Adjust.
* tree.c (type_has_nontrivial_copy_init): Adjust.

From-SVN: r250344

7 years agore PR libquadmath/65757 (gfortran gives incorrect result for anint with real*16 argument)
Jakub Jelinek [Wed, 19 Jul 2017 13:12:58 +0000 (15:12 +0200)]
re PR libquadmath/65757 (gfortran gives incorrect result for anint with real*16 argument)

PR libquadmath/65757
* quadmath-imp.h (math_opt_barrier, math_force_eval,
math_narrow_eval, math_check_force_underflow,
math_check_force_underflow_nonneg): Define.
* math/ceilq.c: Backport changes from upstream glibc
between 2012-11-01 and 2017-07-13.
* math/remquoq.c: Likewise.
* math/expq.c: Likewise.
* math/llroundq.c: Likewise.
* math/logq.c: Likewise.
* math/atanq.c: Likewise.
* math/nearbyintq.c: Likewise.
* math/scalblnq.c: Likewise.
* math/finiteq.c: Likewise.
* math/atanhq.c: Likewise.
* math/expm1q.c: Likewise.
* math/sinhq.c: Likewise.
* math/log10q.c: Likewise.
* math/rintq.c: Likewise.
* math/roundq.c: Likewise.
* math/fmaq.c: Likewise.
* math/erfq.c: Likewise.
* math/log2q.c: Likewise.
* math/lroundq.c: Likewise.
* math/j1q.c: Likewise.
* math/scalbnq.c: Likewise.
* math/truncq.c: Likewise.
* math/frexpq.c: Likewise.
* math/sincosq.c: Likewise.
* math/tanhq.c: Likewise.
* math/asinq.c: Likewise.
* math/coshq.c: Likewise.
* math/j0q.c: Likewise.
* math/asinhq.c: Likewise.
* math/floorq.c: Likewise.
* math/sinq_kernel.c: Likewise.
* math/powq.c: Likewise.
* math/hypotq.c: Likewise.
* math/sincos_table.c: Likewise.
* math/rem_pio2q.c: Likewise.
* math/nextafterq.c: Likewise.
* math/log1pq.c: Likewise.
* math/sincosq_kernel.c: Likewise.
* math/tanq.c: Likewise.
* math/acosq.c: Likewise.
* math/lrintq.c: Likewise.
* math/llrintq.c: Likewise.

From-SVN: r250343

7 years agore PR tree-optimization/81346 (Missed constant propagation into comparison)
Jakub Jelinek [Wed, 19 Jul 2017 13:10:05 +0000 (15:10 +0200)]
re PR tree-optimization/81346 (Missed constant propagation into comparison)

PR tree-optimization/81346
* match.pd: Optimize (X - 1U) <= INT_MAX-1U into (int) X > 0.

* gcc.dg/tree-ssa/pr81346-5.c: New test.

From-SVN: r250342

7 years agoAdd v2di support for nvptx
Tom de Vries [Wed, 19 Jul 2017 13:05:35 +0000 (13:05 +0000)]
Add v2di support for nvptx

2017-07-19  Tom de Vries  <tom@codesourcery.com>

* config/nvptx/nvptx-modes.def: Add V2DImode.
* config/nvptx/nvptx-protos.h (nvptx_data_alignment): Declare.
* config/nvptx/nvptx.c (nvptx_ptx_type_from_mode): Handle V2DImode.
(nvptx_output_mov_insn): Handle lack of mov.b128.
(nvptx_print_operand): Handle 'H' and 'L' codes.
(nvptx_vector_mode_supported): Allow V2DImode.
(nvptx_preferred_simd_mode): New function.
(nvptx_data_alignment): New function.
(TARGET_VECTORIZE_PREFERRED_SIMD_MODE): Redefine to
nvptx_preferred_simd_mode.
* config/nvptx/nvptx.h (STACK_BOUNDARY, BIGGEST_ALIGNMENT): Change from
64 to 128 bits.
(DATA_ALIGNMENT): Define.  Set to nvptx_data_alignment.

* config/nvptx/nvptx.md (VECIM): Add V2DI.

* gcc.target/nvptx/decl-init.c: Update alignment.
* gcc.target/nvptx/slp-2-run.c: New test.
* gcc.target/nvptx/slp-2.c: New test.
* gcc.target/nvptx/v2di.c: New test.

* testsuite/libgomp.oacc-c/vec.c: New test.

From-SVN: r250341

7 years agoAdd v2si support for nvptx
Tom de Vries [Wed, 19 Jul 2017 13:05:21 +0000 (13:05 +0000)]
Add v2si support for nvptx

2017-07-19  Tom de Vries  <tom@codesourcery.com>

* config/nvptx/nvptx-modes.def: New file.  Add V2SImode.
* config/nvptx/nvptx.c (nvptx_ptx_type_from_mode): Handle V2SImode.
(nvptx_vector_mode_supported): New function.  Allow V2SImode.
(TARGET_VECTOR_MODE_SUPPORTED_P): Redefine to nvptx_vector_mode_supported.
* config/nvptx/nvptx.md (VECIM): New mode iterator. Add V2SI.
(mov<VECIM>_insn): New define_insn.
(define_expand "mov<VECIM>): New define_expand.

* gcc.target/nvptx/slp-run.c: New test.
* gcc.target/nvptx/slp.c: New test.
* gcc.target/nvptx/v2si-cvt.c: New test.
* gcc.target/nvptx/v2si-run.c: New test.
* gcc.target/nvptx/v2si.c: New test.
* gcc.target/nvptx/vec.inc: New test.

From-SVN: r250340

7 years agoAdd generic v2 vector mode support for nvptx
Tom de Vries [Wed, 19 Jul 2017 13:05:09 +0000 (13:05 +0000)]
Add generic v2 vector mode support for nvptx

2017-07-19  Tom de Vries  <tom@codesourcery.com>

* config/nvptx/nvptx.c (nvptx_print_operand): Handle v2 vector mode.

From-SVN: r250339

7 years agore PR tree-optimization/81346 (Missed constant propagation into comparison)
Jakub Jelinek [Wed, 19 Jul 2017 12:31:59 +0000 (14:31 +0200)]
re PR tree-optimization/81346 (Missed constant propagation into comparison)

PR tree-optimization/81346
* fold-const.h (fold_div_compare, range_check_type): Declare.
* fold-const.c (range_check_type): New function.
(build_range_check): Use range_check_type.
(fold_div_compare): No longer static, rewritten into
a match.pd helper function.
(fold_comparison): Don't call fold_div_compare here.
* match.pd (X / C1 op C2): New optimization using fold_div_compare
as helper function.

* gcc.dg/tree-ssa/pr81346-1.c: New test.
* gcc.dg/tree-ssa/pr81346-2.c: New test.
* gcc.dg/tree-ssa/pr81346-3.c: New test.
* gcc.dg/tree-ssa/pr81346-4.c: New test.
* gcc.target/i386/umod-3.c: Hide comparison against 1 from the
compiler to avoid X / C1 op C2 optimization to trigger.

From-SVN: r250338

7 years agotree.h (TYPE_MINVAL, [...]): Rename to ...
Nathan Sidwell [Wed, 19 Jul 2017 12:01:18 +0000 (12:01 +0000)]
tree.h (TYPE_MINVAL, [...]): Rename to ...

gcc/
* tree.h (TYPE_MINVAL, TYPE_MAXVAL): Rename to ...
(TYPE_MIN_VALUE_RAW, TYPE_MAX_VALUE_RAW): ... these.
* tree.c (find_decls_types_r, verify_type): Use
TYPE_{MIN,MAX}_VALUE_RAW.
* lto-streamer-out.c (DFS::DFS_write_tree_body): Likewise.
(hash_tree): Likewise.
* tree-streamer-in.c (lto_input_ts_type_non_common_tree_pointers):
Likewise.
* tree-streamer-out.c (write_ts_type_non_common_tree_pointers):
Likewise.

gcc/cp/
* cp-tree.h (PACK_EXPANSION_PARAMETER_PACKS,
PACK_EXPANSION_EXTRA_ARGS): Use TYPE_{MIN,MAX}_VALUE_RAW.

gcc/lto/
* lto.c (mentions_vars_p_type): Use TYPE_{MIN,MAX}_VALUE_RAW.
(compare_tree_sccs_1, lto_fixup_prevailing_decls): Likewise.

gcc/objc/
* objc-act.h (CLASS_NST_METHODS, CLASS_CLS_METHODS): Use
TYPE_{MIN,MAX}_VALUE_RAW.

From-SVN: r250337

7 years agoFix an UBSAN test-case (PR sanitizer/63361).
Martin Liska [Wed, 19 Jul 2017 06:50:34 +0000 (08:50 +0200)]
Fix an UBSAN test-case (PR sanitizer/63361).

2017-07-19  Martin Liska  <mliska@suse.cz>

PR sanitizer/63361
* c-c++-common/ubsan/float-cast-overflow-1.c: Add either
-ffloat-store or -mieee for targets that need it.

From-SVN: r250336

7 years agoHandle equal-argument loop exit phi in expand_omp_for_static_chunk
Tom de Vries [Wed, 19 Jul 2017 06:25:40 +0000 (06:25 +0000)]
Handle equal-argument loop exit phi in expand_omp_for_static_chunk

2017-07-18  Tom de Vries  <tom@codesourcery.com>

PR middle-end/81464
* omp-expand.c (expand_omp_for_static_chunk): Handle equal-argument loop
exit phi.

* gfortran.dg/pr81464.f90: New test.

From-SVN: r250335

7 years agoAdd myself to MAINTAINERS.
Yury Gribov [Wed, 19 Jul 2017 05:25:47 +0000 (05:25 +0000)]
Add myself to MAINTAINERS.

From-SVN: r250334

7 years agoUse dg-require-fileio in new test
Jonathan Wakely [Wed, 19 Jul 2017 00:23:00 +0000 (01:23 +0100)]
Use dg-require-fileio in new test

* testsuite/27_io/basic_filebuf/sgetn/char/81395.cc: Add dg-require.

From-SVN: r250333

7 years agoDaily bump.
GCC Administrator [Wed, 19 Jul 2017 00:16:19 +0000 (00:16 +0000)]
Daily bump.

From-SVN: r250332

7 years agoPR libstdc++/81395 fix crash when write follows large read
Jonathan Wakely [Tue, 18 Jul 2017 23:39:34 +0000 (00:39 +0100)]
PR libstdc++/81395 fix crash when write follows large read

PR libstdc++/81395
* include/bits/fstream.tcc (basic_filebuf::xsgetn): Don't set buffer
pointers for write mode after reading.
* testsuite/27_io/basic_filebuf/sgetn/char/81395.cc: New.

From-SVN: r250328

7 years agocompiler: insert backend type conversion for closure func ptr
Ian Lance Taylor [Tue, 18 Jul 2017 23:29:15 +0000 (23:29 +0000)]
compiler: insert backend type conversion for closure func ptr

    In Func_expression::do_get_backend when creating the backend
    representation for a closure, create a backend type conversion to
    account for potential differences between the closure struct type
    (where the number of fields is dependent on the number of values
    referenced in the closure) and the generic function descriptor type
    (struct with single function pointer field).

    Reviewed-on: https://go-review.googlesource.com/49255

From-SVN: r250327

7 years agore PR go/81451 (missing futex check - libgo/runtime/thread-linux.c:12:0 futex.h:13...
Ian Lance Taylor [Tue, 18 Jul 2017 23:14:29 +0000 (23:14 +0000)]
re PR go/81451 (missing futex check - libgo/runtime/thread-linux.c:12:0 futex.h:13:12: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘long’)

PR go/81451
    runtime: inline runtime_osinit

    We had two identical copies of runtime_osinit. They set runtime_ncpu,
    a variable that is no longer used. Removing that leaves us with two lines.
    Inline those two lines in the two places the function was called.

    This fixes GCC PR 81451.

    Reviewed-on: https://go-review.googlesource.com/48862

From-SVN: r250326

7 years agocompiler: pass correct 'function' flag to circular_pointer_type
Ian Lance Taylor [Tue, 18 Jul 2017 22:31:00 +0000 (22:31 +0000)]
compiler: pass correct 'function' flag to circular_pointer_type

    The code in Named_type::do_get_backend was not passing the correct
    flag value for circular function types to Backend::circular_pointer_type
    (it was always setting this flag to false). Pass a true value if the
    type being converted is a function type.

    Reviewed-on: https://go-review.googlesource.com/49330

From-SVN: r250325

7 years agore PR go/81324 (libgo does not build with glibc 2.18)
Ian Lance Taylor [Tue, 18 Jul 2017 22:06:31 +0000 (22:06 +0000)]
re PR go/81324 (libgo does not build with glibc 2.18)

PR go/81324
    sysinfo.c: ignore ptrace_peeksiginfo_args from <linux/ptrace.h>

    With some versions of glibc and GNU/Linux ptrace_pseeksiginfo_args is
    defined in both <sys/ptrace.h> and <linux/ptrace.h>. We don't actually
    care about the struct, so use a #define to avoid a redefinition error.

    This fixes https://gcc.gnu.org/PR81324.

    Reviewed-on: https://go-review.googlesource.com/49290

From-SVN: r250324

7 years agoupdate my entry in MAINTAINERS
Trevor Saunders [Tue, 18 Jul 2017 21:05:48 +0000 (21:05 +0000)]
update my entry in MAINTAINERS

/:

* MAINTAINERS: Update my email address.

From-SVN: r250321

7 years agostl_list.h (struct _List_node_header): New.
François Dumont [Tue, 18 Jul 2017 20:26:08 +0000 (20:26 +0000)]
stl_list.h (struct _List_node_header): New.

2017-07-18  François Dumont  <fdumont@gcc.gnu.org>

* include/bits/stl_list.h
(struct _List_node_header): New.
(_List_impl()): Fix noexcept qualification.
(_List_impl(_List_impl&&)): New, default.
(_List_base()): Default.
(_List_base(_List_base&&)): Default.
(_List_base::_M_move_nodes): Adapt to use
_List_node_header._M_move_nodes.
(_List_base::_M_init): Likewise.
(list<>()): Default.
(list<>(list&&)): Default.
(list<>::_M_move_assign(list&&, true_type)): Use _M_move_nodes.
(__distance(_List_const_iterator<>, _List_const_iterator<>,
input_iterator_tag)): Adapt.
* testsuite/23_containers/list/allocator/default_init.cc: New.

From-SVN: r250320

7 years agore PR target/81471 (internal compiler error: in curr_insn_transform, at lra-constrain...
Uros Bizjak [Tue, 18 Jul 2017 16:10:20 +0000 (18:10 +0200)]
re PR target/81471 (internal compiler error: in curr_insn_transform, at lra-constraints.c:3495)

PR target/81471
* config/i386/i386.md (rorx_immediate_operand): New mode attribute.
(*bmi2_rorx<mode>3_1): Use rorx_immediate_operand as
operand 2 predicate.
(*bmi2_rorxsi3_1_zext): Use const_0_to_31_operand as
operand 2 predicate.
(ror,rol -> rorx splitters): Use const_int_operand as
operand 2 predicate.

testsuite/ChangeLog:

PR target/81471
* gcc.target/i386/pr81471.c: New test.

From-SVN: r250315

7 years agomklog: Fix extraction of changed file name.
Yury Gribov [Tue, 18 Jul 2017 15:39:39 +0000 (15:39 +0000)]
mklog: Fix extraction of changed file name.

2017-07-17  Yury Gribov  <tetra2005@gmail.com>

* mklog: Fix extraction of changed file name.

From-SVN: r250314

7 years agore PR tree-optimization/81410 (-O3 breaks code)
Richard Biener [Tue, 18 Jul 2017 13:55:47 +0000 (13:55 +0000)]
re PR tree-optimization/81410 (-O3 breaks code)

2017-06-18  Richard Biener  <rguenther@suse.de>

PR tree-optimization/81410
* tree-vect-stmts.c (vectorizable_load): Properly adjust for
the gap in the ! slp_perm SLP case after each group.

* gcc.dg/vect/pr81410.c: New testcase.

From-SVN: r250312

7 years agore PR tree-optimization/81463 (ICE in scale_loop_profile at gcc/cfgloopmanip.c:603)
Jan Hubicka [Tue, 18 Jul 2017 13:51:22 +0000 (15:51 +0200)]
re PR tree-optimization/81463 (ICE in scale_loop_profile at gcc/cfgloopmanip.c:603)

PR middle-end/81463
* cfgloopmanip.c (scale_loop_profile): Watch out for zero frequency
again.

From-SVN: r250311

7 years agore PR tree-optimization/81462 (ICE in estimate_bb_frequencies at gcc/predict.c:3546)
Jan Hubicka [Tue, 18 Jul 2017 13:49:30 +0000 (15:49 +0200)]
re PR tree-optimization/81462 (ICE in estimate_bb_frequencies at gcc/predict.c:3546)

PR middle-end/81462
* predict.c (set_even_probabilities): Cleanup; do not affect
probabilities that are already known.
(combine_predictions_for_bb): Call even when count is set.

* g++.dg/torture/pr81462.C: New testcase.

From-SVN: r250310

7 years agotree-parloops.c (try_transform_to_exit_first_loop_alt): Use TYPE_MAX_VALUE.
Nathan Sidwell [Tue, 18 Jul 2017 13:22:50 +0000 (13:22 +0000)]
tree-parloops.c (try_transform_to_exit_first_loop_alt): Use TYPE_MAX_VALUE.

       gcc/
* tree-parloops.c (try_transform_to_exit_first_loop_alt): Use
TYPE_MAX_VALUE.

       gcc/c-family/
* c-warn.c (warn_for_memset): Use TYPE_{MIN,MAX}_VALUE.

       gcc/c/
* c-parser.c (c_parser_array_notation): Use TYPE_{MIN,MAX}_VALUE.

       gcc/cp/
* cp-array-notation.c (build_array_notation_ref): Use
TYPE_{MIN,MAX}_VALUE.

       gcc/fortran/
* trans.c (gfc_build_array_ref): Use TYPE_MAX_VALUE.

From-SVN: r250309

7 years agogcc: ada: delete old $(P) reference
Mike Frysinger [Tue, 18 Jul 2017 12:38:41 +0000 (12:38 +0000)]
gcc: ada: delete old $(P) reference

The P variable was deleted back in Nov 2015 (svn rev 231062),
but its expansion was missed.  Delete those now too.

From-SVN: r250307

7 years agoclass.c (classtype_has_move_assign_or_move_ctor): Declare.
Nathan Sidwell [Tue, 18 Jul 2017 12:05:12 +0000 (12:05 +0000)]
class.c (classtype_has_move_assign_or_move_ctor): Declare.

* class.c (classtype_has_move_assign_or_move_ctor): Declare.
(add_implicitly_declared_members): Use it.
(type_has_move_constructor, type_has_move_assign): Merge into ...
(classtype_has_move_assign_or_move_ctor): ... this new function.
* cp-tree.h (type_has_move_constructor, type_has_move_assign): Delete.

From-SVN: r250305

7 years agore PR middle-end/81408 (Lots of new -Wunsafe-loop-optimizations warnings with 7 compa...
Bin Cheng [Tue, 18 Jul 2017 11:40:38 +0000 (11:40 +0000)]
re PR middle-end/81408 (Lots of new -Wunsafe-loop-optimizations warnings with 7 compared to 6)

PR target/81408
* tree-ssa-loop-niter.c (number_of_iterations_exit): Dump missed
optimization for loop niter analysis.

gcc/testsuite
* g++.dg/tree-ssa/pr81408.C: New.
* gcc.dg/tree-ssa/pr19210-1.c: Check dump message rather than warning.

From-SVN: r250304

7 years agore PR target/81473 ([avr] build fails due to INT8_MIN and friends.)
Georg-Johann Lay [Tue, 18 Jul 2017 09:36:21 +0000 (09:36 +0000)]
re PR target/81473 ([avr] build fails due to INT8_MIN and friends.)

gcc/
PR target/81473
* config/avr/avr.c (avr_optimize_casesi): Don't use
INT8_MIN, INT8_MAX, UINT8_MAX, INT16_MIN, INT16_MAX, UINT16_MAX.

From-SVN: r250301

7 years agoFix PR81362: Vector peeling
Robin Dapp [Tue, 18 Jul 2017 09:23:35 +0000 (09:23 +0000)]
Fix PR81362: Vector peeling

npeel was erroneously overwritten by vect_peeling_hash_get_lowest_cost
although the corresponding dataref is not used afterwards.  It should
be safe to get rid of the npeel parameter since we use the returned
peeling_info's npeel anyway.  Also removed the body_cost_vec parameter
which is not used elsewhere.

gcc/ChangeLog:

2017-07-18  Robin Dapp  <rdapp@linux.vnet.ibm.com>

* tree-vect-data-refs.c (vect_enhance_data_refs_alignment): Remove
body_cost_vec from _vect_peel_extended_info.
(vect_peeling_hash_get_lowest_cost): Do not set body_cost_vec.
(vect_peeling_hash_choose_best_peeling): Remove body_cost_vec and
npeel.

From-SVN: r250300

7 years ago* config/arm/arm.c (emit_unlikely_jump): Remove unused var.
Bin Cheng [Tue, 18 Jul 2017 08:34:37 +0000 (08:34 +0000)]
* config/arm/arm.c (emit_unlikely_jump): Remove unused var.

From-SVN: r250299

7 years agore PR tree-optimization/80620 (gcc produces wrong code with -O3)
Richard Biener [Tue, 18 Jul 2017 07:35:40 +0000 (07:35 +0000)]
re PR tree-optimization/80620 (gcc produces wrong code with -O3)

2017-07-18  Richard Biener  <rguenther@suse.de>

PR tree-optimization/80620
PR tree-optimization/81403
* tree-ssa-pre.c (phi_translate_1): Clear range and points-to
info when re-using a VN table entry.

* gcc.dg/torture/pr80620.c: New testcase.
* gcc.dg/torture/pr81403.c: Likewise.

From-SVN: r250297

7 years agore PR tree-optimization/81418 (ICE in vect_get_vec_def_for_stmt_copy)
Richard Biener [Tue, 18 Jul 2017 07:26:04 +0000 (07:26 +0000)]
re PR tree-optimization/81418 (ICE in vect_get_vec_def_for_stmt_copy)

2017-06-18  Richard Biener  <rguenther@suse.de>

PR tree-optimization/81418
* tree-vect-loop.c (vectorizable_reduction): Properly compute
vectype_in.  Verify that with lane-reducing reduction operations
we have a single def-use cycle.

* gcc.dg/torture/pr81418.c: New testcase.

From-SVN: r250296

7 years agoRevert commit r249424 2017-06-20 Carl Love <cel@us.ibm.com>
Carl Love [Tue, 18 Jul 2017 03:40:39 +0000 (03:40 +0000)]
Revert commit r249424 2017-06-20 Carl Love <cel@us.ibm.com>

gcc/ChangeLog:

2017-07-17  Carl Love  <cel@us.ibm.com>

Revert commit r249424 2017-06-20  Carl Love  <cel@us.ibm.com>

* config/rs6000/rs6000-c.c (altivec_overloaded_builtins): Add
ALTIVEC_BUILTIN_VMULESW, ALTIVEC_BUILTIN_VMULEUW,
ALTIVEC_BUILTIN_VMULOSW, ALTIVEC_BUILTIN_VMULOUW entries.
* config/rs6000/rs6000.c (rs6000_gimple_fold_builtin,
builtin_function_type): Add ALTIVEC_BUILTIN_* case statements.
* config/rs6000/altivec.md (MVULEUW, VMULESW, VMULOUW,
VMULOSW): New enum "unspec" values.
(vec_widen_umult_even_v4si, vec_widen_smult_even_v4si,
vec_widen_umult_odd_v4si, vec_widen_smult_odd_v4si,
altivec_vmuleuw, altivec_vmulesw, altivec_vmulouw,
altivec_vmulosw): New patterns.
* config/rs6000/rs6000-builtin.def (VMLEUW, VMULESW, VMULOUW,
VMULOSW): Add definitions.

gcc/testsuite/ChangeLog:

2017-07-17  Carl Love  <cel@us.ibm.com>

Revert commit r249572  2017-06-22 Carl Love  <cel@us.ibm.com>
test case changes for commit 249424

* gcc.target/powerpc/builtins-2.c (vmulosh, vmulouh, vmulesh,
vmuleuh): Fix scan-assembler-times should check for word not half word
instructions.

From-SVN: r250295

7 years agoDaily bump.
GCC Administrator [Tue, 18 Jul 2017 00:16:34 +0000 (00:16 +0000)]
Daily bump.

From-SVN: r250294

7 years agoalpha.c: Include predict.h.
Uros Bizjak [Mon, 17 Jul 2017 20:54:31 +0000 (22:54 +0200)]
alpha.c: Include predict.h.

* config/alpha/alpha.c: Include predict.h.

From-SVN: r250290

7 years agore PR tree-optimization/81162 (UBSAN switch triggers incorrect optimization in SLSR)
Bill Schmidt [Mon, 17 Jul 2017 19:12:11 +0000 (19:12 +0000)]
re PR tree-optimization/81162 (UBSAN switch triggers incorrect optimization in SLSR)

2017-07-17  Bill Schmidt  <wschmidt@linux.vnet.ibm.com>

PR tree-optimization/81162
* gcc.dg/pr81162.c: Move this to...
* gcc.dg/ubsan/pr81162.c: ...here.

From-SVN: r250284

7 years agoparser.c (cp_parser_decl_specifier_seq): Add fix-it hints for friend outside class...
Volker Reichelt [Mon, 17 Jul 2017 16:58:00 +0000 (16:58 +0000)]
parser.c (cp_parser_decl_specifier_seq): Add fix-it hints for friend outside class and obsolete auto as...

        * parser.c (cp_parser_decl_specifier_seq): Add fix-it hints for
        friend outside class and obsolete auto as storage-class-specifier.

        * g++.dg/diagnostic/friend1.C: New test.
        * g++.dg/cpp0x/auto1.C: Add check for fix-it hint.

From-SVN: r250282

7 years agoclass.c (maybe_warn_about_overly_private_class): Ignore public copy ctors.
Nathan Sidwell [Mon, 17 Jul 2017 16:52:31 +0000 (16:52 +0000)]
class.c (maybe_warn_about_overly_private_class): Ignore public copy ctors.

* class.c (maybe_warn_about_overly_private_class): Ignore public
copy ctors.

* g++.dg/warn/ctor-dtor-privacy-3.C: New.

From-SVN: r250281

7 years agoclass.c (type_has_user_declared_move_constructor, [...]): Combine into ...
Nathan Sidwell [Mon, 17 Jul 2017 15:57:59 +0000 (15:57 +0000)]
class.c (type_has_user_declared_move_constructor, [...]): Combine into ...

* class.c (type_has_user_declared_move_constructor,
type_has_user_declared_move_assign): Combine into ...
(classtype_has_user_move_assign_or_move_ctor_p): ... this new function.
* cp-tree.h (type_has_user_declared_move_constructor,
type_has_user_declared_move_assign): Combine into ...
(classtype_has_user_move_assign_or_move_ctor_p): ... this. Declare.
* method.c (maybe_explain_implicit_delete): Use it.
(lazily_declare_fn): Use it.
* tree.c (type_has_nontrivial_copy_init): Use it.

From-SVN: r250280

7 years agogcc-dg.exp: Increase expect's match buffer size.
Bernd Edlinger [Mon, 17 Jul 2017 15:54:32 +0000 (15:54 +0000)]
gcc-dg.exp: Increase expect's match buffer size.

2017-07-17  Bernd Edlinger  <bernd.edlinger@hotmail.de>

        * lib/gcc-dg.exp: Increase expect's match buffer size.

From-SVN: r250279

7 years agotree-vrp.c (compare_assert_loc): Fix comparison function to return predictable results.
Yury Gribov [Mon, 17 Jul 2017 14:58:00 +0000 (14:58 +0000)]
tree-vrp.c (compare_assert_loc): Fix comparison function to return predictable results.

2017-07-17  Yury Gribov  <tetra2005@gmail.com>

gcc/
        * tree-vrp.c (compare_assert_loc): Fix comparison function
to return predictable results.

From-SVN: r250278

7 years ago[ARC] Deprecate mexpand-adddi option.
Claudiu Zissulescu [Mon, 17 Jul 2017 12:59:56 +0000 (14:59 +0200)]
[ARC] Deprecate mexpand-adddi option.

Emitting subregs in the expand will result in broken code due to LRA handling of them. Issue observed while turning on mlra and mexpand-adddi options using dejagnu test suite. Deprecate this
option.

gcc/
2017-04-26  Claudiu Zissulescu  <claziss@synopsys.com>

* config/arc/arc.md (adddi3): Remove support for mexpand-adddi
option.
(subdi3): Likewise.
* config/arc/arc.opt (mexpand-adddi): Deprecate it.
* doc/invoke.texi (mexpand-adddi): Update text.

From-SVN: r250276

7 years ago[ARC] [LRA] Avoid emitting COND_EXEC during expand.
Claudiu Zissulescu [Mon, 17 Jul 2017 12:59:45 +0000 (14:59 +0200)]
[ARC] [LRA] Avoid emitting COND_EXEC during expand.

Emmitting COND_EXEC rtxes during expand does introduces errors due to LRA handling of them. Issue discovered while running dejagnu test suit with mlra option on.

gcc/
2017-07-17  Claudiu Zissulescu  <claziss@synopsys.com>

* config/arc/arc.md (clzsi2): Expand to an arc_clzsi2 instruction
that also clobbers the CC register. The old expand code is moved
to ...
(*arc_clzsi2): ... here.
(ctzsi2): Expand to an arc_ctzsi2 instruction that also clobbers
the CC register. The old expand code is moved to ...
(arc_ctzsi2): ... here.

From-SVN: r250275

7 years ago[ARC] Enable indexed loads for elf targers.
Claudiu Zissulescu [Mon, 17 Jul 2017 12:32:02 +0000 (14:32 +0200)]
[ARC] Enable indexed loads for elf targers.

Enable indexed loads only for elf target, as the linux ones need more testing.

gcc/
2017-02-28  Claudiu Zissulescu  <claziss@synopsys.com>

* config/arc/arc.opt (mindexed-loads): Use initial value
TARGET_INDEXED_LOADS_DEFAULT.
(mauto-modify-reg): Use initial value
TARGET_AUTO_MODIFY_REG_DEFAULT.
* config/arc/elf.h (TARGET_INDEXED_LOADS_DEFAULT): Define.
(TARGET_AUTO_MODIFY_REG_DEFAULT): Likewise.
* config/arc/linux.h (TARGET_INDEXED_LOADS_DEFAULT): Define.
(TARGET_AUTO_MODIFY_REG_DEFAULT): Likewise.

From-SVN: r250274

7 years agosemantics.c (classtype_has_nothrow_assign_or_copy_p): Clarify semantics, simplify...
Nathan Sidwell [Mon, 17 Jul 2017 11:54:03 +0000 (11:54 +0000)]
semantics.c (classtype_has_nothrow_assign_or_copy_p): Clarify semantics, simplify implementation.

* semantics.c (classtype_has_nothrow_assign_or_copy_p): Clarify
semantics, simplify implementation.

From-SVN: r250272

7 years agoDo not allow -fgnu-tm w/ -fsanitize={kernel-,}address (PR sanitizer/81302).
Martin Liska [Mon, 17 Jul 2017 11:44:54 +0000 (13:44 +0200)]
Do not allow -fgnu-tm w/ -fsanitize={kernel-,}address (PR sanitizer/81302).

2017-07-17  Martin Liska  <mliska@suse.cz>

PR sanitizer/81302
* opts.c (finish_options): Do not allow -fgnu-tm
w/ -fsanitize={kernel-,}address.  Say sorry.

From-SVN: r250271

7 years agore PR tree-optimization/81369 (ICE in generate_code_for_partition)
Bin Cheng [Mon, 17 Jul 2017 11:40:54 +0000 (11:40 +0000)]
re PR tree-optimization/81369 (ICE in generate_code_for_partition)

PR target/81369
* tree-loop-distribution.c (classify_partition): Only assert on
numer of iterations.
(merge_dep_scc_partitions): Delete prameter.  Update function call.
(distribute_loop): Remove code handling loop with unknown niters.
(pass_loop_distribution::execute): Skip loop with unknown niters.

From-SVN: r250270

7 years agore PR tree-optimization/81369 (ICE in generate_code_for_partition)
Bin Cheng [Mon, 17 Jul 2017 11:38:15 +0000 (11:38 +0000)]
re PR tree-optimization/81369 (ICE in generate_code_for_partition)

PR target/81369
* tree-loop-distribution.c (merge_dep_scc_partitions): Sink call to
function sort_partitions_by_post_order.

gcc/testsuite
* gcc.dg/tree-ssa/pr81369.c: New.

From-SVN: r250269

7 years agore PR tree-optimization/81374 (ICE in bb_top_order_cmp, at tree-loop-distribution...
Bin Cheng [Mon, 17 Jul 2017 11:34:30 +0000 (11:34 +0000)]
re PR tree-optimization/81374 (ICE in bb_top_order_cmp, at tree-loop-distribution.c:391)

PR tree-optimization/81374
* tree-loop-distribution.c (pass_loop_distribution::execute): Record
the max index of basic blocks, rather than number of basic blocks.

From-SVN: r250268

7 years ago[ARC] Consolidate PIC implementation.
Claudiu Zissulescu [Mon, 17 Jul 2017 11:04:37 +0000 (13:04 +0200)]
[ARC] Consolidate PIC implementation.

This patch refactors a number of functions and compiler hooks into using a
single function which checks if a rtx is suited for pic or not. Removed
functions are arc_legitimate_pc_offset_p and arc_legitimate_pic_operand_p
beeing replaced by calls to arc_legitimate_pic_addr_p. Thus we have an
unitary way of checking a rtx beeing pic.

gcc/
2017-07-17  Claudiu Zissulescu  <claziss@synopsys.com>

* config/arc/arc-protos.h (arc_legitimate_pc_offset_p): Remove
proto.
(arc_legitimate_pic_operand_p): Likewise.
* config/arc/arc.c (arc_legitimate_pic_operand_p): Remove
function.
(arc_needs_pcl_p): Likewise.
(arc_legitimate_pc_offset_p): Likewise.
(arc_legitimate_pic_addr_p): Remove LABEL_REF case, as this
function is also used in constrains.md.
(arc_legitimate_constant_p): Use arc_legitimate_pic_addr_p to
validate pic constants. Handle CONST_INT, CONST_DOUBLE, MINUS and
PLUS.  Only return true/false in known cases, otherwise assert.
(arc_legitimate_address_p): Remove arc_legitimate_pic_addr_p as it
is already called in arc_legitimate_constant_p.
* config/arc/arc.h (CONSTANT_ADDRESS_P): Consider also LABEL for
pic addresses.
(LEGITIMATE_PIC_OPERAND_P): Use
arc_raw_symbolic_reference_mentioned_p function.
* config/arc/constraints.md (Cpc): Use arc_legitimate_pic_addr_p
function.
(Cal): Likewise.
(C32): Likewise.

gcc/testsuite
2017-07-17  Claudiu Zissulescu  <claziss@synopsys.com>

* gcc.target/arc/pr9000674901.c: New file.
* gcc.target/arc/pic-1.c: Likewise.
* gcc.target/arc/pr9001191897.c: Likewise.

From-SVN: r250267

7 years ago[PATCH] [ARC] Add support for naked functions.
Claudiu Zissulescu [Mon, 17 Jul 2017 10:46:55 +0000 (12:46 +0200)]
[PATCH] [ARC] Add support for naked functions.

gcc/
2017-07-17  Claudiu Zissulescu  <claziss@synopsys.com>
            Andrew Burgess  <andrew.burgess@embecosm.com>

        * config/arc/arc-protos.h (arc_compute_function_type): Change prototype.
        (arc_return_address_register): New function.
        * config/arc/arc.c (arc_handle_fndecl_attribute): New function.
        (arc_handle_fndecl_attribute): Add naked attribute.
        (TARGET_ALLOCATE_STACK_SLOTS_FOR_ARGS): Define.
        (TARGET_WARN_FUNC_RETURN): Likewise.
        (arc_allocate_stack_slots_for_args): New function.
        (arc_warn_func_return): Likewise.
        (machine_function): Change type fn_type.
        (arc_compute_function_type): Consider new naked function type,
        change function return type.
        (arc_must_save_register): Adapt to handle new
        arc_compute_function_type's return type.
        (arc_expand_prologue): Likewise.
        (arc_expand_epilogue): Likewise.
        (arc_return_address_regs): Delete.
        (arc_return_address_register): New function.
        (arc_epilogue_uses): Use above function.
        * config/arc/arc.h (arc_return_address_regs): Delete prototype.
        (arc_function_type): Change encoding, add naked type.
        (ARC_INTERRUPT_P): Change to handle the new encoding.
        (ARC_FAST_INTERRUPT_P): Likewise.
        (ARC_NORMAL_P): Define.
        (ARC_NAKED_P): Likewise.
        (arc_compute_function_type): Delete prototype.
        * config/arc/arc.md (in_ret_delay_slot): Use
        arc_return_address_register function.
        (simple_return): Likewise.
        (p_return_i): Likewise.

gcc/testsuite
2017-07-17  Claudiu Zissulescu  <claziss@synopsys.com>
            Andrew Burgess  <andrew.burgess@embecosm.com>

        * gcc.target/arc/naked-1.c: New file.
        * gcc.target/arc/naked-2.c: Likewise.

Co-Authored-By: Andrew Burgess <andrew.burgess@embecosm.com>
From-SVN: r250266

7 years agore PR tree-optimization/81428 (ICE: in build_one_cst, at tree.c:2079 with -O2. Fixed...
Jakub Jelinek [Mon, 17 Jul 2017 10:20:41 +0000 (12:20 +0200)]
re PR tree-optimization/81428 (ICE: in build_one_cst, at tree.c:2079 with -O2. Fixed point division.)

PR tree-optimization/81428
* match.pd (X / X -> one): Don't optimize _Fract divisions, as 1
can't be built for those types.

* gcc.dg/fixed-point/pr81428.c: New test.

From-SVN: r250265

7 years agoRemove stuff dead since r239246.
Georg-Johann Lay [Mon, 17 Jul 2017 09:32:42 +0000 (09:32 +0000)]
Remove stuff dead since r239246.

* config/avr/avr-arch.h (avr_inform_devices): Remove dead proto.
* config/avr/avr-devices.c (mcu_name, comparator, avr_mcus_str)
(avr_inform_devices): Remove dead stuff.

From-SVN: r250264

7 years agogcc_update (files_and_dependencies): Remove dead entry.
Georg-Johann Lay [Mon, 17 Jul 2017 09:13:36 +0000 (09:13 +0000)]
gcc_update (files_and_dependencies): Remove dead entry.

* gcc_update (files_and_dependencies)
[gcc/config/avr/avr-tables.opt]: Remove dead entry.

From-SVN: r250263

7 years agoarm_neon.h: Fix softp typo.
Tamar Christina [Mon, 17 Jul 2017 09:12:57 +0000 (09:12 +0000)]
arm_neon.h: Fix softp typo.

2017-07-17  Tamar Christina  <tamar.christina@arm.com>

* config/arm/arm_neon.h: Fix softp typo.

From-SVN: r250262

7 years agore PR tree-optimization/81365 (GCC miscompiles swap)
Jakub Jelinek [Mon, 17 Jul 2017 09:10:23 +0000 (11:10 +0200)]
re PR tree-optimization/81365 (GCC miscompiles swap)

PR tree-optimization/81365
* tree-ssa-phiprop.c (propagate_with_phi): When considering hoisting
aggregate moves onto bb predecessor edges, make sure there are no
loads that could alias the lhs in between the start of bb and the
loads from *phi.

* g++.dg/torture/pr81365.C: New test.

From-SVN: r250261

7 years agore PR middle-end/80929 (Division with constant no more optimized to mult highpart)
Georg-Johann Lay [Mon, 17 Jul 2017 08:56:06 +0000 (08:56 +0000)]
re PR middle-end/80929 (Division with constant no more optimized to mult highpart)

PR 80929
* config/avr/avr.c (avr_mul_highpart_cost): New static function.
(avr_rtx_costs_1) [TRUNCATE]: Use it to compute mul_highpart cost.
[LSHIFTRT, outer_code = TRUNCATE]: Same.

From-SVN: r250258

7 years agore PR tree-optimization/81396 (Optimization of reading Little-Endian 64-bit number...
Jakub Jelinek [Mon, 17 Jul 2017 08:14:16 +0000 (10:14 +0200)]
re PR tree-optimization/81396 (Optimization of reading Little-Endian 64-bit number with portable code has a regression)

PR tree-optimization/81396
* tree-ssa-math-opts.c (struct symbolic_number): Add n_ops field.
(init_symbolic_number): Initialize it to 1.
(perform_symbolic_merge): Add n_ops from both operands into the new
n_ops.
(find_bswap_or_nop): Don't consider n->n == cmpnop computations
without base_addr as useless if they need more than one operation.
(bswap_replace): Handle !bswap case for NULL base_addr.

* gcc.dg/tree-ssa/pr81396.c: New test.

From-SVN: r250257

7 years agoInsert diverging jump alap in nvptx_single
Tom de Vries [Mon, 17 Jul 2017 07:49:22 +0000 (07:49 +0000)]
Insert diverging jump alap in nvptx_single

2017-07-17  Tom de Vries  <tom@codesourcery.com>

PR target/81069
* config/nvptx/nvptx.c (nvptx_single): Insert diverging branch as late
as possible.

From-SVN: r250256

7 years ago[SPARC/RTEMS] Add __FIX_LEON3FT_B2BST
Sebastian Huber [Mon, 17 Jul 2017 05:27:13 +0000 (05:27 +0000)]
[SPARC/RTEMS] Add __FIX_LEON3FT_B2BST

In case the LEON3FT back-to-back store workaround is active
(sparc_fix_b2bst), then define the builtin define __FIX_LEON3FT_B2BST on
RTEMS.  The intended use case for this is operating system code in
assembly language.  See also:

https://lists.rtems.org/pipermail/devel/2017-July/018463.html

gcc/
*  gcc/config/sparc/rtemself.h (TARGET_OS_CPP_BUILTINS): Add
conditional builtin define __FIX_LEON3FT_B2BST.

From-SVN: r250254

7 years ago[RTEMS] Add multilibs for LEON3FT back-to-back store workaround
Daniel Cederman [Mon, 17 Jul 2017 05:18:42 +0000 (05:18 +0000)]
[RTEMS] Add multilibs for LEON3FT back-to-back store workaround

Replace MULTILIB_EXCEPTIONS with MULTILIB_REQUIRED for readability.
-mfix-gr712rc and -mfix-ut700 are currently equivalent.

gcc/
* config/sparc/t-rtems: Add mfix-gr712rc multilibs. Replace
MULTILIB_EXCEPTIONS with MULTILIB_REQUIRED. Match -mfix-gr712rc
with -mfix-ut700.

From-SVN: r250252

7 years agoDaily bump.
GCC Administrator [Mon, 17 Jul 2017 00:16:33 +0000 (00:16 +0000)]
Daily bump.

From-SVN: r250251

7 years agore PR rtl-optimization/81424 (internal error on GPRbuild with -O2)
Eric Botcazou [Sun, 16 Jul 2017 22:03:54 +0000 (22:03 +0000)]
re PR rtl-optimization/81424 (internal error on GPRbuild with -O2)

PR rtl-optimization/81424
* optabs.c (prepare_cmp_insn): Use copy_to_reg instead of force_reg
to remove potential trapping from operands if -fnon-call-exceptions.

From-SVN: r250246

7 years agotree-ssa-loop-manip.c (tree_transform_and_unroll_loop): Use profile_proability for...
Jan Hubicka [Sun, 16 Jul 2017 18:25:26 +0000 (20:25 +0200)]
tree-ssa-loop-manip.c (tree_transform_and_unroll_loop): Use profile_proability for scalling.

* tree-ssa-loop-manip.c (tree_transform_and_unroll_loop): Use
profile_proability for scalling.
* scale_profile_for_vect_loop.c (scale_profile_for_vect_loop): Likewise.

From-SVN: r250245

7 years ago* cgraph.c (cgraph_edge::redirect_call_stmt_to_caller): Cleanup.
Jan Hubicka [Sun, 16 Jul 2017 16:36:48 +0000 (18:36 +0200)]
* cgraph.c (cgraph_edge::redirect_call_stmt_to_caller): Cleanup.

From-SVN: r250243

7 years agocfgloopmanip.c (scale_loop_profile): Avoid use of REG_BR_PROB_BASE fixpoint arithmetics.
Jan Hubicka [Sun, 16 Jul 2017 16:35:00 +0000 (18:35 +0200)]
cfgloopmanip.c (scale_loop_profile): Avoid use of REG_BR_PROB_BASE fixpoint arithmetics.

* cfgloopmanip.c (scale_loop_profile): Avoid use of REG_BR_PROB_BASE
fixpoint arithmetics.

From-SVN: r250242

7 years agotree-ssa-loop-unswitch.c (hoist_guard): Avoid use of REG_BR_PROB_BASE fixpoint arithm...
Jan Hubicka [Sun, 16 Jul 2017 16:30:40 +0000 (18:30 +0200)]
tree-ssa-loop-unswitch.c (hoist_guard): Avoid use of REG_BR_PROB_BASE fixpoint arithmetics.

* tree-ssa-loop-unswitch.c (hoist_guard): Avoid use of REG_BR_PROB_BASE
fixpoint arithmetics.

From-SVN: r250241

7 years agoasan.c (create_cond_insert_point): Avoid use of REG_BR_PROB_BASE fixpoint arithmetics.
Jan Hubicka [Sun, 16 Jul 2017 16:28:57 +0000 (18:28 +0200)]
asan.c (create_cond_insert_point): Avoid use of REG_BR_PROB_BASE fixpoint arithmetics.

* asan.c (create_cond_insert_point): Avoid use of REG_BR_PROB_BASE
fixpoint arithmetics.

From-SVN: r250240

7 years agoprofile-count.h (profile_probability::from_reg_br_prob_note, [...]): New functions.
Jan Hubicka [Sun, 16 Jul 2017 16:10:58 +0000 (18:10 +0200)]
profile-count.h (profile_probability::from_reg_br_prob_note, [...]): New functions.

* profile-count.h (profile_probability::from_reg_br_prob_note,
profile_probability::to_reg_br_prob_note): New functions.
* doc/rtl.texi (REG_BR_PROB_NOTE): Update documentation.
* reg-notes.h (REG_BR_PROB, REG_BR_PRED): Update docs.
* predict.c (probability_reliable_p): Update.
(edge_probability_reliable_p): Update.
(br_prob_note_reliable_p): Update.
(invert_br_probabilities): Update.
(add_reg_br_prob_note): New function.
(combine_predictions_for_insn): Update.
* asan.c (asan_clear_shadow): Update.
* cfgbuild.c (compute_outgoing_frequencies): Update.
* cfgrtl.c (force_nonfallthru_and_redirect): Update.
(update_br_prob_note): Update.
(rtl_verify_edges): Update.
(purge_dead_edges): Update.
(fixup_reorder_chain): Update.
* emit-rtl.c (try_split): Update.
* ifcvt.c (cond_exec_process_insns): Update.
(cond_exec_process_if_block): Update.
(dead_or_predicable): Update.
* internal-fn.c (expand_addsub_overflow): Update.
(expand_neg_overflow): Update.
(expand_mul_overflow): Update.
* loop-doloop.c (doloop_modify): Update.
* loop-unroll.c (compare_and_jump_seq): Update.
* optabs.c (emit_cmp_and_jump_insn_1): Update.
* predict.h: Update.
* reorg.c (mostly_true_jump): Update.
* rtl.h: Update.
* config/aarch64/aarch64.c (aarch64_emit_unlikely_jump): Update.
* config/alpha/alpha.c (emit_unlikely_jump): Update.
* config/arc/arc.c: (emit_unlikely_jump): Update.
* config/arm/arm.c: (emit_unlikely_jump): Update.
* config/bfin/bfin.c (cbranch_predicted_taken_p): Update.
* config/frv/frv.c (frv_print_operand_jump_hint): Update.
* config/i386/i386.c (ix86_expand_split_stack_prologue): Update.
(ix86_print_operand): Update.
(ix86_split_fp_branch): Update.
(predict_jump): Update.
* config/ia64/ia64.c (ia64_print_operand): Update.
* config/mmix/mmix.c (mmix_print_operand): Update.
* config/powerpcspe/powerpcspe.c (output_cbranch): Update.
(rs6000_expand_split_stack_prologue): Update.
* config/rs6000/rs6000.c: Update.
* config/s390/s390.c (s390_expand_vec_strlen): Update.
(s390_expand_vec_movstr): Update.
(s390_expand_cs_tdsi): Update.
(s390_expand_split_stack_prologue): Update.
* config/sh/sh.c (sh_print_operand): Update.
(expand_cbranchsi4): Update.
(expand_cbranchdi4): Update.
* config/sparc/sparc.c (output_v9branch): Update.
* config/spu/spu.c (get_branch_target): Update.
(ea_load_store_inline): Update.
* config/tilegx/tilegx.c (cbranch_predicted_p): Update.
* config/tilepro/tilepro.c: Update.
* gcc.dg/predict-8.c: Update.

From-SVN: r250239

7 years agogimplify.c (mostly_copy_tree_r): Revert latest change.
Eric Botcazou [Sun, 16 Jul 2017 13:36:27 +0000 (13:36 +0000)]
gimplify.c (mostly_copy_tree_r): Revert latest change.

* gimplify.c (mostly_copy_tree_r): Revert latest change.
(gimplify_save_expr): Likewise.

From-SVN: r250238

7 years ago* ipa-visibility.c (function_and_variable_visibility): Fix pasto.
Jan Hubicka [Sun, 16 Jul 2017 11:21:39 +0000 (13:21 +0200)]
* ipa-visibility.c (function_and_variable_visibility): Fix pasto.

From-SVN: r250237

7 years agoipa-fnsummary.c (pass_data_ipa_fn_summary): Use TV_IPA_FNSUMMARY.
Jan Hubicka [Sun, 16 Jul 2017 11:19:44 +0000 (13:19 +0200)]
ipa-fnsummary.c (pass_data_ipa_fn_summary): Use TV_IPA_FNSUMMARY.

* ipa-fnsummary.c (pass_data_ipa_fn_summary): Use
TV_IPA_FNSUMMARY.
* timevar.def (TV_IPA_FNSUMMARY): Define.

From-SVN: r250236

7 years agosparc.md (divdf3_fix): Add NOP to prevent back to back store errata sensitive sequenc...
Daniel Cederman [Sun, 16 Jul 2017 10:43:15 +0000 (10:43 +0000)]
sparc.md (divdf3_fix): Add NOP to prevent back to back store errata sensitive sequence from being...

* config/sparc/sparc.md (divdf3_fix): Add NOP to prevent back
to back store errata sensitive sequence from being generated.
(sqrtdf2_fix): Likewise.

From-SVN: r250234

7 years agotree-ssa-threadupdate.c (compute_path_counts, [...]): Use profile_probability.
Jan Hubicka [Sun, 16 Jul 2017 10:06:00 +0000 (12:06 +0200)]
tree-ssa-threadupdate.c (compute_path_counts, [...]): Use profile_probability.

* tree-ssa-threadupdate.c (compute_path_counts,
update_joiner_offpath_counts): Use profile_probability.

From-SVN: r250233

7 years agoAdd forgotten Changelog entries for
Volker Reichelt [Sun, 16 Jul 2017 09:57:50 +0000 (09:57 +0000)]
Add forgotten Changelog entries for

        * parser.c (cp_parser_cast_expression): Use %q#T instead of %qT
        in old-style cast diagnostic.
        * typeck.c (maybe_warn_about_useless_cast): Use %q#T instead of %qT
        in useless cast diagnostic.
        * error.c (type_to_string): Remove enum special handling.

        * g++.dg/cpp1z/direct-enum-init1.C: Revert special enum handling.
        * g++.dg/warn/pr12242.C: Likewise.

From-SVN: r250232

7 years agoparser.c (cp_parser_cast_expression): Use %q#T instead of %qT in old-style cast diagn...
Volker Reichelt [Sun, 16 Jul 2017 09:55:18 +0000 (09:55 +0000)]
parser.c (cp_parser_cast_expression): Use %q#T instead of %qT in old-style cast diagnostic.

        * parser.c (cp_parser_cast_expression): Use %q#T instead of %qT
        in old-style cast diagnostic.
        * typeck.c (maybe_warn_about_useless_cast): Use %q#T instead of %qT
        in useless cast diagnostic.
        * error.c (type_to_string): Remove enum special handling.

        * g++.dg/cpp1z/direct-enum-init1.C: Revert special enum handling.
        * g++.dg/warn/pr12242.C: Likewise.

From-SVN: r250231

7 years agoDaily bump.
GCC Administrator [Sun, 16 Jul 2017 00:16:22 +0000 (00:16 +0000)]
Daily bump.

From-SVN: r250230

7 years agoMakefile.am (CHECK_ENV): Set GOROOT.
Ian Lance Taylor [Sat, 15 Jul 2017 17:50:18 +0000 (17:50 +0000)]
Makefile.am (CHECK_ENV): Set GOROOT.

* Makefile.am (CHECK_ENV): Set GOROOT.
(ECHO_ENV): Report setting GOROOT.
* Makefile.in: Rebuild.

From-SVN: r250226

7 years agore PR ada/81446 (building Ada fails due to missing No_Elaboration_Code_All)
John Paul Adrian Glaubitz [Sat, 15 Jul 2017 17:01:03 +0000 (17:01 +0000)]
re PR ada/81446 (building Ada fails due to missing No_Elaboration_Code_All)

PR ada/81446
* system-linux-m68k.ads: Add pragma No_Elaboration_Code_All.

From-SVN: r250224

7 years agoReorder std::scoped_lock parameters as per P0739R0 DR status
Jonathan Wakely [Sat, 15 Jul 2017 15:43:22 +0000 (16:43 +0100)]
Reorder std::scoped_lock parameters as per P0739R0 DR status

* include/std/mutex (scoped_lock): Reorder std::adopt_lock_t parameter
as per P0739R0.
* testsuite/30_threads/scoped_lock/cons/1.cc: Reorder arguments.
* testsuite/30_threads/scoped_lock/cons/deduction.cc: Test deduction
with std::adopt_lock_t.
* testsuite/30_threads/scoped_lock/requirements/typedefs.cc: Check
feature-test macro.

From-SVN: r250223

7 years agoRevert "[ARM] Fix definition of __ARM_FEATURE_NUMERIC_MAXMIN"
Thomas Preud'homme [Sat, 15 Jul 2017 11:16:28 +0000 (11:16 +0000)]
Revert "[ARM] Fix definition of __ARM_FEATURE_NUMERIC_MAXMIN"

This reverts commit r250206.

2017-07-15  Thomas Preud'homme  <thomas.preudhomme@arm.com>

    Revert:
    2017-07-14  Thomas Preud'homme  <thomas.preudhomme@arm.com>

    gcc
    * config/arm/arm-c.c (arm_cpu_builtins): Define
    __ARM_FEATURE_NUMERIC_MAXMIN solely based on TARGET_VFP5.

From-SVN: r250222

7 years agoDaily bump.
GCC Administrator [Sat, 15 Jul 2017 00:16:21 +0000 (00:16 +0000)]
Daily bump.

From-SVN: r250221

7 years agolibgo: don't copy semt into runtime.inc
Ian Lance Taylor [Fri, 14 Jul 2017 22:25:26 +0000 (22:25 +0000)]
libgo: don't copy semt into runtime.inc

    https://gcc.gnu.org/PR81449 reports a problem with the definition semt
    in runtime.inc on some systems. Since the C code in libgo/runtime
    doesn't need semt, just don't copy it into runtime.inc.

    Reviewed-on: https://go-review.googlesource.com/48593

From-SVN: r250217

7 years agocmd/go: use gccSupportsFlag for -fsplit-stack
Ian Lance Taylor [Fri, 14 Jul 2017 22:21:37 +0000 (22:21 +0000)]
cmd/go: use gccSupportsFlag for -fsplit-stack

    Don't assume that all (or only) 386/amd64 compilers support
    -fsplit-stack.

    Reviewed-on: https://go-review.googlesource.com/48592

From-SVN: r250216

7 years agors6000-c.c (altivec_overloaded_builtins): Add array entries to represent __ieee128...
Kelvin Nilsen [Fri, 14 Jul 2017 20:16:57 +0000 (20:16 +0000)]
rs6000-c.c (altivec_overloaded_builtins): Add array entries to represent __ieee128 versions of the scalar_test_data_class...

gcc/ChangeLog:

2017-07-14  Kelvin Nilsen  <kelvin@gcc.gnu.org>

* config/rs6000/rs6000-c.c (altivec_overloaded_builtins): Add
array entries to represent __ieee128 versions of the
scalar_test_data_class, scalar_test_neg, scalar_extract_exp,
scalar_extract_sig, and scalar_insert_exp built-in functions.
(altivec_resolve_overloaded_builtin): Add special case handling
for the __builtin_scalar_insert_exp function, as represented by
the P9V_BUILTIN_VEC_VSIEDP constant.
* config/rs6000/rs6000-builtin.def (VSEEQP): Add scalar extract
exponent support for __ieee128 argument.
(VSESQP): Add scalar extract signature support for __ieee128
argument.
(VSTDCNQP): Add scalar test negative support for __ieee128
argument.
(VSIEQP): Add scalar insert exponent support for __int128 argument
with __ieee128 result.
(VSIEQPF): Add scalar insert exponent support for __ieee128
argument with __ieee128 result.
(VSTDCQP): Add scalar test data class support for __ieee128
argument.
(VSTDCNQP): Add overload support for scalar test negative with
__ieee128 argument.
(VSTDCQP): Add overload support for scalar test data class
__ieee128 argument.
* config/rs6000/vsx.md (UNSPEC_VSX_SXSIG) Replace
UNSPEC_VSX_SXSIGDP.
(UNSPEC_VSX_SIEXPQP): New constant.
(xsxexpqp): New insn for VSX scalar extract exponent quad
precision.
(xsxsigqp): New insn for VSX scalar extract significand quad
precision.
(xsiexpqpf): New insn for VSX scalar insert exponent quad
precision with floating point argument.
(xststdcqp): New expand for VSX scalar test data class quad
precision.
(xststdcnegqp): New expand for VSX scalar test negative quad
precision.
(xststdcqp): New insn to match expansions for VSX scalar test data
class quad precision and VSX scalar test negative quad precision.
* config/rs6000/rs6000.c (rs6000_expand_binop_builtin): Add
special case operand checking to enforce that second operand of
VSX scalar test data class with quad precision argument is a 7-bit
unsigned literal.
* doc/extend.texi (PowerPC AltiVec Built-in Functions): Add
prototypes and descriptions of __ieee128 versions of
scalar_extract_exp, scalar_extract_sig, scalar_insert_exp,
scalar_test_data_class, and scalar_test_neg built-in functions.

gcc/testsuite/ChangeLog:

2017-07-14  Kelvin Nilsen  <kelvin@gcc.gnu.org>

* gcc.target/powerpc/bfp/scalar-cmp-exp-eq-3.c: New test.
* gcc.target/powerpc/bfp/scalar-cmp-exp-eq-4.c: New test.
* gcc.target/powerpc/bfp/scalar-cmp-exp-gt-3.c: New test.
* gcc.target/powerpc/bfp/scalar-cmp-exp-gt-4.c: New test.
* gcc.target/powerpc/bfp/scalar-cmp-exp-lt-3.c: New test.
* gcc.target/powerpc/bfp/scalar-cmp-exp-lt-4.c: New test.
* gcc.target/powerpc/bfp/scalar-cmp-exp-unordered-3.c: New test.
* gcc.target/powerpc/bfp/scalar-cmp-exp-unordered-4.c: New test.
* gcc.target/powerpc/bfp/scalar-extract-exp-3.c: New test.
* gcc.target/powerpc/bfp/scalar-extract-exp-4.c: New test.
* gcc.target/powerpc/bfp/scalar-extract-exp-5.c: New test.
* gcc.target/powerpc/bfp/scalar-extract-exp-6.c: New test.
* gcc.target/powerpc/bfp/scalar-extract-exp-7.c: New test.
* gcc.target/powerpc/bfp/scalar-extract-sig-3.c: New test.
* gcc.target/powerpc/bfp/scalar-extract-sig-4.c: New test.
* gcc.target/powerpc/bfp/scalar-extract-sig-5.c: New test.
* gcc.target/powerpc/bfp/scalar-extract-sig-6.c: New test.
* gcc.target/powerpc/bfp/scalar-extract-sig-7.c: New test.
* gcc.target/powerpc/bfp/scalar-insert-exp-10.c: New test.
* gcc.target/powerpc/bfp/scalar-insert-exp-11.c: New test.
* gcc.target/powerpc/bfp/scalar-insert-exp-12.c: New test.
* gcc.target/powerpc/bfp/scalar-insert-exp-13.c: New test.
* gcc.target/powerpc/bfp/scalar-insert-exp-14.c: New test.
* gcc.target/powerpc/bfp/scalar-insert-exp-15.c: New test.
* gcc.target/powerpc/bfp/scalar-insert-exp-6.c: New test.
* gcc.target/powerpc/bfp/scalar-insert-exp-7.c: New test.
* gcc.target/powerpc/bfp/scalar-insert-exp-8.c: New test.
* gcc.target/powerpc/bfp/scalar-insert-exp-9.c: New test.
* gcc.target/powerpc/bfp/scalar-test-data-class-10.c: New test.
* gcc.target/powerpc/bfp/scalar-test-data-class-11.c: New test.
* gcc.target/powerpc/bfp/scalar-test-data-class-12.c: New test.
* gcc.target/powerpc/bfp/scalar-test-data-class-13.c: New test.
* gcc.target/powerpc/bfp/scalar-test-data-class-14.c: New test.
* gcc.target/powerpc/bfp/scalar-test-data-class-15.c: New test.
* gcc.target/powerpc/bfp/scalar-test-data-class-8.c: New test.
* gcc.target/powerpc/bfp/scalar-test-data-class-9.c: New test.
* gcc.target/powerpc/bfp/scalar-test-neg-4.c: New test.
* gcc.target/powerpc/bfp/scalar-test-neg-5.c: New test.
* gcc.target/powerpc/bfp/scalar-test-neg-6.c: New test.
* gcc.target/powerpc/bfp/scalar-test-neg-7.c: New test.
* gcc.target/powerpc/bfp/scalar-test-neg-8.c: New test.
* gcc.target/powerpc/bfp/vec-extract-exp-4.c: New test.
* gcc.target/powerpc/bfp/vec-extract-exp-5.c: New test.
* gcc.target/powerpc/bfp/vec-extract-sig-4.c: New test.
* gcc.target/powerpc/bfp/vec-extract-sig-5.c: New test.
* gcc.target/powerpc/bfp/vec-insert-exp-10.c: New test.
* gcc.target/powerpc/bfp/vec-insert-exp-11.c: New test.
* gcc.target/powerpc/bfp/vec-insert-exp-8.c: New test.
* gcc.target/powerpc/bfp/vec-insert-exp-9.c: New test.
* gcc.target/powerpc/bfp/vec-test-data-class-8.c: New test.
* gcc.target/powerpc/bfp/vec-test-data-class-9.c: New test.

From-SVN: r250214

7 years agoConstrain std::variant constructor for class template argument deduction
Jason Merrill [Fri, 14 Jul 2017 19:13:49 +0000 (15:13 -0400)]
Constrain std::variant constructor for class template argument deduction

2017-07-14  Jason Merrill  <jason@redhat.com>
    Jonathan Wakely  <jwakely@redhat.com>

* include/std/variant (variant::variant(_Tp&&)): Constrain to remove
the constructor for empty variants from the candidate functions
during class template argument deduction.
* testsuite/20_util/variant/deduction.cc: New.

Co-Authored-By: Jonathan Wakely <jwakely@redhat.com>
From-SVN: r250213

7 years agore PR tree-optimization/81162 (UBSAN switch triggers incorrect optimization in SLSR)
Bill Schmidt [Fri, 14 Jul 2017 18:06:45 +0000 (18:06 +0000)]
re PR tree-optimization/81162 (UBSAN switch triggers incorrect optimization in SLSR)

[gcc]

2016-07-14  Bill Schmidt  <wschmidt@linux.vnet.ibm.com>

PR tree-optimization/81162
* gimple-ssa-strength-reduction.c (replace_mult_candidate): Don't
replace a negate with an add.

[gcc/testsuite]

2016-07-14  Bill Schmidt  <wschmidt@linux.vnet.ibm.com>

PR tree-optimization/81162
* gcc.dg/pr81162.c: New file.

From-SVN: r250212

7 years agossa-dse-30.c: Correct test to look for memmove that bcopy is expected to be transform...
Martin Sebor [Fri, 14 Jul 2017 16:16:23 +0000 (16:16 +0000)]
ssa-dse-30.c: Correct test to look for memmove that bcopy is expected to be transformed to.

gcc/testsuite/ChangeLog:

* gcc.dg/tree-ssa/ssa-dse-30.c: Correct test to look for memmove
that bcopy is expected to be transformed to.

From-SVN: r250209

7 years ago[Patch ARM] Document the +crypto extension on CPUs.
James Greenhalgh [Fri, 14 Jul 2017 15:48:57 +0000 (15:48 +0000)]
[Patch ARM] Document the +crypto extension on CPUs.

We don't document the list of CPU names which can take a +crypto extension
in the ARM port. This patch fixes that oversight.

gcc/

2017-14-07  James Greenhalgh  <james.greenhalgh@arm.com>

* doc/invoke.texi (arm/-mcpu): Document +crypto.

From-SVN: r250207

7 years ago[ARM] Fix definition of __ARM_FEATURE_NUMERIC_MAXMIN
Thomas Preud'homme [Fri, 14 Jul 2017 15:26:28 +0000 (15:26 +0000)]
[ARM] Fix definition of __ARM_FEATURE_NUMERIC_MAXMIN

Definition of __ARM_FEATURE_NUMERIC_MAXMIN checks for
TARGET_ARM_ARCH >= 8 and TARGET_NEON being true in addition to
TARGET_VFP5. However, instructions covered by this macro are part of
FPv5 which is available in ARMv7E-M architecture. This commit fixes the
macro to only check for TARGET_VFP5.

2017-07-14  Thomas Preud'homme  <thomas.preudhomme@arm.com>

    gcc/
    * config/arm/arm-c.c (arm_cpu_builtins): Define
    __ARM_FEATURE_NUMERIC_MAXMIN solely based on TARGET_VFP5.

From-SVN: r250206

7 years ago[ARM] Add support for ARM Cortex-R52 processor
Thomas Preud'homme [Fri, 14 Jul 2017 15:26:19 +0000 (15:26 +0000)]
[ARM] Add support for ARM Cortex-R52 processor

2017-07-14  Thomas Preud'homme  <thomas.preudhomme@arm.com>

    gcc/
    * config/arm/arm-cpus.in (cortex-r52): Add new entry.
    (armv8-r): Set ARM Cortex-R52 as default CPU.
    * config/arm/arm-tables.opt: Regenerate.
    * config/arm/arm-tune.md: Regenerate.
    * config/arm/driver-arm.c (arm_cpu_table): Add entry for ARM
    Cortex-R52.
    * doc/invoke.texi: Mention -mtune=cortex-r52 and availability of fp.dp
    extension for -mcpu=cortex-r52.

From-SVN: r250205

7 years ago[ARM] Rewire -mfpu=fp-armv8 as VFPv5 + D32 + DP
Thomas Preud'homme [Fri, 14 Jul 2017 15:26:09 +0000 (15:26 +0000)]
[ARM] Rewire -mfpu=fp-armv8 as VFPv5 + D32 + DP

fp-armv8 is currently defined as a double precision FPv5 with 32 D
registers *and* a special FP_ARMv8 bit. However FP for ARMv8 should only
bring 32 D registers on top of FPv5-D16 so this FP_ARMv8 bit is
spurious. As a consequence, many instruction patterns which are guarded
by TARGET_FPU_ARMV8 are unavailable to FPv5-D16 and FPv5-SP-D16.

This commit gets rid of TARGET_FPU_ARMV8 and rewire all uses to
expressions based on TARGET_VFP5, TARGET_VFPD32 and TARGET_VFP_DOUBLE.
It also redefine ISA_FP_ARMv8 to include the D32 capability to
distinguish it from FPv5-D16. At last, it sets the +fp.sp for ARMv8-R to
enable FPv5-SP-D16 (ie FP for ARMv8 with single precision only and 16 D
registers).

2017-07-14  Thomas Preud'homme  <thomas.preudhomme@arm.com>

    gcc/
    * config/arm/arm-isa.h (isa_bit_FP_ARMv8): Delete enumerator.
    (ISA_FP_ARMv8): Define as ISA_FPv5 and ISA_FP_D32.
    * config/arm/arm-cpus.in (armv8-r): Define fp.sp as enabling FPv5.
    (fp-armv8): Define it as FP_ARMv8 only.
    config/arm/arm.h (TARGET_FPU_ARMV8): Delete.
    (TARGET_VFP_FP16INST): Define using TARGET_VFP5 rather than
    TARGET_FPU_ARMV8.
    config/arm/arm.c (arm_rtx_costs_internal): Replace checks against
    TARGET_FPU_ARMV8 by checks against TARGET_VFP5.
    * config/arm/arm-builtins.c (arm_builtin_vectorized_function): Define
    first ARM_CHECK_BUILTIN_MODE definition using TARGET_VFP5 rather
    than TARGET_FPU_ARMV8.
    * config/arm/arm-c.c (arm_cpu_builtins): Likewise for
    __ARM_FEATURE_NUMERIC_MAXMIN macro definition.
    * config/arm/arm.md (cmov<mode>): Condition on TARGET_VFP5 rather than
    TARGET_FPU_ARMV8.
    * config/arm/neon.md (neon_vrint): Likewise.
    (neon_vcvt): Likewise.
    (neon_<fmaxmin_op><mode>): Likewise.
    (<fmaxmin><mode>3): Likewise.
    * config/arm/vfp.md (l<vrint_pattern><su_optab><mode>si2): Likewise.
    * config/arm/predicates.md (arm_cond_move_operator): Check against
    TARGET_VFP5 rather than TARGET_FPU_ARMV8 and fix spacing.

From-SVN: r250204