Commit Graph

163341 Commits

Author SHA1 Message Date
Jonathan Wakely
2383ed0269 Minor optimisations in operator new(size_t, align_val_t)
* libsupc++/new_opa.cc (operator new(size_t, align_val_t)): Use
	__is_pow2 to check for valid alignment. Avoid branching when rounding
	size to multiple of alignment.

From-SVN: r263515
2018-08-13 19:54:38 +01:00
Jonathan Wakely
7997ede243 Add <bit> and <version> to freestanding headers
* include/Makefile.am: Install <bit> and <version> for freestanding.
	* include/Makefile.in: Regenerate.
	* testsuite/17_intro/freestanding.cc: Check for <bit> and <version>.

From-SVN: r263514
2018-08-13 19:54:34 +01:00
Jonathan Wakely
9db03bee15 Revert "libstdc++-v3: Have aligned_alloc() on Newlib"
This reverts commit r263461 / 2e920cd849b3cf0a72df4f172e27676a3e70b73f
because aligned_alloc is not defined for baremetal newlib targets, see
https://gcc.gnu.org/ml/libstdc++/2018-08/msg00065.html

Revert
2018-08-10  Sebastian Huber  <sebastian.huber@embedded-brains.de>

	PR target/85904
	* configure.ac: Define HAVE_ALIGNED_ALLOC if building for
	Newlib.
	* configure: Regenerate.

From-SVN: r263513
2018-08-13 19:54:21 +01:00
Will Schmidt
3f7a77cd20 rs6000.c (rs6000_builtin_valid_without_lhs): Add vec_xst variants to the list.
[gcc]

2018-08-13 Will Schmidt <will_schmidt@vnet.ibm.com>

	* config/rs6000/rs6000.c (rs6000_builtin_valid_without_lhs): Add
	vec_xst variants to the list.
	(rs6000_gimple_fold_builtin): Add support for folding unaligned
	vector loads and stores.

From-SVN: r263512
2018-08-13 18:13:20 +00:00
Martin Sebor
23aa9f7c46 PR tree-optimization/71625 - missing strlen optimization on different array initialization style
gcc/c/ChangeLog:

	PR tree-optimization/71625
	* c-parser.c (c_parser_declaration_or_fndef): Call
	braced_list_to_string.

gcc/c-family/ChangeLog:

	PR tree-optimization/71625
	* c-common.c (braced_list_to_string): New function.
	* c-common.h (braced_list_to_string): Declare it.

gcc/cp/ChangeLog:

	PR tree-optimization/71625
	* decl.c (check_initializer):  Call braced_list_to_string.
	(eval_check_narrowing): New function.
	* gcc/cp/typeck2.c (digest_init_r): Accept strings literals
	as initilizers for all narrow character types.

gcc/testsuite/ChangeLog:

	PR tree-optimization/71625

	* g++.dg/init/string2.C: New test.
	* g++.dg/init/string3.C: New test.
	* g++.dg/init/string4.C: New test.
	* gcc.dg/init-string-3.c: New test.
	* gcc.dg/strlenopt-55.c: New test.
	* gcc.dg/strlenopt-56.c: New test.

From-SVN: r263511
2018-08-13 11:57:51 -06:00
Marek Polacek
e6a1e5fe73 P0806R2 - Deprecate implicit capture of this via [=]
P0806R2 - Deprecate implicit capture of this via [=]
	* lambda.c (add_default_capture): Formatting fixes.  Warn about
	deprecated implicit capture of this via [=].

	* g++.dg/cpp2a/lambda-this1.C: New test.
	* g++.dg/cpp2a/lambda-this2.C: New test.
	* g++.dg/cpp2a/lambda-this3.C: New test.

From-SVN: r263508
2018-08-13 15:46:42 +00:00
Marek Polacek
27a98312c5 re PR c++/86915 (Segmentation fault for an array of auto in template parameter)
PR c++/86915
	* decl.c (create_array_type_for_decl): Handle null name.

	* g++.dg/diagnostic/auto1.C: New test.

From-SVN: r263507
2018-08-13 15:36:30 +00:00
David Edelsohn
116c7f320e config.gcc (rs6000-ibm-aix4.x): Delete.
* config.gcc (rs6000-ibm-aix4.x): Delete.
        (rs6000-ibm-aix5.1): Delete.
        (rs6000-ibm-aix5.2): Delete.
        (rs6000-ibm-aix5.3): Delete.
        * config/rs6000/aix43.h: Delete.
        * config/rs6000/aix51.h: Delete.
        * config/rs6000/aix52.h: Delete.
        * config/rs6000/t-aix43: Delete.

From-SVN: r263506
2018-08-13 09:37:19 -04:00
Cesar Philippidis
bd9b3d3d1a [nvptx] Use CUDA driver API to select default runtime launch geometry
The CUDA driver API starting version 6.5 offers a set of runtime functions to
calculate several occupancy-related measures, as a replacement for the occupancy
calculator spreadsheet.

This patch adds a heuristic for default runtime launch geometry, based on the
new runtime function cuOccupancyMaxPotentialBlockSize.

Build on x86_64 with nvptx accelerator and ran libgomp testsuite.

2018-08-13  Cesar Philippidis  <cesar@codesourcery.com>
	    Tom de Vries  <tdevries@suse.de>

	PR target/85590
	* plugin/cuda/cuda.h (CUoccupancyB2DSize): New typedef.
	(cuOccupancyMaxPotentialBlockSize): Declare.
	* plugin/cuda-lib.def (cuOccupancyMaxPotentialBlockSize): New
	CUDA_ONE_CALL_MAYBE_NULL.
	* plugin/plugin-nvptx.c (CUDA_VERSION < 6050): Define
	CUoccupancyB2DSize and declare
	cuOccupancyMaxPotentialBlockSize.
	(nvptx_exec): Use cuOccupancyMaxPotentialBlockSize to set the
	default num_gangs and num_workers when the driver supports it.

Co-Authored-By: Tom de Vries <tdevries@suse.de>

From-SVN: r263505
2018-08-13 12:04:24 +00:00
Ilya Leoshkevich
cdf899781c S/390: Factor out constant pool ref decomposition
gcc/ChangeLog:

2018-08-13  Ilya Leoshkevich  <iii@linux.ibm.com>

	* config/s390/s390.c (s390_decompose_constant_pool_ref):
        New function.
	(s390_decompose_address): Factor out constant pool ref
        decomposition.

From-SVN: r263504
2018-08-13 11:33:38 +00:00
GCC Administrator
5a3b69f94b Daily bump.
From-SVN: r263503
2018-08-13 00:16:33 +00:00
Paul Thomas
9a8013d112 re PR fortran/66679 ([OOP] ICE with class(*) and transfer)
2018-08-12  Paul Thomas  <pault@gcc.gnu.org>

	PR fortran/66679
	* trans-intrinsic.c (gfc_conv_intrinsic_transfer): Class array
	elements are returned as references to the data element. Get
	the class expression by stripping back the references. Use this
	for the element size.

2018-08-12  Paul Thomas  <pault@gcc.gnu.org>

	PR fortran/66679
	* gfortran.dg/transfer_class_3.f90: New test.

From-SVN: r263499
2018-08-12 17:19:09 +00:00
Chung-Ju Wu
5b774d92b0 [NDS32] Change return type of predicator to bool.
gcc/
	* config/nds32/nds32-predicates.c
	(nds32_can_use_bclr_p): Change return type as bool.
	(nds32_can_use_bset_p): Ditto.
	(nds32_can_use_btgl_p): Ditto.
	(nds32_can_use_bitci_p): Ditto.
	* config/nds32/nds32-protos.h
	(nds32_can_use_bclr_p): Change declaration.
	(nds32_can_use_bset_p): Ditto.
	(nds32_can_use_btgl_p): Ditto.
	(nds32_can_use_bitci_p): Ditto.

From-SVN: r263497
2018-08-12 15:21:02 +00:00
Chung-Ju Wu
d057a470d3 [NDS32] Add new option: -msched-prolog-epilog
gcc/
	* config/nds32/nds32.c (nds32_expand_prologue, nds32_expand_epilogue):
	Support -msched-prolog-epilog option.
	* config/nds32/nds32.opt (msched-prolog-epilog): New option.

From-SVN: r263496
2018-08-12 13:41:22 +00:00
Chung-Ju Wu
68acadb1ff [NDS32] Enable -malways-align by default at -O1 and above.
gcc/
	* common/config/nds32/nds32-common.c
	(nds32_option_optimization_table): Enalbe -malways-align.

From-SVN: r263495
2018-08-12 13:26:05 +00:00
Paul Thomas
8532a010b6 re PR fortran/86906 (erroneous name clash with renaming in use statement)
2018-08-12  Paul Thomas  <pault@gcc.gnu.org>

	PR fortran/86906
	* resolve.c (resolve_fl_variable_derived): Check if the derived
	type is use associated before checking for the host association
	error.

2018-08-12  Paul Thomas  <pault@gcc.gnu.org>

	PR fortran/86906
	* gfortran.dg/use_rename_9.f90: New test.

From-SVN: r263494
2018-08-12 10:55:13 +00:00
Chung-Ju Wu
a493174524 [NDS32] Implement more C ISR extension.
gcc/
	* config.gcc (nds32*): Add nds32_isr.h and nds32_init.inc in
	extra_headers.
	* common/config/nds32/nds32-common.c (nds32_handle_option): Handle
	OPT_misr_secure_ case.
	* config/nds32/nds32-isr.c: Implementation of backward compatibility.
	* config/nds32/nds32-protos.h (nds32_isr_function_critical_p): New.
	* config/nds32/nds32.c (nds32_attribute_table): Add critical and
	secure attribute.
	* config/nds32/nds32.h (nds32_isr_nested_type): Add NDS32_CRITICAL.
	(nds32_isr_info): New field security_level.
	(TARGET_ISR_VECTOR_SIZE_4_BYTE): New macro.
	* config/nds32/nds32.md (return_internal): Consider critical attribute.
	* config/nds32/nds32.opt (misr-secure): New option.
	* config/nds32/nds32_init.inc: New file.
	* config/nds32/nds32_isr.h: New file.

libgcc/
	* config/nds32/t-nds32-isr: Rearrange object dependency.
	* config/nds32/initfini.c: Add dwarf2 unwinding support.
	* config/nds32/isr-library/adj_intr_lvl.inc: Consider new extensions
	and registers usage.
	* config/nds32/isr-library/excp_isr.S: Ditto.
	* config/nds32/isr-library/intr_isr.S: Ditto.
	* config/nds32/isr-library/reset.S: Ditto.
	* config/nds32/isr-library/restore_all.inc: Ditto.
	* config/nds32/isr-library/restore_mac_regs.inc: Ditto.
	* config/nds32/isr-library/restore_partial.inc: Ditto.
	* config/nds32/isr-library/restore_usr_regs.inc: Ditto.
	* config/nds32/isr-library/save_all.inc: Ditto.
	* config/nds32/isr-library/save_mac_regs.inc: Ditto.
	* config/nds32/isr-library/save_partial.inc: Ditto.
	* config/nds32/isr-library/save_usr_regs.inc: Ditto.
	* config/nds32/isr-library/vec_vid*.S: Consider 4-byte vector size.

From-SVN: r263493
2018-08-12 07:38:40 +00:00
GCC Administrator
39d2c7ed9f Daily bump.
From-SVN: r263492
2018-08-12 00:16:29 +00:00
John David Anglin
2b1969f635 pa.md (UNSPEC_MEMORY_BARRIER): New unspec enum.
gcc
	* config/pa/pa.md (UNSPEC_MEMORY_BARRIER): New unspec enum.
	Update comment for atomic instructions.
	(atomic_storeqi, atomic_storehi, atomic_storesi, atomic_storesf,
	atomic_loaddf, atomic_loaddf_1, atomic_storedf, atomic_storedf_1):
	Remove.
	(atomic_loaddi): Revise fence expansion to only emit fence prior to
	load for __ATOMIC_SEQ_CST model.
	(atomic_loaddi_1): Remove float register target.
	(atomic_storedi): Handle CONST_INT values.
	(atomic_storedi_1): Remove float register source.  Add special case
	for zero value.
	(memory_barrier): New expander and insn.

	libgcc
	* config/pa/linux-atomic.c: Update comment.
	(FETCH_AND_OP_2, OP_AND_FETCH_2, FETCH_AND_OP_WORD, OP_AND_FETCH_WORD,
	COMPARE_AND_SWAP_2, __sync_val_compare_and_swap_4,
	SYNC_LOCK_TEST_AND_SET_2, __sync_lock_test_and_set_4): Use
	__ATOMIC_RELAXED for atomic loads.
	(SYNC_LOCK_RELEASE_1): New define.  Use __sync_synchronize() and
	unordered store to release lock.
	(__sync_lock_release_8): Likewise.
	(SYNC_LOCK_RELEASE_2): Remove define.

From-SVN: r263488
2018-08-11 21:37:55 +00:00
Jakub Jelinek
8be591a9cd re PR tree-optimization/86835 (Bogus "is used uninitialized" warning with -ffast-math)
PR tree-optimization/86835
	* tree-ssa-math-opts.c (insert_reciprocals): Even when inserting
	new_stmt after def_gsi, make sure to insert new_square_stmt after
	that stmt, not 2 stmts before it.

	* gcc.dg/pr86835.c: New test.

From-SVN: r263487
2018-08-11 13:29:12 +02:00
Jason Merrill
fc186cbd1c PR c++/86728 - C variadic generic lambda.
* parser.c (cp_parser_parameter_declaration): Don't turn 'auto' into
	a pack if it's followed by a declarator-id.

From-SVN: r263484
2018-08-11 06:47:03 -04:00
GCC Administrator
1d03ff3ff1 Daily bump.
From-SVN: r263483
2018-08-11 00:16:30 +00:00
Jonathan Wakely
b66e5a95c0 PR libstdc++/68210 adjust operator new and delete for LWG 206
Ensure that nothrow versions of new and delete call the ordinary
versions of new or delete, instead of calling malloc or free directly.

These files are all compiled with -std=gnu++14 so can use noexcept and
nullptr to make the code more readable.

	PR libstdc++/68210
	* doc/xml/manual/intro.xml: Document LWG 206 change.
	* libsupc++/del_op.cc: Replace _GLIBCXX_USE_NOEXCEPT with noexcept.
	* libsupc++/del_opa.cc: Likewise.
	* libsupc++/del_opant.cc: Likewise.
	* libsupc++/del_opnt.cc: Likewise. Call operator delete(ptr) instead
	of free(ptr).
	* libsupc++/del_ops.cc: Replace _GLIBCXX_USE_NOEXCEPT with noexcept.
	* libsupc++/del_opsa.cc: Likewise.
	* libsupc++/del_opva.cc: Likewise.
	* libsupc++/del_opvant.cc: Likewise.
	* libsupc++/del_opvnt.cc: Likewise. Call operator delete[](ptr)
	instead of operator delete(ptr).
	* libsupc++/del_opvs.cc: Replace _GLIBCXX_USE_NOEXCEPT with noexcept.
	* libsupc++/del_opvsa.cc: Likewise.
	* libsupc++/new_op.cc: Use __builtin_expect in check for zero size.
	* libsupc++/new_opa.cc: Use nullptr instead of literal 0.
	* libsupc++/new_opant.cc: Likewise. Replace _GLIBCXX_USE_NOEXCEPT
	with noexcept.
	* libsupc++/new_opnt.cc: Likewise. Call operator new(sz) instead of
	malloc(sz).
	* libsupc++/new_opvant.cc: Use nullptr and noexcept.
	* libsupc++/new_opvnt.cc: Likewise. Call operator new[](sz) instead of
	operator new(sz, nothrow).
	* testsuite/18_support/new_nothrow.cc: New test.

From-SVN: r263478
2018-08-10 21:20:27 +01:00
Jonathan Wakely
6894c57b1e Fix formatting in ChangeLog
From-SVN: r263476
2018-08-10 20:04:01 +01:00
Janus Weil
bf9197df81 re PR fortran/57160 (short-circuit IF only with -ffrontend-optimize)
2018-08-10  Janus Weil  <janus@gcc.gnu.org>

	PR fortran/57160
	* invoke.texi (frontend-optimize): Mention short-circuiting.
	* options.c (gfc_post_options): Disable -ffrontend-optimize with -Og.
	* resolve.c (resolve_operator): Warn about short-circuiting only with
	-ffrontend-optimize.
	* trans-expr.c (gfc_conv_expr_op): Use short-circuiting operators only
	with -ffrontend-optimize. Without that flag, make sure that both
	operands are evaluated.

2018-08-10  Janus Weil  <janus@gcc.gnu.org>

	PR fortran/57160
	* gfortran.dg/actual_pointer_function_1.f90: Fix invalid test case.
	* gfortran.dg/inline_matmul_23.f90: Add option "-ffrontend-optimize".
	* gfortran.dg/short_circuiting_2.f90: New test case.
	* gfortran.dg/short_circuiting_3.f90: New test case.

From-SVN: r263471
2018-08-10 16:08:53 +02:00
Martin Liska
8b9a5b5e0e Remove not needed __builtin_expect due to malloc predictor.
2018-08-10  Martin Liska  <mliska@suse.cz>

	* libsupc++/new_op.cc (new): Remove __builtin_expect as malloc
        predictor can handle that.
	* libsupc++/new_opa.cc: Likewise.
	* libsupc++/new_opnt.cc (new): Likewise.

From-SVN: r263470
2018-08-10 11:40:40 +00:00
Martin Liska
aa40590559 Fix wrongly removed line.
2018-08-10  Martin Liska  <mliska@suse.cz>

	* MAINTAINERS: Revert change in previous commit and
        join lines.

From-SVN: r263469
2018-08-10 11:38:12 +00:00
Martin Liska
04e2b41d41 Fix extra line in MAINTAINERS.
2018-08-10  Martin Liska  <mliska@suse.cz>

	* MAINTAINERS: Remove extra line.

From-SVN: r263468
2018-08-10 10:36:12 +00:00
Alexander Monakov
f80d6a178e i386: do not use SImode mul-highpart on 64-bit (PR 82418)
PR target/82418
	* config/i386/i386.md (<s>mul<mode>3_highpart): Use DWIH mode iterator
	instead of SWI48.

testsuite/
	* gcc.target/i386/pr82418.c: New test.

From-SVN: r263467
2018-08-10 13:13:37 +03:00
Martin Liska
1e9168b279 Introduce __builtin_expect_with_probability (PR target/83610).
2018-08-10  Martin Liska  <mliska@suse.cz>

        PR target/83610
	* builtin-types.def (BT_FN_LONG_LONG_LONG_DOUBLE): Add new
        function type.
	* builtins.c (expand_builtin_expect_with_probability):
        New function.
	(expand_builtin_expect_with_probability): New function.
	(build_builtin_expect_predicate): Add new argumnet probability
        for BUILT_IN_EXPECT_WITH_PROBABILITY.
	(fold_builtin_expect):
	(fold_builtin_2):
	(fold_builtin_3):
	* builtins.def (BUILT_IN_EXPECT_WITH_PROBABILITY):
	* builtins.h (fold_builtin_expect): Set new argument.
	* doc/extend.texi: Document __builtin_expect_with_probability.
	* doc/invoke.texi: Likewise.
	* gimple-fold.c (gimple_fold_call): Pass new argument.
	* ipa-fnsummary.c (find_foldable_builtin_expect): Handle
        also BUILT_IN_EXPECT_WITH_PROBABILITY.
	* predict.c (get_predictor_value): New function.
	(expr_expected_value): Add new argument probability. Assume
        that predictor and probability are always non-null.
	(expr_expected_value_1): Likewise.  For __builtin_expect and
        __builtin_expect_with_probability set probability.  Handle
        combination in binary expressions.
	(tree_predict_by_opcode): Simplify code by simply calling
        get_predictor_value.
	(pass_strip_predict_hints::execute): Add handling of
        BUILT_IN_EXPECT_WITH_PROBABILITY.
	* predict.def (PRED_BUILTIN_EXPECT_WITH_PROBABILITY): Add
        new predictor.
	* tree.h (DECL_BUILT_IN_P): New function.
2018-08-10  Martin Liska  <mliska@suse.cz>

        PR target/83610
	* gcc.dg/predict-17.c: New test.
	* gcc.dg/predict-18.c: New test.
	* gcc.dg/predict-19.c: New test.

From-SVN: r263466
2018-08-10 09:43:06 +00:00
Martin Liska
7a096965f6 Strip only selected predictors after early tree passes (PR tree-optimization/85799).
2018-08-10  Martin Liska  <mliska@suse.cz>

        PR tree-optimization/85799
	* passes.def: Add argument for pass_strip_predict_hints.
	* predict.c (class pass_strip_predict_hints): Add new argument
        early_p.
	(strip_predictor_early): New function.
	(pass_strip_predict_hints::execute): Call the function to
        strip predictors.
	(strip_predict_hints): New function.
	* predict.def: Fix comment.
2018-08-10  Martin Liska  <mliska@suse.cz>

        PR tree-optimization/85799
	* gcc.dg/pr85799.c: New test.

From-SVN: r263465
2018-08-10 09:31:51 +00:00
Thomas Preud'homme
d568f0b6db Clarify source of tm.texi to copy for GFDL grant
When tm.texi.in is updated in the source tree, the following message
gets displayed:

Verify that you have permission to grant a GFDL license for all
new text in tm.texi, then copy it to <gcc src dir>/gcc/doc/tm.texi.

Having been myself and some colleagues confused several time by that
message as to what tm.texi to copy, I think it would be clearer to
indicate the absolute path for the source as well. This patch achieves
that.

2018-08-10  Thomas Preud'homme  <thomas.preudhomme@linaro.org>

    gcc/
    * Makefile.in: Clarify which tm.texi to copy over to assert the
    right to grant a GFDL license for all.

From-SVN: r263464
2018-08-10 08:48:34 +00:00
Sebastian Huber
ee6ad3e788 libstdc++-v3: Have aligned_alloc() on Newlib
While building for Newlib, some configure checks must be hard coded.
The aligned_alloc() is supported since 2015 in Newlib.

libstdc++-v3/

	PR target/85904
	* configure.ac: Define HAVE_ALIGNED_ALLOC if building for
	Newlib.
	* configure: Regenerate.

From-SVN: r263461
2018-08-10 06:27:35 +00:00
GCC Administrator
f047d28abb Daily bump.
From-SVN: r263460
2018-08-10 00:16:29 +00:00
Jonathan Wakely
1fc9d0b0e4 Define aliases for containers using polymorphic_allocator
These aliases are placed in the top-level header, e.g. <vector> not
<bits/stl_vector.h>. This ensures that they refer to whichever of
std::vector or __debug::vector or __profile::vector is in use when the
header is included.

	* include/std/deque (std::pmr::deque): Declare alias.
	* include/std/forward_list (std::pmr::forward_list): Likewise.
	* include/std/list (std::pmr::list): Likewise.
	* include/std/map (std::pmr::map, std::pmr::multimap): Likewise.
	* include/std/regex (std::pmr::match_results, std::pmr::cmatch)
	(std::pmr::smatch, std::pmr::wcmatch, std::pmr::wsmatch): Likewise.
	* include/std/set (std::pmr::set, std::pmr::multiset): Likewise.
	* include/std/string (std::pmr::basic_string, std::pmr::string)
	(std::pmr::u16string, std::pmr::u32string, std::pmr::wstring):
	Likewise.
	* include/std/unordered_map (std::pmr::unordered_map)
	(std::pmr::unordered_multimap): Likewise.
	* include/std/unordered_set (std::pmr::unordered_set)
	(std::pmr::unordered_multiset): Likewise.
	* include/std/vector (std::pmr::vector): Likewise.
	* testsuite/21_strings/basic_string/types/pmr_typedefs.cc: New test.
	* testsuite/23_containers/deque/types/pmr_typedefs.cc: New test.
	* testsuite/23_containers/forward_list/pmr_typedefs.cc: New test.
	* testsuite/23_containers/list/pmr_typedefs.cc: New test.
	* testsuite/23_containers/map/pmr_typedefs.cc: New test.
	* testsuite/23_containers/multimap/pmr_typedefs.cc: New test.
	* testsuite/23_containers/multiset/pmr_typedefs.cc: New test.
	* testsuite/23_containers/set/pmr_typedefs.cc: New test.
	* testsuite/23_containers/unordered_map/pmr_typedefs.cc: New test.
	* testsuite/23_containers/unordered_multimap/pmr_typedefs.cc: New
	test.
	* testsuite/23_containers/unordered_multiset/pmr_typedefs.cc: New
	test.
	* testsuite/23_containers/unordered_set/pmr_typedefs.cc: New test.
	* testsuite/23_containers/vector/pmr_typedefs.cc: New test.
	* testsuite/28_regex/match_results/pmr_typedefs.cc: New test.

From-SVN: r263456
2018-08-10 00:25:53 +01:00
Jeff Law
093f71dbec m68k.c (m68k_adjust_decorated_operand): Remove unused variable.
* config/m68k/m68k.c (m68k_adjust_decorated_operand): Remove
	unused variable.

From-SVN: r263455
2018-08-09 11:18:43 -06:00
Jeff Law
568f6ad572 re PR middle-end/86897 (gcc.dg/uninit-suppress_2.c FAILs)
PR middle-end/86897
	* gcc.dg/uninit-suppress_2.c: Disable DOM.

From-SVN: r263454
2018-08-09 11:11:45 -06:00
Richard Earnshaw
cdaa7e324a Add missing PR to Nios fix for CVE-2017-5753
I nearly missed this patch for my accumulated back-porting list since
it didn't have the PR number in it.

Just adding it so that I can track things properly.  The original
commit landed as r263301.

From-SVN: r263453
2018-08-09 16:53:48 +00:00
Andreas Schwab
6b10fc37f7 m68k-protos.h (m68k_final_prescan_insn): Remove prototype.
* config/m68k/m68k-protos.h (m68k_final_prescan_insn): Remove
prototype.

From-SVN: r263452
2018-08-09 16:25:12 +00:00
Richard Sandiford
b8d5e148f6 Allow inner-loop reductions with variable-length vectors
While working on PR 86871, I noticed we were being overly restrictive
when handling variable-length vectors.  For:

  for (i : ...)
    {
      res = ...;
      for (j : ...)
        res op= ...;
      a[i] = res;
    }

we don't need a reduction operation (although we do for double
reductions like:

  res = ...;
  for (i : ...)
    for (j : ...)
      res op= ...;
  a[i] = res;

which must still be rejected).

2018-08-08  Richard Sandiford  <richard.sandiford@arm.com>

gcc/
	* tree-vect-loop.c (vectorizable_reduction): Allow inner-loop
	reductions for variable-length vectors.

gcc/testsuite/
	* gcc.target/aarch64/sve/reduc_8.c: New test.

From-SVN: r263451
2018-08-09 16:03:25 +00:00
David Malcolm
56b61d7fc4 diagnostics: add line numbers to source (PR other/84889)
This patch adds a left margin to the lines of source (and annotations)
printed by diagnostic_show_locus, so that e.g. rather than:

test.c: In function 'test':
test.c:12:15: error: 'struct foo' has no member named 'm_bar'; did you mean 'bar'?
   return ptr->m_bar;
               ^~~~~
               bar

we print:

test.c: In function 'test':
test.c:12:15: error: 'struct foo' has no member named 'm_bar'; did you mean 'bar'?
12 |   return ptr->m_bar;
   |               ^~~~~
   |               bar

Similarly, for a multiline case (in C++ this time), this:

bad-binary-ops.C: In function 'int test_2()':
bad-binary-ops.C:26:4: error: no match for 'operator+' (operand types are 's' and 't')
   return (some_function ()
           ~~~~~~~~~~~~~~~~
    + some_other_function ());
    ^~~~~~~~~~~~~~~~~~~~~~~~

becomes:

bad-binary-ops.C: In function 'int test_2()':
bad-binary-ops.C:26:4: error: no match for 'operator+' (operand types are 's' and 't')
25 |   return (some_function ()
   |           ~~~~~~~~~~~~~~~~
26 |    + some_other_function ());
   |    ^~~~~~~~~~~~~~~~~~~~~~~~

I believe this slightly improves the readability of the output, in that it:
- distinguishes between the user's source code vs the annotation lines
  that we're adding (the underlinings and fix-it hints here)
- shows the line numbers in another place (potentially helpful for
  multiline diagnostics, where the user can see the line numbers directly,
  rather than have to figure them out relative to the caret: in the 2nd
  example, note how the diagnostic is reported at line 26, but the first
  line printed is actually line 25)

I'm not sure that this is the precise format we want to go with [1], but
I think it's an improvement over the status quo, and we're in stage 1
of gcc 9, so there's plenty of time to shake out issues.

I've turned it on by default; it can be disabled via
-fno-diagnostics-show-line-numbers (it's also turned off in the testsuite, to
avoid breaking numerous existing test cases).

[1] Some possible variants:
  - maybe just "LL|" rather than "LL | "
  - maybe ':' rather than '|'
  - maybe we should have some leading indentation, to better split up
    the diagnostics visually via the left-hand column
  - etc

gcc/ChangeLog:
	PR other/84889
	* common.opt (fdiagnostics-show-line-numbers): New option.
	* diagnostic-show-locus.c (class layout): Add fields
	"m_show_line_numbers_p" and "m_linenum_width";
	(num_digits): New function.
	(test_num_digits): New function.
	(layout::layout): Initialize new fields.  Update m_x_offset
	logic to handle any left margin.
	(layout::print_source_line): Print line number when requested.
	(layout::start_annotation_line): New member function.
	(layout::print_annotation_line): Call it.
	(layout::print_leading_fixits): Likewise.
	(layout::print_trailing_fixits): Likewise.  Update calls to
	move_to_column for new parameter.
	(layout::get_x_bound_for_row): Add "add_left_margin" param and use
	it to potentially call start_annotation_line.
	(layout::show_ruler): Call start_annotation_line.
	(selftest::test_line_numbers_multiline_range): New selftest.
	(selftest::diagnostic_show_locus_c_tests): Call test_num_digits
	and selftest::test_line_numbers_multiline_range.
	* diagnostic.c (diagnostic_initialize): Initialize
	show_line_numbers_p.
	* diagnostic.h (struct diagnostic_context): Add field
	"show_line_numbers_p".
	* doc/invoke.texi (Diagnostic Message Formatting Options): Add
	-fno-diagnostics-show-line-numbers.
	* dwarf2out.c (gen_producer_string): Add
	OPT_fdiagnostics_show_line_numbers to the ignored options.
	* lto-wrapper.c (merge_and_complain): Likewise to the "pick
	one setting" options.
	(append_compiler_options): Likewise to the dropped options.
	(append_diag_options): Likewise to the passed-on options.
	* opts.c (common_handle_option): Handle the new option.
	* toplev.c (general_init): Set up global_dc->show_line_numbers_p.

gcc/testsuite/ChangeLog:
	PR other/84889
	* gcc.dg/plugin/diagnostic-test-show-locus-bw-line-numbers.c: New
	test.
	* gcc.dg/plugin/diagnostic-test-show-locus-color-line-numbers.c:
	New test.
	* gcc.dg/plugin/plugin.exp (plugin_test_list): Add the new tests.
	* lib/prune.exp: Add -fno-diagnostics-show-line-numbers to
	TEST_ALWAYS_FLAGS.

From-SVN: r263450
2018-08-09 15:32:13 +00:00
Kelvin Nilsen
f4b905f010 extend.texi (PowerPC AltiVec Built-in Functions Available on ISA 2.07): Correct spelling of bcdsub to be __builtin_bcdsub.
gcc/ChangeLog:

2018-08-09  Kelvin Nilsen  <kelvin@gcc.gnu.org>

	* doc/extend.texi (PowerPC AltiVec Built-in Functions Available on
	ISA 2.07): Correct spelling of bcdsub to be __builtin_bcdsub.  Add
	third argument of type "const signed char" to descriptions of
	__builtin_bcdadd, __builtin_bcdadd_lt, __builtin_bcdadd_eq,
	__builtin_bcdadd_gt, __builtin_bcdadd_ov, __builtin_bcdsub,
	__builtin_bcdsub_lt, __builtin_bcdsub_eq, __builtin_bcdsub_gt,
	__builtin_bcdsub_ov functions.

From-SVN: r263449
2018-08-09 15:01:55 +00:00
Richard Sandiford
3dec9a89d4 Restore flow_bb_inside_loop_p tests (PR 86858)
The series to remove vinfo_for_stmt also removed tests of
flow_bb_inside_loop_p if the call was simply testing whether the
statement was in the vectorisation region.  I'd tried to keep calls
that were testing whether the statement was in a particular loop
(inner or outer), but messed up in vect_is_simple_reduction and
removed calls that were actually needed.  This patch restores them.

I double-checked the other removed calls and I think these are
the only ones affected.

2018-08-08  Richard Sandiford  <richard.sandiford@arm.com>

gcc/
	PR tree-optimization/86858
	* tree-vect-loop.c (vect_is_simple_reduction): Restore
	flow_bb_inside_loop_p calls.

gcc/testsuite/
	PR tree-optimization/86858
	* gcc.dg/vect/pr86858.c: New test.

From-SVN: r263448
2018-08-09 14:45:02 +00:00
Richard Sandiford
4beb66421f Fix invalid assumption in vect_transform_stmt (PR 86871)
The handling of outer-loop uses of inner-loop definitions assumed
that anything that wasn't a PHI would be a gassign.  It's also
possible for it to be a gcall.

2018-08-08  Richard Sandiford  <richard.sandiford@arm.com>

gcc/
	PR tree-optimization/86871
	* tree-vect-stmts.c (vect_transform_stmt): Use gimple_get_lhs
	instead of gimple_assign_lhs.

gcc/testsuite/
	PR tree-optimization/86871
	* gcc.dg/vect/pr86871.c: New test.

From-SVN: r263447
2018-08-09 14:37:24 +00:00
Richard Earnshaw
16621f0de3 aarch64 - PR target/86887 Fix missing register constraints in carryin patterns
Some of the carryin insn patterns are missing a register constraint.
That means that the register allocator can pick practically anything
to hold that value, including memory locations, or registers of the
wrong class.

	PR target/86887
	* config/aarch64/aarch64.md (add<mode>3_carryinC_zero): Add missing
	register constraint to operand 0.
	(add<mode>3_carryinC): Likewise.
	(add<mode>3_carryinV_zero, add<mode>3_carryinV): Likewise.

From-SVN: r263446
2018-08-09 13:39:17 +00:00
Paolo Carlini
40c27f7d97 p784.C: Add -fpermissive.
2018-08-09  Paolo Carlini  <paolo.carlini@oracle.com>

	* g++.old-deja/g++.mike/p784.C: Add -fpermissive.

From-SVN: r263445
2018-08-09 11:49:26 +00:00
Martin Liska
35cf9fd028 Remove extra line in common.opt (PR c/86895).
2018-08-09  Martin Liska  <mliska@suse.cz>

        PR c/86895
	* common.opt: Remove extra line.

From-SVN: r263444
2018-08-09 10:37:02 +00:00
Andreas Krebbel
be03e78511 S/390: Fix target attribute tests
These broke after removing G5 and G6 CPUs from the processor
enumeration.

gcc/testsuite/ChangeLog:

2018-08-09  Andreas Krebbel  <krebbel@linux.ibm.com>

	* gcc.target/s390/target-attribute/tattr-arch-tune-1.c: Decrement
	arch and tune numbers by 2.
	* gcc.target/s390/target-attribute/tattr-arch-tune-2.c: Likewise.
	* gcc.target/s390/target-attribute/tattr-m31-1.c: Likewise.
	* gcc.target/s390/target-attribute/tattr-m31-10.c: Likewise.
	* gcc.target/s390/target-attribute/tattr-m31-11.c: Likewise.
	* gcc.target/s390/target-attribute/tattr-m31-12.c: Likewise.
	* gcc.target/s390/target-attribute/tattr-m31-13.c: Likewise.
	* gcc.target/s390/target-attribute/tattr-m31-14.c: Likewise.
	* gcc.target/s390/target-attribute/tattr-m31-15.c: Likewise.
	* gcc.target/s390/target-attribute/tattr-m31-16.c: Likewise.
	* gcc.target/s390/target-attribute/tattr-m31-17.c: Likewise.
	* gcc.target/s390/target-attribute/tattr-m31-18.c: Likewise.
	* gcc.target/s390/target-attribute/tattr-m31-19.c: Likewise.
	* gcc.target/s390/target-attribute/tattr-m31-2.c: Likewise.
	* gcc.target/s390/target-attribute/tattr-m31-20.c: Likewise.
	* gcc.target/s390/target-attribute/tattr-m31-21.c: Likewise.
	* gcc.target/s390/target-attribute/tattr-m31-22.c: Likewise.
	* gcc.target/s390/target-attribute/tattr-m31-23.c: Likewise.
	* gcc.target/s390/target-attribute/tattr-m31-24.c: Likewise.
	* gcc.target/s390/target-attribute/tattr-m31-25.c: Likewise.
	* gcc.target/s390/target-attribute/tattr-m31-26.c: Likewise.
	* gcc.target/s390/target-attribute/tattr-m31-27.c: Likewise.
	* gcc.target/s390/target-attribute/tattr-m31-28.c: Likewise.
	* gcc.target/s390/target-attribute/tattr-m31-29.c: Likewise.
	* gcc.target/s390/target-attribute/tattr-m31-3.c: Likewise.
	* gcc.target/s390/target-attribute/tattr-m31-30.c: Likewise.
	* gcc.target/s390/target-attribute/tattr-m31-31.c: Likewise.
	* gcc.target/s390/target-attribute/tattr-m31-32.c: Likewise.
	* gcc.target/s390/target-attribute/tattr-m31-4.c: Likewise.
	* gcc.target/s390/target-attribute/tattr-m31-5.c: Likewise.
	* gcc.target/s390/target-attribute/tattr-m31-6.c: Likewise.
	* gcc.target/s390/target-attribute/tattr-m31-7.c: Likewise.
	* gcc.target/s390/target-attribute/tattr-m31-8.c: Likewise.
	* gcc.target/s390/target-attribute/tattr-m31-9.c: Likewise.
	* gcc.target/s390/target-attribute/tattr-m64-1.c: Likewise.
	* gcc.target/s390/target-attribute/tattr-m64-10.c: Likewise.
	* gcc.target/s390/target-attribute/tattr-m64-11.c: Likewise.
	* gcc.target/s390/target-attribute/tattr-m64-12.c: Likewise.
	* gcc.target/s390/target-attribute/tattr-m64-13.c: Likewise.
	* gcc.target/s390/target-attribute/tattr-m64-14.c: Likewise.
	* gcc.target/s390/target-attribute/tattr-m64-15.c: Likewise.
	* gcc.target/s390/target-attribute/tattr-m64-16.c: Likewise.
	* gcc.target/s390/target-attribute/tattr-m64-17.c: Likewise.
	* gcc.target/s390/target-attribute/tattr-m64-18.c: Likewise.
	* gcc.target/s390/target-attribute/tattr-m64-19.c: Likewise.
	* gcc.target/s390/target-attribute/tattr-m64-2.c: Likewise.
	* gcc.target/s390/target-attribute/tattr-m64-20.c: Likewise.
	* gcc.target/s390/target-attribute/tattr-m64-21.c: Likewise.
	* gcc.target/s390/target-attribute/tattr-m64-22.c: Likewise.
	* gcc.target/s390/target-attribute/tattr-m64-23.c: Likewise.
	* gcc.target/s390/target-attribute/tattr-m64-24.c: Likewise.
	* gcc.target/s390/target-attribute/tattr-m64-25.c: Likewise.
	* gcc.target/s390/target-attribute/tattr-m64-26.c: Likewise.
	* gcc.target/s390/target-attribute/tattr-m64-27.c: Likewise.
	* gcc.target/s390/target-attribute/tattr-m64-28.c: Likewise.
	* gcc.target/s390/target-attribute/tattr-m64-29.c: Likewise.
	* gcc.target/s390/target-attribute/tattr-m64-3.c: Likewise.
	* gcc.target/s390/target-attribute/tattr-m64-30.c: Likewise.
	* gcc.target/s390/target-attribute/tattr-m64-31.c: Likewise.
	* gcc.target/s390/target-attribute/tattr-m64-32.c: Likewise.
	* gcc.target/s390/target-attribute/tattr-m64-33.c: Likewise.
	* gcc.target/s390/target-attribute/tattr-m64-4.c: Likewise.
	* gcc.target/s390/target-attribute/tattr-m64-5.c: Likewise.
	* gcc.target/s390/target-attribute/tattr-m64-6.c: Likewise.
	* gcc.target/s390/target-attribute/tattr-m64-7.c: Likewise.
	* gcc.target/s390/target-attribute/tattr-m64-8.c: Likewise.
	* gcc.target/s390/target-attribute/tattr-m64-9.c: Likewise.

From-SVN: r263443
2018-08-09 08:47:39 +00:00
Martin Liska
874ffe9e20 Fix typos in params.def.
2018-08-09  Martin Liska  <mliska@suse.cz>

	* params.def (PARAM_ALIGN_LOOP_ITERATIONS): Remove double dots
        at the end of a line, make first letter capital and end up
        a sentence with a dot.
	(PARAM_LOOP_INTERCHANGE_STRIDE_RATIO): Likewise.
	(PARAM_LOOP_BLOCK_TILE_SIZE): Likewise.
	(PARAM_GRAPHITE_MAX_NB_SCOP_PARAMS): Likewise.
	(PARAM_GRAPHITE_MAX_ARRAYS_PER_SCOP): Likewise.
	(PARAM_MAX_ISL_OPERATIONS): Likewise.
	(PARAM_GRAPHITE_ALLOW_CODEGEN_ERRORS): Likewise.
	(PARAM_PROFILE_FUNC_INTERNAL_ID): Likewise.
	(PARAM_INDIR_CALL_TOPN_PROFILE): Likewise.
	(PARAM_SLP_MAX_INSNS_IN_BB): Likewise.
	(PARAM_IPA_CP_EVAL_THRESHOLD): Likewise.
	(PARAM_IPA_CP_RECURSION_PENALTY): Likewise.
	(PARAM_IPA_CP_SINGLE_CALL_PENALTY): Likewise.
	(PARAM_IPA_CP_LOOP_HINT_BONUS): Likewise.
	(PARAM_IPA_CP_ARRAY_INDEX_HINT_BONUS): Likewise.
	(PARAM_TREE_REASSOC_WIDTH): Likewise.
	(PARAM_HSA_GEN_DEBUG_STORES): Likewise.
	(PARAM_MAX_SPECULATIVE_DEVIRT_MAYDEFS): Likewise.
	(PARAM_MAX_VRP_SWITCH_ASSERTIONS): Likewise.

From-SVN: r263442
2018-08-09 08:08:44 +00:00
Andreas Krebbel
0b06c9a6da S/390: Fix PR84332 ICE with stack clash protection
Our implementation of the stack probe requires the probe interval to
be used as displacement in an address operand.  The maximum probe
interval currently is 64k.  This would exceed short displacements.
Trim that value down to 4k if that happens.  This might result in too
many probes being generated only on the oldest supported machine level
z900.

gcc/ChangeLog:

2018-08-09  Andreas Krebbel  <krebbel@linux.ibm.com>

	PR target/84332
	* config/s390/s390.c (s390_option_override_internal): Reduce the
	stack-clash-protection-probe-interval param if it would be too big
	for z900.

gcc/testsuite/ChangeLog:

2018-08-09  Andreas Krebbel  <krebbel@linux.ibm.com>

	PR target/84332
	* gcc.target/s390/pr84332.c: New testcase.

From-SVN: r263441
2018-08-09 07:06:23 +00:00