155520 Commits

Author SHA1 Message Date
Richard Biener
b2d961e734 Update ChangeLog and version files for release
From-SVN: r278197
releases/gcc-7.5.0
2019-11-14 07:40:39 +00:00
GCC Administrator
320cafa844 Daily bump.
From-SVN: r278186
2019-11-14 00:16:05 +00:00
GCC Administrator
7fd21be7ff Daily bump.
From-SVN: r278108
2019-11-13 00:16:13 +00:00
GCC Administrator
c3a75c146f Daily bump.
From-SVN: r278071
2019-11-12 00:16:24 +00:00
GCC Administrator
026f079912 Daily bump.
From-SVN: r278029
2019-11-11 00:16:05 +00:00
GCC Administrator
b49af8cd70 Daily bump.
From-SVN: r278010
2019-11-10 00:16:10 +00:00
GCC Administrator
1242ed1f83 Daily bump.
From-SVN: r277996
2019-11-09 00:16:06 +00:00
GCC Administrator
9fed5e3d20 Daily bump.
From-SVN: r277937
2019-11-08 00:16:04 +00:00
GCC Administrator
3b4cd0a722 Daily bump.
From-SVN: r277896
2019-11-07 00:16:07 +00:00
GCC Administrator
15667d051c Daily bump.
From-SVN: r277867
2019-11-06 00:16:05 +00:00
GCC Administrator
0890b8389d Daily bump.
From-SVN: r277807
2019-11-05 00:16:06 +00:00
GCC Administrator
fae9fcba75 Daily bump.
From-SVN: r277761
2019-11-04 00:16:05 +00:00
Iain Sandoe
649db6227b [Darwin, testsuite] Fix PR 79274
The solution for initialising global TLS variables does not apply
to platforms using emulated TLS.  XFAIL the test for this on Darwin.

2019-11-03  Iain Sandoe  <iain@sandoe.co.uk>

	PR c++/79274
	* g++.dg/tls/pr77285-2.C: XFAIL test for Darwin.

From-SVN: r277751
2019-11-03 08:23:33 +00:00
GCC Administrator
558877bef9 Daily bump.
From-SVN: r277746
2019-11-03 00:16:04 +00:00
Iain Sandoe
334a72eb12 [testsuite] Require alias support for pr90760.
This test fails on Darwin because it requires alias support, so
add the relevant dg-requires.

gcc/testsuite/

2019-11-02  Iain Sandoe  <iain@sandoe.co.uk>

	Backport from mainline
	2019-06-13  Iain Sandoe  <iain@sandoe.co.uk>

	* gcc.dg/pr90760.c: Require alias support.

From-SVN: r277745
2019-11-02 12:27:29 +00:00
GCC Administrator
ee7037c0a4 Daily bump.
From-SVN: r277737
2019-11-02 00:16:05 +00:00
Iain Sandoe
ff76f68fa5 [Darwin, machopic] Back out part of PR71767 fix.
We applied a conservative, but fairly large, hammer to fix PR71767.
However, ideally, we want minimise the number of symbols visible to
ld64 and to match the cases emitted by clang (since that's what ld64
is expecting). Now we've improved the handling of indirections, we
can make the indirection symbols local when they are in the regular
non-lazy symbol pointers section. We will continue to make any
indirections in the data section visible (since right now we have no
way to track if a given symbol follows a weak global).
This change makes no difference to handling of labels for constants
(to be revised in a future patch).

There's a mechanical change to a number of tests (allowing 'l' or 'L'
as the indirection symbol prefix).

gcc/

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

	Backport from mainline
	2019-10-13  Iain Sandoe  <iain@sandoe.co.uk>

	* config/darwin.c (machopic_indirection_name): Rework the
	function to emit linker-visible symbols only for indirections
	in the data section.  Clean up the code and update comments.

gcc/testsuite/

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

	Backport from mainline.
	2019-10-13  Iain Sandoe  <iain@sandoe.co.uk>

	* gcc.target/i386/indirect-thunk-1.c: Allow 'l' or 'L' in
	indirection label prefix, for Darwin.
	* gcc.target/i386/indirect-thunk-2.c: Likewise.
	* gcc.target/i386/indirect-thunk-3.c: Likewise.
	* gcc.target/i386/indirect-thunk-4.c: Likewise.
	* gcc.target/i386/indirect-thunk-attr-1.c: Likewise.
	* gcc.target/i386/indirect-thunk-attr-2.c: Likewise.
	* gcc.target/i386/indirect-thunk-attr-3.c: Likewise.
	* gcc.target/i386/indirect-thunk-attr-4.c: Likewise.
	* gcc.target/i386/indirect-thunk-attr-5.c: Likewise.
	* gcc.target/i386/indirect-thunk-attr-6.c: Likewise.
	* gcc.target/i386/indirect-thunk-extern-1.c: Likewise.
	* gcc.target/i386/indirect-thunk-extern-2.c: Likewise.
	* gcc.target/i386/indirect-thunk-extern-3.c: Likewise.
	* gcc.target/i386/indirect-thunk-extern-4.c: Likewise.
	* gcc.target/i386/indirect-thunk-inline-1.c: Likewise.
	* gcc.target/i386/indirect-thunk-inline-2.c: Likewise.
	* gcc.target/i386/indirect-thunk-inline-3.c: Likewise.
	* gcc.target/i386/indirect-thunk-inline-4.c: Likewise.
	* gcc.target/i386/pr32219-2.c: Likewise.
	* gcc.target/i386/pr32219-3.c: Likewise.
	* gcc.target/i386/pr32219-4.c: Likewise.
	* gcc.target/i386/pr32219-7.c: Likewise.
	* gcc.target/i386/pr32219-8.c: Likewise.
	* gcc.target/i386/ret-thunk-14.c: Likewise.
	* gcc.target/i386/ret-thunk-15.c: Likewise.
	* gcc.target/i386/ret-thunk-9.c: Likewise.

From-SVN: r277727
2019-11-01 20:52:21 +00:00
Iain Sandoe
87b14bf0d2 [Darwin] Fix Objective-C NeXT ABI version check diagnostics.
This fixes build errors when used with newer GCC and corrects a mistake
in the checking of ABI versions.

276768 We were missing a check for the case that user's ABI was > 2 and the
codegen was for 64 bit.

276635 Fix some format-related build warnings.

This fixes two error messages to avoid punctuation and contracted
negations.

gcc/

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

	Backport from mainline
	2019-10-09  Iain Sandoe  <iain@sandoe.co.uk>

	* config/darwin.c (darwin_override_options): Make the check for
	Objective-C ABI version more specific for 64bit code.

	Backport from mainline
	2019-10-06  Iain Sandoe  <iain@sandoe.co.uk>

	* config/darwin.c (darwin_override_options): Adjust objective-c
	ABI version error messages to avoid punctuation and contracted
	negations.

From-SVN: r277726
2019-11-01 20:47:48 +00:00
Iain Sandoe
1830e27db9 [Darwin] Some TLC for older Darwin versions.
The library handling and some of the options for creating the crts for
the older PPC Darwin versions had bit-rotted somewhat. This adjusts the
build criteria for the crts to avoid newer ld64 versions warnings about
mismatches in build and object versions.

Added to some of the comments that it's documented why the specs are as
they are.

gcc/

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

	Backport from mainline
	2019-07-03  Iain Sandoe  <iain@sandoe.co.uk>

	* config/darwin.h (REAL_LIBGCC_SPEC): Adjust for earlier Darwin.
	(STARTFILE_SPEC): Split crt3 into a separate spec.
	(DARWIN_EXTRA_SPECS): Add crt2 and crt3 spec.
	(DARWIN_CRT2_SPEC): New.
	(DARWIN_CRT3_SPEC): New.
	(MIN_LD64_OMIT_STUBS): Revise to 62.1.
	* config/rs6000/darwin.h (DARWIN_CRT2_SPEC): Revise conditions.
	(DARWIN_CRT3_SPEC): New.

libgcc/

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

	Backport from mainline.
	2019-07-03  Iain Sandoe  <iain@sandoe.co.uk>

	* config.host (powerpc-*-darwin*,powerpc64-*-darwin*): Revise crt
	list.
	* config/rs6000/t-darwin: Build crt3_2 for older systems.  Revise
	mmacosx-version-min for crts to run across all system versions.
	* config/rs6000/t-darwin64 (LIB2ADD): Remove.
	* config/t-darwin: Revise mmacosx-version-min for crts to run across
	system versions >= 10.4.

From-SVN: r277725
2019-11-01 20:44:32 +00:00
Iain Sandoe
f8d58fbe57 [Darwin, PPC] Move the out of line register save/restore to an endfile.
272660
We have been including this in libgcc, which means that we have to append
-lgcc even when using shared libgcc. In preparation for revision of libgcc
split this into an endfile.

272759 Correct whitespace in specs.

gcc/

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

	Backport from mainline
	2019-06-27  Iain Sandoe  <iain@sandoe.co.uk>

	* config/rs6000/darwin.h (ENDFILE_SPEC): Correct whitespace in the
	spec.

	Backport from mainline
	2019-06-25  Iain Sandoe  <iain@sandoe.co.uk>

	* config/rs6000/darwin.h (ENDFILE_SPEC): New.

libgcc/

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

	Backport from mainline.
	2019-06-25  Iain Sandoe  <iain@sandoe.co.uk>

	* config.host: Add libef_ppc.a to the extra files for powerpc-darwin.
	* config/rs6000/t-darwin: (PPC_ENDFILE_SRC, PPC_ENDFILE_OBJS): New.
	Build objects for the out of line save/restore register functions
	so that they can be used for any supported Darwin version.
	* config/t-darwin: Default the build Darwin version to Darwin8
	(MacOS 10.4).

From-SVN: r277724
2019-11-01 20:38:37 +00:00
Iain Sandoe
092a2f2a64 [Darwin] The need for FDE symbols is dependent on linker used, not OS rev.
For very old toolchains, the compiler generated extra symbols that mark the
start of each FDE. We no longer need this (since xcode 3 era) - so, for
compatibility with newer linkers, omit this when it is not required.

Since we have detection of the linker version, we can use that directly to
determine if support is needed.

gcc/

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

	Backport from mainline
	2019-06-18  Iain Sandoe  <iain@sandoe.co.uk>

	* config/darwin.c (darwin_emit_unwind_label): New default to false.
	(darwin_override_options): Set darwin_emit_unwind_label as needed.

From-SVN: r277722
2019-11-01 20:33:39 +00:00
Iain Sandoe
371307760a [Darwin] The need for picsym stubs is dependent on linker used, not OS rev.
272356 For very old toolchains, the compiler generated pic symbol stubs that
provide the necessary indirections. We no longer need this (since xcode
3 era) and it's more efficient for the linker to make one stub when it
knows a symbol is needed that for us to emit them speculatively in every
object.

Our current codegen is making the assumption that a specific OS version
uses a specific linker version - and therefore the presence of support
could be based on the target OS rev. Of course, that's way too simplistic
(most likely bogus for cross-toolchains) and we want to make things explict.

Since we have detection of the linker version, we can use that directly
(A config test for support for stub-less linking might also be feasible
but much more involved).

Finally, should the user wish to generate code that caters for export to
use in an environment with an older toolchain, the generation of stubs
can be forced from the command line.

In addition to the points above, branch islanding and a long branch opt
for PowerPC Darwin has become conflated with the emission of these stubs.

274379 There is no need to distinguish PIC/non-PIC symbol stubs.

So we can use a single flag for both.

gcc/

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

	Backport from mainline
	2019-08-13 Iain Sandoe <iain@sandoe.co.uk>

	* config/darwin.c (machopic_indirect_call_target): Rename symbol stub
	flag.
	(darwin_override_options): Likewise.
	* config/darwin.h: Likewise.
	* config/darwin.opt: Likewise.
	* config/i386/i386.c (output_pic_addr_const): Likewise.
	* config/rs6000/darwin.h: Likewise.
	* config/rs6000/rs6000.c (rs6000_call_darwin_1): Likewise.
	* config/i386/darwin.h (TARGET_MACHO_PICSYM_STUBS): Rename to ...
	... this TARGET_MACHO_SYMBOL_STUBS.
	(FUNCTION_PROFILER):Likewise.
	* config/i386/i386.h: Likewise.

	Backport from mainline
	2019-06-16  Iain Sandoe  <iain@sandoe.co.uk>

	* config/darwin.c (machopic_indirect_call_target): Use renamed
	darwin_picsymbol_stubs to decide on output.
	(darwin_override_options): Handle darwin_picsymbol_stubs.
	* config/darwin.h (MIN_LD64_OMIT_STUBS): New.
	(LD64_VERSION): Revise default.
	* config/darwin.opt: (mpic-symbol-stubs): New option.
	(darwin_picsymbol_stubs): New variable.
	* config/i386/darwin.h (TARGET_MACHO_BRANCH_ISLANDS):
	rename to TARGET_MACHO_PICSYM_STUBS.
	* config/i386/i386.c (output_pic_addr_const): Likewise.
	* config/i386/i386.h Likewise.
	* config/rs6000/darwin.h: Likewise.
	* config/rs6000/rs6000.c (rs6000_call_darwin_1): Use renamed
	darwin_picsymbol_stubs.

gcc/testsuite/

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

	Backport from mainline.
	2019-08-13  Iain Sandoe  <iain@sandoe.co.uk>

	* obj-c++.dg/stubify-1.mm: Rename symbol stub option.
	* obj-c++.dg/stubify-2.mm: Likewise.
	* objc.dg/stubify-1.m: Likewise.
	* objc.dg/stubify-2.m: Likewise.

From-SVN: r277721
2019-11-01 20:30:26 +00:00
Iain Sandoe
f8689f6bda [Darwin, PPC] Install the same headers as other sub-targets.
This is primarily in order to improve testsuite coverage, we might elect
to prune the list at some point.

gcc/

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

	Backport from mainline
	2019-06-28  Iain Sandoe  <iain@sandoe.co.uk>

	* config.gcc (powerpc-*-darwin*, powerpc64-*-darwin*): Remove
	override on extra_headers.

From-SVN: r277720
2019-11-01 20:20:47 +00:00
Iain Sandoe
8cb850187d [Darwin, PPC] Allow the user to override the use of hard float in kexts.
The default for the kernel is soft-float, however a user writing a kernel
extension might want to make use of hard float. This aligns GCC with the
system tools and makes ' -mkernel -mhard-float ' work as expected.

gcc/

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

	Backport from mainline
	2019-06-27  Iain Sandoe  <iain@sandoe.co.uk>

	* config/rs6000/rs6000.c (darwin_rs6000_override_options): Honour
	user-specified float mode choice for kernel mode code.

From-SVN: r277718
2019-11-01 20:11:12 +00:00
Iain Sandoe
bf5d24ca9f [Darwin, PPC] Handle GCC target pragma.
For compatibility with other members of the port.
Note, that we do not handle the longcall attribute, since longcall
is not required/used on current Darwin.

gcc/

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

	Backport from mainline
	2019-06-23  Iain Sandoe  <iain@sandoe.co.uk>

	* config/rs6000/darwin.h: Handle GCC target pragma.

From-SVN: r277717
2019-11-01 20:05:17 +00:00
Iain Sandoe
10f6583a9d [Darwin, PPC, testsuite] Exclude darwin from VSX, power8 and power9.
If we build Darwin with a modern assembler, then it might well
recognise insns that cannot be used on current Darwin systems.

The patch augments the tests for feature support for VSX,
power8 and power9 to exclude Darwin even if the assembler can
handle the instructions.

gcc/testsuite/

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

	Backport from mainline.
	2019-05-15  Iain Sandoe  <iain@sandoe.co.uk>

	* lib/target-supports.exp 
	(check_effective_target_powerpc_p8vector_ok): No support for Darwin.
	(check_effective_target_powerpc_p9vector_ok): Likewise.
	(check_effective_target_powerpc_float128_sw_ok): Likewise.
	(check_effective_target_powerpc_float128_hw_ok): Likewise.
	(check_effective_target_powerpc_vsx_ok): Likewise.
	* gcc.target/powerpc/bfp/bfp.exp: Don't try to run this for Darwin.
	* gcc.target/powerpc/dfp/dfp.exp: Likewise.

From-SVN: r277716
2019-11-01 20:01:52 +00:00
GCC Administrator
8ae6abb868 Daily bump.
From-SVN: r277700
2019-11-01 00:16:04 +00:00
GCC Administrator
88a7275c30 Daily bump.
From-SVN: r277650
2019-10-31 00:16:04 +00:00
GCC Administrator
4a1c247ef4 Daily bump.
From-SVN: r277596
2019-10-30 00:16:36 +00:00
Iain Sandoe
9b6d95b967 [Darwin, PPC] Fix PR 65342.
The current Darwin load/store lo_sum patterns have neither predicate nor
constraint. This means that most parts of the backend, which rely on
recog() to validate the rtx, can produce invalid combinations/selections.

For 32bit cases this isn't a problem since we can load/store to unaligned
addresses using D-mode insns.

Conversely, for 64bit instructions that use DS mode, this can manifest as
assemble errors (for an assembler that checks the LO14 relocations), or as
crashes caused by wrong offsets (or worse, wrong content for the two LSBs).

What we want to check for Y on Darwin is:
  - that the alignment of the Symbols' target is sufficient for DS mode
  - that the offset is suitable for DS mode.
    (while looking through the Mach-O PIC unspecs).

So, the patch removes the Darwin-specific lo_sum patterns (we begin using
the movdi_internal64 patterns). We also we need to extend the handling of the
mem_operand_gpr constraint to allow looking through Mach-O PIC UNSPECs in
the lo_sum cases.

2019-10-29  Iain Sandoe  <iain@sandoe.co.uk>

	Backport from mainline
	2019-10-17  Iain Sandoe  <iain@sandoe.co.uk>

	PR target/65342
	* config/rs6000/darwin.md (movdi_low, movsi_low_st): Delete.
	(movdi_low_st): Delete.
	* config/rs6000/rs6000.c
	(darwin_rs6000_legitimate_lo_sum_const_p): New.
	(mem_operand_gpr): Validate Mach-O LO_SUM cases separately.
	* config/rs6000/rs6000.md (movsi_low): Delete.

From-SVN: r277590
2019-10-29 20:20:23 +00:00
Iain Sandoe
2e58cf1399 [Darwin, machopic] Fix for 67183
When we're using the LLVM-based assembler (the default on modern Darwin)
the ordering of stubs and non-lazy symbol pointers is important.

Interleaving the output (current GCC behaviour) leads to crashes which
prevents us from building code with symbol stubs.

To resolve this, we order the output of stubs and symbol indirections:

1. Any indirections in the data section
2. Symbol stubs.
3. Non-lazy symbol pointers.

At present, we still emit LTO sections after these.

2019-10-29  Iain Sandoe  <iain@sandoe.co.uk>

	Backport from mainline
	2019-10-12  Iain Sandoe  <iain@sandoe.co.uk>

	PR target/67183
	* config/darwin.c (machopic_indirection): New field to flag
	non-lazy-symbol-pointers in the data section.
	(machopic_indirection_name): Compute if an indirection should
	appear in the data section.
	(machopic_output_data_section_indirection): New callback split
	from machopic_output_indirection.
	(machopic_output_stub_indirection): Likewise.
	(machopic_output_indirection): Retain the code for non-lazy
	symbol pointers in their regular section.
	(machopic_finish): Use the new callbacks to order the indirection
	output.

From-SVN: r277587
2019-10-29 20:16:28 +00:00
Iain Sandoe
67fcb83c9d [Darwin, machopic] Preparatory patches.
This is a combined set of 5 patches that allows us to fix PRs 65342
and 67183.

276924 Make machopic_finish() static.

276767 Set a SYMBOL flag for indirections.

We are able to treat these specially where needed in legitimate address
tests (specifically, they are guaranteed to be pointer-aligned).

276708 Compute and cache indirection rules.

This caches a check for the requirement to indirect a symbol in the Darwin
ABI, and uses it where needed. We also ensure that we place the indirection
pointers into the non-lazy symbol pointers section. Other placements have
occurred with various platform toolchains - but these seem to have been
unintentional so we match current platform toolchains.

276675 Consider visibility in indirections.

For weak, hidden vars the indirection should just be as normal, that
is that the indirections for such symbols should appear in the non-lazy
symbol pointers table, not in the .data section.

276674 Initial tidy of Mach-O symbol handling.

We want to improve the detection and caching of symbol-properties
so that (a) we can make the compiler's output match the platform
norms (b) we can improve efficiency by checking flags instead of
inspecting strings. (c) The fix for PR71767 was a largish hammer
and we want to reduce the number of symbols that are made linker-
visible.

This first patch is largely typographical changes with no functional
difference intended:

- Tries to ensure that there's no overlap between the symbols used in
the Mach-O case and those declared in the i386 or rs6000 port trees.

- Some improvement to comments.

- Makes the naming of the symbol flags consistent with other uses.

- Provides a predicate macro for each use.

2019-10-29  Iain Sandoe  <iain@sandoe.co.uk>

	Backport from mainline
	2019-10-12  Iain Sandoe  <iain@sandoe.co.uk>

	* config/darwin-protos.h (machopic_finish): Delete.
	* config/darwin.c (machopic_finish): Make static.

	Backport from mainline
	2019-10-09  Iain Sandoe  <iain@sandoe.co.uk>

	* config/darwin.c (machopic_indirect_data_reference): Set flag to
	indicate that the new symbol is an indirection.
	(machopic_indirect_call_target): Likewise.
	* config/darwin.h (MACHO_SYMBOL_FLAG_INDIRECTION): New.
	(MACHO_SYMBOL_INDIRECTION_P): New.
	(MACHO_SYMBOL_FLAG_STATIC): Adjust bit number.

	Backport from mainline
	2019-10-08  Iain Sandoe  <iain@sandoe.co.uk>

	* config/darwin.c (machopic_indirect_data_reference): Check for
	required indirections before making direct access to defined
	values.
	(machopic_output_indirection): Place the indirected pointes for
	required indirections into the non-lazy symbol pointers section.
	(darwin_encode_section_info):
	* config/darwin.h (MACHO_SYMBOL_FLAG_MUST_INDIRECT): New.
	(MACHO_SYMBOL_MUST_INDIRECT_P): New.

	Backport from mainline
	2019-10-07  Iain Sandoe  <iain@sandoe.co.uk>

	* config/darwin.c (machopic_output_indirection): Don't put
	hidden symbol indirections into the .data section, use the
	non-lazy symbol pointers section as normal.
	(darwin_encode_section_info): Record if a symbol is hidden.
	* config/darwin.h (MACHO_SYMBOL_FLAG_HIDDEN_VIS): New.
	(MACHO_SYMBOL_HIDDEN_VIS_P): New.

	Backport from mainline
	2019-10-07  Iain Sandoe  <iain@sandoe.co.uk>

	* config/darwin.c (machopic_symbol_defined_p): Use symbol flag
	predicates instead of accessing bits directly.
	(machopic_indirect_call_target): Likewise.
	(machopic_output_indirection): Likewise.
	(darwin_encode_section_info): Improve description.  Use renamed
	symbol flags.  Use predicate macros for variables and functions.
	* config/darwin.h:
	Rename MACHO_SYMBOL_VARIABLE to MACHO_SYMBOL_FLAG_VARIABLE.
	Rename MACHO_SYMBOL_DEFINED to MACHO_SYMBOL_FLAG_DEFINED.
	Rename MACHO_SYMBOL_STATIC to MACHO_SYMBOL_FLAG_STATIC.
	(MACHO_SYMBOL_VARIABLE_P): New.
	(MACHO_SYMBOL_DEFINED_P):New.
	(MACHO_SYMBOL_STATIC_P): New.
	* config/i386/darwin.h (MACHO_SYMBOL_FLAG_VARIABLE): Delete.
	(SYMBOL_FLAG_SUBT_DEP): New.
	* config/rs6000/darwin.h (SYMBOL_FLAG_SUBT_DEP): New.

From-SVN: r277586
2019-10-29 20:13:06 +00:00
Iain Sandoe
5e0adba026 [Darwin, testsuite] Skip pr72802.c.
As fallout from 19315, which is not fixed on this branch, the presence
of an unused static variable causes a 'promotion' of that to extern.
This produces wrong code on Darwin when Mach-O PIC is in use (m32 X86
and all PPC). So skip this unconditionally, as noted in the PR trail,
the usefulness of the test is questionable anyway.

gcc/testsuite/

2019-10-29  Iain Sandoe  <iain@sandoe.co.uk>

	* gcc.c-torture/compile/pr72802.c: Skip for Darwin.

From-SVN: r277585
2019-10-29 20:09:40 +00:00
Iain Sandoe
0f700e89f7 [Darwin] Amend section for constants with relocations.
Darwin's linker doesn't like text section relocations (they require special
enabling). The Fortran FE, at least, seems to generate cases where the
initialiser for a pointer constant can need a relocation. We can handle
this by special-casing SECCAT_RODATA when the relocation is present by
placing the constant in the .const_data section.

2019-10-29  Iain Sandoe  <iain@sandoe.co.uk>

	Backport from mainline
	2019-10-05  Iain Sandoe  <iain@sandoe.co.uk>

	PR target/59888
	* config/darwin.c (darwin_rodata_section): Add relocation flag,
	choose const_data section for constants with relocations.
	(machopic_select_section): Pass relocation flag to
	darwin_rodata_section ().

From-SVN: r277584
2019-10-29 20:05:05 +00:00
Iain Sandoe
35cd1262dc [Darwin] Update machopic_legitimize_pic_address.
Some changes were missed here in the transition to LRA. The Darwin
archs are all using LRA now, testing for reload is not correct.

2019-10-18  Iain Sandoe  <iain@sandoe.co.uk>

	Backport from mainline
	2019-09-21  Iain Sandoe  <iain@sandoe.co.uk>

	* config/darwin.c (machopic_legitimize_pic_address): Check
	for lra, rather than reload.

From-SVN: r277583
2019-10-29 20:01:59 +00:00
Iain Sandoe
2928367a0a [Darwin] Pick up SDKROOT as the sysroot fallback.
For compatibility with xcrun and the behaviour of the clang driver, make use
of the setting of the SDKROOT environment variable when it is available.
This applies to both finding headers and libraries (i.e. it is also passed to
ld64).

Priority:
1. User's command-line specified --sysroot= or -isysroot.
2. The SDKROOT variable when set, and validated.
3. Any sysroot provided by --with-sysroot= configuration parameter.

SDKROOT is checked thus:
1. Presence.
2. That it starts with / (i.e. 'absolute').
3. That it is not / only (since that's the default).
4. That it is readable by the process executing the driver.

This is pretty much the same rule set as used by the clang driver.

NOTE: (3) might turn out to be overly restrictive in the case that we
have configured with --with-sysroot= and then we want to run on a system
with an installation of the headers/libraries in /. We can revisit this
if that turns out to be an important use-case.

So one can do:

xcrun --sdk macosx /path/to/gcc ....

and that provides the SDK path as the sysroot to GCC as expected.

CAVEAT: An unfortunate effect of the fact that gcc (and g++) are
executables in the Xcode installation, which are found ahead of any such
named in the $PATH

PATH=/path/to/gcc/install:$PATH
xcrun --sdk macosx gcc ....

does *not* work, instead that executes the clang from the xcode/commmand
line tools installation.

PATH=/path/to/gcc/install:$PATH
xcrun --sdk macosx x64_64-apple-darwinXX-gcc ...

does work as expected, however.

2019-10-29  Iain Sandoe  <iain@sandoe.co.uk>

	Backport from mainline
	2019-10-03  Iain Sandoe  <iain@sandoe.co.uk>

	PR target/87243
	* config/darwin-driver.c (maybe_get_sysroot_from_sdkroot): New.
	(darwin_driver_init): Use the sysroot provided by SDKROOT when that
	is available and the user has not set one on the command line.

From-SVN: r277582
2019-10-29 19:52:20 +00:00
Iain Sandoe
3260d09d1e [Darwin, specs] Fix driver handling of PIE options.
pie, no-pie and rdynamic are driver options, we can process them in the
relevant place and drop them once dealt with. There's no need to generate
a new header to process the no_compact_unwind which is applied on the
basis of the target system.

Support for the -pie, -no_pie and -no_compact_unwind options should ideally
be checked at configure time, however the status quo is to assert that linkers
capable of targeting the relevant systems support these options (i.e. we trust
that the user doesn't attempt to configure inappropriately).

TODO: check the availability of the linker opts in configure rather than
trusting to the user.

This will fix the fail of pie-7.c, which is a result of failing to handle the
no-pie driver option.

2019-10-29  Iain Sandoe  <iain@sandoe.co.uk>

	Backport from mainline
	2019-07-03  Iain Sandoe  <iain@sandoe.co.uk>

	* config/darwin.h (DRIVER_SELF_SPECS): Remove the linker cases.
	(RDYNAMIC): Rename to, DARWIN_RDYNAMIC.
	(DARWIN_PIE_SPEC, DARWIN_NOPIE_SPEC): Adjust to remove the Xlinker
	clauses.
	(LINK_COMMAND_SPEC_A): Add DARWIN_RDYNAMIC, DARWIN_PIE_SPEC and
	DARWIN_NOPIE_SPEC.

	Backport from mainline
	2019-06-19  Iain Sandoe  <iain@sandoe.co.uk>

	* config/darwin.h (DRIVER_SELF_SPECS): Add RDYNAMIC, DARWIN_PIE_SPEC
	and DARWIN_NOPIE_SPEC.
	(RDYNAMIC): New, modified from DARWIN_EXPORT_DYNAMIC.
	(DARWIN_PIE_SPEC): Collate from darwin.h and darwin9.h.
	(DARWIN_NOPIE_SPEC): Collate from darwin10.h.
	(DARWIN_NOCOMPACT_UNWIND): New from darwin10.h
	(DARWIN_EXPORT_DYNAMIC): Delete.
	* config/darwin10.h (LINK_GCC_C_SEQUENCE_SPEC): Move no_compact_unwind
	and pie options processing to  darwin.h.
	* config/darwin9.h (DARWIN_PIE_SPEC): Move pie processing to darwin.h

From-SVN: r277581
2019-10-29 19:46:05 +00:00
GCC Administrator
c3864e6639 Daily bump.
From-SVN: r277547
2019-10-29 00:16:14 +00:00
GCC Administrator
cb57e36d13 Daily bump.
From-SVN: r277496
2019-10-28 00:16:15 +00:00
Paul Thomas
07ae342ac7 backport: re PR fortran/86248 (LEN_TRIM in specification expression causes link failure)
2019-10-27  Paul Thomas  <pault@gcc.gnu.org>

	Backport from mainline
	PR fortran/86248
	* resolve.c (flag_fn_result_spec): Correct a typo before the
	function declaration.
	* trans-decl.c (gfc_sym_identifier): Boost the length of 'name'
	to allow for all variants. Simplify the code by using a pointer
	to the symbol's proc_name and taking the return out of each of
	the conditional branches. Allow symbols with fn_result_spec set
	that do not come from a procedure namespace and have a module
	name to go through the non-fn_result_spec branch.

2019-10-27  Paul Thomas  <pault@gcc.gnu.org>

	Backport from mainline
	PR fortran/86248
	* gfortran.dg/char_result_19.f90 : New test.
	* gfortran.dg/char_result_mod_19.f90 : Module for the new test.

From-SVN: r277488
2019-10-27 16:21:36 +00:00
GCC Administrator
9908023fd2 Daily bump.
From-SVN: r277477
2019-10-27 00:16:15 +00:00
Iain Sandoe
8c3da58491 [Darwin, PPC] Check for out of range asm values.
There are some cases in which the value for the max skip to a p2align
directive can be negative. The older assembler (and GAS) just ignores
these cases but newer tools produce an error. To preserve behaviour,
we avoid emitting out of range values.

2019-10-26  Iain Sandoe  <iain@sandoe.co.uk>

	* config/rs6000/darwin.h (ASM_OUTPUT_MAX_SKIP_ALIGN):Guard
	against out of range max skip or log values.

From-SVN: r277471
2019-10-26 10:43:40 +00:00
GCC Administrator
e393660afe Daily bump.
From-SVN: r277465
2019-10-26 00:16:31 +00:00
Richard Earnshaw
578f81c42a [arm][PR88167] Fix __builtin_return_address returns invalid address
This patch fixes a problem with the thumb1 prologue code where the link
register could be unconditionally used as a scratch register even if the
return value was still live at the end of the prologue.

Additionally, the patch improves the code generated when we are not
using many low call-saved registers to make use of any unused call
clobbered registers to help with the saving of high registers that
cannot be pushed directly (quite rare in normal code as the register
allocator correctly prefers low registers).

2019-05-08  Mihail Ionescu  <mihail.ionescu@arm.com>
	    Richard Earnshaw  <rearnsha@arm.com>

gcc:

	PR target/88167
	* config/arm/arm.c (thumb1_prologue_unused_call_clobbered_lo_regs): New
	function.
	(thumb1_epilogue_unused_call_clobbered_lo_regs): New function.
	(thumb1_compute_save_core_reg_mask): Don't force a spare work
	register if both the epilogue and prologue can use call-clobbered
	regs.
	(thumb1_unexpanded_epilogue): Use
	thumb1_epilogue_unused_call_clobbered_lo_regs.  Reverse the logic for
	picking temporaries for restoring high regs to match that of the
	prologue where possible.
	(thumb1_expand_prologue): Add any usable call-clobbered low registers to
	the list of work registers.  Detect if the return address is still live
	at the end of the prologue and avoid using it for a work register if so.
	If the return address is not live, add LR to the list of pushable regs
	after the first pass.

gcc/testsuite:

	PR target/88167
	* gcc.target/arm/pr88167-1.c: New test.
	* gcc.target/arm/pr88167-2.c: New test.

From-SVN: r277454
2019-10-25 14:39:06 +00:00
GCC Administrator
a8bf745550 Daily bump.
From-SVN: r277430
2019-10-25 00:16:49 +00:00
Jonathan Wakely
474aa6a4fd PR libstdc++/92143 adjust for OS X aligned_alloc behaviour
OS X 10.15 adds aligned_alloc but it has the same restriction as the AIX
version, namely that alignments smaller than sizeof(void*) are not
supported.

Backport from mainline
2019-10-18  Jonathan Wakely  <jwakely@redhat.com>

	PR libstdc++/92143
	* libsupc++/new_opa.cc (operator new) [__APPLE__]: Increase alignment
	to at least sizeof(void*).

From-SVN: r277414
2019-10-24 16:31:00 +01:00
Jonathan Wakely
bd6377aef1 Add makefile target to update HTML files in source tree
Also remove the creation of the html/ext sub-directory, which has been
unused since revision r245258.

Backport from mainline
2019-10-08  Jonathan Wakely  <jwakely@redhat.com>

	* doc/Makefile.am (doc-html-docbook-regenerate): New target.
	(${docbook_outdir}/html): Do not create unused 'html/ext' directory.
	* doc/Makefile.in: Regenerate.
	* doc/xml/manual/documentation_hacking.xml: Document new target.
	* doc/html/*: Regenerate.

From-SVN: r277413
2019-10-24 16:30:57 +01:00
Jonathan Wakely
160e1822e4 Update URL for CUJ article in libstdc++ docs
* doc/xml/manual/allocator.xml: Use archived copy of CUJ article.

From-SVN: r277412
2019-10-24 16:30:53 +01:00
Jonathan Wakely
dbc92d91ba Update URL for Hoard in libstdc++ docs
Backport from mainline
2019-05-31  Gerald Pfeifer  <gerald@pfeifer.com>

	* doc/xml/manual/allocator.xml: Move hoard.org back to http.

From-SVN: r277411
2019-10-24 16:30:49 +01:00
Richard Biener
d23b9ce715 backport: [multiple changes]
2019-10-24  Richard Biener  <rguenther@suse.de>

	Backport from mainline
	2019-10-17  Richard Biener  <rguenther@suse.de>

	PR debug/91887
	* dwarf2out.c (gen_formal_parameter_die): Also try to match
	context_die against a DW_TAG_GNU_formal_parameter_pack parent.

	* g++.dg/debug/dwarf2/pr91887.C: New testcase.

	2019-09-19  Richard Biener  <rguenther@suse.de>

	PR tree-optimization/91812
	* tree-ssa-phiprop.c (propagate_with_phi): Do not replace
	volatile loads.

	* gcc.dg/torture/pr91812.c: New testcase.

From-SVN: r277370
2019-10-24 09:38:56 +00:00