Commit Graph

171154 Commits

Author SHA1 Message Date
Alexander Monakov
2b196fb76e contrib/vimrc: override formatting options for more files
* vim-gcc-dev/syntax/gcc-match.vim: Do not override 'tabstop' here.
	* vimrc: Set preferred values for 'tabstop', 'softtabstop',
	'shiftwidth', 'noexpandtab', 'textwidth', 'formatoptions' for all
	files, not just C-like files.

From-SVN: r275316
2019-09-02 15:30:02 +03:00
Jonathan Wakely
d2faf10f95 Use __constinit keyword in libstdc++ sources
* src/c++17/memory_resource.cc: Use __constinit keyword.

From-SVN: r275315
2019-09-02 12:31:34 +01:00
Jonathan Wakely
30f43083ae Update libstdc++ docs for library version bumps
* doc/xml/manual/abi.xml: Document 9.x library versions.
	* doc/html/*: Regenerate.

From-SVN: r275314
2019-09-02 12:31:30 +01:00
Jonathan Wakely
6e672b1801 Minor simplifications for std::to_chars implementation
* include/std/charconv (__detail::__to_chars_2_len): Use std::log2p1.
	(__detail::__to_chars_8_len): Remove.
	(__detail::__to_chars_8): Inline length calculation here.
	(__detail::__from_chars_binary): Use numeric_limits instead of
	CHAR_BIT.

From-SVN: r275313
2019-09-02 12:31:25 +01:00
Eric Botcazou
000a5f8d23 re PR target/91323 (LTGT rtx produces UCOMISS instead of COMISS)
PR target/91323
	* doc/generic.texi (LTGT_EXPR): Merge with other comparison operators.
	* rtl.def (LTGT): Likewise.  Add note about floating-point exceptions.
	* tree.def (LTGT_EXPR): Likewise.
	* config/sparc/sparc.c (select_cc_mode): Return CCFPEmode for LTGT.

From-SVN: r275303
2019-09-02 10:10:23 +00:00
Jakub Jelinek
976f9aa1e8 re PR go/91617 (Many go test case failures after r275026)
PR go/91617
	* fold-const.c (range_check_type): For enumeral and boolean
	type, pass 1 to type_for_size langhook instead of
	TYPE_UNSIGNED (etype).  Return unsigned_type_for result whenever
	etype isn't TYPE_UNSIGNED INTEGER_TYPE.
	(build_range_check): Don't call unsigned_type_for for pointer types.
	* match.pd (X / C1 op C2): Don't call unsigned_type_for on
	range_check_type result.

From-SVN: r275299
2019-09-02 10:38:13 +02:00
Rainer Orth
8756957f01 Update Solaris baselines for GCC 10.0
* config/abi/post/i386-solaris/baseline_symbols.txt: Regenerate.
	* config/abi/post/i386-solaris/amd64/baseline_symbols.txt: Likewise.
	* config/abi/post/sparc-solaris/baseline_symbols.txt: Likewise.
	* config/abi/post/sparc-solaris/sparcv9/baseline_symbols.txt:
	Likewise.

From-SVN: r275298
2019-09-02 08:31:07 +00:00
Eric Botcazou
0f605e4049 gimple-ssa-strength-reduction.c (valid_mem_ref_cand_p): New function.
* gimple-ssa-strength-reduction.c (valid_mem_ref_cand_p): New function.
	(replace_ref): Do not replace a chain of only two candidates which are
	valid memory references.

From-SVN: r275297
2019-09-02 08:14:47 +00:00
Martin Liska
c746efcab3 Set tabstop=8 for gcc-match file types.
2019-09-02  Martin Liska  <mliska@suse.cz>

	* vim-gcc-dev/syntax/gcc-match.vim: Set tabstop=8.

From-SVN: r275295
2019-09-02 07:46:18 +00:00
Martin Liska
1acbaa7530 Fix thinko in early bail out in tree-switch-conversion.
2019-09-02  Martin Liska  <mliska@suse.cz>

	* tree-switch-conversion.c (jump_table_cluster::find_jump_tables):
	Bail out when we'll end up with the same number of clusters as
	at the beginning.
	(bit_test_cluster::find_bit_tests): Likewise for bit tests.
	(jump_table_cluster::can_be_handled): Remove the guard
	as it's already handled in ::is_enabled.  Allocate output
	after early bail out.

From-SVN: r275293
2019-09-02 07:09:39 +00:00
Martin Liska
ae0d3f6a59 Use cxx_printable_name for __PRETTY_FUNCTION__ in cp_fname_init.
2019-09-02  Martin Liska  <mliska@suse.cz>

	PR c++/91155
	* c-common.c (fname_as_string): Use cxx_printable_name for
	__PRETTY_FUNCTION__ same as was used before r265711.
2019-09-02  Martin Liska  <mliska@suse.cz>

	PR c++/91155
	* g++.dg/torture/pr91155.C: New test.

From-SVN: r275292
2019-09-02 07:07:11 +00:00
Martin Liska
9297e01329 Consider also negative edges in cycle detection.
2019-09-02  Martin Liska  <mliska@suse.cz>

	PR gcov-profile/91601
	* gcov.c (path_contains_zero_cycle_arc): Rename to ...
	(path_contains_zero_or_negative_cycle_arc): ... this and handle
	also negative edges.
	(circuit): Handle also negative edges as they can happen
	in some situations.

From-SVN: r275291
2019-09-02 07:06:54 +00:00
GCC Administrator
ea323e9e92 Daily bump.
From-SVN: r275290
2019-09-02 00:16:37 +00:00
Marek Polacek
556f8de3be PR c++/91129 - wrong error with binary op in template argument.
* typeck.c (warn_for_null_address): Use fold_for_warn instead of
	fold_non_dependent_expr.
	(cp_build_binary_op): Likewise.

	* g++.dg/cpp1y/nontype1.C: New test.

From-SVN: r275285
2019-09-01 22:54:15 +00:00
François Dumont
a37ab089c2 2019-09-01 François Dumont <fdumont@gcc.gnu.org>
* testsuite_files/util/testsuite_performance.h
	(resource_counter::start): Ignore unused malloc(0) result.

From-SVN: r275284
2019-09-01 20:11:42 +00:00
Iain Sandoe
3791ba494b [testsuite] Unsupport 20190827-1.c for targets without alias support.
gcc/testsuite/

2019-09-01  Iain Sandoe  <iain@sandoe.co.uk>

	* gcc.c-torture/compile/20190827-1.c: Add dg-requires-alias.

From-SVN: r275274
2019-09-01 18:38:59 +00:00
Eric Botcazou
4c122404fa target-supports.exp (check_effective_target_pthread): Add #include <pthread.h> directive to the test.
* lib/target-supports.exp (check_effective_target_pthread): Add
	#include <pthread.h> directive to the test.

From-SVN: r275271
2019-09-01 12:55:58 +00:00
Eric Botcazou
2dae212347 re PR target/91472 (gmp testsuite segfaults with gcc-8 and gcc-9, works fine with gcc-7)
PR target/91472
	* config/sparc/sparc.c (sparc_cannot_force_const_mem): Return true
	during LRA/reload in PIC mode if the PIC register hasn't been used yet.
	(sparc_pic_register_p): Test reload_in_progress for consistency's sake.

From-SVN: r275270
2019-09-01 12:55:22 +00:00
Paul Thomas
70570ec192 array.c (spec_dimen_size): Check for the presence of expressions for the bounds.
2019-09-01  Paul Thomas  <pault@gcc.gnu.org>

	* array.c (spec_dimen_size): Check for the presence of
	expressions for the bounds.
	* decl.c (gfc_match_end): Add case COMP_SELECT_RANK.
	* dump-parse-tree.c(show_symbol): Show the arrayspec of class
	entities.
	(show_code_node): Show the code for SELECT_RANK.
	* expr.c (gfc_check_vardef_context): Omit the context of
	variable definition for select rank associate names since the
	ASSUMED RANK throws.
	* gfortran.h : Add ST_SELECT_RANK and ST_RANK to enum
	gfc_statement. Add select_rank_temporary to symbol attribute
	structure. Add EXEC_SELECT_RANK to enum gfc_exec_op.
	* match.c (match_exit_cycle): Add COMP_SELECT_RANK.
	(copy_ts_from_selector_to_associate): Add as special case for
	assumed rank class variables.
	(select_intrinsic_set_tmp): Clean up the code by using symbols
	for references to the temporary and the selector.
	(select_type_set_tmp): Ditto.
	(select_rank_set_tmp): New function.
	(gfc_match_select_rank): New function.
	(gfc_match_rank_is): New function.
	* match.h : Add prototypes for gfc_match_select_rank and
	gfc_match_rank_is.
	* parse.c (decode_statement): Attempt to match select_rank and
	rank statements.
	(next_statement, gfc_ascii_statement): Add ST_SELECT_RANK.
	(parse_select_rank_block): New function.
	(parse_executable): Parse select rank block for ST_SELECT_RANK.
	* parse.h : Add COMP_SELECT_RANK to enum gfc_compile_state.
	* resolve.c (resolve_variable): Exclude select_rank_temporaries
	from the check on use of ASSUMED RANK.
	(gfc_resolve_expr): Make sure that unlimited polymorphic select
	rank temporaries expressions are not resolved again after being
	successfully resolved.
	(resolve_assoc_var): Do not do the rank check for select rank
	temporaries.
	(resolve_select_rank): New function.
	(gfc_resolve_blocks): Deal with case EXEC_SELECT_RANK.
	(resolve_symbol): Exclude select rank temporaries for check on
	use of ASSUMED RANK.
	* st.c (gfc_free_statement): Include EXEC_SELECT_RANK.
	* trans-array.c (gfc_conv_array_ref): Select rank temporaries
	may have dimen == 0.
	(gfc_conv_expr_descriptor): Zero the offset of select rank
	temporaries.
	* trans-stmt.c (copy_descriptor): New function.
	(trans_associate_var): Add code to associate select rank temps.
	(gfc_trans_select_rank_cases): New function.
	(gfc_trans_select_rank): New function.
	* trans-stmt.h : Add prototype for gfc_trans_select_rank.
	trans.c (trans_code): Add select rank case.


2019-09-01  Paul Thomas  <pault@gcc.gnu.org>

	* gfortran.dg/select_rank_1.f90 : New test.
	* gfortran.dg/select_rank_2.f90 : New test.

From-SVN: r275269
2019-09-01 12:53:02 +00:00
Gerald Pfeifer
3e7254c5e4 policy_data_structures_biblio.xml (COM: Component Model Object Technologies): Adjust name and link.
* doc/xml/manual/policy_data_structures_biblio.xml (COM: Component
	Model Object Technologies): Adjust name and link.

From-SVN: r275268
2019-09-01 12:42:41 +00:00
Jakub Jelinek
9151048d85 re PR middle-end/91623 (-msse4.1 -O3 segfault in /usr/lib/gcc/x86_64-pc-linux-gnu/8.3.0/include/smmintrin.h:270:10)
PR middle-end/91623
	* optabs.c (expand_vec_cond_expr): If op0 is a VECTOR_CST and only
	EQ_EXPR/NE_EXPR is supported, verify that op0 only contains
	zeros or negative elements and use NE_EXPR instead of LT_EXPR against
	zero vector.

	* gcc.target/i386/pr91623.c: New test.

From-SVN: r275267
2019-09-01 13:57:10 +02:00
Jakub Jelinek
d1e2e50a5f re PR lto/91572 (lto1: error: type variant has different ‘TREE_TYPE’ since r269862)
PR lto/91572
	* tree.c (find_decls_types_in_node): Also walk TREE_PURPOSE of
	GIMPLE_ASM TREE_LIST operands.

	* g++.dg/lto/pr91572_0.C: New test.

From-SVN: r275266
2019-09-01 13:56:13 +02:00
Bernd Edlinger
12b19f6aaf Fix wrong dates in ChangeLog
From-SVN: r275265
2019-09-01 10:40:52 +00:00
GCC Administrator
7a9f7e59dd Daily bump.
From-SVN: r275264
2019-09-01 00:16:48 +00:00
Jason Merrill
ad527d8018 Add source location to TRAIT_EXPR.
Since TRAIT_EXPR is exceptional, maybe_wrap_with_location won't wrap it, so
we need to put its location in the TRAIT_EXPR node itself.

	* cp-tree.h (TRAIT_EXPR_LOCATION): New.
	(struct tree_trait_expr): Add locus field.
	* parser.c (cp_parser_trait_expr): Pass trait_loc down.
	* pt.c (tsubst_copy_and_build) [TRAIT_EXPR]: Likewise.
	* semantics.c (finish_trait_expr): Add location parm.
	* tree.c (cp_expr_location): Handle TRAIT_EXPR.

From-SVN: r275260
2019-08-31 18:09:47 -04:00
Joseph Myers
bd486c8cdf * es.po: Update.
From-SVN: r275258
2019-08-31 22:49:27 +01:00
Gerald Pfeifer
8498adc271 generic.texi (Unary and Binary Expressions): Mark up an instance of TYPE_MIN.
* doc/generic.texi (Unary and Binary Expressions): Mark up
	an instance of TYPE_MIN.

From-SVN: r275243
2019-08-31 17:20:28 +00:00
Stafford Horne
fd631eb5a7 or1k: Fix issue with set_got clobbering LR (r9)
When compiling glibc we found that the GOT register was being allocated
r9 when the instruction was still set_got_tmp.  That is a problem
because r9 is the Link Register (LR) in OpenRISC which is used/clobbered
in set_got.  We cannot use r9 as the GOT register.  Also, we cannot
simply say set_got_tmp clobbers r9 as this is the reason for having the
temporary set_got_tmp.

Fix by using a register class constraint that does not allow r9 during
register allocation.

gcc/ChangeLog:

        * config/or1k/constraints.md (t): New constraint.
        * config/or1k/or1k.h (GOT_REGS): New register class.
        * config/or1k/or1k.md (set_got_tmp, set_got): Use t contraint.

From-SVN: r275242
2019-08-31 06:00:56 +00:00
Ian Lance Taylor
3ba155dd19 compiler: check for notinheap struct at each struct field
When generating write barriers, we were only checking for a notinheap
    struct at the outermost struct.  That mishandled the case of setting a
    pointer to a notinheap struct as a field of another struct that is not
    notinheap.  This caused an invalid write barrier error when building
    the 1.13 version of the runtime.
    
    Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/192279

From-SVN: r275240
2019-08-31 03:07:48 +00:00
Ian Lance Taylor
c70ff9f9be compiler, runtime: support and use single argument go:linkname
The gc compiler has started permitting go:linkname comments with a
    single argument to mean that a function should be externally visible
    outside the package.  Implement this in the Go frontend.
    
    Change the libgo runtime package to use it, rather than repeating the
    name just to export a function.
    
    Remove a couple of unnecessary go:linkname comments on declarations.
    
    Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/192197

From-SVN: r275239
2019-08-31 03:01:15 +00:00
Ian Lance Taylor
e7c8f75569 compiler: don't report runtime escapes if we've seen errors
If we get errors during compilation, we skip the escape analysis pass.
    If we are compiling the runtime package, we report an error if a bound
    method expression escapes.  The effect is that if we get an error
    while compiling the runtime package, we would report confusing and
    meaningless errors about bound method expressions escaping.
    
    This CL stops doing that.
    
    Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/192720

From-SVN: r275238
2019-08-31 02:56:55 +00:00
Ian Lance Taylor
d24c41ef1a runtime: always build panic32.go
Avoids problems with arm64 ILP32 mode.  We might want to handle that
    mode better in general, but always building panic32.go is simple and
    fixes the build.
    
    Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/192723

From-SVN: r275237
2019-08-31 02:55:09 +00:00
Steven G. Kargl
460b985ea3 re PR fortran/91587 (ICE in gfc_resolve_filepos, at fortran/io.c:2913)
2019-08-30  Steven G. Kargl  <kargl@gcc.gnu.org>

	PR fortran/91587
	* io.c (match_filepos): MATCH_ERROR should branch to a syntax error.

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

	PR fortran/91587
	* gfortran.dg/pr91587.f90: New test.

From-SVN: r275236
2019-08-31 00:32:48 +00:00
GCC Administrator
a74e175a43 Daily bump.
From-SVN: r275235
2019-08-31 00:17:00 +00:00
Jim Wilson
a169f35890 RISC-V: Disable -msave-restore for shared libraries.
This was noticed while trying to test -msave-restore support.  The
save/restore routines use the alternate return register t0/x5 which is
clobbered by the PLT header, so we can't use them in shared libraries.
This patch disables -msave-restore when -fpic (and -mplt), and emits a
warning if the user explicitly turned on -msave-restore.

	gcc/
	* config/riscv/riscv.c (riscv_option_override): If -msave-restore
	and -fpic and -mplt then disable -msave-restore and warn.

From-SVN: r275231
2019-08-30 16:32:52 -07:00
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