Commit Graph

170969 Commits

Author SHA1 Message Date
Ian Lance Taylor 4a14082645 compile, runtime: permit anonymous and empty fields in C header
Permit putting structs with anonymous and empty fields in the C header
    file runtime.inc that is used to build the C runtime code.  This is
    required for upcoming 1.13 support, as the m struct has picked up an
    anonymous field.
    
    Doing this lets the C header contain all the type descriptor structs,
    so start using those in the C code.  This cuts the number of copies of
    type descriptor definitions from 3 to 2.
    
    Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/192343

From-SVN: r275227
2019-08-30 21:49:49 +00:00
Jonathan Wakely aff0632d4f Fix ChangeLog
From-SVN: r275223
2019-08-30 21:00:28 +01:00
Martin Sebor 648af16845 PR middle-end/91599 - GCC does not say where warning is happening
gcc/ChangeLog:

	PR middle-end/91599
	* tree-ssa-strlen.c (handle_store): Use a fallback location if
	the statement doesn't have one.
	* gimple-pretty-print.c (percent_G_format): Same.

gcc/testsuite/ChangeLog:

	PR middle-end/91599
	* gcc.dg/Wstringop-overflow-16.c: New test.

From-SVN: r275211
2019-08-30 11:49:17 -06:00
Martin Sebor 5d69df7e92 PR middle-end/91584 - Bogus warning from -Warray-bounds during string assignment
gcc/ChangeLog:

	PR middle-end/91584
	* tree-vrp.c (vrp_prop::check_mem_ref): Normalize type domain bounds
	before using them to validate MEM_REF offset.

gcc/testsuite/ChangeLog:
	* gfortran.dg/char_array_constructor_4.f90: New test.

From-SVN: r275210
2019-08-30 11:42:57 -06:00
Antony Polukhin 7259a9d577 Optimize std::to_chars
Bunch of micro optimizations for std::to_chars:
* For base == 8 replacing the lookup in __digits table with arithmetic
computations leads to a same CPU cycles for a loop (exchanges two movzx
with 3 bit ops). However this saves 129 bytes of data and totally avoids
a chance of cache misses on __digits.
* For base == 16 replacing the lookup in __digits table with
arithmetic computations leads to a few additional instructions, but
totally avoids a chance of cache misses on __digits (- ~9 cache misses
for worst case) and saves 513 bytes of const data.
* Replacing __first[pos] and __first[pos - 1] with __first[1] and
__first[0] on final iterations saves ~2% of code size.
* Removing trailing '\0' from arrays of digits allows the linker to
merge the symbols (so that "0123456789abcdefghijklmnopqrstuvwxyz" and
"0123456789abcdef" could share the same address). This improves data
locality and reduces binary sizes.
* Using __detail::__to_chars_len_2 instead of a generic
__detail::__to_chars_len makes the operation O(1) instead of O(N). It
also makes the code two times shorter.

In sum: this significantly reduces the size of a binary (for about 4KBs
only for base-8 conversion), deals with latency (CPU cache misses)
without changing the iterations count and without adding costly
instructions into the loops.

2019-08-30  Antony Polukhin  <antoshkka@gmail.com>

	* include/std/charconv (__detail::__to_chars_8)
	__detail::__to_chars_16): Replace array of precomputed digits with
	arithmetic operations to avoid CPU cache misses. Remove zero
	termination from array of digits to allow symbol merge with generic
	implementation of __detail::__to_chars. Replace final offsets with
	constants. Use __detail::__to_chars_len_2 instead of a generic
	__detail::__to_chars_len.
	(__detail::__to_chars): Remove zero termination from array of digits.
	(__detail::__to_chars_2): Leading digit is always '1'.

From-SVN: r275205
2019-08-30 17:25:24 +01:00
Jonathan Wakely 1ecaf589db Fix errors in new test
* testsuite/23_containers/vector/cons/89164_c++17.cc: Fix errors.

From-SVN: r275204
2019-08-30 17:25:20 +01:00
Eric Botcazou 875bdbe2f6 decl.c (maybe_saturate_size): New function.
* gcc-interface/decl.c (maybe_saturate_size): New function.
	(gnat_to_gnu_entity): Invoke it on the Esize of types before sending
	it for back-annotations.
	* gcc-interface/trans.c: Fix typo.

From-SVN: r275200
2019-08-30 15:32:51 +00:00
Uros Bizjak f76cf133e2 baseline_symbols.txt: Update.
* config/abi/post/alpha-linux-gnu/baseline_symbols.txt: Update.

From-SVN: r275199
2019-08-30 17:27:10 +02:00
Eric Botcazou 1edbeb153d ada-tree.h (DECL_FORCED_BY_REF_P): New macro.
* gcc-interface/ada-tree.h (DECL_FORCED_BY_REF_P): New macro.
	* gcc-interface/decl.c (gnat_to_gnu_param): Set it on parameters
	whose mechanism was forced to by-reference.
	* gcc-interface/trans.c (Call_to_gnu): Do not issue a warning about a
	misaligned actual parameter if it is based on a CONSTRUCTOR.  Remove
 	obsolete warning for users of Starlet.  Issue a warning if a temporary
	is make around the call for a parameter with DECL_FORCED_BY_REF_P set.
	(addressable_p): Return true for REAL_CST and ADDR_EXPR.

From-SVN: r275198
2019-08-30 15:22:34 +00:00
Eric Botcazou 5e017b1e25 trans.c (gnat_to_gnu): Do not set the location on an expression used for a tag.
* gcc-interface/trans.c (gnat_to_gnu): Do not set the location on an
	expression used for a tag.

From-SVN: r275197
2019-08-30 15:15:40 +00:00
Eric Botcazou 0c2837b5c4 gigi.h (aggregate_type_contains_array_p): Declare.
* gcc-interface/gigi.h (aggregate_type_contains_array_p): Declare.
	* gcc-interface/decl.c (gnat_to_gnu_entity) <E_Record_Type>: For an
	extension, test Has_Record_Rep_Clause instead of Has_Specified_Layout.
	(adjust_packed): Return 0 if the type of the field is an aggregate
	type that contains (or is) a self-referential array.
	(type_has_variable_size): Delete.
	* gcc-interface/utils.c (inish_record_type): Constify a variable.
	(aggregate_type_contains_array_p): Add parameter SELF_REFERENTIAL.
	<RECORD_TYPE>: Pass it in the recursive call.
	<ARRAY_TYPE>: If it is true, return true only if the array type is
	self-referential.
	(create_field_decl): Streamline the setting of the alignment on the
	field.  Pass false to aggregate_type_contains_array_p.

From-SVN: r275196
2019-08-30 15:12:20 +00:00
Jeff Law c85dbadc06 * gcc.target/mips/r10k-cache-barrier-9.c: Suppress warnings.
From-SVN: r275195
2019-08-30 09:10:14 -06:00
Eric Botcazou 7f6dd1021e trans.c (lvalue_required_p): Adjust GNU_TYPE in the recursive call.
* gcc-interface/trans.c (lvalue_required_p) <N_Slice>: Adjust GNU_TYPE
	in the recursive call.
	<N_Selected_Component>: Likewise.

From-SVN: r275191
2019-08-30 14:48:16 +00:00
Eric Botcazou e5969b734d utils.c (build_template): Deal with parameters passed by pointer to component of multi-dimensional arrays.
* gcc-interface/utils.c (build_template): Deal with parameters
	passed by pointer to component of multi-dimensional arrays.

From-SVN: r275190
2019-08-30 14:44:50 +00:00
Eric Botcazou 37cf930263 decl.c (annotate_value): Inline the call also if List_Representation_Info is greater than 3.
* gcc-interface/decl.c (annotate_value) <CALL_EXPR>: Inline the call
	also if List_Representation_Info is greater than 3.

From-SVN: r275188
2019-08-30 14:39:09 +00:00
Eric Botcazou da81cc570f * gcc-interface/trans.c (Attribute_to_gnu) <Attr_Size>: Add assertion.
From-SVN: r275187
2019-08-30 14:26:20 +00:00
Marek Polacek 81e753d9c8 * doc/invoke.texi (-Wvolatile): Use @code for volatile.
From-SVN: r275178
2019-08-30 13:55:59 +00:00
Jonathan Wakely 61f5cb2313 PR libstdc++/89164 enforce constraints for uninitialized algos
The memmove optimizations for std::uninitialized_copy/fill/_n will
compile even if the type is not copy constructible, because std::copy
doesn't require copy construction to work. But the uninitialized
algorithms do require it.

This adds explicit static assertions to ensure we don't allow ill-formed
initializations.

	PR libstdc++/89164
	* include/bits/stl_algobase.h (__copy_move): Give descriptive names
	to template parameters.
	* include/bits/stl_uninitialized.h (uninitialized_copy)
	(uninitialized_fill, uninitialized_fill_n): Add static assertions to
	diagnose invalid uses.
	* testsuite/20_util/specialized_algorithms/uninitialized_copy/1.cc:
	Adjust expected error.
	* testsuite/20_util/specialized_algorithms/uninitialized_copy/89164.cc:
	New test.
	* testsuite/20_util/specialized_algorithms/uninitialized_copy_n/
	89164.cc: New test.
	* testsuite/20_util/specialized_algorithms/uninitialized_fill/89164.cc:
	New test.
	* testsuite/20_util/specialized_algorithms/uninitialized_fill_n/
	89164.cc: New test.
	* testsuite/23_containers/vector/cons/89164.cc: New test.
	* testsuite/23_containers/vector/cons/89164_c++17.cc: New test.

From-SVN: r275177
2019-08-30 14:54:49 +01:00
Eric Botcazou 815b536832 gigi.h (gigi_checking_assert): New macro.
* gcc-interface/gigi.h (gigi_checking_assert): New macro.
	* gcc-interface/decl.c (gnat_to_gnu_entity) <E_Modular_Integer_Type>:
	Remove redundant test and adjust comments.  Minor tweaks.
	* gcc-interface/trans.c (Call_to_gnu): Do not generate range checks,
	instead assert that the Do_Range_Check flag is not set.  Adjust call
	to convert_with_check.
	(gnat_to_gnu): Likewise.
	(assoc_to_constructor): Likewise.
	(pos_to_constructor): Likewise.  Remove GNAT_COMPONENT_TYPE parameter.
	(emit_range_check): Delete.
	(convert_with_check): Remove RANGE_P parameter and adjust.  Do a single
	overflow check for modular types.

From-SVN: r275174
2019-08-30 13:50:34 +00:00
Bernd Edlinger 3eefaaa9fe arm.md (unaligned_loaddi, [...]): New unspec insn patterns.
2019-08-30  Bernd Edlinger  <bernd.edlinger@hotmail.de>

        * config/arm/arm.md (unaligned_loaddi,
        unaligned_storedi): New unspec insn patterns.
        * config/arm/neon.md (unaligned_storev8qi): Likewise.
        * config/arm/arm.c (gen_cpymem_ldrd_strd): Use unaligned_loaddi
        and unaligned_storedi for 4-byte aligned memory.
        (arm_block_set_aligned_vect): Use unaligned_storev8qi for
        4-byte aligned memory.

From-SVN: r275063
2019-08-30 10:38:37 +00:00
Martin Jambor bb4d170d7b [PR 91579] Avoid creating redundant PHI nodes in tail-call pass
2019-08-30  Martin Jambor  <mjambor@suse.cz>

	tree-optimization/91579
	* tree-tailcall.c (tailr_arg_needs_copy): New variable.
	(find_tail_calls): Allocate tailr_arg_needs_copy and set its bits as
	appropriate.
	(arg_needs_copy_p): Removed.
	(eliminate_tail_call): Test tailr_arg_needs_copy instead of calling
	arg_needs_copy_p.
	(tree_optimize_tail_calls_1): Likewise.  Free tailr_arg_needs_copy.

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

From-SVN: r275062
2019-08-30 10:08:42 +02:00
GCC Administrator ffb738a286 Daily bump.
From-SVN: r275059
2019-08-30 00:16:23 +00:00
Uros Bizjak 2a3daf5b61 * config/i386/i386-features.c
(general_scalar_chain::compute_convert_gain):
	Correct cost for double-word shifts.
	(general_scalar_to_vector_candidate_p): Reject count operands
	greater or equal to mode bitsize.

From-SVN: r275055
2019-08-29 21:47:19 +02:00
Uros Bizjak d1041899c2 i386.c (inline_secondary_memory_needed): Return true for moves between SSE and non-general registers and between mask...
* config/i386/i386.c (inline_secondary_memory_needed): Return true
	for moves between SSE and non-general registers and between
	mask and non-general registers.
	(ix86_register_move_cost): Remove stalled comment.

From-SVN: r275050
2019-08-29 20:15:13 +02:00
Uros Bizjak ce189a6254 * ChangeLog: Fix wrong ChangeLog of my last entry.
From-SVN: r275049
2019-08-29 20:09:50 +02:00
Nathan Sidwell b0d11f1ed6 [preprocessor] Include stacking
https://gcc.gnu.org/ml/gcc-patches/2019-08/msg01971.html
	* internal.h (enum include_type): Add IT_MAIN, IT_DIRECTIVE_HWM,
	IT_HEADER_HWM.
	(_cpp_stack_file): Take include_type, not a bool.
	* files.c (_cpp_find_file): Refactor to not hide an if inside a
	for conditional.
	(should_stack_file): Break apart to ...
	(is_known_idempotent_file, has_unique_contents): ... these.
	(_cpp_stack_file): Replace IMPORT boolean with include_type enum.
	Refactor to use new predicates.  Do linemap compensation here ...
	(_cpp_stack_include): ... not here.
	* init.c (cpp_read_main_file): Pass IT_MAIN to _cpp_stack_file.

From-SVN: r275034
2019-08-29 14:06:32 +00:00
Jonathan Wakely d02a041242 PR libstdc++/91067 add more missing exports for directory iterators
PR libstdc++/91067
	* acinclude.m4 (libtool_VERSION): Bump to 6:28:0.
	* configure: Regenerate.
	* config/abi/pre/gnu.ver (GLIBCXX_3.4.28): Add new version. Export
	missing symbols.
	* testsuite/27_io/filesystem/iterators/91067.cc: Test move
	constructors.
	* testsuite/util/testsuite_abi.cc: Add new symbol version.

From-SVN: r275032
2019-08-29 13:16:27 +01:00
Richard Biener 132e2b41ef i386-features.c (general_scalar_chain::convert_insn): Guard debug work with MAY_HAVE_DEBUG_BIND_INSNS.
2019-08-29  Richard Biener  <rguenther@suse.de>

	* config/i386/i386-features.c (general_scalar_chain::convert_insn):
	Guard debug work with MAY_HAVE_DEBUG_BIND_INSNS.

From-SVN: r275031
2019-08-29 11:59:41 +00:00
Richard Biener c49609be4f re PR bootstrap/91580 (i686-{darwin, linux} bootstrap fails after r274926)
2019-08-29  Richard Biener  <rguenther@suse.de>

	PR bootstrap/91580
	* config/i386/i386-features.c (general_scalar_chain::convert_insn):
	Do not emit scalar copies for debug-insns, instead replace
	their uses with the reg copy used in the chain or reset them
	if there is a reaching definition outside of the chain as well.

From-SVN: r275030
2019-08-29 10:30:48 +00:00
Jakub Jelinek ae32cd0384 baseline_symbols.txt: Update.
* config/abi/post/aarch64-linux-gnu/baseline_symbols.txt: Update.
	* config/abi/post/s390x-linux-gnu/baseline_symbols.txt: Update.

From-SVN: r275028
2019-08-29 12:25:13 +02:00
Jakub Jelinek 4bf4c103ee re PR target/91560 (Try harder for AVX non-AVX2 cross-lane permutations)
PR target/91560
	* config/i386/i386-expand.c (expand_vec_perm_movs,
	expand_vec_perm_blend, expand_vec_perm_vpermil,
	expand_vec_perm_pshufb, expand_vec_perm_1,
	expand_vec_perm_pshuflw_pshufhw, expand_vec_perm_palignr,
	expand_vec_perm_interleave2, expand_vec_perm_vpermq_perm_1,
	expand_vec_perm_vperm2f128, expand_vec_perm_interleave3,
	expand_vec_perm_vperm2f128_vblend, expand_vec_perm_2vperm2f128_vshuf,
	expand_vec_perm_even_odd, expand_vec_perm_broadcast): Adjust function
	comments - replace ix86_expand_vec_perm_builtin_1 with
	ix86_expand_vec_perm_const_1.
	(expand_vec_perm2_vperm2f128_vblend): New function.
	(ix86_expand_vec_perm_const_1): New forward declaration.  Call
	expand_vec_perm2_vperm2f128_vblend as last resort.
	(canonicalize_perm): Formatting fix.

	* gcc.dg/torture/vshuf-8.inc: Add two further permutations.

From-SVN: r275027
2019-08-29 11:22:57 +02:00
Jakub Jelinek 1d9cd701ec re PR tree-optimization/91351 (-fstrict-enums generates incorrect code)
PR tree-optimization/91351
	* tree-cfg.c (generate_range_test): Use range_check_type instead of
	unsigned_type_for.
	* tree-cfgcleanup.c (convert_single_case_switch): Punt if
	range_check_type returns NULL.
	* tree-switch-conversion.c (switch_conversion::build_one_array):
	Use range_check_type instead of unsigned_type_for, don't perform
	linear opt if it returns NULL.
	(bit_test_cluster::find_bit_tests): Formatting fix.
	(bit_test_cluster::emit): Use range_check_type instead of
	unsigned_type_for.
	(switch_decision_tree::try_switch_expansion): Punt if range_check_type
	returns NULL.

	* g++.dg/opt/pr91351.C: New test.

From-SVN: r275026
2019-08-29 11:20:54 +02:00
Paolo Carlini c3bad34748 decl.c (check_var_type): Add location_t parameter and use it.
/cp
2019-08-29  Paolo Carlini  <paolo.carlini@oracle.com>

	* decl.c (check_var_type): Add location_t parameter and use it.
	(grokdeclarator): Adjust call.
	* pt.c (tsubst_decl): Likewise.
	* cp-tree.h: Adjust declaration.

/testsuite
2019-08-29  Paolo Carlini  <paolo.carlini@oracle.com>

	* g++.dg/spellcheck-typenames.C: Adjust expected locations.
	* g++.dg/cpp0x/pr84676.C: Check locations.
	* g++.dg/other/pr88187.C: Likewise.
	* g++.dg/parse/crash13.C: Likewise.
	* g++.dg/parse/crash46.C: Likewise.
	* g++.dg/parse/template28.C: Likewise.
	* g++.dg/parse/typename4.C: Likewise.

From-SVN: r275025
2019-08-29 09:01:26 +00:00
Richard Biener f48e4da325 re PR tree-optimization/91568 (internal compiler error: in vect_schedule_slp_instance, at tree-vect-slp.c:3922)
2019-08-29  Richard Biener  <rguenther@suse.de>

	PR tree-optimization/91568
	* tree-vectorizer.h (_slp_tree::max_nunits): Add.
	(vect_update_max_nunits): Add overload for poly_uint64.
	* tree-vect-slp.c (vect_create_new_slp_node): Initialize it.
	(vect_build_slp_tree): Record max_nunits into the subtree
	and merge it upwards.
	(vect_print_slp_tree): Print max_nunits.

	* gfortran.dg/pr91568.f: New testcase.

From-SVN: r275023
2019-08-29 08:07:35 +00:00
Marek Polacek 8a902edbbd Implement P1152R4: Deprecating some uses of volatile.
PR c++/91361
	* c-opts.c (c_common_post_options): Enable -Wvolatile by
	default for C++2a, unless -Wno-deprecated.
	* c.opt (Wvolatile): New warning.

	* cp-gimplify.c (cp_fold): Set TREE_THIS_VOLATILE.
	* decl.c (grokdeclarator): Warn about a volatile-qualified structured
	binding and return type.
	(grokparms): Warn about a volatile-qualified function parameter.
	* expr.c (mark_use) <case MODIFY_EXPR>: Emit a -Wvolatile warning.
	* typeck.c (cp_build_unary_op): Emit a -Wvolatile warning for pre and
	post ++/-- on a volatile operand.
	(genericize_compound_lvalue): Use a better location.  Don't lose
	TREE_THIS_VOLATILE.
	(cp_build_modify_expr): Emit a -Wvolatile warning for a compound
	assignment whose LHS is volatile-qualified.  Build the assignment with
	a more precise location.

	* doc/invoke.texi: Document -Wvolatile.

	* c-c++-common/Wbool-operation-1.c: Use -Wno-volatile in C++.
	* c-c++-common/gomp/atomic-1.c: Likewise.
	* c-c++-common/gomp/atomic-9.c: Likewise.
	* c-c++-common/gomp/depend-iterator-1.c: Likewise.
	* c-c++-common/gomp/loop-1.c: Adjust warning location for C++.
	* c-c++-common/gomp/order-3.c: Likewise.
	* c-c++-common/pr69733.c: Use -Wno-volatile in C++.
	* c-c++-common/spec-barrier-2.c: Likewise.
	* c-c++-common/tm/pr54893.c: Likewise.
	* g++.dg/cpp0x/pr65327.C: Add dg-warning.
	* g++.dg/cpp0x/rv-conv2.C: Likewise.
	* g++.dg/cpp0x/rv1n.C: Likewise.
	* g++.dg/cpp0x/rv1p.C: Likewise.
	* g++.dg/cpp0x/rv2n.C: Likewise.
	* g++.dg/cpp0x/rv2p.C: Likewise.
	* g++.dg/cpp0x/rv3n.C: Likewise.
	* g++.dg/cpp0x/rv3p.C: Likewise.
	* g++.dg/cpp0x/rv4n.C: Likewise.
	* g++.dg/cpp0x/rv4p.C: Likewise.
	* g++.dg/cpp0x/rv5n.C: Likewise.
	* g++.dg/cpp0x/rv5p.C: Likewise.
	* g++.dg/cpp0x/rv6n.C: Likewise.
	* g++.dg/cpp0x/rv6p.C: Likewise.
	* g++.dg/cpp0x/rv7n.C: Likewise.
	* g++.dg/cpp0x/rv7p.C: Likewise.
	* g++.dg/cpp0x/rv8p.C: Likewise.
	* g++.dg/cpp0x/trailing14.C: Use -Wno-volatile.
	* g++.dg/cpp1y/new1.C: Add dg-warning.
	* g++.dg/cpp2a/volatile1.C: New test.
	* g++.dg/cpp2a/volatile2.C: New test.
	* g++.dg/cpp2a/volatile3.C: New test.
	* g++.dg/cpp2a/volatile4.C: New test.
	* g++.dg/expr/bool3.C: Add dg-warning.
	* g++.dg/expr/bool4.C: Likewise.
	* g++.dg/expr/cond9.C: Likewise.
	* g++.dg/ext/vector25.C: Likewise.
	* g++.dg/gomp/depend-iterator-1.C: Use -Wno-volatile.
	* g++.dg/inherit/covariant21.C: Add dg-warning.
	* g++.dg/init/ref18.C: Likewise.
	* g++.dg/ipa/pr63838.C: Likewise.
	* g++.dg/overload/rvalue2.C: Likewise.
	* g++.dg/parse/semicolon4.C: Likewise.
	* g++.dg/warn/Wreturn-type-4.C: Likewise.
	* g++.dg/warn/pr36069.C: Likewise.
	* g++.old-deja/g++.mike/p9506.C: Likewise.
	* g++.old-deja/g++.other/volatile1.C: Likewise.

From-SVN: r275022
2019-08-29 03:11:50 +00:00
GCC Administrator 737c5bac68 Daily bump.
From-SVN: r275021
2019-08-29 00:16:24 +00:00
Joseph Myers c085c154df * es.po: Update.
From-SVN: r275012
2019-08-28 22:40:43 +01:00
Jonathan Wakely d8c26520fa Update ABI baselines for x86 and powerpc GNU targets
* config/abi/post/i386-linux-gnu/baseline_symbols.txt: Update.
	* config/abi/post/i486-linux-gnu/baseline_symbols.txt: Update.
	* config/abi/post/powerpc-linux-gnu/baseline_symbols.txt: Update.
	* config/abi/post/powerpc64-linux-gnu/32/baseline_symbols.txt: Update.
	* config/abi/post/powerpc64-linux-gnu/baseline_symbols.txt: Update.
	* config/abi/post/x86_64-linux-gnu/32/baseline_symbols.txt: Update.
	* config/abi/post/x86_64-linux-gnu/baseline_symbols.txt: Update.

From-SVN: r275011
2019-08-28 22:14:58 +01:00
Ian Lance Taylor 32b1d51f16 runtime: move osinit to Go
This is a step toward updating libgo to 1.13.  This adds the 1.13
    version of the osinit function to Go code, and removes the
    corresponding code from the C runtime.  This should simplify future updates.
    Some additional 1.13 code was brought in to simplify this change.
    
    Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/191717

From-SVN: r275010
2019-08-28 20:39:32 +00:00
Steven G. Kargl c980510a5a re PR fortran/91551 (ICE in sort_actual, at fortran/intrinsic.c:4193)
2019-08-28  Steven G. Kargl  <kargl@gcc.gnu.org>

	PR fortran/91551
	* intrinsic.c (sort_actual): ALLOCATED has one argument. Check for
	no argument case.

2019-08-28  Steven G. Kargl  <kargl@gcc.gnu.org>

	PR fortran/91551
	* gfortran.dg/allocated_3.f90

From-SVN: r275009
2019-08-28 20:36:00 +00:00
Marek Polacek 4742dbe718 PR c++/91360 - Implement C++20 P1143R2: constinit.
* c-common.c (c_common_reswords): Add constinit and __constinit.
	(keyword_is_decl_specifier): Handle RID_CONSTINIT.
	* c-common.h (enum rid): Add RID_CONSTINIT, RID_FIRST_CXX20, and
	RID_LAST_CXX20.
	(D_CXX20): Define.
	* c-cppbuiltin.c (c_cpp_builtins): Define __cpp_constinit.
	* c-format.c (cxx_keywords): Add "constinit".
	* c.opt (Wc++2a-compat, Wc++20-compat): New options.

	* cp-tree.h (TINFO_VAR_DECLARED_CONSTINIT): Define.
	(LOOKUP_CONSTINIT): Define.
	(enum cp_decl_spec): Add ds_constinit.
	* decl.c (check_tag_decl): Give an error for constinit in type
	declarations.
	(check_initializer): Also check LOOKUP_CONSTINIT.
	(cp_finish_decl): Add checking for a constinit declaration.  Set
	TINFO_VAR_DECLARED_CONSTINIT.
	(grokdeclarator): Add checking for a declaration with the constinit
	specifier.
	* lex.c (init_reswords): Handle D_CXX20.
	* parser.c (cp_lexer_get_preprocessor_token): Pass a better location
	to warning_at.  Warn about C++20 keywords.
	(cp_keyword_starts_decl_specifier_p): Handle RID_CONSTINIT.
	(cp_parser_diagnose_invalid_type_name): Add an inform about constinit.
	(cp_parser_decomposition_declaration): Maybe pass LOOKUP_CONSTINIT to
	cp_finish_decl.
	(cp_parser_decl_specifier_seq): Handle RID_CONSTINIT.
	(cp_parser_init_declarator): Maybe pass LOOKUP_CONSTINIT to
	cp_finish_decl.
	(set_and_check_decl_spec_loc): Add "constinit".
	* pt.c (tsubst_decl): Set TINFO_VAR_DECLARED_CONSTINIT.
	(instantiate_decl): Maybe pass LOOKUP_CONSTINIT to cp_finish_decl.
	* typeck2.c (store_init_value): If a constinit variable wasn't
	initialized using a constant initializer, give an error.

	* doc/invoke.texi: Document -Wc++20-compat.

	* g++.dg/cpp2a/constinit1.C: New test.
	* g++.dg/cpp2a/constinit2.C: New test.
	* g++.dg/cpp2a/constinit3.C: New test.
	* g++.dg/cpp2a/constinit4.C: New test.
	* g++.dg/cpp2a/constinit5.C: New test.
	* g++.dg/cpp2a/constinit6.C: New test.
	* g++.dg/cpp2a/constinit7.C: New test.
	* g++.dg/cpp2a/constinit8.C: New test.
	* g++.dg/cpp2a/constinit9.C: New test.
	* g++.dg/cpp2a/constinit10.C: New test.
	* g++.dg/cpp2a/constinit11.C: New test.
	* g++.dg/cpp2a/constinit12.C: New test.

From-SVN: r275008
2019-08-28 20:31:31 +00:00
Steven G. Kargl 6e12721acd re PR fortran/91565 (ICE in gfc_simplify_reshape, at fortran/simplify.c:6707 etc.)
2019-08-28  Steven G. Kargl  <kargl@gcc.gnu.org>

	PR fortran/91565
	* simplify.c (gfc_simplify_reshape): Add additional checks of the
	ORDER dummy argument.

2019-08-28  Steven G. Kargl  <kargl@gcc.gnu.org>

	PR fortran/91565
	* gfortran.dg/pr91565.f90: New test.

From-SVN: r275007
2019-08-28 20:16:57 +00:00
Steven G. Kargl ab0f6d4c5f re PR fortran/91564 (ICE in gimplify_expr, at gimplify.c:14147)
2019-08-28  Steven G. Kargl  <kargl@gcc.gnu.org>

	PR fortran/91564
	* check.c (gfc_check_kill_sub): Additional checks on status dummy
	argument.

2019-08-28  Steven G. Kargl  <kargl@gcc.gnu.org>

	PR fortran/91564
	* gfortran.dg/pr91564.f90: New test.

From-SVN: r275005
2019-08-28 19:54:23 +00:00
Martin Liska 91eed5f281 Add .clangd and compile_commands.json to .gitignore.
2019-08-28  Martin Liska  <mliska@suse.cz>

	* .gitignore: Add .clangd and compile_commands.json
	to .gitignore.

From-SVN: r275004
2019-08-28 19:33:28 +00:00
Ian Lance Taylor 4ee38894af compiler: handle unsafe conversion expression in escape analysis
Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/192037

From-SVN: r275000
2019-08-28 18:45:45 +00:00
Nathan Sidwell a0be978a82 [Preprocessor] small cleanups
https://gcc.gnu.org/ml/gcc-patches/2019-08/msg01904.html
	* directives-only.c (_cpp_preprocess_dir_only): Use false, not
	zero for _cpp_handle_directive call.
	* directives.c (_cpp_handle_directive): Indented is bool.
	* files.c (struct _cpp_file): Make bools 1 bit bitfields.
	* internal.h (enum include_type): Reformat and comment.
	(struct cpp_buffer): Make flags 1 bit bitfields.
	(_cpp_handle_directive): Indented is bool.

From-SVN: r274999
2019-08-28 18:43:37 +00:00
Ian Lance Taylor fc4f90f0c8 compiler, runtime: provide index information on bounds check failure
This implements https://golang.org/cl/161477 in the gofrontend.
    
    Updates golang/go#30116
    
    Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/191881

From-SVN: r274998
2019-08-28 18:27:30 +00:00
Martin Sebor 464969eb9b PR tree-optimization/91457 - inconsistent warning for writing past the end of an array member
gcc/ChangeLog:

	PR tree-optimization/91457
	* builtins.c (component_size): New function.
	(compute_objsize): Add argument. Handle ARRAY_REF and COMPONENT_REF.
	* builtins.h (compute_objsize): Add argument.
	* tree-ssa-strlen.c (handle_store): Handle no-warning bit.
	* tree-vrp.c (vrp_prop::check_array_ref): Return warning result.
	(vrp_prop::check_mem_ref): Same.
	(vrp_prop::search_for_addr_array): Set no-warning bit.
	(check_array_bounds): Same.

gcc/testsuite/ChangeLog:

	PR tree-optimization/91457
	* c-c++-common/Wstringop-overflow-2.c: New test.
	* g++.dg/warn/Warray-bounds-8.C: New test.
	* g++.dg/warn/Wstringop-overflow-3.C: New test.
	* gcc.dg/Wstringop-overflow-15.c: New test.

From-SVN: r274997
2019-08-28 10:43:56 -06:00
Martin Sebor e2eee23981 PR driver/80545 - option -Wstringop-overflow not recognized by Fortran
gcc/ChangeLog:

	PR driver/80545
	* opts-common.c (option_enabled): Correct checking for language
	options.

From-SVN: r274996
2019-08-28 10:24:38 -06:00
Uros Bizjak bc4aa158c9 * config/i386/i386-features.c
(general_scalar_chain::compute_convert_gain):
	Correct cost for double-word shifts.
	(general_scalar_to_vector_candidate_p): Reject count operands
	greater or equal to mode bitsize.

From-SVN: r274994
2019-08-28 17:09:51 +02:00