Commit Graph

183776 Commits

Author SHA1 Message Date
Nathan Sidwell 4d66685e49 c++: instantiating imported specializations [PR 99389]
When an incomplete class specialization is imported, and is completed
by instantiation, we were failing to mark the instantiation, and thus
didn't stream it out.  Leading to errors in importing as we had
members of an incomplete type.

	PR c++/99389
	gcc/cp/
	* pt.c (instantiate_class_template_1): Set instantiating module
	here.
	gcc/testsuite/
	* g++.dg/modules/pr99389_a.H: New.
	* g++.dg/modules/pr99389_b.C: New.
	* g++.dg/modules/pr99389_c.C: New.
2021-03-05 05:30:30 -08:00
Eric Botcazou 331763de7d Fix build breakage with latest glibc release
gcc/ada/
	PR ada/99264
	* init.c (__gnat_alternate_sta) [Linux]: Remove preprocessor test on
	MINSIGSTKSZ and bump size to 32KB.
	* libgnarl/s-osinte__linux.ads (Alternate_Stack_Size): Bump to 32KB.
2021-03-05 12:47:28 +01:00
Eric Botcazou e51f67c155 Fix oversight in support for forward declarations
gcc/c-family/
	* c-ada-spec.c (dump_ada_declaration) <TYPE_DECL>: Dump nested types
	after entering the separate class package, if any.
2021-03-05 12:47:28 +01:00
Eric Botcazou 28354bc22b Fix undefined behavior spotted by the sanitizer
gcc/
	PR rtl-optimization/99376
	* rtlanal.c (nonzero_bits1) <arithmetic operators>: If the number
	of low-order zero bits is too large, set the result to 0 directly.
2021-03-05 12:47:28 +01:00
Tobias Burnus 6ddedd3efa OpenACC: C/C++ - fix async parsing [PR99137]
gcc/c/ChangeLog:

	PR c/99137
	* c-parser.c (c_parser_oacc_clause_async): Reject comma expressions.

gcc/cp/ChangeLog:

	PR c/99137
	* parser.c (cp_parser_oacc_clause_async): Reject comma expressions.

gcc/testsuite/ChangeLog:

	PR c/99137
	* c-c++-common/goacc/asyncwait-1.c: Update dg-error; add
	additional test.
2021-03-05 11:41:44 +01:00
Tobias Burnus 80cf2facbb Fortran: Follow fixes to -freal-{4,8}-real* handling [PR99355,PR57871]
gcc/fortran/ChangeLog:

	PR fortran/99355
	PR fortran/57871
	* invoke.texi (-freal{4,8}-real-*): Extend description.
	* primary.c (match_real_constant): Also promote real literals
	with '_kind' number.

gcc/testsuite/ChangeLog:

	* gfortran.dg/real4-10-real8-10.f90: Add check for real literals
	with '_kind' number.
	* gfortran.dg/real4-10-real8-16.f90: Likewise.
	* gfortran.dg/real4-10-real8-4.f90: Likewise.
	* gfortran.dg/real4-10.f90: Likewise.
	* gfortran.dg/real4-16-real8-10.f90: Likewise.
	* gfortran.dg/real4-16-real8-16.f90: Likewise.
	* gfortran.dg/real4-16-real8-4.f90: Likewise.
	* gfortran.dg/real4-16.f90: Likewise.
	* gfortran.dg/real4-8-real8-10.f90: Likewise.
	* gfortran.dg/real4-8-real8-16.f90: Likewise.
	* gfortran.dg/real4-8-real8-4.f90: Likewise.
	* gfortran.dg/real4-8.f90: Likewise.
	* gfortran.dg/real8-10.f90: Likewise.
	* gfortran.dg/real8-16.f90: Likewise.
	* gfortran.dg/real8-4.f90: Likewise.
2021-03-05 10:43:11 +01:00
Hans-Peter Nilsson 8d240b3f06 gcc.dg/debug/dwarf2/stacked-qualified-types-3.c: xfail for cris
The test is still failing and is a regression on master for
cris-elf: the remedy for (all) other targets wasn't
sufficient.  I'm not myself going to put any effort into it
(debug-information being different enough for a test to
fail, is not a priority) and apparently not anyone else in
the last 5 years, so I'm just going to xfail it.

gcc/testsuite:
	PR debug/66668
	* gcc.dg/debug/dwarf2/stacked-qualified-types-3.c: xfail for cris-*-*
2021-03-05 02:01:05 +01:00
GCC Administrator 67f10d28f0 Daily bump. 2021-03-05 00:16:21 +00:00
Iain Sandoe 0d737ed217 Darwin, testsuite : Prune 'object file not found for object'.
This is not a GCC problem, but a fault in the static linker where,
when a source file is used multiple times, with conditional compilation
the source file is only referenced by the linker for the first object.
Then, when dsymutil tries to find the source file for next object based
off that source there is no record for it.

gcc/testsuite/ChangeLog:

	* lib/prune.exp: Prune useless output caused by a linker bug.
2021-03-04 19:35:27 +00:00
Jakub Jelinek 0ad6de3883 expand: Fix ICE in store_bit_field_using_insv [PR93235]
The following testcase ICEs on aarch64.  The problem is that
op0 is (subreg:HI (reg:HF ...) 0) and because we can't create a SUBREG of a
SUBREG and aarch64 doesn't have HImode insv, only SImode insv,
store_bit_field_using_insv tries to create (subreg:SI (reg:HF ...) 0)
which is not valid for the target and so gen_rtx_SUBREG ICEs.

The following patch fixes it by punting if the to be created SUBREG
doesn't validate, callers of store_bit_field_using_insv can handle
the fallback.

2021-03-04  Jakub Jelinek  <jakub@redhat.com>

	PR middle-end/93235
	* expmed.c (store_bit_field_using_insv): Return false of xop0 is a
	SUBREG and a SUBREG to op_mode can't be created.

	* gcc.target/aarch64/pr93235.c: New test.
2021-03-04 19:38:08 +01:00
Richard Biener 87dc3d0d36 Handle ERROR_MARK in direct_abstract_declarator
The gcc.dg/noncompile/pr79758.c testcase prints

pr79758.c:5:6: error: redefinition of 'fn1'
'error_mark' not supported by direct_abstract_declarator)'/home/rguenther/src/gcc3/gcc/testsuite/gcc.dg/noncompile/pr79758.c:4:6: note: previous definition of 'fn1' with type

which shows a) re-entry of pp_printf via pp_unsupported_tree and b) a
bogus diagnostic.  The following handles ERROR_MARK in
direct_abstract_declarator, yielding in the better

/home/rguenther/src/gcc3/gcc/testsuite/gcc.dg/noncompile/pr79758.c:5:6: error: redefinition of 'fn1'
/home/rguenther/src/gcc3/gcc/testsuite/gcc.dg/noncompile/pr79758.c:4:6: note: previous definition of 'fn1' with type 'void(<type-error>)'

but still maybe not perfect.

2021-03-04  Richard Biener  <rguenther@suse.de>

gcc/c-family/
	* c-pretty-print.c (c_pretty_printer::direct_abstract_declarator):
	Handle ERROR_MARK.
2021-03-04 16:53:24 +01:00
Martin Liska 6a8fc0c31a profiling: fix streaming of TOPN counters
libgcc/ChangeLog:

	PR gcov-profile/99105
	* libgcov-driver.c (write_top_counters): Rename to ...
	(write_topn_counters): ... this.
	(write_one_data): Pre-allocate buffer for number of items
	in the corresponding linked lists.
	* libgcov.h (malloc_mmap): New function.
	(allocate_gcov_kvp): Use it.

gcc/testsuite/ChangeLog:

	PR gcov-profile/99105
	* gcc.dg/tree-prof/indir-call-prof-malloc.c: Use profile
	correction as the wrapped malloc is called one more time
	from libgcov.
	* gcc.dg/tree-prof/pr97461.c: Likewise.
2021-03-04 16:21:52 +01:00
Jakub Jelinek c981619632 c++: Fix up [[nodiscard]] on ctors on targetm.cxx.cdtor_returns_this targets [PR99362]
In the P1771R1 changes JeanHeyd reverted part of Alex' PR88146 fix,
but that seems to be incorrect to me.
Where P1771R1 suggests warnings for [[nodiscard]] on constructors is
handled in a different place - in particular the TARGET_EXPR handling
of convert_to_void.  When we have CALL_EXPR of a ctor, on most arches
that call has void return type and so returns early, and on arm where
the ctor returns the this pointer it is undesirable to warn as it warns
about all ctor calls, not just the ones where it should warn.

The P1771R1 changes added a test for this, but as it was given *.c
extension rather than *.C, the test was never run and so this didn't get
spotted immediately.  The test also had a bug, (?n) can't be used
in dg-warning/dg-error because those are implemented by prepending
some regexp before the user provided one and (?n) must come at the start
of the regexp.  Furthermore, while -ftrack-macro-expansion=0 is useful
in one nodiscard test which uses macros, I don't see how it would be
relevant to all the other cpp2a/nodiscard* tests which don't use any
macros.

2021-03-04  Jakub Jelinek  <jakub@redhat.com>

	PR c++/88146
	PR c++/99362
gcc/cp/
	* cvt.c (convert_to_void): Revert 2019-10-17 changes.  Clarify
	comment.
gcc/testsuite/
	* g++.dg/cpp2a/nodiscard-constructor.c: Renamed to ...
	* g++.dg/cpp2a/nodiscard-constructor1.C: ... this.  Remove
	-ftrack-macro-expansion=0 from dg-options.  Don't use (?n) in
	dg-warning regexps, instead replace .* with \[^\n\r]*.
	* g++.dg/cpp2a/nodiscard-constructor2.C: New test.
	* g++.dg/cpp2a/nodiscard-reason-only-one.C: Remove
	-ftrack-macro-expansion=0 from dg-options.
	* g++.dg/cpp2a/nodiscard-reason-nonstring.C: Likewise.
	* g++.dg/cpp2a/nodiscard-once.C: Likewise.
2021-03-04 16:04:48 +01:00
Jakub Jelinek a1b56c3ef7 c-ppoutput: Fix preprocessing ICE on very large line number [PR99325]
In libcpp, lines are represented as linenum_type, which is unsigned int.
The following testcases ICE because maybe_print_line_1 is sometimes called
with UNKNOWN_LOCATION (e.g. at pragma eof) and while most of the time
the
        && src_line >= print.src_line
        && src_line < print.src_line + 8
check doesn't succeed for the src_line of 0 from UNKNOWN_LOCATION, when
print.src_line is from very large line numbers (UINT_MAX - 7 and above)
it succeeds (with UB on the compiler side) but src_file is NULL for
UNKNOWN_LOCATION and so the strcmp call ICEs.
As print.src_line can easily wrap around, this patch changes its type
to unsigned int to match libcpp, so that we don't invoke UB in the compiler.
For print.src_line of UINT_MAX - 7 and above, src_line from UNKNOWN_LOCATION
will not pass that test anymore, but when it wraps around to 0, it can,
so I've also added a check for src_loc != UNKNOWN_LOCATION (or, if
preferred, could be src_file != NULL).
Besides fixing the ICE and UB in the compiler, I believe worst case the
patch will cause printing a few more line directives in the preprocessed
source around the wrapping from lines UINT_MAX - 7 to 0 (but less
around the wrapping from INT_MAX to INT_MAX + 1U), but I think those
are exceptional cases (sources with > 2billion lines are rare and
we warn or error on #line > INT_MAX).

2021-03-04  Jakub Jelinek  <jakub@redhat.com>

	PR c/99325
	* c-ppoutput.c (print): Change src_line type from int to unsigned.
	(token_streamer::stream) Likewise.
	(maybe_print_line_1): Likewise.  Don't strcmp src_file if src_loc is
	UNKNOWN_LOCATION.

	* gcc.dg/cpp/line11.c: New test.
	* gcc.dg/cpp/line12.c: New test.
2021-03-04 16:02:07 +01:00
Alex Coplan a6bc1680a4 aarch64: Add missing error_mark_node check [PR99381]
We were missing a check in function_resolver::require_vector_type to see
if the argument type was already invalid. This was causing us to attempt
to emit a diagnostic and subsequently ICE in print_type. Fixed thusly.

gcc/ChangeLog:

	PR target/99381
	* config/aarch64/aarch64-sve-builtins.cc
	(function_resolver::require_vector_type): Handle error_mark_node.

gcc/testsuite/ChangeLog:

	PR target/99381
	* gcc.target/aarch64/pr99381.c: New test.
2021-03-04 14:36:39 +00:00
Nathan Sidwell 9553c8a1b9 c++: Post-pending redesign cleanup [PR 99170]
With pending entities reimplemented, the remaining use of uintset can just
use a regular hash map -- I only used a uintset because it was there.
So one adhoc hash-table/vector structure goes away.

	PR c++/99170
	gcc/cp/
	* module.cc (class uintset): Delete.
	(typedef attached_map_t): A hash map.
	(attached_table): Use attached_map_t.  Adjust uses ...
	(trees_out::decl_value, trees_in::decl_value): ... here ...
	(trees_out::key_mergeable): ... here ...
	(trees_in::key_mergeable): ... here ...
	(maybe_attach_decl): ... here ...
	(direct_import): ... and here.
2021-03-04 05:49:53 -08:00
Ilya Leoshkevich e52ef6e60d Add input_modes parameter to TARGET_MD_ASM_ADJUST hook
If TARGET_MD_ASM_ADJUST changes a mode of an input operand (which
should be ok as long as the hook itself as well as after_md_seq make up
for it), input_mode will contain stale information.

It might be tempting to fix this by removing input_mode altogether and
just using GET_MODE (), but this will not work correctly with constants.
So add input_modes parameter and document that it should be updated
whenever inputs parameter is updated.

gcc/ChangeLog:

2021-01-05  Ilya Leoshkevich  <iii@linux.ibm.com>

	* cfgexpand.c (expand_asm_loc): Pass new parameter.
	(expand_asm_stmt): Likewise.
	* config/arm/aarch-common-protos.h (arm_md_asm_adjust): Add new
	parameter.
	* config/arm/aarch-common.c (arm_md_asm_adjust): Likewise.
	* config/arm/arm.c (thumb1_md_asm_adjust): Likewise.
	* config/cris/cris.c (cris_md_asm_adjust): Likewise.
	* config/i386/i386.c (ix86_md_asm_adjust): Likewise.
	* config/mn10300/mn10300.c (mn10300_md_asm_adjust): Likewise.
	* config/nds32/nds32.c (nds32_md_asm_adjust): Likewise.
	* config/pdp11/pdp11.c (pdp11_md_asm_adjust): Likewise.
	* config/rs6000/rs6000.c (rs6000_md_asm_adjust): Likewise.
	* config/vax/vax.c (vax_md_asm_adjust): Likewise.
	* config/visium/visium.c (visium_md_asm_adjust): Likewise.
	* doc/tm.texi (md_asm_adjust): Likewise.
	* target.def (md_asm_adjust): Likewise.
2021-03-04 14:33:41 +01:00
Ilya Leoshkevich af60228add IBM Z: Compile mul-signed-overflow tests on old machines
Commit 34d39d1409 ("IBM Z: Run mul-signed-overflow tests only on
z14") restricted mul-signed-overflow tests to z14+.  It's actually fine
to compile them on old machines, only running needs to be restricted.

gcc/testsuite/ChangeLog:

	* gcc.target/s390/mul-signed-overflow-1.c: Compile on old
	machines.
	* gcc.target/s390/mul-signed-overflow-2.c: Likewise.
2021-03-04 14:14:41 +01:00
Nathan Sidwell c778a237c1 c++: Redesign pending entity handling [PR 99170]
This patch addresses 99170.  with modules (and in particular header
units), one module can provide a (maybe nested) class or template and
another module can provide a definition or (maybe partial)
specialization of said entity, or member thereof.  when both are
imported into a 3rd TU, and that TU instantiates or uses the class, it
needs to stream in those entities (in general).  But how does it key
those entities to the original?  It can't /just/ use the entity index,
because, when header-units and/or partitions are in play, the entity
index /is not unique/.  I had two complicated schemes that tried to
unify that, but it failed.  Here's a simpler scheme.  Such pending
entities are keyed to the namespace and identifier of the
namespace-scope entity that contains them.  Thus the final TU needs to
find that entity and look in a hash table for lists of sections that
need loading just before instantiating a template or looking inside a
class.

I would like to make this more efficient, but given the complex scheme
failed, I'm shooting for correctness right now.  There will be a
follow up patch to complete the cleanup this enables.

	PR c++/99170
	gcc/cp/
	* cp-tree.h
	* lex.c (cxx_dup_lang_specific_decl): Adjust for module_attached_p
	rename.
	* module.cc (class pending_key): New.
	(default_hash_traits<pending_key>): New specialization.
	(pending_map_t): New typedef.
	(pending_table): Replace old table.
	(trees_out::lang_decl_bools): Adjust.
	(trees_in::lang_decl_bools): Adjust.
	(trees_in::install_entity): Drop pending member and specialization
	handling.
	(find_pending_key): New.
	(depset:#️⃣:fiund_dependencies): Use it.
	(pendset_lazy_load): Delete.
	(module_state::write_cluster): Don't count pendings here.  Bye
	Duff's device-like thing.
	(module_state::write_pendings): Reimplement.
	(module_state::read_pendings): Reimplement.
	(lazy_specializations_p): Delete.
	(module_state::write): Adjust write_pendings call.
	(lazy_load_pendings): New.
	(lazy_load_specializations): Delete.
	(lazy_load_members): Delete.
	(init_modules):	Adjust.
	* name-lookup.c (maybe_lazily_declare):	Call lazy_load_pendings
	not lazy_load_members.
	(note_pending_specializations): Delete.
	(load_pending_specializations): Delete.
	* name-lookup.h	(BINDING_VECTR_PENDING_SPECIALIZATIONS_P): Delete.
	(BINDING_VECTOR_PENDING_MEMBERS_P): Delete.
	(BINDING_VECTR_PENDING_MEMBERS_P): Delete.
	(note_pending_specializations): Delete.
	(load_pending_specializations): Delete.
	* pt.c (lookup_template_class_1): Call lazy_load_pendings not
	lazy_load_specializations.
	(instantiate_template_class_1): Likewise.
	(instantiate_decl): Call lazy_load_pendings.
	* typeck.c (complete_type): Likewise.
	gcc/testsuite/
	* g++.dg/modules/pr99170-1_a.H: New.
	* g++.dg/modules/pr99170-1_b.C: New.
	* g++.dg/modules/pr99170-2.h: New.
	* g++.dg/modules/pr99170-2_a.C: New.
	* g++.dg/modules/pr99170-2_b.C: New.
	* g++.dg/modules/pr99170-3_a.H: New.
	* g++.dg/modules/pr99170-3_b.C: New.
	* g++.dg/modules/inst-2_b.C: Adjust scan.
	* g++.dg/modules/inst-4_a.C: Adjust scan.
	* g++.dg/modules/inst-4_b.C: Adjust scan.
	* g++.dg/modules/member-def-1_b.C: Adjust scan.
	* g++.dg/modules/member-def-1_c.C: Adjust scan.
	* g++.dg/modules/tpl-spec-1_a.C: Adjust scan.
	* g++.dg/modules/tpl-spec-1_b.C: Adjust scan.
	* g++.dg/modules/tpl-spec-2_b.C: Adjust scan.
	* g++.dg/modules/tpl-spec-2_c.C: Adjust scan.
	* g++.dg/modules/tpl-spec-2_d.C: Adjust scan.
	* g++.dg/modules/tpl-spec-3_a.C: Adjust scan.
	* g++.dg/modules/tpl-spec-3_b.C: Adjust scan.
	* g++.dg/modules/tpl-spec-4_a.C: Adjust scan.
	* g++.dg/modules/tpl-spec-4_b.C: Adjust scan.
	* g++.dg/modules/tpl-spec-5_a.C: Adjust scan.
	* g++.dg/modules/tpl-spec-5_b.C: Adjust scan.
2021-03-04 04:46:57 -08:00
Martin Liska 4c955b4ad3 gcov: call mmap MAP_ANONYMOUS with fd equal to -1
libgcc/ChangeLog:

	PR gcov-profile/99385
	* libgcov.h (allocate_gcov_kvp): Call mmap with fd equal to -1.
2021-03-04 11:53:33 +01:00
Richard Biener f232f782e6 middle-end/97855 - avoid recursing into pp_printf
When diagnostic messages use pretty-printer formats like %D or %E
the pp_printf invocation can end up in tree pretty-printers which
then have to avoid using pp_printf themselves since this function
is not re-entrant.

The following removes all pp_printf uses from tree-pretty-print.c
fixing the observed malformed diagnostics.  It also poisons the
identifier so new uses are less likely to creep in.

2021-03-04  Richard Biener  <rguenther@suse.de>

	PR middle-end/97855
	* tree-pretty-print.c: Poison pp_printf.
	(dump_decl_name): Avoid use of pp_printf.
	(dump_block_node): Likewise.
	(dump_generic_node): Likewise.
2021-03-04 11:32:34 +01:00
Jonathan Wakely 905ce0ca30 libstdc++: Fix buffer overflows in tests [PR 99382]
This seems to be a typo/thinko in the definition of the arrays used as
storage.

libstdc++-v3/ChangeLog:

	PR libstdc++/99382
	* testsuite/20_util/specialized_algorithms/uninitialized_default_n/sizes.cc:
	Make storage larger than required. Verify no write to the last
	element.
	* testsuite/20_util/specialized_algorithms/uninitialized_value_construct_n/sizes.cc:
	Likewise.
2021-03-04 10:31:27 +00:00
Jakub Jelinek f65e551f73 libgomp: Use sizeof(void*) based checks instead of looking through $CC $CFLAGS for -m32/-mx32
Some gcc configurations default to -m32 but support -m64 too.  This patch
just makes the ILP32 tests more reliable by following what e.g. libsanitizer
configury does.

2021-03-04  Jakub Jelinek  <jakub@redhat.com>

	* configure.ac: Add AC_CHECK_SIZEOF([void *]).
	* plugin/configfrag.ac: Check $ac_cv_sizeof_void_p value instead of
	checking of -m32 or -mx32 options on the command line.
	* config.h.in: Regenerated.
	* configure: Regenerated.
2021-03-04 09:43:34 +01:00
Tobias Burnus d259ab1576 Fortran: Fix -freal-{4,8}-real* handling [PR99355]
Avoid chain kind conversion for, e.g., -freal-4-real-8 -freal-8-real-10.
Note that gfc_default_double_kind/gfc_default_double_kind already
honors the -freal flags.

gcc/fortran/ChangeLog:

	PR fortran/99355
	* decl.c (gfc_match_old_kind_spec, gfc_match_kind_spec): Avoid
	redoing kind conversions.
	* primary.c (match_real_constant): Likewise.

gcc/testsuite/ChangeLog:

	PR fortran/99355
	* gfortran.dg/real4-10-real8-10.f90: New test.
	* gfortran.dg/real4-10-real8-16.f90: New test.
	* gfortran.dg/real4-10-real8-4.f90: New test.
	* gfortran.dg/real4-10.f90: New test.
	* gfortran.dg/real4-16-real8-10.f90: New test.
	* gfortran.dg/real4-16-real8-16.f90: New test.
	* gfortran.dg/real4-16-real8-4.f90: New test.
	* gfortran.dg/real4-16.f90: New test.
	* gfortran.dg/real4-8-real8-10.f90: New test.
	* gfortran.dg/real4-8-real8-16.f90: New test.
	* gfortran.dg/real4-8-real8-4.f90: New test.
	* gfortran.dg/real4-8.f90: New test.
	* gfortran.dg/real8-10.f90: New test.
	* gfortran.dg/real8-16.f90: New test.
	* gfortran.dg/real8-4.f90: New test.
2021-03-04 08:20:01 +01:00
GCC Administrator f3641ac70e Daily bump. 2021-03-04 00:16:48 +00:00
Hans-Peter Nilsson cdfc2f6a6d gcc.misc-tests/outputs.exp: enumerate tests
Go from:
PASS: outputs asm default 1: outputs-0.s
PASS: outputs asm default 1: extra
PASS: outputs asm default 1: std out
PASS: outputs asm default 2: outputs-1.s
PASS: outputs asm default 2: outputs-2.s
PASS: outputs asm default 2: extra
PASS: outputs asm default 2: std out
PASS: outputs obj default 1: outputs-0.o
PASS: outputs obj default 1: extra
PASS: outputs obj default 1: std out
...

to:
PASS: outputs-1 asm default 1: outputs-0.s
PASS: outputs-1 asm default 1: extra
PASS: outputs-1 asm default 1: std out
PASS: outputs-2 asm default 2: outputs-1.s
PASS: outputs-2 asm default 2: outputs-2.s
PASS: outputs-2 asm default 2: extra
PASS: outputs-2 asm default 2: std out
PASS: outputs-3 obj default 1: outputs-0.o
PASS: outputs-3 obj default 1: extra
PASS: outputs-3 obj default 1: std out
...

thereby helping a human to quickly pin-point the result of a
specific test.

This mechanical patch was produced by applying
perl -pe 's/^(outest "\$b) /sprintf("%s-%d ",$1, ++$n)/e;'
to outputs.exp.

gcc/testsuite:
	* gcc.misc-tests/outputs.exp: Enumerate tests.
2021-03-04 01:10:19 +01:00
Hans-Peter Nilsson 5c8eb88418 gcc.misc-tests/outputs.exp: assert unique test-names
The gcc.misc-tests/outputs.exp tests can take some effort to
digest.

Navigating and debugging causes for failing tests here isn't
helped by the existence of tests with duplicate names.
Let's stop that from happening.  This requires that test-run
output is actually reviewed, as Tcl errors don't stop the
test-run, but then again there's no such dejagnu construct
that I know of.

Tested x86_64-pc-linux-gnu.

gcc/testsuite:
	* gcc.misc-tests/outputs.exp: Append discriminating
	suffixes to tests with duplicate names.
	(outest): Assert that each running test has a unique
	name.
2021-03-04 01:10:12 +01:00
Martin Sebor 8d57bdadd2 Correct a workaround for vectorized stores.
Resolves:
PR middle-end/96963 - -Wstringop-overflow false positive with -ftree-vectorize when assigning consecutive char struct members
PR middle-end/94655 - -Wstringop-overflow on implicit string assignment with vectorized char store

gcc/ChangeLog:

	PR middle-end/96963
	PR middle-end/94655
	* builtins.c (handle_array_ref): New helper.
	(handle_mem_ref): New helper.
	(compute_objsize_r): Factor out ARRAY_REF and MEM_REF handling
	into new helper functions.  Correct a workaround for vectorized
	assignments.

gcc/testsuite/ChangeLog:

	PR middle-end/96963
	PR middle-end/94655
	* gcc.dg/Wstringop-overflow-47.c: Xfail tests.
	* gcc.dg/Wstringop-overflow-65.c: New test.
	* gcc.dg/Warray-bounds-69.c: Same.
2021-03-03 17:04:48 -07:00
Pat Haugen 9a5a1e278f Update size attribute for Power10.
2021-03-03  Pat Haugen  <pthaugen@linux.ibm.com>

gcc/
	* config/rs6000/dfp.md (extendddtd2, trunctddd2, *cmp<mode>_internal1,
	floatditd2, ftrunc<mode>2, fix<mode>di2, dfp_ddedpd_<mode>,
	dfp_denbcd_<mode>, dfp_dxex_<mode>, dfp_diex_<mode>,
	*dfp_sgnfcnc_<mode>, dfp_dscli_<mode>, dfp_dscri_<mode>): Update size
	attribute for Power10.
	* config/rs6000/mma.md (*movoo): Likewise.
	* config/rs6000/rs6000.md (define_attr "size"): Add 256.
	(define_mode_attr bits): Add DD/TD modes.
	* config/rs6000/sync.md (load_quadpti, store_quadpti, load_lockedpti,
	store_conditionalpti): Update size attribute for Power10.
2021-03-03 17:54:30 -06:00
Nathan Sidwell c390c5df71 c++: Defer cloning to post-loading [PR 99170]
It turns out that cloning can cause use to load things. Specifically when
checking paramter shadows (this is avoidable), and also the delete
operator of a deleting dtor (not avoidable).  Doing that in the middle of
loading is a bad thing.  This defers it to a post-load worklist.  If it
causes more loading at that point there is no problem, as we've completed
the first set of loads, bar this bit of cleanup.

Again, this doesn't fix 99170, but is a step towards a solution.

	PR c++/99170
	gcc/cp/
	* module.cc (post_load_decls): New.
	(lazy_snum, recursive_lazy): Move earlier.
	(module_state::read_cluster): Push cloning onto post_load_decls.
	(post_load_processing): New.  Do the cloning here.
	(module_state::read_inits): Call post_load_processing.
	(module_state::read_language): Likewise.
	(lazy_load_binding, lazy_load_specializations): Likewise
	(lazy_load_members): Likewise
2021-03-03 12:45:32 -08:00
Marek Polacek 49df367b17 c++: Add fixed test [PR96474]
Was happy to find out that my recent dguide fix (r11-7483) fixed
this test too.  In particular, the

+  /* Wait until the enclosing scope is non-dependent.  */
+  if (DECL_CLASS_SCOPE_P (tmpl)
+      && dependent_type_p (DECL_CONTEXT (tmpl)))
+    return ptype;

bit.

gcc/testsuite/ChangeLog:

	PR c++/96474
	* g++.dg/cpp1z/class-deduction83.C: New test.
2021-03-03 15:12:07 -05:00
Nathan Sidwell 499193a692 c++: Defer specialization registration [PR 99170]
This defers inserting specializations into the specialization table,
until we have completed their streaming.  When streaming a cluster we
ensure that all imports are populated before any of the cluster, so
they need no visibility of other specializations.  Further within the
same import, we've already partitioned the graph, so no earlier
cluster can be refering to a specialization in a later cluster.
Inserting them early causes problems when other specializations of the
same template are inserted.  (This doesn't fix 99170, but is a
necessary change for that PR).

Earlier on, I had less deferred processing, but it has become clearer
that deferred worklists are the right way of handling a few things.
This patch highlights a fixme, in that we're streaming a key twice,
and need not do that, but I wanted to get correctness first.  Besides
the second streaming will end up being a back reference, which is of
course much cheaper than a by-value stream.

	PR c++/99170
	gcc/cp/
	* module.cc (trees_out::decl_value): Stream specialization keys
	after decl.
	(trees_in::decl_value): Stream them back and insert after
	completing the decl.
	(trees_out::key_mergeable): Drop some streaming here ...
	(trees_in::key_mergeable): ... and here.  Don't insert into
	specialization tables.
2021-03-03 11:32:32 -08:00
Iain Buclaw d6177870dd d: Fix heap-buffer-overflow in checkModFileAlias [PR 99337]
The code wrongly assumed memcmp did not read past the mismatch.

Reviewed-on: https://github.com/dlang/dmd/pull/12247

gcc/d/ChangeLog:

	PR d/99337
	* dmd/MERGE: Merge upstream dmd a3c9bf422.
2021-03-03 18:51:08 +01:00
Patrick Palka 5a559ace9b c++: Unify REQUIRES_EXPR evaluation / diagnostic routines
This folds the diagnose_requires_expr routines into the corresponding
tsubst_requires_expr ones.  This is achieved by making the latter
routines take a sat_info instead of a subst_info, and assigning the
appropriate meanings to the flags sat_info::noisy and
sat_info::diagnose_unsatisfaction_p during tsubst_requires_expr:
info.noisy() controls whether to diagnose invalid types and expressions
inside the requirements, and info.diagnose_unsatisfaction_p() controls
whether to additionally diagnose why the requires-expression evaluates
to false.

gcc/cp/ChangeLog:

	* constraint.cc (struct sat_info): Document the different
	meanings of noisy() and diagnose_unsatisfaction_p() during
	satisfaction and requires-expression evaluation.
	(tsubst_valid_expression_requirement): Take a sat_info instead
	of a subst_info.  Perform the substitution quietly first.  Fold
	in error-replaying code from diagnose_valid_expression.
	(tsubst_simple_requirement): Take a sat_info instead of a
	subst_info.
	(tsubst_type_requirement_1): New.  Fold in error-replaying code
	from diagnose_valid_type.
	(tsubst_type_requirement): Use the above.  Take a sat_info
	instead of a subst_info.
	(tsubst_compound_requirement): Likewise.  Fold in
	error-replaying code from diagnose_compound_requirement.
	(tsubst_nested_requirement): Take a sat_info instead of a
	subst_info.  Fold in error-replaying code from
	diagnose_nested_requirement.
	(tsubst_requirement): Take a sat_info instead of a subst_info.
	(tsubst_requires_expr): Split into two versions, one that takes
	a sat_info argument and another that takes a complain and
	in_decl argument.  Remove outdated documentation.  Document the
	effects of the sat_info argument.  Don't short-circuit
	processing of requirements when diagnosing unsatisfaction,
	mirroring diagnose_requires_expr.
	(satisfy_nondeclaration_constraint) <case REQUIRES_EXPR>: Remove
	assert, and se the three-parameter version of tsubst_requires_expr.
	(diagnose_trait_expr): Make static.  Take a template argument
	vector instead of a parameter mapping.
	(diagnose_valid_expression): Remove.
	(diagnose_valid_type): Remove.
	(diagnose_simple_requirement): Remove.
	(diagnose_compound_requirement): Remove.
	(diagnose_type_requirement): Remove.
	(diagnose_nested_requirement): Remove.
	(diagnose_requirement): Remove.
	(diagnose_requires_expr): Remove.
	(diagnose_atomic_constraint): Take a sat_info instead of a
	subst_info.  Adjust call to diagnose_trait_expr.  Call
	tsubst_requires_expr instead of diagnose_requires_expr.
	(diagnose_constraints): Remove special casing of REQUIRES_EXPR
	and just always call constraint_satisfaction_value.
2021-03-03 12:03:09 -05:00
Patrick Palka 662ef5b54d c++: Clean up normalization and satisfaction routines
This patch mostly performs some straightforward refactoring:

  - Renamed satisfy_constraint to satisfy_normalized_constraints
  - Renamed the three-parameter version of satisfy_constraint_expression
    to satisfy_nondeclaration_constraints
  - Removed normalize_(non)?template_requirements
  - Removed satisfy_associated_constraints (and made its callers
    check for dependent template args sooner, before normalization)
  - Removed the tsubst_flags_t parameter of evaluate_concept_check
  - Combined the two versions of constraint_satisfaction_value
  - Combined the two versions of constraint_satisfied_p

Additionally, this patch removes the handling of general
constraint-expressions from satisfy_nondeclaration_constraints, and
hence constraints_satisfied_p and constraint_satisfaction_value now take
only things that carry their own template information needed for
normalization, and, as a special case, REQUIRES_EXPRs.  But the latter
now get evaluated directly via tsubst_requires_expr rather than going
through satisfaction.

(That we used to evaluate REQUIRES_EXPR via satisfaction might even be a
correctness issue: since we cache satisfaction in special ways that don't
apply to regular evaluation, going through satisfaction could in theory
cause us to reuse a cached value for a REQUIRES_EXPR when we shouldn't
have.)

gcc/cp/ChangeLog:

	* constexpr.c (cxx_eval_call_expression): Adjust call to
	evaluate_concept_check.
	(cxx_eval_constant_expression) <case REQUIRES_EXPR>: Use
	evaluate_requires_expression instead of
	satisfy_constraint_expression.
	<case TEMPLATE_ID_EXPR>: Adjust call to evaluate_concept_check.
	* constraint.cc (struct sat_info): Adjust comment about which
	satisfaction entrypoints use noisy-unsat.
	(normalize_template_requirements): Remove (and adjust callers
	appropriately).
	(normalize_nontemplate_requirements): Likewise.
	(tsubst_nested_requirement): Use constraint_satisfaction_value
	instead of satisfy_constraint_expression, which'll do the
	noisy replaying of ill-formed quiet satisfaction for us.
	(decl_satisfied_cache): Adjust comment.
	(satisfy_constraint): Rename to ...
	(satisfy_normalized_constraints): ... this.
	(satisfy_associated_constraints): Remove (and make its
	callers check for dependent arguments).
	(satisfy_constraint_expression): Rename to ...
	(satisfy_nondeclaration_constraints): ... this.  Assert that
	'args' is empty when 't' is a concept-id.  Removing handling
	bare constraint-expressions, and handle REQUIRES_EXPRs
	specially.  Adjust comment accordingly.
	(satisfy_declaration_constraints): Assert in the two-parameter
	version that 't' is not a TEMPLATE_DECL.  Adjust following
	removal of normalize_(non)?template_requirements and
	satisfy_asociated_constraints.
	(constraint_satisfaction_value): Combine the two- and
	three-parameter versions in the natural way.
	(constraints_satisfied_p): Combine the one- and two-parameter
	versions in the natural way.  Improve documentation.
	(evaluate_requires_expr): Define.
	(evaluate_concept_check): Remove 'complain' parameter.  Use
	constraint_satisfaction_value instead of
	satisfy_constraint_expression.
	(diagnose_nested_requirement): Adjust following renaming of
	satisfy_constraint_expression.
	(diagnose_constraints): Handle REQUIRES_EXPR by going through
	diagnose_requires_expr directly instead of treating it as a
	constraint-expression.  Improve documentation.
	* cp-gimplify.c (cp_genericize_r) <case CALL_EXPR>: Adjust call
	to evaluate_concept_check.
	<case REQUIRES_EXPR>: Use evaluate_requires_expr instead of
	constraints_satisfied_p.
	<case TEMPLATE_ID_EXPR>: Adjust call to evaluate_concept_check.
	* cp-tree.h (evaluate_requires_expr): Declare.
	(evaluate_concept_check): Remove tsubst_flag_t parameter.
	(satisfy_constraint_expression): Remove declaration.
	(constraints_satisfied_p): Remove one-parameter declaration.
	Add a default argument to the two-parameter declaration.
	* cvt.c (convert_to_void): Adjust call to
	evaluate_concept_check.
2021-03-03 12:01:13 -05:00
Jonathan Wright 39d7eb8a73 testsuite: aarch64: Add tests for vcvt FP intrinsics
Add tests for vcvtx* and vcvt_fXX_fXX floating-point Neon intrinsics.
Since these intrinsics are only supported for AArch64, these tests
are restricted to only run on AArch64 targets.

gcc/testsuite/ChangeLog:

2021-02-18  Jonathan Wright  <jonathan.wright@arm.com>

	* gcc.target/aarch64/advsimd-intrinsics/vcvt_fXX_fXX.c:
	New test.
	* gcc.target/aarch64/advsimd-intrinsics/vcvtx.c:
	New test.
2021-03-03 15:51:58 +00:00
Jonathan Wright 3a0fbf7604 testsuite: aarch64: Add tests for v[q]mov[u]n_high intrinsics
Add tests for v[q]mov[u]n_high Neon intrinsics. Since these
intrinsics are only supported for AArch64, these tests are restricted
to only run on AArch64 targets.

gcc/testsuite/ChangeLog:

2021-03-02  Jonathan Wright  <jonathan.wright@arm.com>

	* gcc.target/aarch64/advsimd-intrinsics/vmovn_high.c:
	New test.
	* gcc.target/aarch64/advsimd-intrinsics/vqmovn_high.c:
	New test.
	* gcc.target/aarch64/advsimd-intrinsics/vqmovun_high.c:
	New test.
2021-03-03 15:51:45 +00:00
Jonathan Wright fd85814c4b testsuite: aarch64: Add tests for v[r]shrn_high intrinsics
Add tests for v[r]shrn_high Neon intrinsics. Since these intrinsics
are only supported for AArch64, these tests are restricted to only
run on AArch64 targets.

gcc/testsuite/ChangeLog:

2021-03-02  Jonathan Wright  <jonathan.wright@arm.com>

	* gcc.target/aarch64/advsimd-intrinsics/vrshrn_high_n.c:
	New test.
	* gcc.target/aarch64/advsimd-intrinsics/vshrn_high_n.c:
	New test.
2021-03-03 15:51:30 +00:00
Jonathan Wright 949eab55b6 testsuite: aarch64: Add tests for narrowing-arithmetic intrinsics
Add tests for v[r]addhn_high and v[r]subhn_high Neon intrinsics.
Since these intrinsics are only supported for AArch64, these tests
are restricted to only run on AArch64 targets.

gcc/testsuite/ChangeLog:

2021-03-02  Jonathan Wright  <jonathan.wright@arm.com>

	* gcc.target/aarch64/advsimd-intrinsics/vXXXhn_high.inc:
	New test template.
	* gcc.target/aarch64/advsimd-intrinsics/vaddhn_high.c:
	New test.
	* gcc.target/aarch64/advsimd-intrinsics/vraddhn_high.c:
	New test.
	* gcc.target/aarch64/advsimd-intrinsics/vrsubhn_high.c:
	New test.
	* gcc.target/aarch64/advsimd-intrinsics/vsubhn_high.c:
	New test.
2021-03-03 15:51:12 +00:00
Jakub Jelinek 0b8fa12015 c++: Fix -fstrong-eval-order for operator &&, || and , [PR82959]
P0145R3 added
"However, the operands are sequenced in the order prescribed for the built-in
operator" rule for overloaded operator calls when using the operator syntax.
op_is_ordered follows that, but added just the overloaded operators
added in that paper.  &&, || and comma operators had rules that
lhs is sequenced before rhs already in C++98.
The following patch adds those cases to op_is_ordered.

2021-03-03  Jakub Jelinek  <jakub@redhat.com>

	PR c++/82959
	* call.c (op_is_ordered): Handle TRUTH_ANDIF_EXPR, TRUTH_ORIF_EXPR
	and COMPOUND_EXPR.

	* g++.dg/cpp1z/eval-order10.C: New test.
2021-03-03 16:12:23 +01:00
Rainer Orth fa6092d2cd sparcv9: Disable -Wuninitialized warnings breaking bootstrap [PR92002]
sparcv9 bootstrap has been broken for 1 1/2 years now by spurious
-Wuninitialized warnings:

In function ‘wide_int wi::max_value(unsigned int, signop)’,
    inlined from ‘wide_int wi::max_value(unsigned int, signop)’ at /vol/gcc/src/hg/master/local/gcc/wide-int.cc:330:1:
/vol/gcc/src/hg/master/local/gcc/wide-int.cc:335:31: error: ‘<anonymous>.generic_wide_int<wide_int_storage>::<anonymous>.wide_int_storage::val[1]’ may be used uninitialized [-Werror=maybe-uninitialized]
  335 |     return shwi (-1, precision);
      |                               ^
[...]
In function ‘wide_int get_nonzero_bits(const_tree)’,
    inlined from ‘wide_int get_nonzero_bits(const_tree)’ at /vol/gcc/src/hg/master/local/gcc/tree-ssanames.c:531:1:
/vol/gcc/src/hg/master/local/gcc/tree-ssanames.c:544:67: error: ‘<anonymous>.generic_wide_int<wide_int_storage>::<anonymous>.wide_int_storage::val[1]’ may be used uninitialized [-Werror=maybe-uninitialized]
  544 |                          | (HOST_WIDE_INT) pi->misalign, precision);
      |                                                                   ^
[...]

Before we ship yet another release with this issue, I suggest to at
least include a workaround of demoting them to warnings.

Tested on sparcv9-sun-solaris2.11.


2021-03-03  Rainer Orth  <ro@CeBiTec.Uni-Bielefeld.DE>

	gcc:
	PR bootstrap/92002
	* config/sparc/t-sparc (tree-ssanames.o-warn): Don't error for
	-Wuninitialized, -Wmaybe-uninitialized.
	(wide-int.o-warn): Likewise.
2021-03-03 16:01:50 +01:00
Marek Polacek 1dabbfb0f4 c++: ICE with deduction guide in checking type-dep [PR99009, PR97034]
We represent deduction guides with FUNCTION_DECLs, but they are built
without DECL_CONTEXT, leading to an ICE in type_dependent_expression_p
on the assert that the type of a function template with no dependent
(innermost!) template arguments must be non-dependent.  Consider the
attached class-deduction79.C: we create a deduction guide:

  template<class T> G(T)-> E<Z>::G<T>

we deduce T and create a partial instantiation:

  G(T) -> E<Z>::G<T> [with T = int]

And then do_class_deduction wants to create a CALL_EXPR from the above
using build_new_function_call -> build_over_call which calls mark_used
-> maybe_instantiate_noexcept -> type_dependent_expression_p.

There, the innermost template arguments are non-dependent (<int>), but
the fntype is dependent -- the return type is a TYPENAME_TYPE, and
since we have no DECL_CONTEXT, this check holds:

  /* Otherwise, if the function decl isn't from a dependent scope, it can't be
     type-dependent.  Checking this is important for functions with auto return
     type, which looks like a dependent type.  */
  if (TREE_CODE (expression) == FUNCTION_DECL
      && !(DECL_CLASS_SCOPE_P (expression)
           && dependent_type_p (DECL_CONTEXT (expression)))

whereupon we ICE.

This patch fixes it by deferring the class deduction until the
enclosing scope is non-dependent.  build_deduction_guide and maybe_aggr_guide
needed a little tweaking to make the deduction work in a member
template.

Co-Authored-By: Jason Merrill <jason@redhat.com>

gcc/cp/ChangeLog:

	PR c++/97034
	PR c++/99009
	* pt.c (build_deduction_guide): Use INNERMOST_TEMPLATE_ARGS.
	(maybe_aggr_guide): Use the original template type where needed.  In
	a class member template, partially instantiate the result of
	collect_ctor_idx_types.
	(do_class_deduction): Defer the deduction until the enclosing
	scope is non-dependent.

gcc/testsuite/ChangeLog:

	PR c++/97034
	PR c++/99009
	* g++.dg/cpp1z/class-deduction81.C: New test.
	* g++.dg/cpp1z/class-deduction82.C: New test.
	* g++.dg/cpp2a/class-deduction-aggr8.C: New test.
	* g++.dg/cpp2a/class-deduction-aggr9.C: New test.
	* g++.dg/cpp2a/class-deduction-aggr10.C: New test.
2021-03-03 09:52:37 -05:00
Richard Earnshaw 15cf7fe355 arm: Ignore --with-mode when CPU only supports one instruction set.
Arm processors can support up to two instruction sets.  Some early
cores only support the traditional A32 (Arm) instructions, while some
more recent devices only support T32 (Thumb) instructions.

When configuring the compiler,--with-mode can be used to select the
default instruction set to target if the user has not made an explicit
choice, but this can cause needless problems if the default is not
supported by the requested CPU.

To fix this this patch adjusts the way that the --with-mode selection
is processed so that it can take into account the selected CPU or
architecture and not create a meaningless combination.

gcc:
	* common/config/arm/arm-common.c: Include configargs.h.
	(arm_config_default): New function.
	(arm_target_mode): Renamed from arm_target_thumb_only.  Handle
	processors that do not support Thumb.  Take into account the
	--with-mode configuration setting for selecting the default.
	* config/arm/arm.h (OPTION_DEFAULT_SPECS): Remove entry for 'mode'.
	(TARGET_MODE_SPEC_FUNCTIONS): Update for function name change.
2021-03-03 13:53:37 +00:00
Jason Merrill 74aee6d208 c++: C++17 and decltype of multi-operator expression [PR95675]
A call that is the immediate operand of decltype has special semantics: no
temporary is produced, so it's OK for the return type to be e.g. incomplete.
But we were treating (e | f) the same way, which confused overload
resolution when we then tried to evaluate ... | g.

Fixed by making build_temp do what its name says, and force the C++17
temporary materialization conversion.

gcc/cp/ChangeLog:

	PR c++/95675
	* call.c (build_temp): Wrap a CALL_EXPR in a TARGET_EXPR
	if it didn't get one before.

gcc/testsuite/ChangeLog:

	PR c++/95675
	* g++.dg/cpp0x/decltype-call5.C: New test.
	* g++.dg/cpp0x/decltype-call6.C: New test.
2021-03-03 08:47:03 -05:00
Rainer Orth 5bc3a2bc8a libstdc++: Update Solaris baselines for GCC 11.1
The following patch updates the Solaris baselines for GCC 11.1.  There's
only one caveat: comparing the Solaris 11.3 and 11.4 baselines, I find

+FUNC:_ZSt10from_charsPKcS0_RdSt12chars_format@@GLIBCXX_3.4.29
+FUNC:_ZSt10from_charsPKcS0_ReSt12chars_format@@GLIBCXX_3.4.29
+FUNC:_ZSt10from_charsPKcS0_RfSt12chars_format@@GLIBCXX_3.4.29

i.e.

std::from_chars(char const*, char const*, double&, std::chars_format)

and similarly for long double, float.  Those are from from
src/c++17/floating_from_chars.cc and only defined if
_GLIBCXX_HAVE_USELOCALE, i.e. depend on the XPG7 addition.  Given that
only Solaris 11.4 supports XPG7, I've taken the 11.3 baselines to avoid
having separate ones for 11.3 and 11.4.

Tested on i386-pc-solaris2.11 and sparc-sun-solaris2.11 (sparc and x86,
32 and 64-bit, 11.3 and 11.4).


2021-02-10  Rainer Orth  <ro@CeBiTec.Uni-Bielefeld.DE>

	libstdc++-v3:
	* 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.
2021-03-03 14:25:51 +01:00
Martin Liska 00d79dc4be gcov: use mmap pools for KVP.
gcc/ChangeLog:

	PR gcov-profile/97461
	* gcov-io.h (GCOV_PREALLOCATED_KVP): Remove.

libgcc/ChangeLog:

	PR gcov-profile/97461
	* config.in: Regenerate.
	* configure: Likewise.
	* configure.ac: Check sys/mman.h header file
	* libgcov-driver.c (struct gcov_kvp): Remove static
	pre-allocated pool and use a dynamic one.
	* libgcov.h (MMAP_CHUNK_SIZE): New.
	(gcov_counter_add): Use mmap to allocate pool for struct
	gcov_kvp.
2021-03-03 14:21:45 +01:00
Rainer Orth 8cfa06570d testsuite: i386: Fix gcc.target/i386/pr95798-?.c on Solaris
The new gcc.target/i386/pr95798-?.c tests FAIL on 64-bit Solaris/x86:

+FAIL: gcc.target/i386/pr95798-1.c scan-assembler 1,
8\\\\(%rsp,%r[a-z0-9]*,8\\\\)
+FAIL: gcc.target/i386/pr95798-1.c scan-assembler 2,
16\\\\(%rsp,%r[a-z0-9]*,8\\\\)
+FAIL: gcc.target/i386/pr95798-1.c scan-assembler 3,
24\\\\(%rsp,%r[a-z0-9]*,8\\\\)
+FAIL: gcc.target/i386/pr95798-1.c scan-assembler 4,
32\\\\(%rsp,%r[a-z0-9]*,8\\\\)
+FAIL: gcc.target/i386/pr95798-1.c scan-assembler 5,
40\\\\(%rsp,%r[a-z0-9]*,8\\\\)
+FAIL: gcc.target/i386/pr95798-1.c scan-assembler 6,
48\\\\(%rsp,%r[a-z0-9]*,8\\\\)
+FAIL: gcc.target/i386/pr95798-1.c scan-assembler 7,
56\\\\(%rsp,%r[a-z0-9]*,8\\\\)
+FAIL: gcc.target/i386/pr95798-2.c scan-assembler 1,
8\\\\(%rsp,%r[a-z0-9]*,8\\\\)
+FAIL: gcc.target/i386/pr95798-2.c scan-assembler 2,
16\\\\(%rsp,%r[a-z0-9]*,8\\\\)
+FAIL: gcc.target/i386/pr95798-2.c scan-assembler 3,
24\\\\(%rsp,%r[a-z0-9]*,8\\\\)
+FAIL: gcc.target/i386/pr95798-2.c scan-assembler 4,
32\\\\(%rsp,%r[a-z0-9]*,8\\\\)
+FAIL: gcc.target/i386/pr95798-2.c scan-assembler 5,
40\\\\(%rsp,%r[a-z0-9]*,8\\\\)
+FAIL: gcc.target/i386/pr95798-2.c scan-assembler 6,
48\\\\(%rsp,%r[a-z0-9]*,8\\\\)
+FAIL: gcc.target/i386/pr95798-2.c scan-assembler 7,
56\\\\(%rsp,%r[a-z0-9]*,8\\\\)

This happens because Solaris/amd64 defaults to -fno-omit-frame-pointer
and can be avoided by always passing -fomit-frame-pointer.

Tested on i386-pc-solaris2.11 and x86_64-pc-linux-gnu.


2021-03-02  Rainer Orth  <ro@CeBiTec.Uni-Bielefeld.DE>

	gcc/testsuite:
	* gcc.target/i386/pr95798-1.c: Add -fomit-frame-pointer to
	dg-options.
	* gcc.target/i386/pr95798-2.c: Likewise.
2021-03-03 13:49:28 +01:00
Nathan Sidwell 8c4f0c0ceb c++: namespace reachability [PR 99344]
This reworks namespace serializing to avoid some issues I ran into
when working on 99170.  In modules, (non-anonymous) namespaces are
strange beasts, that always have external linkage, but may have
module-specific visibility.  I still don't get the latter 100%
correct, but this is in the right direction.

	PR c++/99344
	gcc/cp/
	* module.cc (trees_out::decl_node): Small refactor.
	(depset:#️⃣:add_binding_entity): Return true on meeting an
	import.  Set namespace's import here.
	(module_state:write_namespaces): Inform of purview too.
	(module_state:read_namespaces): Adjust.
	* name-lookup.c (implicitly_export_namespace): Delete.
	(do_pushdecl): Don't call it.
	(push_namespace): Likewise, set purview.
	(add_imported_namespace): Reorder parms.
	* name-lookup.h (add_imported_namespace): Alter param ordering.
	gcc/testsuite/
	* g++.dg/modules/namespace-2_a.C
	* g++.dg/modules/pr99344_a.C
	* g++.dg/modules/pr99344_b.C
2021-03-03 04:23:08 -08:00
Rainer Orth a726723737 libstdc++: Don't use reserved identifiers in simd headers
Two simd tests FAIL on Solaris, both SPARC and x86:

FAIL: experimental/simd/standard_abi_usable.cc -msse2 -O2 -Wno-psabi (test for excess errors)
FAIL: experimental/simd/standard_abi_usable_2.cc -msse2 -O2 -Wno-psabi (test for excess errors)

This happens because the simd headers use identifiers documented in the
libstdc++ manual as reserved by system headers.

Fixed as follows, tested on i386-pc-solaris2.11, sparc-sun-solaris2.11,
and x86_64-pc-linux-gnu.


2021-02-01  Rainer Orth  <ro@CeBiTec.Uni-Bielefeld.DE>

	libstdc++-v3:
	* include/experimental/bits/simd.h: Replace reserved _X, _B by
	_Xp, _Bp.
	* include/experimental/bits/simd_builtin.h: Likewise.
	* include/experimental/bits/simd_x86.h: Likewise.
2021-03-03 13:16:35 +01:00
Eric Botcazou 357c435068 Fix ICE with pathologically large frames
gcc/
	PR target/99234
	* config/i386/i386.c (ix86_compute_frame_layout): For a SEH target,
	point back the hard frame pointer to its default location when the
	frame is larger than SEH_MAX_FRAME_SIZE.
2021-03-03 12:29:15 +01:00