Commit Graph

177130 Commits

Author SHA1 Message Date
GCC Administrator
4a9aa9dec7 Daily bump. 2020-06-02 00:16:25 +00:00
Jonathan Wakely
cd3f067b82 libstdc++: Fix filesystem::u8path for mingw targets (PR 95392)
When I refactored filesystem::path string conversions in
r11-587-584d52b088f9fcf78704b504c3f1f07e17c1cded I failed to update the
mingw-specific code in filesystem::u8path, causing a bootstrap failure.

This fixes it, and further refactors the mingw-specific code along the
same lines as the previous commit. All conversions from UTF-8 strings to
wide strings now use the same helper function, __wstr_from_utf8.

	PR libstdc++/95392
	* include/bits/fs_path.h (path::_S_to_string): Move to
	namespace-scope and rename to ...
	(__detail::__string_from_range): ... this.
	[WINDOWS] (__detail::__wstr_from_utf8): New function template to
	convert a char sequence containing UTF-8 to wstring.
	(path::_S_convert(Iter, Iter)): Adjust call to _S_to_string.
	(path::_S_convert_loc(Iter, Iter, const locale&)): Likewise.
	(u8path(InputIterator, InputIterator)) [WINDOWS]: Use
	__string_from_range to obtain a contiguous range and
	__wstr_from_utf8 to obtain a wide string.
	(u8path(const Source&)) [WINDOWS]: Use __effective_range to
	obtain a contiguous range and __wstr_from_utf8 to obtain a wide
	string.
	(path::_S_convert(const _EcharT*, const _EcharT)) [WINDOWS]:
	Use __wstr_from_utf8.
2020-06-02 00:07:05 +01:00
Jeff Law
c7969df1c5 Fix 92085-2.c ICE due to having (const_int 0) as the destination of a set.
gcc/
	* lower-subreg.c (resolve_simple_move): If simplify_gen_subreg_concatn
	returns (const_int 0) for the destination, then emit nothing.
2020-06-01 17:18:03 -04:00
Jason Merrill
172f2c42a1 c++: vptr ubsan and object of known type [PR95466]
Another case where we can't find the OBJ_TYPE_REF_OBJECT in the
OBJ_TYPE_REF_EXPR.  So let's just evaluate the sanitize call first.

gcc/cp/ChangeLog:

	PR c++/95466
	PR c++/95311
	PR c++/95221
	* class.c (build_vfn_ref): Revert 95311 change.
	* cp-ubsan.c (cp_ubsan_maybe_instrument_member_call): Build a
	COMPOUND_EXPR.

gcc/testsuite/ChangeLog:

	PR c++/95466
	* g++.dg/ubsan/vptr-17.C: New test.
2020-06-01 16:52:47 -04:00
Uros Bizjak
832c1192eb i386: Add __attribute__ ((gcc_struct)) to struct fenv [PR95418]
Windows ABI (MinGW) is different than Linux ABI when bitfileds are involved.
The following patch adds __attribute__ ((gcc_struct)) to struct fenv in order
to match the layout of x87 state image in memory.

2020-06-01  Uroš Bizjak  <ubizjak@gmail.com>

libatomic/ChangeLog:
	* config/x86/fenv.c (struct fenv): Add __attribute__ ((gcc_struct)).

libgcc/ChangeLog:
	* config/i386/sfp-exceptions.c (struct fenv):
	Add __attribute__ ((gcc_struct)).

libgfortran/ChangeLog:
	PR libfortran/95418
	* config/fpu-387.h (struct fenv): Add __attribute__ ((gcc_struct)).
2020-06-01 22:29:20 +02:00
Iain Sandoe
88f48e2967 coroutines: Correct handling of references in parm copies [PR95350].
Adjust to handle rvalue refs the same way as clang, and to correct
the handling of moves when a copy CTOR is present.  This is one area
where we could make things easier for the end-user (as was implemented
before this change), however there needs to be agreement about when the
full statement containing a coroutine call ends (i.e. when the ramp
terminates or when the coroutine terminates).

gcc/cp/ChangeLog:

	PR c++/95350
	* coroutines.cc (struct param_info): Remove rv_ref field.
	(build_actor_fn): Remove specifial rvalue ref handling.
	(morph_fn_to_coro): Likewise.

gcc/testsuite/ChangeLog:

	PR c++/95350
	* g++.dg/coroutines/torture/func-params-08.C: Adjust test to
	reflect that all rvalue refs are dangling.
	* g++.dg/coroutines/torture/func-params-09-awaitable-parms.C:
	Likewise.
	* g++.dg/coroutines/pr95350.C: New test.
2020-06-01 19:44:22 +01:00
Jonathan Wakely
118158b646 libstdc++: Fix __gnu_test::input_iterator_wrapper::operator++(int)
I noticed recently that our input_iterator_wrapper utility for writing
tests has the following post-increment operator:

    void
    operator++(int)
    {
      ++*this;
    }

That fails to meet the Cpp17InputIterator requirement that *r++ is
valid. This change makes it return a non-void proxy type that can be
deferenced to produce another proxy, which is convertible to the
value_type. The second proxy converts to const T& to ensure it can't be
written to.

	* testsuite/util/testsuite_iterators.h:
	(input_iterator_wrapper::operator++(int)): Return proxy object.
2020-06-01 18:30:47 +01:00
Jan Hubicka
1746d5f3e6 Cleanup global decl stream reference streaming, part 2
gcc/ChangeLog:

2020-06-01  Jan Hubicka  <hubicka@ucw.cz>

	* lto-streamer.h (enum LTO_tags): Remove LTO_field_decl_ref,
	LTO_function_decl_ref, LTO_label_decl_ref, LTO_namespace_decl_ref,
	LTO_result_decl_ref, LTO_type_decl_ref, LTO_type_ref,
	LTO_const_decl_ref, LTO_imported_decl_ref,
	LTO_translation_unit_decl_ref, LTO_global_decl_ref and
	LTO_namelist_decl_ref; add LTO_global_stream_ref.
	* lto-streamer-in.c (lto_input_tree_ref): Simplify.
	(lto_input_scc): Update.
	(lto_input_tree_1): Update.
	* lto-streamer-out.c (lto_indexable_tree_ref): Simlify.
	* lto-streamer.c (lto_tag_name): Update.
2020-06-01 19:13:58 +02:00
Jonathan Wakely
258059d91b libstdc++: Document API changes in GCC 10
* doc/xml/manual/evolution.xml: Document deprecation of
	__is_nullptr_t and removal of std::allocator members.
	* doc/html/manual/api.html: Regenerate.
2020-06-01 16:50:53 +01:00
Jonathan Wakely
a1ffe9b6f4 libstdc++: Fix incorrect Docbook links
The <xref> element creates the link text automatically from the link
target, rather than using the text node child of the element. This can
be changed by using an endterm attribute, but it's simpler to just use
the <link> element instead.

	* doc/xml/manual/containers.xml: Replace <xref> with <link>.
	* doc/xml/manual/evolution.xml: Likewise.
	* doc/html/manual/api.html: Regenerate.
	* doc/html/manual/containers.html: Regenerate.
2020-06-01 16:49:31 +01:00
Gerald Pfeifer
e41b988cc5 libstdc++: Update/streamline Valgrind references
* doc/xml/faq.xml: Adjust Valgrind reference and remove another.
	* doc/html/faq.html: Regenerate.
2020-06-01 17:04:22 +02:00
Jan Hubicka
ff7da2b5d6 Cleanup global decl stream reference streaming, part 1
This patch further simplifies way we reffer to global stream.  Every function
section has vector of references to global trees which are populated during
streaming.  This vector is for some reason divided into field_decls, fn_decls,
type_decls, types, namespace_decls, labels_decls and var_decls which contains
also other things.

There is no benefit for this split except perhaps for making the indexes
bit smaller and possibly better encodable by ulebs.  This however does not
pay back and makes things unnecesarily complex.
We may want to re-add multiple tables if we start streaming something else than
trees into the global stream, but that would not work with current
infrastructure anyway.

The patch drops different streams and I checked that it results in reduction of
global stream and apparently very small increase in function streams but it may
be just because I updated tree in between the tests. This will be fixed by
incremental patch.

[WPA] Compression: 86220483 input bytes, 217762146 uncompressed bytes (ratio: 2.525643)
[WPA] Compression: 111735464 input bytes, 297410918 uncompressed bytes (ratio: 2.661741)
[WPA] Size of mmap'd section decls: 86220483 bytes
[WPA] Size of mmap'd section function_body: 14353447 bytes

to:

[WPA] Compression: 85754594 input bytes, 216006049 uncompressed bytes (ratio: 2.518886)
[WPA] Compression: 111370381 input bytes, 295746052 uncompressed bytes (ratio: 2.655518)
[WPA] Size of mmap'd section decls: 85754594 bytes
[WPA] Size of mmap'd section function_body: 14447946 bytes

The patch also removes some of ugly macro generators of accessors functions and
makes it easier to further optimize the way we stream references to trees which
I plan to do incrementally.

I also made the API for streaming referneces symmetric.  I.e. you
stream out by
  lto_output_var_decl_ref
and stream in by
  lto_input_var_decl_ref

instead streaming out by
  lto_output_var_decl_index
and streaming in by
  decl_index = streamer_read_uhwi (ib);
  lto_file_decl_data_get_fn_decl (file_data, decl_index);

lto-bootstrapped/regtested x86_64-linux, will commit it shortly.

gcc/ChangeLog:

2020-06-01  Jan Hubicka  <hubicka@ucw.cz>

	* ipa-reference.c (stream_out_bitmap): Use lto_output_var_decl_ref.
	(ipa_reference_read_optimization_summary): Use lto_intput_var_decl_ref.
	* lto-cgraph.c (lto_output_node): Likewise.
	(lto_output_varpool_node): Likewise.
	(output_offload_tables): Likewise.
	(input_node): Likewise.
	(input_varpool_node): Likewise.
	(input_offload_tables): Likewise.
	* lto-streamer-in.c (lto_input_tree_ref): Declare.
	(lto_input_var_decl_ref): Declare.
	(lto_input_fn_decl_ref): Declare.
	* lto-streamer-out.c (lto_indexable_tree_ref): Use only one decl stream.
	(lto_output_var_decl_index): Rename to ..
	(lto_output_var_decl_ref): ... this.
	(lto_output_fn_decl_index): Rename to ...
	(lto_output_fn_decl_ref): ... this.
	* lto-streamer.h (enum lto_decl_stream_e_t): Remove per-type streams.
	(DEFINE_DECL_STREAM_FUNCS): Remove.
	(lto_output_var_decl_index): Remove.
	(lto_output_fn_decl_index): Remove.
	(lto_output_var_decl_ref): Declare.
	(lto_output_fn_decl_ref): Declare.
	(lto_input_var_decl_ref): Declare.
	(lto_input_fn_decl_ref): Declare.
2020-06-01 15:57:32 +02:00
Feng Xue
c055929ff2 Fix dump in clone materialization
2020-06-01  Feng Xue  <fxue@os.amperecomputing.com>

gcc/
	* cgraphclones.c (materialize_all_clones): Adjust replace map dump.
	* ipa-param-manipulation.c (ipa_dump_adjusted_parameters): Do not
	dump infomation if there is no adjusted parameter.
	* (ipa_param_adjustments::dump): Adjust prefix spaces for dump string.
2020-06-01 16:58:17 +08:00
Aldy Hernandez
62efd1c481 Move array bounds checking into its own file.
gcc/
	* Makefile.in (gimple-array-bounds.o): New.
	* tree-vrp.c: Move array bounds code...
	* gimple-array-bounds.cc: ...here...
	* gimple-array-bounds.h: ...and here.
2020-06-01 09:50:48 +02:00
Aldy Hernandez
4a5e9d0089 Move value_range_equiv code to its own file.
gcc/
	* Makefile.in (OBJS): Add value-range-equiv.o.
	* tree-vrp.c (*value_range_equiv*): Move to...
	* value-range-equiv.cc: ...here.
	* tree-vrp.h (class value_range_equiv): Move to...
	* value-range-equiv.h: ...here.
	* vr-values.h: Include value-range-equiv.h.
2020-06-01 09:48:43 +02:00
Feng Xue
32633ec815 Fix missed IPA-CP on by-ref argument directly passed through (PR 93429)
2020-06-01  Feng Xue  <fxue@os.amperecomputing.com>

gcc/
	PR ipa/93429
	* ipa-cp.c (propagate_aggs_across_jump_function): Check aggregate
	lattice for simple pass-through by-ref argument.

gcc/testsuite/
	PR ipa/93429
	* gcc.dg/ipa/ipcp-agg-8.c: Change dump string.
	* gcc.dg/ipa/ipcp-agg-13.c: New test.
2020-06-01 14:10:04 +08:00
GCC Administrator
e7340ed74a Daily bump. 2020-06-01 00:16:26 +00:00
Gerald Pfeifer
0feb332152 libstdc++: Remove stray change from previous commit
There is a stray change (introducing a bogus line at the top) that
came via 2babbb6760c43bcd803a5e168ef5ecb0be8a5121; remove that again.

	* doc/xml/manual/policy_data_structures_biblio.xml: Remove
	stray change.
2020-06-01 02:10:24 +02:00
Gerald Pfeifer
2babbb6760 libstdc++: Switch www.cs.princeton.edu to https
* doc/xml/manual/policy_data_structures_biblio.xml: Switch
	www.cs.princeton.edu to https.
	* doc/html/manual/policy_data_structures.html: Regenerate.
2020-06-01 02:03:48 +02:00
Douglas B Rupp
0edfc1fd22 Check for more missing math decls on vxworks.
Use the GLIBCXX_CHECK_MATH_DECL macro to check for the full list of
vxworks math decls.

libstdc++-v3/ChangeLog

	* crossconfig.m4 (<*-vxworks>): Check for more math decls.
	* configure: Rebuild.
2020-05-31 14:32:27 -07:00
Iain Sandoe
1bb8085046 coroutines: Avoid functions with unlowered coroutine trees [PR95087].
Diagnosing bad uses of 'return' in coroutines is somewhat
tricky, since the user can use the keyword before we know
that the function is a coroutine (where such returns are not
permitted).  At present, we are just doing a check for any
use of 'return' and erroring on that.  However, we can't then
pass the function body on, since it will contain unlowered
coroutine trees.

This avoids the issue by dropping the entire function body
under that circumstance.  We could do better (for 11) but
this is intended to allow back-port of other fixes to 10.

gcc/cp/ChangeLog:

	PR c++/95087
	* coroutines.cc (morph_fn_to_coro): If we see an
	early fatal error, drop the erroneous function body.

gcc/testsuite/ChangeLog:

	PR c++/95087
	* g++.dg/coroutines/co-return-syntax-08-bad-return.C:
	Adjust the testcase to do the compile (rather than an
	-fsyntax-only parse).
2020-05-31 20:48:09 +01:00
Iain Buclaw
7248bf60a2 contrib: Add v850e1-elf to config-list.mk
This comment was added in SVN r173410, v850e1-* was added to config.sub
in SVN r174691 (around 2011).  So it should no longer apply.

contrib/ChangeLog:

	* config-list.mk (LIST): Add v850e1-elf.
2020-05-31 21:41:55 +02:00
Iain Buclaw
5f35a8288b contrib: Add or1k-elf, or1k-linux-*, and or1k-rtems to config-list.mk
Support for OpenRISC target was added in SVN r265963.

contrib/ChangeLog:

	* config-list.mk (LIST): Add or1k-elf, or1k-linux-*, and or1k-rtems.
2020-05-31 21:41:16 +02:00
Iain Buclaw
30da9dc40c contrib: Remove arm-wrs-vxworks from config-list.mk
Support for arm-wrs-vxworks was removed in git r10-4684.

contrib/ChangeLog:

	* config-list.mk (LIST): Remove arm-wrs-vxworks.
2020-05-31 21:40:11 +02:00
Iain Buclaw
95625d3580 contrib: Remove cris-linux and crisv32-* from config-list.mk
Support for crisv32-*-* and cris-*-linux* was removed in git r11-214.

contrib/ChangeLog:

	* config-list.mk (LIST): Remove cris-linux, crisv32-elf, and
	crisv32-linux.
2020-05-31 21:37:19 +02:00
Iain Sandoe
3cf2a9e047 coroutines: Remove up some unused values.
The build_new_method_call allows us to inspect the
function decl used.  In most cases, this is not used
and we can just set the parm to NULL.

gcc/cp/ChangeLog:

	* coroutines.cc (build_co_await): Remove unused
	variable.
	(finish_co_await_expr): Likewise.
	(finish_co_yield_expr): Likewise; revise comment.
2020-05-31 19:32:01 +01:00
Jeff Law
c25d0fa4d7 Fix execute/20071219-1.c regression on H8 due to loss of REG_INC notes in peephole2.
gcc/
	* lra.c (add_auto_inc_notes): Remove function.
	* reload1.c (add_auto_inc_notes): Similarly.  Move into...
	* rtlanal.c (add_auto_inc_notes): New function.
	* rtl.h (add_auto_inc_notes): Add prototype.
	* recog.c (peep2_attempt): Scan and add REG_INC notes to new insns
	as needed.
2020-05-31 11:18:15 -06:00
Jan Hubicka
05430b9b6a Cleanup indexable tree streaming.
gcc/

	* lto-section-out.c (lto_output_decl_index): Remove.
	(lto_output_field_decl_index): Move to lto-streamer-out.c
	(lto_output_fn_decl_index): Move to lto-streamer-out.c
	(lto_output_namespace_decl_index): Remove.
	(lto_output_var_decl_index): Remove.
	(lto_output_type_decl_index): Remove.
	(lto_output_type_ref_index): Remove.
	* lto-streamer-out.c (output_type_ref): Remove.
	(lto_get_index): New function.
	(lto_output_tree_ref): Remove.
	(lto_indexable_tree_ref): New function.
	(lto_output_var_decl_index): Move here from lto-section-out.c; simplify.
	(lto_output_fn_decl_index): Move here from lto-section-out.c; simplify.
	(stream_write_tree_ref): Update.
	(lto_output_tree): Update.
	* lto-streamer.h (lto_output_decl_index): Remove prototype.
	(lto_output_field_decl_index): Remove prototype.
	(lto_output_namespace_decl_index): Remove prototype.
	(lto_output_type_decl_index): Remove prototype.
	(lto_output_type_ref_index): Remove prototype.
	(lto_output_var_decl_index): Move.
	(lto_output_fn_decl_index): Move
2020-05-31 17:36:58 +02:00
Iain Buclaw
1d2d5afc80 contrib: Add pru-elf to config-list.mk
Support for the TI PRU target was added in SVN r272202.

contrib/ChangeLog:

	* config-list.mk (LIST): Add pru-elf.
2020-05-31 14:43:51 +02:00
Thomas Koenig
811f902b76 Finalization depends on the expression, not on the component.
This patch fixes a 8/9/10/11 regression, where finalized types
were not finalized (and deallocated), which led to memory
leaks.

gcc/fortran/ChangeLog:

2020-05-24  Thomas Koenig  <tkoenig@gcc.gnu.org>

	PR fortran/94361
	* class.c (finalize_component): Use expr->finalized instead of
	comp->finalized.
	* gfortran.h (gfc_component): Remove finalized member.
	(gfc_expr): Add it here instead.

gcc/testsuite/ChangeLog:

2020-05-24  Thomas Koenig  <tkoenig@gcc.gnu.org>

	PR fortran/94361
	* gfortran.dg/finalize_28.f90: Adjusted free counts.
	* gfortran.dg/finalize_33.f90: Likewise.
	* gfortran.dg/finalize_34.f90: Likewise.
	* gfortran.dg/finalize_35.f90: New test.
2020-05-31 12:00:07 +02:00
Jakub Jelinek
dc8c02ca1c expr: Fix fallout from optimize store_expr from STRING_CST [PR95052]
> Can't hurt, and debugging the assert tripping is likely a hell of a lot easier
> than debugging the resultant incorrect code.   So if it passes, then I'd say go
> for it.

Testing passed, so I've committed it with those asserts (and thankfully I've
added them!) but it apparently broke Linux kernel build on arm.

The problem is that if the STRING_CST is very short, while the full object
has BLKmode, the short string could very well have
QImode/HImode/SImode/DImode and in that case it wouldn't take the path that
copies the string and then clears the remaining space, but different paths
in which it will ICE because of those asserts and without those it would
just emit wrong-code.

The following patch fixes it by enforcing BLKmode for the string MEM, even
if it is short, so that we copy it and memset the rest.

2020-05-31  Jakub Jelinek  <jakub@redhat.com>

	PR middle-end/95052
	* expr.c (store_expr): For shortedned_string_cst, ensure temp has
	BLKmode.

	* gcc.dg/pr95052.c: New test.
2020-05-31 11:54:41 +02:00
Jeff Law
6dda860844 Disable brabc/brabs patterns as their length computation is horribly broken and leads to incorrect code generation.
* config/h8300/jumpcall.md (brabs, brabc): Disable patterns.
2020-05-30 21:53:28 -06:00
GCC Administrator
945b53ccf6 Daily bump. 2020-05-31 00:16:22 +00:00
Jim Wilson
d5cdcd5cf2 RISC-V: Optimize si to di zero-extend followed by left shift.
This is potentially a sequence of 3 shifts, we which optimize to a sequence
of 2 shifts.  This can happen when unsigned int is used for array indexing.

	gcc/
	* config/riscv/riscv.md (zero_extendsidi2_shifted): New.

	gcc/testsuite/
	* gcc.target/riscv/zero-extend-5.c: New.
2020-05-30 17:09:15 -07:00
Arnaud Charlet
9f2e635def Ability to build the GNAT runtime with project files
This change add project files to provide the ability to rebuild the
runtime with gprbuild after setup-rts is called.

gcc/ada/

	* Makefile.rtl (ADA_INCLUDE_SRCS): Replace Makefile.adalib by
	libada.gpr and associated project files.
	(g-debpoo.o): Add missing rule to ensure subprograms are not reordered.
	(setup-rts): Add generation of libgnat/libgnarl.lst.
	(LIBGNAT_SRCS): Remove thread.c which is part of libgnarl.
	* tracebak.c, tb-gcc.c: Merged the two files to simplify dependencies.
	* libgnarl/libgnarl.gpr, libgnat/libada.gpr,
	libgnat/libgnat.gpr, libgnat/libgnat_common.gpr: New files.
	* doc/gnat_ugn/the_gnat_compilation_model.rst: Makefile.adalib
	replaced by libada.gpr.
	* libgnat/system-mingw.ads: Remove obsolete comment.
	* gcc-interface/Makefile.in: Remove dependency on tb-gcc.c.
2020-05-30 16:15:25 -04:00
Harald Anlauf
dd38c765a0 PR fortran/95373 - ICE in build_reference_type, at tree.c:7942
The use of KIND, LEN, RE, and IM inquiry references for applicable intrinsic
types is valid only for suffienctly new Fortran standards.  Add appropriate
checks in the appropriate place.

2020-05-30  Harald Anlauf  <anlauf@gmx.de>

gcc/fortran/
	PR fortran/95373
	* primary.c (is_inquiry_ref): Move validity check of inquiry
	references against selected Fortran standard from here...
	(gfc_match_varspec) ...to here.

gcc/testsuite/
	PR fortran/95373
	* gfortran.dg/pr95373_1.f90: Adjust error messages.
	* gfortran.dg/pr95373_2.f90: Adjust error message.
2020-05-30 20:59:41 +02:00
Harald Anlauf
bf5fbbbd8c PR fortran/95090 - ICE: identifier overflow
Implement buffer overrun check for temporary that holds mangled names.

2020-05-30  Harald Anlauf  <anlauf@gmx.de>

gcc/fortran/
	PR fortran/95090
	* class.c (get_unique_type_string): Use buffer overrun check.
2020-05-30 20:50:59 +02:00
Iain Sandoe
9df0ff5f21 coroutines: Fix unused value found by static analysis.
This fixes up the zero-initialization of the coro frame pointer
to avoid an unused assigned value, spotted by Martin Liska with
static analysis.

gcc/cp/ChangeLog:

	* coroutines.cc (morph_fn_to_coro): Revise initialization
	of the frame pointer to avoid an unused value.
2020-05-30 19:08:36 +01:00
Jakub Jelinek
05e4db63d0 openmp: omp_alloc(0, ...) should return NULL.
2020-05-30  Jakub Jelinek  <jakub@redhat.com>

	* allocator.c (omp_alloc): For size == 0, return NULL early.

	* testsuite/libgomp.c-c++-common/alloc-4.c: New test.
2020-05-30 14:02:56 +02:00
Jonathan Yong
850533ab16 gcc/config/i386/mingw32.h: Ensure -lmsvcrt precede -lkernel32
This is necessary as libmsvcrt.a is not a pure import library, but
also contains some functions that invoke others in KERNEL32.DLL.

gcc/
	* config/i386/mingw32.h (REAL_LIBGCC_SPEC): Insert -lkernel32
	after -lmsvcrt. This is necessary as libmsvcrt.a is not a pure
	import library, but also contains some functions that invoke
	others in KERNEL32.DLL.

Signed-off-by: Liu Hao <lh_mouse@126.com>
Signed-off-by: Jonathan Yong <10walls@gmail.com>
2020-05-30 04:03:57 +00:00
Patrick Palka
aef6e234a8 c++: satisfaction value of type typedef to bool [PR95386]
In the testcase below, the satisfaction value of fn1<int>'s constraint
is INTEGER_CST '1' of type BOOLEAN_TYPE value_type, which is a typedef
to the standard boolean_type_node.  But satisfaction_value expects to
see exactly boolean_true_node or integer_one_node, which this value is
neither, causing us to trip over the assert therein.

This patch changes satisfaction_value to accept INTEGER_CST of any
boolean type.

gcc/cp/ChangeLog:

	PR c++/95386
	* constraint.cc (satisfaction_value): Accept INTEGER_CST of any
	boolean type.

gcc/testsuite/ChangeLog:

	PR c++/95386
	* g++.dg/concepts/pr95386.C: New test.
2020-05-29 21:12:21 -04:00
GCC Administrator
885ef72f27 Daily bump. 2020-05-30 00:16:27 +00:00
Segher Boessenkool
ee969a36d9 rs6000: Prefer VSX insns over VMX ones (part 1: perm and mrg)
There are various VSX insns that do the same job as (older) AltiVec
insns, just with a wider range of possible registers.  Many patterns
for such insns have the "v" alternative before the "wa" alternative,
which makes the output less readable than possible (since vs32 is v0,
and most insns before or after this insn will be VSX as well).

This changes the define_insns for the mrg and perm machine instructions
to prefer the VSX form.  No behaviour change.  Only one testcase needed
a little adjustment as well.

2020-05-29  Segher Boessenkool  <segher@kernel.crashing.org>

	* config/rs6000/altivec.md (altivec_vmrghw_direct): Prefer VSX form.
	(altivec_vmrglw_direct): Ditto.
	(altivec_vperm_<mode>_direct): Ditto.
	(altivec_vperm_v8hiv16qi): Ditto.
	(*altivec_vperm_<mode>_uns_internal): Ditto.
	(*altivec_vpermr_<mode>_internal): Ditto.
	(vperm_v8hiv4si): Ditto.
	(vperm_v16qiv8hi): Ditto.

gcc/testsuite/
	* gcc.target/powerpc/vsx-vector-6.p9.c: Allow xxperm as perm as well.
2020-05-29 23:14:43 +00:00
Patrick Palka
c75ebe76ae c++: P0848R3 and member function templates [PR95181]
When comparing two special member function templates to see if one hides
the other (as per P0848R3), we need to check satisfaction which we can't
do on templates.  So this patch makes add_method skip the eligibility
test on member function templates and just lets them coexist.

gcc/cp/ChangeLog:

	PR c++/95181
	* class.c (add_method): Let special member function templates
	coexist if they are not equivalently constrained, or in a class
	template.

gcc/testsuite/ChangeLog:

	PR c++/95181
	* g++.dg/concepts/pr95181.C: New test.
	* g++.dg/concepts/pr95181-2.C: New test.

Co-authored-by: Jason Merrill <jason@redhat.com>
2020-05-29 18:18:29 -04:00
Jason Merrill
2fb595f834 c++: Template template parameter in constraint [PR95371]
any_template_parm_r was assuming that the DECL_TEMPLATE_RESULT of a template
will have a suitable TEMPLATE_INFO from which we can look at the generic
arguments for that template.  But that wasn't true for a template template
parameter; this patch makes it so.

gcc/cp/ChangeLog:

	PR c++/95371
	* pt.c (process_template_parm): Set DECL_TEMPLATE_INFO
	on the DECL_TEMPLATE_RESULT.

gcc/testsuite/ChangeLog:

	PR c++/95371
	* g++.dg/cpp2a/concepts-ttp1.C: New test.
2020-05-29 18:16:54 -04:00
Jan Hubicka
33e23881aa Simplify tree streaming.
this patch cleans up tree streaming.  The code is prepared to stream nested
trees, but we only handle flat trees. As a result we have quite heavy function
to stream in/out tree reference which is used many times and shows up in
profile.

This patch adds stream_write_tree_ref/stream_read_tree_ref which is used to
stream references to trees that are required to exist in the cache or be
indexable.

The actual implementation is just a first cut.  I would like to make it more
compact. We used to stream 2 byte tag (as UHWI) + UHWI representing the index.
Now we stream one UHWI that represent type of reference + index for references
to cache, but still two integers for references to global stream.  This is
becaue the abstraction is not very helpful here and I want to clean this up
incrementally.

I would also like to get rid of the ref_p parameters which seems unnecessary for
flat streams.

This reduces around 7% of global stream, 3% when compressed.
More reduction will happen once the format is sanitized a bit.

from
[WPA] read 4597161 unshared trees
[WPA] read 2937414 mergeable SCCs of average size 1.364280
[WPA] 8604617 tree bodies read in total
[WPA] tree SCC table: size 524287, 247507 elements, collision ratio: 0.377468
[WPA] tree SCC max chain length 2 (size 1)
[WPA] Compared 2689907 SCCs, 184 collisions (0.000068)
[WPA] Merged 2689890 SCCs
[WPA] Merged 3722677 tree bodies
[WPA] Merged 632040 types
...
[WPA] Compression: 88124141 input bytes, 234906430 uncompressed bytes (ratio: 2.665631)
[WPA] Size of mmap'd section decls: 88124141 bytes
...
[WPA] Compression: 113758813 input bytes, 316149514 uncompressed bytes (ratio: 2.779121)
[WPA] Size of mmap'd section decls: 88124141 bytes
[WPA] Size of mmap'd section function_body: 14485721 bytes

to

[WPA] read 4597174 unshared trees
[WPA] read 2937413 mergeable SCCs of average size 1.364280
[WPA] 8604629 tree bodies read in total
[WPA] tree SCC table: size 524287, 247509 elements, collision ratio: 0.377458
[WPA] tree SCC max chain length 2 (size 1)
[WPA] Compared 2689904 SCCs, 183 collisions (0.000068)
[WPA] Merged 2689888 SCCs
[WPA] Merged 3722675 tree bodies
[WPA] Merged 632041 types
....
[WPA] Size of mmap'd section decls: 86177293 bytes
[WPA] Compression: 86177293 input bytes, 217625095 uncompressed bytes (ratio: 2.525318)
....
[WPA] Compression: 111682269 input bytes, 297228756 uncompressed bytes (ratio: 2.661378)
[WPA] Size of mmap'd section decls: 86177293 bytes
[WPA] Size of mmap'd section function_body: 14349032 bytes

gcc/ChangeLog:

	* lto-streamer-in.c (streamer_read_chain): Move here from
	tree-streamer-in.c.
	(stream_read_tree_ref): New.
	(lto_input_tree_1): Simplify.
	* lto-streamer-out.c (stream_write_tree_ref): New.
	(lto_write_tree_1): Simplify.
	(lto_output_tree_1): Simplify.
	(DFS::DFS_write_tree): Simplify.
	(streamer_write_chain): Move here from tree-stremaer-out.c.
	* lto-streamer.h (lto_output_tree_ref): Update prototype.
	(stream_read_tree_ref): Declare
	(stream_write_tree_ref): Declare
	* tree-streamer-in.c (streamer_read_chain): Update to use
	stream_read_tree_ref.
	(lto_input_ts_common_tree_pointers): Likewise.
	(lto_input_ts_vector_tree_pointers): Likewise.
	(lto_input_ts_poly_tree_pointers): Likewise.
	(lto_input_ts_complex_tree_pointers): Likewise.
	(lto_input_ts_decl_minimal_tree_pointers): Likewise.
	(lto_input_ts_decl_common_tree_pointers): Likewise.
	(lto_input_ts_decl_with_vis_tree_pointers): Likewise.
	(lto_input_ts_field_decl_tree_pointers): Likewise.
	(lto_input_ts_function_decl_tree_pointers): Likewise.
	(lto_input_ts_type_common_tree_pointers): Likewise.
	(lto_input_ts_type_non_common_tree_pointers): Likewise.
	(lto_input_ts_list_tree_pointers): Likewise.
	(lto_input_ts_vec_tree_pointers): Likewise.
	(lto_input_ts_exp_tree_pointers): Likewise.
	(lto_input_ts_block_tree_pointers): Likewise.
	(lto_input_ts_binfo_tree_pointers): Likewise.
	(lto_input_ts_constructor_tree_pointers): Likewise.
	(lto_input_ts_omp_clause_tree_pointers): Likewise.
	* tree-streamer-out.c (streamer_write_chain): Update to use
	stream_write_tree_ref.
	(write_ts_common_tree_pointers): Likewise.
	(write_ts_vector_tree_pointers): Likewise.
	(write_ts_poly_tree_pointers): Likewise.
	(write_ts_complex_tree_pointers): Likewise.
	(write_ts_decl_minimal_tree_pointers): Likewise.
	(write_ts_decl_common_tree_pointers): Likewise.
	(write_ts_decl_non_common_tree_pointers): Likewise.
	(write_ts_decl_with_vis_tree_pointers): Likewise.
	(write_ts_field_decl_tree_pointers): Likewise.
	(write_ts_function_decl_tree_pointers): Likewise.
	(write_ts_type_common_tree_pointers): Likewise.
	(write_ts_type_non_common_tree_pointers): Likewise.
	(write_ts_list_tree_pointers): Likewise.
	(write_ts_vec_tree_pointers): Likewise.
	(write_ts_exp_tree_pointers): Likewise.
	(write_ts_block_tree_pointers): Likewise.
	(write_ts_binfo_tree_pointers): Likewise.
	(write_ts_constructor_tree_pointers): Likewise.
	(write_ts_omp_clause_tree_pointers): Likewise.
	(streamer_write_tree_body): Likewise.
	(streamer_write_integer_cst): Likewise.
	* tree-streamer.h (streamer_read_chain):Declare.
	(streamer_write_chain):Declare.
	(streamer_write_tree_body): Update prototype.
	(streamer_write_integer_cst): Update prototype.
2020-05-29 22:41:11 +02:00
H.J. Lu
9051b54827 Avoid nested save_CFLAGS and save_LDFLAGS
Avoid nested save_CFLAGS and save_LDFLAGS by replacing save_CFLAGS and
save_LDFLAGS with cet_save_CFLAGS and cet_save_LDFLAGS in cet.m4.

config/

	PR bootstrap/95413
	* cet.m4: Replace save_CFLAGS and save_LDFLAGS with
	cet_save_CFLAGS and cet_save_LDFLAGS.

gcc/

	PR bootstrap/95413
	* configure: Regenerated.

libatomic/

	PR bootstrap/95413
	* configure: Regenerated.

libbacktrace/

	PR bootstrap/95413
	* configure: Regenerated.

libcc1/

	PR bootstrap/95413
	* configure: Regenerated.

libcpp/

	PR bootstrap/95413
	* configure: Regenerated.

libdecnumber/

	PR bootstrap/95413
	* configure: Regenerated.

libgcc/

	PR bootstrap/95413
	* configure: Regenerated.

libgfortran/

	PR bootstrap/95413
	* configure: Regenerated.

libgomp/

	PR bootstrap/95413
	* configure: Regenerated.

libiberty/

	PR bootstrap/95413
	* configure: Regenerated.

libitm/

	PR bootstrap/95413
	* configure: Regenerated.

libobjc/

	PR bootstrap/95413
	* configure: Regenerated.

libphobos/

	PR bootstrap/95413
	* configure: Regenerated.

libquadmath/

	PR bootstrap/95413
	* configure: Regenerated.

libsanitizer/

	PR bootstrap/95413
	* configure: Regenerated.

libssp/

	PR bootstrap/95413
	* configure: Regenerated.

libstdc++-v3/

	PR bootstrap/95413
	* configure: Regenerated.

libvtv/

	PR bootstrap/95413
	* configure: Regenerated.

lto-plugin/

	PR bootstrap/95413
	* configure: Regenerated.

zlib/

	PR bootstrap/95413
	* configure: Regenerated.
2020-05-29 12:56:40 -07:00
Harald Anlauf
7deca8c0b3 PR fortran/95090 - ICE: identifier overflow
The initial fix for this PR uncovered several latent issues with further
too small string buffers which showed up only when testing on i686.
Provide sufficiently large temporaries.

2020-05-29  Harald Anlauf  <anlauf@gmx.de>

gcc/fortran/
	PR fortran/95090
	* class.c (get_unique_type_string): Enlarge temporary for
	name-mangling.  Use strncpy to prevent buffer overrun.
	(get_unique_hashed_string): Enlarge temporary.
	(gfc_hash_value): Enlarge temporary for name-mangling.
2020-05-29 21:19:31 +02:00
Jakub Jelinek
316fe6b401 libgfortran: Export forgotten _gfortran_{,m,s}findloc{0,1}_c10 [PR95390]
I have noticed we don't export these 6 symbols and thus the testcase
below fails to link.

2020-05-29  Jakub Jelinek  <jakub@redhat.com>

	PR libfortran/95390
	* gfortran.dg/findloc_8.f90: New test.

	* Makefile.am (i_findloc0_c): Add findloc0_i10.c.
	(i_findloc1_c): Add findloc1_i10.c.
	* gfortran.map (GFORTRAN_10.2): New symbol version, export
	_gfortran_{,m,s}findloc{0,1}_c10 symbols.
	* Makefile.in: Regenerated.
	* generated/findloc0_c10.c: Generated.
	* generated/findloc1_c10.c: Generated.
2020-05-29 19:01:50 +02:00
Marek Polacek
1f32d5294f c++: Fix bogus -Wparentheses warning [PR95344]
Since r267272, which added location wrappers, cp_fold loses
TREE_NO_WARNING on a MODIFY_EXPR that finish_parenthesized_expr set, and
that results in a bogus -Wparentheses warning.

I.e., previously we had "b = 1" but now we have "VIEW_CONVERT_EXPR<bool>(b) = 1"
and cp_fold_maybe_rvalue folds away the location wrapper and so we do
2718             x = fold_build2_loc (loc, code, TREE_TYPE (x), op0, op1);
in cp_fold and the flag is lost.

	PR c++/95344
	* cp-gimplify.c (cp_fold) <case MODIFY_EXPR>: Don't set
	TREE_THIS_VOLATILE here.
	(cp_fold): Set it here along with TREE_NO_WARNING.

	* c-c++-common/Wparentheses-2.c: New test.
2020-05-29 12:31:49 -04:00