Commit Graph

182611 Commits

Author SHA1 Message Date
Richard Sandiford
8a25be517f rtl-ssa: Fix updates to call clobbers [PR98403]
In the PR, fwprop was changing a call instruction and tripped
an assert when trying to update a list of call clobbers.
There are two ways we could handle this: remove the call clobber
and then add it back, or assume that the clobber will stay in its
current place.

At the moment we don't have enough information to safely move
calls around, so the second approach seems simpler and more
efficient.

gcc/
	PR rtl-optimization/98403
	* rtl-ssa/changes.cc (function_info::finalize_new_accesses): Explain
	why we don't remove call clobbers.
	(function_info::apply_changes_to_insn): Don't attempt to add
	call clobbers here.

gcc/testsuite/
	PR rtl-optimization/98403
	* g++.dg/opt/pr98403.C: New test.
2021-01-05 11:04:15 +00:00
Richard Sandiford
01be45ecce vect: Fix missing alias checks for 128-bit SVE [PR98371]
On AArch64, the vectoriser tries various ways of vectorising with both
SVE and Advanced SIMD and picks the best one.  All other things being
equal, it prefers earlier attempts over later attempts.

The way this works currently is that, once it has a successful
vectorisation attempt A, it analyses all other attempts as epilogue
loops of A:

      /* When pick_lowest_cost_p is true, we should in principle iterate
	 over all the loop_vec_infos that LOOP_VINFO could replace and
	 try to vectorize LOOP_VINFO under the same conditions.
	 E.g. when trying to replace an epilogue loop, we should vectorize
	 LOOP_VINFO as an epilogue loop with the same VF limit.  When trying
	 to replace the main loop, we should vectorize LOOP_VINFO as a main
	 loop too.

	 However, autovectorize_vector_modes is usually sorted as follows:

	 - Modes that naturally produce lower VFs usually follow modes that
	   naturally produce higher VFs.

	 - When modes naturally produce the same VF, maskable modes
	   usually follow unmaskable ones, so that the maskable mode
	   can be used to vectorize the epilogue of the unmaskable mode.

	 This order is preferred because it leads to the maximum
	 epilogue vectorization opportunities.  Targets should only use
	 a different order if they want to make wide modes available while
	 disparaging them relative to earlier, smaller modes.  The assumption
	 in that case is that the wider modes are more expensive in some
	 way that isn't reflected directly in the costs.

	 There should therefore be few interesting cases in which
	 LOOP_VINFO fails when treated as an epilogue loop, succeeds when
	 treated as a standalone loop, and ends up being genuinely cheaper
	 than FIRST_LOOP_VINFO.  */

However, the vectoriser can normally elide alias checks for epilogue
loops, on the basis that the main loop should do them instead.
Converting an epilogue loop to a main loop can therefore cause the alias
checks to be skipped.  (It probably also unfairly penalises the original
loop in the cost comparison, given that one loop will have alias checks
and the other won't.)

As the comment says, we should in principle analyse each vector mode
twice: once as a main loop and once as an epilogue.  However, doing
that up-front would be quite expensive.  This patch instead goes for a
compromise: if an epilogue loop for mode M2 seems better than a main
loop for mode M1, re-analyse with M2 as the main loop.

The patch fixes dg.torture.exp=pr69719.c when testing with
-msve-vector-bits=128.

gcc/
	PR tree-optimization/98371
	* tree-vect-loop.c (vect_reanalyze_as_main_loop): New function.
	(vect_analyze_loop): If an epilogue loop appears to be cheaper
	than the main loop, re-analyze it as a main loop before adopting
	it as a main loop.
2021-01-05 11:03:22 +00:00
Rainer Orth
a20893cf6b build: libcody: Link with -lsocket -lnsl if necessary [PR98316]
With the introduction of C++20 modules and libcody, cc1plus and
cc1objplus gained a dependency on the socket functions.  Before those
were merged into libc in Solaris 11.4, one needed to link with -lsocket -lnsl
on Solaris, so that merge broke the Solaris 11.3 build.

While we already have 4 different checks for those libraries in the
tree, I decided to import autoconf-archive's AX_LIB_SOCKET_NSL macro
instead.  At the same time, the patch only links libcody and the
networking libs where needed (cc1plus, cc1objplus).

Bootstrapped without regressions on i386-pc-solaris2.11 (Solaris 11.3
and 11.4), sparc-sun-solaris2.11, and x86_64-pc-linux-gnu.

2020-12-16  Rainer Orth  <ro@CeBiTec.Uni-Bielefeld.DE>

	c++tools:
	PR c++/98316
	* configure.ac: Include ../config/ax_lib_socket_nsl.m4.
	(NETLIBS): Determine using AX_LIB_SOCKET_NSL.
	* configure: Regenerate.
	* Makefile.in (NETLIBS): Define.
	(g++-mapper-server$(exeext)): Add $(NETLIBS).

	gcc/objcp:
	PR c++/98316
	* Make-lang.in (cc1objplus$(exeext)): Add $(CODYLIB), $(NETLIBS).

	gcc/cp:
	PR c++/98316
	* Make-lang.in (cc1plus$(exeext)): Add $(CODYLIB), $(NETLIBS).

	gcc:
	PR c++/98316
	* configure.ac (NETLIBS): Determine using AX_LIB_SOCKET_NSL.
	* aclocal.m4, configure: Regenerate.
	* Makefile.in (NETLIBS): Define.
	(BACKEND): Remove $(CODYLIB).

	config:
	PR c++/98316
	* ax_lib_socket_nsl.m4: Import from autoconf-archive.
2021-01-05 11:32:31 +01:00
Jakub Jelinek
4615cde5d7 simplify-rtx: Optimize (x - 1) * y + y [PR98334]
We don't try to optimize for signed x, y (int) (x - 1U) * y + y
into x * y, we can't do that with signed x * y, because the former
is well defined for INT_MIN and -1, while the latter is not.
We could perhaps optimize it during isel or some very late optimization
where we'd turn magically flag_wrapv, but we don't do that yet.

This patch optimizes it in simplify-rtx.c, such that we can optimize
it during combine.

2021-01-05  Jakub Jelinek  <jakub@redhat.com>

	PR rtl-optimization/98334
	* simplify-rtx.c (simplify_context::simplify_binary_operation_1):
	Optimize (X - 1) * Y + Y to X * Y or (X + 1) * Y - Y to X * Y.

	* gcc.target/i386/pr98334.c: New test.
2021-01-05 10:59:00 +01:00
Bernd Edlinger
6b69738c1e Restore input_location after recursive expand_call_inline
This is just a precautionary fix.

2021-01-05  Bernd Edlinger  <bernd.edlinger@hotmail.de>

	* tree-inline.c (expand_call_inline): Restore input_location.
	Return result from recursive call.
2021-01-05 10:57:54 +01:00
Jerome Lambourg
560d991576 Fix testsuite/g++.dg/cpp1y/constexpr-66093.C execution failure...
The constexpr iteration dereferenced an array element past the end of
the array.


for  gcc/testsuite/ChangeLog

	* g++.dg/cpp1y/constexpr-66093.C: Fix bounds issue.
2021-01-05 04:47:41 -03:00
Ian Lance Taylor
bf183413c6 Go frontend: add -fgo-embedcfg option
This option will be used by the go command to implement go:embed directives,
which are new with the upcoming Go 1.16 release.

	* lang.opt (fgo-embedcfg): New option.
	* go-c.h (struct go_create_gogo_args): Add embedcfg field.
	* go-lang.c (go_embedcfg): New static variable.
	(go_langhook_init): Set go_create_gogo_args embedcfg field.
	(go_langhook_handle_option): Handle OPT_fgo_embedcfg_.
	* gccgo.texi (Invoking gccgo): Document -fgo-embedcfg.
2021-01-04 17:41:16 -08:00
David Malcolm
15af33a880 analyzer: fix ICE with -fsanitize=undefined [PR98293]
-fsanitize=undefined with calls to nonnull functions
creates struct __ubsan_nonnull_arg_data instances
with CONSTRUCTORs for RECORD_TYPEs with NULL index values.
The analyzer was mistakenly using INTEGER_CST for these
fields, leading to ICEs.

Fix the issue by iterating through the fields in the type
for such cases, imitating similar logic in varasm.c's
output_constructor.

gcc/analyzer/ChangeLog:
	PR analyzer/98293
	* store.cc (binding_map::apply_ctor_to_region): When "index" is
	NULL, iterate through the fields for RECORD_TYPEs, rather than
	creating an INTEGER_CST index.

gcc/testsuite/ChangeLog:
	PR analyzer/98293
	* gcc.dg/analyzer/pr98293.c: New test.
2021-01-04 19:20:32 -05:00
GCC Administrator
7e73f51157 Daily bump. 2021-01-05 00:16:42 +00:00
Martin Uecker
a000eb5918 C: Add test for incorrect warning for assignment of certain volatile expressions fixed by commit 58a45ce [PR98029]
2021-01-04  Martin Uecker  <muecker@gwdg.de>

gcc/testsuite/
	PR c/98029
	* gcc.dg/pr98029.c: New test.
2021-01-04 22:53:58 +01:00
Philipp Tomsich
f262a35188 MAINTAINERS: Update my email address.
2021-01-04  Philipp Tomsich  <philipp.tomsich@vrull.eu>

	* MAINTAINERS: Update my email address.
2021-01-04 17:37:54 +01:00
Nathan Sidwell
a5469584f6 c++: Add stdlib module test cases
The remaining modules tests use the std library.  These are those.

	gcc/testsuite/
	* g++.dg/modules/binding-1_a.H: New.
	* g++.dg/modules/binding-1_b.H: New.
	* g++.dg/modules/binding-1_c.C: New.
	* g++.dg/modules/binding-2.H: New.
	* g++.dg/modules/builtin-3_a.C: New.
	* g++.dg/modules/global-2_a.C: New.
	* g++.dg/modules/global-2_b.C: New.
	* g++.dg/modules/global-3_a.C: New.
	* g++.dg/modules/global-3_b.C: New.
	* g++.dg/modules/hello-1_a.C: New.
	* g++.dg/modules/hello-1_b.C: New.
	* g++.dg/modules/iostream-1_a.H: New.
	* g++.dg/modules/iostream-1_b.C: New.
	* g++.dg/modules/part-5_a.C: New.
	* g++.dg/modules/part-5_b.C: New.
	* g++.dg/modules/part-5_c.C: New.
	* g++.dg/modules/stdio-1_a.H: New.
	* g++.dg/modules/stdio-1_b.C: New.
	* g++.dg/modules/string-1_a.H: New.
	* g++.dg/modules/string-1_b.C: New.
	* g++.dg/modules/string-view1.C: New.
	* g++.dg/modules/string-view2.C: New.
	* g++.dg/modules/tinfo-1.C: New.
	* g++.dg/modules/tinfo-2_a.H: New.
	* g++.dg/modules/tinfo-2_b.C: New.
	* g++.dg/modules/tname-spec-1_a.H: New.
	* g++.dg/modules/tname-spec-1_b.C: New.
	* g++.dg/modules/xtreme-header-1.h: New.
	* g++.dg/modules/xtreme-header-1_a.H: New.
	* g++.dg/modules/xtreme-header-1_b.C: New.
	* g++.dg/modules/xtreme-header-1_c.C: New.
	* g++.dg/modules/xtreme-header-2.h: New.
	* g++.dg/modules/xtreme-header-2_a.H: New.
	* g++.dg/modules/xtreme-header-2_b.C: New.
	* g++.dg/modules/xtreme-header-2_c.C: New.
	* g++.dg/modules/xtreme-header-3.h: New.
	* g++.dg/modules/xtreme-header-3_a.H: New.
	* g++.dg/modules/xtreme-header-3_b.C: New.
	* g++.dg/modules/xtreme-header-3_c.C: New.
	* g++.dg/modules/xtreme-header-4.h: New.
	* g++.dg/modules/xtreme-header-4_a.H: New.
	* g++.dg/modules/xtreme-header-4_b.C: New.
	* g++.dg/modules/xtreme-header-4_c.C: New.
	* g++.dg/modules/xtreme-header-5.h: New.
	* g++.dg/modules/xtreme-header-5_a.H: New.
	* g++.dg/modules/xtreme-header-5_b.C: New.
	* g++.dg/modules/xtreme-header-5_c.C: New.
	* g++.dg/modules/xtreme-header-6.h: New.
	* g++.dg/modules/xtreme-header-6_a.H: New.
	* g++.dg/modules/xtreme-header-6_b.C: New.
	* g++.dg/modules/xtreme-header-6_c.C: New.
	* g++.dg/modules/xtreme-header.h: New.
	* g++.dg/modules/xtreme-header_a.H: New.
	* g++.dg/modules/xtreme-header_b.C: New.
	* g++.dg/modules/xtreme-tr1.h: New.
	* g++.dg/modules/xtreme-tr1_a.H: New.
	* g++.dg/modules/xtreme-tr1_b.C: New.
2021-01-04 07:52:21 -08:00
Richard Sandiford
aa204d5118 vect, aarch64: Fix alignment units for IFN_MASK* [PR95401]
The IFN_MASK* functions take two leading arguments: a load or
store pointer and a “cookie”.  The type of the cookie is the
type of the access for TBAA purposes (like for MEM_REFs)
while the value of the cookie is the alignment of the access.
This PR was caused by a disagreement about whether the alignment
is measured in bits or bytes.

It looks like this goes back to PR68786, which made the
vectoriser create its own cookie argument rather than reusing
the one created by ifcvt.  The alignment value of the new cookie
was measured in bytes (as needed by set_ptr_info_alignment)
while the existing code expected it to be measured in bits.
The folds I added for IFN_MASK_LOAD and STORE then made
things worse.

gcc/
	PR tree-optimization/95401
	* config/aarch64/aarch64-sve-builtins.cc
	(gimple_folder::load_store_cookie): Use bits rather than bytes
	for the alignment argument to IFN_MASK_LOAD and IFN_MASK_STORE.
	* gimple-fold.c (gimple_fold_mask_load_store_mem_ref): Likewise.
	* tree-vect-stmts.c (vectorizable_store): Likewise.
	(vectorizable_load): Likewise.

gcc/testsuite/
	PR tree-optimization/95401
	* g++.dg/vect/pr95401.cc: New test.
	* g++.dg/vect/pr95401a.cc: Likewise.
2021-01-04 14:44:21 +00:00
Nathan Sidwell
6288183377 [libcody] Remove some std::move [PR 98368]
Compiling on clang showed a couple of pessimizations.  Fixed thusly.

	libcody/
	* client.cc (Client::ProcessResponse): Remove std::move
	inside ?:
	c++tools/
	* resolver.cc (module_resolver::cmi_response): Remove
	std::move of temporary.
2021-01-04 06:38:52 -08:00
Mateusz Wajchęprzełóż
6bbc196c64 [libcody] Windows absdir fix
An obvious thinko in dirve name check :(

	libcody/
	* resolver.cc (IsAbsDir): Fix string indexing.

Signed-off-by: Nathan Sidwell <nathan@acm.org>
2021-01-04 08:59:10 -05:00
Richard Biener
9e79d76a16 tree-optimization/98308 - set vector type for mask of masked load
This makes sure to set the vector type on an invariant mask argument
for a masked load and SLP.

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

	PR tree-optimization/98308
	* tree-vect-stmts.c (vectorizable_load): Set invariant mask
	SLP vectype.

	* gcc.dg/vect/pr98308.c: New testcase.
2021-01-04 14:39:14 +01:00
Jakub Jelinek
24cd9afe61 loop-niter: Recognize popcount idioms even with char, short and __int128 [PR95771]
As the testcase shows, we punt unnecessarily on popcount loop idioms if
the type is smaller than int or larger than long long.
Smaller type than int can be handled by zero-extending the argument to
unsigned int, and types twice as long as long long by doing
__builtin_popcountll on both halves of the __int128.

2020-01-04  Jakub Jelinek  <jakub@redhat.com>

	PR tree-optimization/95771
	* tree-ssa-loop-niter.c (number_of_iterations_popcount): Handle types
	with precision smaller than int's precision and types with precision
	twice as large as long long.  Formatting fixes.

	* gcc.target/i386/pr95771.c: New test.
2021-01-04 14:36:06 +01:00
Richard Biener
39bd65faee tree-optimization/98464 - replace loop info with avail at uses
This does VN replacement in loop nb_iterations consistent with
the rest of the IL by using availability at the definition site
of uses.

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

	PR tree-optimization/98464
	* tree-ssa-sccvn.c (vn_valueize_for_srt): Rename from ...
	(vn_valueize_wrapper): ... this.  Temporarily adjust vn_context_bb.
	(process_bb): Adjust.

	* g++.dg/opt/pr98464.C: New testcase.
2021-01-04 13:51:56 +01:00
Matthew Malcomson
7f2b731756 docs: Fix wording describing the hwaddress sanitizer
The original documentation added to mention the clash between
-fsanitize=address and -fsanitize=hwaddress used confusing wording trying
to say that -fsanitize=hwaddress is only available on AArch64.

It read as if -fsanitize=address were only supported on AArch64.

This patch fixes that wording by being more explicit.

gcc/ChangeLog:

	PR other/98437
	* doc/invoke.texi (-fsanitize=address): Fix wording describing
	clash with -fsanitize=hwaddress.
2021-01-04 12:06:27 +00:00
Richard Biener
13b80a7d1b tree-optimization/98282 - classify V_C_E<constant> as nary
This avoids running into memory reference code in compute_avail by
properly classifying unfolded reference trees on constants.

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

	PR tree-optimization/98282
	* tree-ssa-sccvn.c (vn_get_stmt_kind): Classify tcc_reference on
	invariants as VN_NARY.

	* g++.dg/opt/pr98282.C: New testcase.
2021-01-04 12:59:44 +01:00
Richard Sandiford
b41e6dd50f aarch64: Improve vcombine codegen [PR89057]
This patch fixes a codegen regression in the handling of things like:

  __temp.val[0]								     \
    = vcombine_##funcsuffix (__b.val[0],				     \
			     vcreate_##funcsuffix (__AARCH64_UINT64_C (0))); \

in the 64-bit vst[234] functions.  The zero was forced into a
register at expand time, and we relied on combine to fuse the
zero and combine back together into a single combinez pattern.
The problem is that the zero could be hoisted before combine
gets a chance to do its thing.

gcc/
	PR target/89057
	* config/aarch64/aarch64-simd.md (aarch64_combine<mode>): Accept
	aarch64_simd_reg_or_zero for operand 2.  Use the combinez patterns
	to handle zero operands.

gcc/testsuite/
	PR target/89057
	* gcc.target/aarch64/pr89057.c: New test.
2021-01-04 11:59:07 +00:00
Richard Sandiford
ba15b0fa0d aarch64: Use the MUL VL form of SVE PRF[BHWD]
The expansions of the svprf[bhwd] instructions weren't taking
advantage of the immediate addressing mode.

gcc/
	* config/aarch64/aarch64.c (offset_6bit_signed_scaled_p): New function.
	(offset_6bit_unsigned_scaled_p): Fix typo in comment.
	(aarch64_sve_prefetch_operand_p): Accept MUL VLs in the range
	[-32, 31].

gcc/testsuite/
	* gcc.target/aarch64/sve/acle/asm/prfb.c: Test for a MUL VL range of
	[-32, 31].
	* gcc.target/aarch64/sve/acle/asm/prfh.c: Likewise.
	* gcc.target/aarch64/sve/acle/asm/prfw.c: Likewise.
	* gcc.target/aarch64/sve/acle/asm/prfd.c: Likewise.
2021-01-04 11:56:19 +00:00
Richard Biener
0926259f9f tree-optimization/98393 - properly init matches when failing SLP
This zeroes matches when failing SLP discovery because of the
work limit.

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

	PR tree-optimization/98393
	* tree-vect-slp.c (vect_build_slp_tree): Properly zero matches
	when hitting the limit.
2021-01-04 12:13:44 +01:00
Martin Liska
a40718b5fc Convert 2 files to utf8.
libiberty/ChangeLog:

	* strverscmp.c: Convert to utf8 from iso8859.

gcc/testsuite/ChangeLog:

	* README: Convert to utf8 from iso8859.
2021-01-04 11:35:17 +01:00
Martin Liska
ff6b406247 avr.exp: convert Dos newlines to Unix ones
gcc/testsuite/ChangeLog:

	* gcc.target/avr/avr.exp: Run dos2unix on the file.
2021-01-04 11:21:20 +01:00
Richard Biener
8837f82e4b tree-optimization/98291 - allow SLP more vectorization of reductions
When the VF is one a SLP reduction is in-order and thus we can
vectorize even when the reduction op is not associative.

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

	PR tree-optimization/98291
	* tree-vect-loop.c (vectorizable_reduction): Bypass
	associativity check for SLP reductions with VF 1.

	* gcc.dg/vect/slp-reduc-11.c: New testcase.
	* gcc.dg/vect/vect-reduc-in-order-4.c: Adjust.
2021-01-04 10:47:43 +01:00
Jakub Jelinek
ad64e807ff match.pd: Fold x == ~x to false [PR96782]
x is never equal to ~x, so we can fold such comparisons to constants.

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

	PR tree-optimization/96782
	* match.pd (x == ~x -> false, x != ~x -> true): New simplifications.

	* gcc.dg/tree-ssa/pr96782.c: New test.
2021-01-04 10:37:12 +01:00
Jakub Jelinek
99dee82307 Update copyright years. 2021-01-04 10:26:59 +01:00
Jakub Jelinek
c00e2af363 Add AMD and Ulf Adams as external authors
* update-copyright.py: Add AMD and Ulf Adams as external authors.
2021-01-04 10:25:17 +01:00
Martin Liska
f96f664cf6 Remove duplicate ChangeLog entries.
gcc/fortran/ChangeLog:

	* ChangeLog-2018: Remove duplicate ChangeLog entries.
2021-01-04 10:18:18 +01:00
Jakub Jelinek
2a680610d1 Fix up indentation in update-copyright.py
* update-copyright.py: Use 8 spaces instead of tab to indent.
2021-01-04 10:16:13 +01:00
Martin Liska
cf76bbf8a8 mklog.py: add --update-copyright option
contrib/ChangeLog:

	* mklog.py: Add --update-copyright option which adds:
	"Update copyright years." to ChangeLog files belonging
	to a modified file.
2021-01-04 10:09:07 +01:00
Martin Liska
8869bd0efc gcc-changelog: Ignore copyright years commits.
contrib/ChangeLog:

	* gcc-changelog/git_commit.py: Skip Update copyright
	years commits.
2021-01-04 10:09:07 +01:00
Jakub Jelinek
b4cdbb9335 Remove duplicated ChangeLog entries from po/ChangeLog
to undo broken https://gcc.gnu.org/git/?p=gcc.git;a=blobdiff;f=gcc/po/ChangeLog;h=9f4bf9a8e3a34266e521e24be1adbba52f31e8d3;hp=5f5f8f70e44a374d3a8a615abc6cddc6642982a3;hb=818ab71a415cd234be092111a0aa5e812ec56434;hpb=21fa2a29dc265ab54c957c37d8a9e9ab07d7cd66
change.
2021-01-04 10:08:04 +01:00
Bernd Edlinger
e9f8a554ef Fix -save-temp leaking lto files in /tmp
When linking with -flto and -save-temps, various
temporary files are created in /tmp.
The same happens when invoking the driver with @file
parameter, and using -L or -I options.

gcc:
2021-01-04  Bernd Edlinger  <bernd.edlinger@hotmail.de>

	* collect-utils.c (collect_execute): Check dumppfx.
	* collect2.c (maybe_run_lto_and_relink, do_link): Pass atsuffix
	to collect_execute.
	(do_link): Add new parameter atsuffix.
	(main): Handle -dumpdir option.  Skip one argument for
	-o, -isystem and -B options.
	* gcc.c (make_at_file): New helper function.
	(close_at_file): Use it.

gcc/testsuite:
2021-01-04  Bernd Edlinger  <bernd.edlinger@hotmail.de>

	* gcc.misc-tests/outputs.exp: Adjust testcase.
2021-01-04 10:03:19 +01:00
Jakub Jelinek
c48514bea6 Update Copyright in ChangeLog files
Do this separately from all other Copyright updates, as ChangeLog files
can be modified only separately.
2021-01-04 09:35:45 +01:00
GCC Administrator
2e96eec614 Daily bump. 2021-01-04 00:16:18 +00:00
Eric Botcazou
f14f89c5c4 Bump copyright year
gcc/ada/
	* gnatvsn.ads: Bump copyright year.
2021-01-03 13:43:01 +01:00
Mike Frysinger
3335c9f954 config: import pkg.m4 from pkg-config
We use this in the sim tree currently.  Rather than require people to
have pkg-config installed, include it in the config/ dir.

config/ChangeLog:

	* pkg.m4: New file from pkg-config-0.29.2.
2021-01-02 21:53:56 -05:00
Mike Frysinger
37d0bb1f5b libiberty.h: punt duplicate strverscmp prototype
SVN r216772 accidentally copied & pasted this prototype when adding
other ones nearby.

include/ChangeLog:

	* libiberty.h (strverscmp): Delete duplicate prototype.
2021-01-02 21:51:14 -05:00
GCC Administrator
2eacfdbd6a Daily bump. 2021-01-03 00:16:20 +00:00
Iain Sandoe
ef370f933c Darwin : Adjust defaults for the linker.
Ideally, the linker will be queried for its version and that will be
used to determine capabilities that cannot be discovered from
reasonable configuration testing.

When building cross tools, this might not be possible, and we have
strategies for providing useful defaults.  These are adjusted here to
refect current choices.

gcc/ChangeLog:

	* config/darwin.h (MIN_LD64_NO_COAL_SECTS): Adjust.
	Amend handling for LD64_VERSION fallback defaults.
2021-01-02 19:56:19 +00:00
Iain Sandoe
4a04f09dc7 Darwin, Simplify headers 4/5 : Remove redundant headers.
The darwinN.h headers (with the sole exception of darwin7.h,
which contains a target macro definition) now only contain
values that set fall-backs for cross-compilations, these can
be provided from the config.gcc script which means we no longer
need the darwinN.h - so delete them.

gcc/ChangeLog:

	* config.gcc: Compute default version information
	from the configured target.  Likewise defaults for
	ld64.
	* config/darwin10.h: Removed.
	* config/darwin12.h: Removed.
	* config/darwin9.h: Removed.
	* config/rs6000/darwin8.h: Removed.
2021-01-02 19:56:19 +00:00
Iain Sandoe
5282e22f0e Darwin, Simplify headers 3/5 : Delete dead code.
Darwin defines ASM_OUTPUT_ALIGNED_DECL_COMMON which is used in
preference to ASM_OUTPUT_ALIGNED_COMMON, which makes the latter
definition dead code.  Remove this.

gcc/ChangeLog:

	* config/darwin9.h (ASM_OUTPUT_ALIGNED_COMMON): Delete.
2021-01-02 19:56:19 +00:00
Iain Sandoe
ac6ecec4b3 Darwin, Simplify headers 2/5 : Move spec for STACK_CHECK_STATIC_BUILTIN.
We now need a modern (C++11) toolchain to bootstrap GCC, so there's no
need to skip the stack protect for Darwin < 9.

gcc/ChangeLog:

	* config/darwin9.h (STACK_CHECK_STATIC_BUILTIN): Move from here..
	* config/darwin.h (STACK_CHECK_STATIC_BUILTIN): .. to here.
2021-01-02 19:56:19 +00:00
Iain Sandoe
896607741f Darwin, Simplify headers 1/5 : Move LINK_GCC_C_SEQUENCE_SPEC [NFC].
There is no need to make the LINK_GCC_C_SEQUENCE_SPEC conditional on
configuration parameters, it is adequately conditionalized on the
macosx-version-min.

gcc/ChangeLog:

	* config/darwin10.h (LINK_GCC_C_SEQUENCE_SPEC): Move from
	here...
	* config/darwin.h (LINK_GCC_C_SEQUENCE_SPEC): ... to here.
2021-01-02 19:56:19 +00:00
Iain Sandoe
1dfeaca014 Darwin, Simplify headers 0/5 : Move spec for Darwin 10 unwind stub [NFC].
The darwinN.h headers were (presumably) introduced to allow specs to be
adjusted when there was no mmacosx-version-min handling, or that was
considered unreliable.

We have version-specific specs for the values that have configuration
data, and the version is set in the driver (so may be considered
reliably present).

Some of the 'darwinN.h' content has become dead code, and the reminder
is either conditionalised on version information (or is setting values
used as fall-backs in cross-compilations).

With the changes needed for Darwin20 / macOS 11 the 'darwnN.h' headers
are now too unwieldy to be useful - so this series moves the relevant
specs definitons to the common 'darwin.h' header and then finally uses
the config.gcc script to supply the fall-back defaults for cross-
compilations.

We can then delete all but the main header, since the darwinN.h are
unused.

This change moves a spec from darwin10.h to the main darwin.h
target header.

gcc/ChangeLog:

	* config/darwin10.h (LINK_GCC_C_SEQUENCE_SPEC): Move the spec
	for the Darwin10 unwinder stub from here ...
	* config/darwin.h (LINK_COMMAND_SPEC_A): ... to here.
2021-01-02 19:56:19 +00:00
Iain Sandoe
b2cee5e1e8 Darwin : Adjust defaults for current bootstrap constraints.
The toolchain now requires a C++11 compiler to bootstrap and
none of the older Darwin toolchains which were based on stabs
debugging are suitable.  We can simplify the debug setup now.

gcc/ChangeLog:

	* config/darwin.h (DSYMUTIL_SPEC): Default to DWARF
	(ASM_DEBUG_SPEC):Only define if the assembler supports
	stabs.
	(PREFERRED_DEBUGGING_TYPE): Default to DWARF.
	(DARWIN_PREFER_DWARF): Define.
	* config/darwin9.h (PREFERRED_DEBUGGING_TYPE): Remove.
	(DARWIN_PREFER_DWARF): Likewise
	(DSYMUTIL_SPEC): Likewise.
	(COLLECT_RUN_DSYMUTIL): Likewise.
	(ASM_DEBUG_SPEC): Likewise.
	(ASM_DEBUG_OPTION_SPEC): Likewise.
2021-01-02 19:56:19 +00:00
Jan Hubicka
ae99b315ba ggc_free basic blocks
* cfg.c (free_block): ggc_free bb.
2021-01-02 16:05:17 +01:00
Jan Hubicka
c304a68e41 Free datastructures pointing to CFG after parsing
* cp-tree.h (cp_tree_c_finish_parsing): Declare.
	* decl2.c (c_parse_final_cleanups): Call cp_tree_c_finish_parsing.
	* tree.c (cp_tree_c_finish_parsing): New function.
2021-01-02 16:04:24 +01:00