Compare commits

...

1615 Commits

Author SHA1 Message Date
Richard Biener b2d961e734 Update ChangeLog and version files for release
From-SVN: r278197
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
GCC Administrator 49734ba5d1 Daily bump.
From-SVN: r277359
2019-10-24 00:16:06 +00:00
Eric Botcazou 1e2d5f2b2c re PR tree-optimization/92131 (incorrect assumption that (ao >= 0) is always false)
PR tree-optimization/92131
	* tree-vrp.c (extract_range_from_plus_minus_expr): If the resulting
	range would be symbolic, drop to varying for any explicit overflow
	in the constant part or if neither range is a singleton.

From-SVN: r277331
2019-10-23 13:17:34 +00:00
GCC Administrator 4fb19443f5 Daily bump.
From-SVN: r277303
2019-10-23 00:16:04 +00:00
GCC Administrator 5fe92a1026 Daily bump.
From-SVN: r277273
2019-10-22 00:16:05 +00:00
GCC Administrator 6d6d020699 Daily bump.
From-SVN: r277218
2019-10-21 00:16:05 +00:00
GCC Administrator 52d90355bb Daily bump.
From-SVN: r277206
2019-10-20 00:16:14 +00:00
GCC Administrator 497e004fde Daily bump.
From-SVN: r277196
2019-10-19 00:17:15 +00:00
Steven G. Kargl b83b9ffd0b re PR fortran/69455 ([F08] Assembler error(s) when using intrinsic modules in two BLOCK)
2019-10-18  Steven G. Kargl  <kargl@gcc.gnu.org>

	PR fortran/69455
	* trans-decl.c (generate_local_decl): Avoid misconstructed
	intrinsic modules in a BLOCK construct.

2019-10-18  Steven G. Kargl  <kargl@gcc.gnu.org>

	PR fortran/69455
	* gfortran.dg/pr69455_1.f90: New test.
	* gfortran.dg/pr69455_2.f90: Ditto.

From-SVN: r277193
2019-10-18 19:26:22 +00:00
Georg-Johann Lay ee31b9755e backport: re PR target/86040 ([avr]: RAMPZ is not always cleared after loading __flashN data)
Backport from 2019-10-18 trunk r277143.
	PR target/86040
	* config/avr/avr.c (avr_out_lpm): Do not shortcut-return.

From-SVN: r277149
2019-10-18 09:16:16 +00:00
GCC Administrator d0b5c7fcc3 Daily bump.
From-SVN: r277137
2019-10-18 00:16:04 +00:00
Segher Boessenkool 0129c64c26 backport: re PR rtl-optimization/89721 (__builtin_mffs sometimes optimized away)
Backport from trunk
	2019-03-15  Segher Boessenkool  <segher@kernel.crashing.org>

	PR rtl-optimization/89721
	* lra-constraints (invariant_p): Return false if side_effects_p holds.

From-SVN: r277132
2019-10-17 21:52:55 +02:00
Richard Earnshaw f66da75fa4 [arm] PR target/89400 fix thumb1 unaligned access expansion
Armv6 has support for unaligned accesses to memory.  However, the
thumb1 code patterns were trying to use the 32-bit code constraints.
One failure mode from this was that the patterns are designed to be
compatible with conditional execution and this was then causing an
assert in the compiler.

The unaligned_loadhis pattern is only used for expanding extv, which
in turn is only enabled for systems supporting thumb2.  Given that
there is no simple expansion for a thumb1 sign-extending load (the
instruction has no immediate offset form and requires two registers in
the address) it seems simpler to just disable this for thumb1.

Fixed thusly:

        Backport from trunk:
	2019-05-03  Richard Earnshaw  <rearnsha@arm.com>

	PR target/89400
	* config/arm/arm.md (unaligned_loadsi): Add variant for thumb1.
	Restrict 'all' variant to 32-bit configurations.
	(unaligned_loadhiu): Likewise.
	(unaligned_storehi): Likewise.
	(unaligned_storesi): Likewise.
	(unaligned_loadhis): Disable when compiling for thumb1.

From-SVN: r277125
2019-10-17 16:48:39 +00:00
Bill Schmidt 41f9f8f420 backport: re PR testsuite/92093 (New test case gcc.target/powerpc/pr91275.c from r276410 fails on BE)
2019-10-17  Bill Schmidt  <wschmidt@linux.ibm.com>

	Backport from mainline
	2019-10-15  Bill Schmidt  <wschmidt@linux.ibm.com>

	PR target/92093
	* gcc.target/powerpc/pr91275.c: Fix type and endian issues.

From-SVN: r277119
2019-10-17 15:35:28 +00:00
GCC Administrator bbc94370be Daily bump.
From-SVN: r277085
2019-10-17 00:16:05 +00:00
Peter Bergner 97f82a5f9a backport: config.gcc: Move -L usage from LINK_OS_EXTRA_SPEC32 and LINK_OS_EXTRA_SPEC64 to...
Backport from mainline
	2019-10-08  Tulio Magno Quites Machado Filho  <tuliom@linux.ibm.com>

	* config.gcc: Move -L usage from LINK_OS_EXTRA_SPEC32 and
	LINK_OS_EXTRA_SPEC64 to MD_STARTFILE_PREFIX and
	MD_STARTFILE_PREFIX_1 when using --with-advance-toolchain.

From-SVN: r277072
2019-10-16 10:19:46 -05:00
GCC Administrator ceff5fe69d Daily bump.
From-SVN: r277030
2019-10-16 00:16:04 +00:00
GCC Administrator 0b3cd58a99 Daily bump.
From-SVN: r276979
2019-10-15 00:16:05 +00:00
GCC Administrator b9f158e462 Daily bump.
From-SVN: r276944
2019-10-14 00:16:05 +00:00
GCC Administrator a7f4a4d8f4 Daily bump.
From-SVN: r276930
2019-10-13 00:16:13 +00:00
Eric Botcazou e926bf7c59 re PR ada/91995 (gnat miscompilation and bootstrap failure on m68k-linux)
PR ada/91995
	* sem_util.ads (Defining_Entity): Remove 2nd and 3th parameters.
	* sem_util.adb (Defining_Entity): Remove 2nd and 3th parameters,
	and adjust accordingly.

From-SVN: r276919
2019-10-12 14:51:26 +00:00
GCC Administrator 2c828253a9 Daily bump.
From-SVN: r276909
2019-10-12 00:16:05 +00:00
Oleg Endo 438d3b12fe backport: re PR target/88630 (Incorrect float negating together with convertion to int on ST-40)
gcc/
	Backport from mainline
	2019-10-10  Oleg Endo  <olegendo@gcc.gnu.org>

	PR target/88630
	* config/sh/sh.h (TARGET_FPU_SH4_300): New macro.
	* config/sh/sh.c (sh_option_override): Enable fsca and fsrra insns
	also for TARGET_FPU_SH4_300.
	(sh_emit_mode_set): Check for TARGET_FPU_SH4_300 instead of
	TARGET_SH4_300.
	* config/sh/sh.md (toggle_pr): Add TARGET_FPU_SH4_300 condition.
	(negsf2): Expand to either negsf2_fpscr or negsf2_no_fpscr.
	(*negsf2_i): Split into ...
	(negsf2_fpscr, negsf2_no_fpscr): ... these new patterns.
	(abssf2): Expand to either abssf2_fpsc or abssf2_no_fpsc.
	(**abssf2_i): Split into ...
	(abssf2_fpscr, abssf2_no_fpscr): ... these new patterns.
	(negdf2): Expand to either negdf2_fpscr or negdf2_no_fpscr.
	(*negdf2_i): Split into ...
	(negdf2_fpscr, negdf2_no_fpscr): ... these new patterns.
	(absdf2): Expand to either absdf2_fpscr or absdf2_no_fpsc.
	(**abssf2_i): Split into ...
	(absdf2_fpscr, absdf2_no_fpscr): ... these new patterns.

From-SVN: r276877
2019-10-11 11:12:28 +00:00
Eric Botcazou a49f79b7a9 decl.c (annotate_value): Really test the sign of the value when deciding to build a NEGATE_EXPR.
* gcc-interface/decl.c (annotate_value) <INTEGER_CST>: Really test the
	sign of the value when deciding to build a NEGATE_EXPR.
	<PLUS_EXPR>: Remove redundant line.
	<BIT_AND_EXPR>: Do the negation here.

From-SVN: r276869
2019-10-11 08:57:58 +00:00
GCC Administrator f439d7065f Daily bump.
From-SVN: r276855
2019-10-11 00:16:27 +00:00
GCC Administrator 6c7cec74ce Daily bump.
From-SVN: r276783
2019-10-10 00:16:07 +00:00
GCC Administrator 6a438c3ef8 Daily bump.
From-SVN: r276747
2019-10-09 00:16:10 +00:00
GCC Administrator 4b22f6ac99 Daily bump.
From-SVN: r276682
2019-10-08 00:16:04 +00:00
Bill Schmidt 2cd5a89bc4 backport: re PR target/91275 (__builtin_crypto_vpmsumd gives different results -O[123] vs -O0)
[gcc]

2019-10-07  Bill Schmidt  <wschmidt@linux.ibm.com>

	Backport from mainline
	2019-10-01  Bill Schmidt  <wschmidt@linux.ibm.com>

	PR target/91275
	* config/rs6000/rs6000.c (rtx_is_swappable_p): Don't swap
	vpmsumd.

[gcc/testsuite]

2019-10-07  Bill Schmidt  <wschmidt@linux.ibm.com>

	Backport from mainline
	2019-10-01  Bill Schmidt  <wschmdit@linux.ibm.com>

	PR target/91275
	* gcc.target/powerpc/pr91275.c: New.

From-SVN: r276678
2019-10-07 20:50:05 +00:00
GCC Administrator 9e8661ee99 Daily bump.
From-SVN: r276641
2019-10-07 00:16:05 +00:00
GCC Administrator eea83c109d Daily bump.
From-SVN: r276631
2019-10-06 00:16:09 +00:00
GCC Administrator 73fe84e2c6 Daily bump.
From-SVN: r276615
2019-10-05 00:16:08 +00:00
GCC Administrator 9787d36dc6 Daily bump.
From-SVN: r276557
2019-10-04 00:16:05 +00:00
GCC Administrator e7697394ae Daily bump.
From-SVN: r276499
2019-10-03 00:16:07 +00:00
GCC Administrator a6146ccaed Daily bump.
From-SVN: r276435
2019-10-02 00:16:08 +00:00
Oleg Endo a15784eede backport: re PR c++/88562 (Incorrect pointer incrementing on SH4)
gcc/
2019-10-01  Oleg Endo  <olegendo@gcc.gnu.org>

	Backport from mainline

	2019-10-01  Oleg Endo  <olegendo@gcc.gnu.org>

	PR target/88562
	* config/sh/sh.c (sh_extending_set_of_reg::use_as_extended_reg): Use
	sh_check_add_incdec_notes to preserve REG_INC notes when replacing
	a memory access insn.

From-SVN: r276414
2019-10-01 15:02:25 +00:00
GCC Administrator 1d2481a55a Daily bump.
From-SVN: r276383
2019-10-01 00:16:05 +00:00
GCC Administrator 5a59ee64e8 Daily bump.
From-SVN: r276273
2019-09-30 00:16:26 +00:00
GCC Administrator 100aca5426 Daily bump.
From-SVN: r276261
2019-09-29 00:16:17 +00:00
Iain Sandoe f5c1bea71d [X86, Darwin] Backport fix for pr82920 (part 4).
As part of the backport for pr82920, the following three testcases
that are only present on the 7 and 8 branch, also needed amendment.

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

	PR target/82920
	* gcc.target/i386/indirect-thunk-bnd-1.c: Adjust scan-asms for Darwin,
	do not use -fno-pic on Darwin.
	* gcc.target/i386/indirect-thunk-bnd-2.c: Likewise.
	* gcc.target/i386/ret-thunk-25.c: Skip for Darwin, which has a
	different ABI for returning this category of complex value.

From-SVN: r276259
2019-09-28 20:05:38 +00:00
Iain Sandoe 7a7681f570 [X86, Darwin] Backport fix for pr82920 (part 2).
Darwin doesn't support mx32, and some tests were
failing because it was trying to do them.  When we
disable this it turns out that quite a few tests
requiring mx32 support were not guarded.

gcc/

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

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

	PR target/82920
	* config/i386/darwin.h (CC1_SPEC): Report -mx32 as an error for
	Darwin.

gcc/testsuite/

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

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

	PR target/82920
	* gcc.target/i386/pr52146.c: Require effective target x32.
	* gcc.target/i386/pr52698.c: Likewise.
	* gcc.target/i386/pr52857-1.c: Likewise.
	* gcc.target/i386/pr52857-2.c: Likewise.
	* gcc.target/i386/pr52876.c: Likewise.
	* gcc.target/i386/pr53698.c: Likewise.
	* gcc.target/i386/pr54157.c: Likewise.
	* gcc.target/i386/pr55049-1.c: Likewise.
	* gcc.target/i386/pr55093.c: Likewise.
	* gcc.target/i386/pr55116-1.c: Likewise.
	* gcc.target/i386/pr55116-2.c: Likewise.
	* gcc.target/i386/pr55597.c: Likewise.
	* gcc.target/i386/pr59929.c: Likewise.
	* gcc.target/i386/pr66470.c: Likewise.

From-SVN: r276258
2019-09-28 20:00:22 +00:00
Iain Sandoe 72f8fb6210 [X86, Darwin] Backport fix for pr82920 (part 1).
The various thunks output codes have inconsistent output
mechanisms. The patch factors out some common code that
writes out the jumps and uses the regular output scheme
that accounts for __USER_LABEL_PREFIX__.

The testsuite changes are largely mechanical compensation
for the revised output (and the fact that Darwin doesn't
use non-PIC by default).

gcc/

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

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

	PR target/82920
	* config/i386/i386.c (ix86_output_jmp_thunk_or_indirect): New.
	(ix86_output_indirect_branch_via_reg): Use output mechanism
	accounting for __USER_LABEL_PREFIX__.
	(ix86_output_indirect_branch_via_push): Likewise.
	(ix86_output_function_return): Likewise.
	(ix86_output_indirect_function_return): Likewise.

gcc/testsuite/

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

	Backport from mainline.
	2019-05-12  Iain Sandoe  <iain@sandoe.co.uk>
	    Dominique d'Humieres  <dominiq@gcc.gnu.org>

	PR target/82920
	* gcc.target/i386/indirect-thunk-1.c: Adjust scan-asms for Darwin,
	do not use -fno-pic on 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-7.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-attr-7.c: Likewise.
	* gcc.target/i386/indirect-thunk-attr-8.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-extern-7.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/indirect-thunk-inline-7.c: Likewise.
	* gcc.target/i386/indirect-thunk-register-1.c: Likewise.
	* gcc.target/i386/indirect-thunk-register-2.c: Likewise.
	* gcc.target/i386/indirect-thunk-register-3.c: Likewise.
	* gcc.target/i386/indirect-thunk-register-4.c: Likewise.
	* gcc.target/i386/ret-thunk-1.c: Likewise.
	* gcc.target/i386/ret-thunk-10.c: Likewise.
	* gcc.target/i386/ret-thunk-11.c: Likewise.
	* gcc.target/i386/ret-thunk-12.c: Likewise.
	* gcc.target/i386/ret-thunk-13.c: Likewise.
	* gcc.target/i386/ret-thunk-14.c: Likewise.
	* gcc.target/i386/ret-thunk-15.c: Likewise.
	* gcc.target/i386/ret-thunk-16.c: Likewise.
	* gcc.target/i386/ret-thunk-2.c: Likewise.
	* gcc.target/i386/ret-thunk-22.c: Likewise.
	* gcc.target/i386/ret-thunk-23.c: Likewise.
	* gcc.target/i386/ret-thunk-24.c: Likewise.
	* gcc.target/i386/ret-thunk-3.c: Likewise.
	* gcc.target/i386/ret-thunk-4.c: Likewise.
	* gcc.target/i386/ret-thunk-5.c: Likewise.
	* gcc.target/i386/ret-thunk-6.c: Likewise.
	* gcc.target/i386/ret-thunk-7.c: Likewise.
	* gcc.target/i386/ret-thunk-8.c: Likewise.
	* gcc.target/i386/ret-thunk-9.c: Likewise.

From-SVN: r276257
2019-09-28 19:54:00 +00:00
Oleg Endo c6214e02be backport: re PR libitm/86712 (libitm produces libitm.so with TEXTREL on SuperH (sh4) in _ITM_beginTransaction)
libitm/
2019-09-28  Oleg Endo  <olegendo@gcc.gnu.org>

	Backport from mainline
	2018-08-03  Sergei Trofimovich  <slyfox@gentoo.org>

	PR target/86712
	* config/sh/sjlj.S: Adjust to use PIC vs normal code to avoid
	absolute relocation in a shared library.

From-SVN: r276247
2019-09-28 09:12:34 +00:00
Oleg Endo 6a1f70d395 backport: re PR target/80672 (gcc/config/sh/sh.c:716: prefer compare to find.)
gcc/
2019-09-28  Oleg Endo  <olegendo@gcc.gnu.org>

	Backport from mainline
	2019-09-28  Oleg Endo  <olegendo@gcc.gnu.org>

	PR target/80672
	* config/sh/sh.c (parse_validate_atomic_model_option): Use
	std::string::compare instead of std::string::find.

From-SVN: r276243
2019-09-28 08:41:09 +00:00
Oleg Endo 5c9f68d586 backport: re PR target/85993 (config/sh/sh.c:10878: suspicious if .. else chain)
gcc/
2019-09-28  Oleg Endo  <olegendo@gcc.gnu.org>

	Backport from mainline
	2018-07-15  Jeff Law  <law@redhat.com>

	PR target/85993
	* config/sh/sh.c (output_mi_thunk): Remove dead conditional
	block.

From-SVN: r276239
2019-09-28 07:29:06 +00:00
GCC Administrator 5d60ba12b8 Daily bump.
From-SVN: r276224
2019-09-28 00:16:05 +00:00
Iain Sandoe 267db46041 [Darwin, opts processing] Fix missing RejectNegative etc.
This adds RejectNegative in a number of places it was needed,
reorders the opts into two groups (one general and one driver-only).
We also add a minimal description to each opt, and note some that
are now obsolete. The only functional change is to permit
-mtarget-linker= as an alias of -mtarget-linker.

This fixes the Darwin part of PR89327

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

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

	* config/darwin.opt (prebind, noprebind, seglinkedit,
	noseglinkedit): Add RejectNegative.

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

	* config/darwin.opt: Add RejectNegative where needed, reorder
	and add minimal functional descriptions.

From-SVN: r276195
2019-09-27 18:44:16 +00:00
GCC Administrator 93e247b27a Daily bump.
From-SVN: r276169
2019-09-27 00:16:09 +00:00
GCC Administrator 64e8163e75 Daily bump.
From-SVN: r276136
2019-09-26 00:16:05 +00:00
GCC Administrator 3b29ca8b8d Daily bump.
From-SVN: r276108
2019-09-25 00:16:24 +00:00
GCC Administrator fb7910ad8b Daily bump.
From-SVN: r276086
2019-09-24 00:16:09 +00:00
Eric Botcazou 6f6cb4761a trans.c (Attribute_to_gnu): Test Can_Use_Internal_Rep on the underlying type of the node.
* gcc-interface/trans.c (Attribute_to_gnu): Test Can_Use_Internal_Rep
	on the underlying type of the node.
	(Call_to_gnu): Likewise with the type of the prefix.

From-SVN: r276044
2019-09-23 08:10:03 +00:00
Max Filippov 576c1fe4b8 xtensa: backport fix for PR target/90922
Stack pointer adjustment code in prologue missed a case of no
callee-saved registers and a stack frame size bigger than 128 bytes.
Handle that case.

This fixes the following gcc tests with call0 ABI:
  gcc.c-torture/execute/stdarg-2.c
  gcc.dg/torture/pr55882.c
  gcc.dg/torture/pr57569.c

gcc/
2019-09-23  Max Filippov  <jcmvbkbc@gmail.com>

	Backport from mainline
	2019-06-18  Max Filippov  <jcmvbkbc@gmail.com>

	* config/xtensa/xtensa.c (xtensa_expand_prologue): Add stack
	pointer adjustment for the case of no callee-saved registers and
	stack frame bigger than 128 bytes.

From-SVN: r276039
2019-09-23 07:50:40 +00:00
GCC Administrator 19bc0e219b Daily bump.
From-SVN: r276032
2019-09-23 00:16:05 +00:00
GCC Administrator 31ddd22d75 Daily bump.
From-SVN: r276023
2019-09-22 00:16:04 +00:00
GCC Administrator af28036a8a Daily bump.
From-SVN: r276012
2019-09-21 00:16:05 +00:00
John David Anglin 2ea4773f07 pa.c (pa_trampoline_init): Remove spurious extended characters.
* config/pa/pa.c (pa_trampoline_init): Remove spurious extended
	characters.

From-SVN: r276010
2019-09-20 22:03:40 +00:00
Andreas Krebbel 3686c5158d re PR rtl-optimization/88751 (Performance regression reload vs lra)
Fix PR88751
    
This patch implements a small improvement for the heuristic in lra
which decides when it has to activate the simpler register allocation
algorithm.
    
gcc/ChangeLog:

2019-09-20  Andreas Krebbel  <krebbel@linux.ibm.com>

	Backport from mainline
	2019-06-06  Andreas Krebbel  <krebbel@linux.ibm.com>

	PR rtl-optimization/88751
	* ira.c (ira): Use the number of the actually referenced registers
	when calculating the threshold.

From-SVN: r275993
2019-09-20 09:23:50 +00:00
GCC Administrator ebc8f1772e Daily bump.
From-SVN: r275983
2019-09-20 00:16:04 +00:00
GCC Administrator d69a5a74b6 Daily bump.
From-SVN: r275921
2019-09-19 00:16:05 +00:00
GCC Administrator d9b461ec5c Daily bump.
From-SVN: r275830
2019-09-18 00:16:04 +00:00
Iain Sandoe e669d29d63 [Darwin, testsuite] Fix pr71694 fail for m32.
This test fails for Darwin m32 because it's scanning for absence
of an instruction that's validly used in PIC code. Fixed, in this
case, by using non-PIC codegen.

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

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

	* g++.dg/pr71694.C: Use non-PIC codegen for Darwin m32.

From-SVN: r275801
2019-09-17 11:48:24 +00:00
GCC Administrator 6a5baacd9e Daily bump.
From-SVN: r275760
2019-09-17 00:16:05 +00:00
Iain Sandoe 055ed07427 [Darwin, testsuite] Fix isysroot-1.c.
For the test to succeed there needs to be some header that is to be found in
the 'expected' place i.e. <sysroot>/usr/include/. It's important that it is
not the name of a header for which fixincludes have been applied, since such
headers will be found in the gcc include-fixed dir and, in general, reference
additional headers. The dummy sysroot will prevent the additional headers
from being found, resulting in a failed test. The fix is to use a header name
that isn't expected to be present in a real sysroot.

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

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

	* gcc.dg/cpp/isysroot-1.c: Use <example.h> as the test header.
	* gcc.dg/cpp/usr/include/stdio.h: Rename...
	* gcc.dg/cpp/usr/include/example.h: ... to this.

From-SVN: r275742
2019-09-16 00:30:59 +00:00
GCC Administrator 919244d32b Daily bump.
From-SVN: r275738
2019-09-16 00:16:05 +00:00
Thomas Koenig 945b9ca887 backport: re PR fortran/91557 (Bogus warning about unused dummy argument _formal_*)
2019-09-15  Thomas Koenig  <tkoenig@gcc.gnu.org>

	Backport from trunk
	PR fortran/91557
	* trans-decl.c (generate_local_decl): Do not warn if the symbol
	is artificial.
	* trans-types.c (get_formal_from_actual_arglist): Set artificial
	attribute on dummy arguments.

2019-09-15  Thomas Koenig  <tkoenig@gcc.gnu.org>

	Backport from trunk
	PR fortran/91557
	* gfortran.dg/warn_unused_dummy_argument_5.f90: New test.

From-SVN: r275737
2019-09-15 22:35:40 +00:00
Iain Sandoe 9c9d3d5025 [objective-c++, testsuite] Fix test line number.
The syntax-1.mm test line numbering is differnent on 7 (and earlier)
branches, so the test needs a minor update for the PR90709 workaround.

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

	* obj-c++.dg/syntax-error-1.mm: Adjust line number in dg-error.

From-SVN: r275725
2019-09-15 02:48:44 +00:00
Iain Sandoe 6d23ec6a50 [objective-c/c++, testsuite] Workaround for PR90709.
Since we cannot parse the current NeXT headers, because of PR90709 and its
dependents, we have a large amount of testsuite noise for Darwin platforms.
In order to restore the usefulness of the testsuite, we are going add headers
without the modern syntax elements that trigger the bug, and use these for
test runs on newer Darwin.

The headers are imported from GNUStep, with some local modifications to make
sure that __BLOCKS__ is honoured as a gate for Apple-style blocks closures.

CF-CFString.h, F-NS*.h are proxy headers that use the installed CoreFoundation
or Foundation headers on systems <= Darwin12 and the GNUStep headers for newer.

Use the CF-CFString.h, F-NS*.h proxy headers where needed in the objective-c
testsuite. Make minor adjustments to tests as required, providing that those
do not alter the test intent.

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

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

	PR objc/90709
	* obj-c++.dg/proto-lossage-7.mm: Use proxy headers.
	* obj-c++.dg/strings/const-cfstring-2.mm: Likewise.
	* obj-c++.dg/strings/const-cfstring-5.mm: Likewise
	* obj-c++.dg/strings/const-str-12.mm: Likewise.
	* obj-c++.dg/syntax-error-1.mm: Likewise.
	* obj-c++.dg/torture/strings/const-cfstring-1.mm: Likewise.
	* obj-c++.dg/torture/strings/const-str-10.mm: Likewise.
	* obj-c++.dg/torture/strings/const-str-11.mm: Likewise.
	* obj-c++.dg/torture/strings/const-str-9.mm: Likewise.
	* obj-c++.dg/cxx-ivars-3.mm: Skip on later Darwin, where the 10.4 API
	in no longer supported, also on m64 where there's no meaning to it.
	* obj-c++.dg/isa-field-1.mm: Suppress unwanted warning, add comment why.
	* obj-c++.dg/objc-gc-3.mm: Skip for Darwin > 16, the API use is an error
	there.
	* obj-c++.dg/qual-types-1.mm: Prune a spurious l64 warning.
	* obj-c++.dg/stubify-1.mm: Tidy up after better compiler warnings.
	* obj-c++.dg/stubify-2.mm: Likewise.
	* obj-c++.dg/try-catch-1.mm: Likewise.
	* obj-c++.dg/try-catch-3.mm: Likewise.

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

	PR objc/90709
	* objc.dg/encode-7-next-64bit.m: Use proxy headers.
	* objc.dg/image-info.m: Likewise.
	* objc.dg/method-6.m: Likewise.
	* objc.dg/no-extra-load.m: Likewise.
	* objc.dg/objc-foreach-4.m: Likewise.
	* objc.dg/objc-foreach-5.m: Likewise.
	* objc.dg/proto-lossage-7.m: Likewise.
	* objc.dg/strings/const-cfstring-2.m: Likewise.
	* objc.dg/strings/const-cfstring-5.m: Likewise.
	* objc.dg/strings/const-str-12b.m: Likewise.
	* objc.dg/symtab-1.m: Likewise.
	* objc.dg/torture/strings/const-cfstring-1.m: Likewise.
	* objc.dg/torture/strings/const-str-10.m: Likewise.
	* objc.dg/torture/strings/const-str-11.m: Likewise.
	* objc.dg/torture/strings/const-str-9.m: Likewise.
	* objc.dg/zero-link-1.m: Likewise.
	* objc.dg/zero-link-2.m: Likewise.
	* objc.dg/zero-link-3.m: Likewise.
	* objc.dg/isa-field-1.m: Suppress unwanted warning, add comment why.
	* objc.dg/headers.m: XFAIL for Darwin14-19.
	* objc.dg/objc-gc-4.m: Skip for Darwin > 16, the API use is an error
	there.

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

	PR objc/90709
	* objc-obj-c++-shared/CF-CFString.h: New.
	* objc-obj-c++-shared/F-NSArray.h: New.
	* objc-obj-c++-shared/F-NSAutoreleasePool.h: New.
	* objc-obj-c++-shared/F-NSObject.h: New.
	* objc-obj-c++-shared/F-NSString.h: New.
	* objc-obj-c++-shared/F-NSValue.h: New.
	* objc-obj-c++-shared/GNUStep/CoreFoundation/CFArray.h: New.
	* objc-obj-c++-shared/GNUStep/CoreFoundation/CFAvailability.h: New.
	* objc-obj-c++-shared/GNUStep/CoreFoundation/CFBase.h: New.
	* objc-obj-c++-shared/GNUStep/CoreFoundation/CFCharacterSet.h: New.
	* objc-obj-c++-shared/GNUStep/CoreFoundation/CFData.h: New.
	* objc-obj-c++-shared/GNUStep/CoreFoundation/CFDictionary.h: New.
	* objc-obj-c++-shared/GNUStep/CoreFoundation/CFLocale.h: New.
	* objc-obj-c++-shared/GNUStep/CoreFoundation/CFString.h: New.
	* objc-obj-c++-shared/GNUStep/Foundation/NSArray.h: New.
	* objc-obj-c++-shared/GNUStep/Foundation/NSAutoreleasePool.h: New.
	* objc-obj-c++-shared/GNUStep/Foundation/NSDate.h: New.
	* objc-obj-c++-shared/GNUStep/Foundation/NSEnumerator.h: New.
	* objc-obj-c++-shared/GNUStep/Foundation/NSGeometry.h: New.
	* objc-obj-c++-shared/GNUStep/Foundation/NSObjCRuntime.h: New.
	* objc-obj-c++-shared/GNUStep/Foundation/NSObject.h: New.
	* objc-obj-c++-shared/GNUStep/Foundation/NSRange.h: New.
	* objc-obj-c++-shared/GNUStep/Foundation/NSString.h: New.
	* objc-obj-c++-shared/GNUStep/Foundation/NSValue.h: New.
	* objc-obj-c++-shared/GNUStep/Foundation/NSZone.h: New.
	* objc-obj-c++-shared/GNUStep/GNUstepBase/GNUstep.h: New.
	* objc-obj-c++-shared/GNUStep/GNUstepBase/GSBlocks.h: New.
	* objc-obj-c++-shared/GNUStep/GNUstepBase/GSConfig.h: New.
	* objc-obj-c++-shared/GNUStep/GNUstepBase/GSObjCRuntime.h: New.
	* objc-obj-c++-shared/GNUStep/GNUstepBase/GSVersionMacros.h: New.
	* objc-obj-c++-shared/GNUStep/GNUstepBase/NSArray+GNUstepBase.h: New.
	* objc-obj-c++-shared/GNUStep/GNUstepBase/NSMutableString+GNUstepBase.h:
	New.
	* objc-obj-c++-shared/GNUStep/GNUstepBase/NSNumber+GNUstepBase.h: New.
	* objc-obj-c++-shared/GNUStep/GNUstepBase/NSObject+GNUstepBase.h: New.
	* objc-obj-c++-shared/GNUStep/GNUstepBase/NSString+GNUstepBase.h: New.

From-SVN: r275724
2019-09-15 02:38:25 +00:00
GCC Administrator 99dc092f59 Daily bump.
From-SVN: r275720
2019-09-15 00:16:11 +00:00
GCC Administrator b63400e8c2 Daily bump.
From-SVN: r275706
2019-09-14 00:16:05 +00:00
Iain Sandoe 24682dea3b [Darwin, testsuite] Adjust two tests that fail on newer OS versions.
Newer OS versions (10.14+) do not provide some of the CRTs that are used
for older ones (e.g. 10.5), and thus link tests that specify targeting
such a revision fail. We retain the testing of the correct defined OS
version number but switch to compile-only testing for these two tests.

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

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

	* gcc.dg/darwin-minversion-1.c: Use compile rather than link/run.

From-SVN: r275705
2019-09-13 21:45:28 +00:00
GCC Administrator 3dd2a01fb8 Daily bump.
From-SVN: r275692
2019-09-13 00:16:06 +00:00
Iain Sandoe 0586da4f85 [Darwin, X86, testsuite] Adjust test for Darwin's align syntax.
Darwin has a .align taking a power of 2 by default, so that some
tests expecting a byte count are failing, fixed by adjusting the
scan-asms.  We also avoid the ABI-mandated indirection for common
and PIC extras for m32 (by adjusting compile options).

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

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

	* gcc.target/i386/pr22076.c: Adjust options to
	match codegen expected by the scan-asms.

From-SVN: r275690
2019-09-12 19:26:49 +00:00
Paul Thomas 2a5360f041 re PR fortran/91686 (ICE in gimplify:2554)
2019-09-12  Paul Thomas  <pault@gcc.gnu.org>

	PR fortran/91686
	Backport from mainline
	* trans-expr.c (gfc_trans_assignment_1): Copy and paste section
	handling the rse.pre block from mainline.

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

	PR fortran/91686
	* gfortran.dg/pr91686.f90 : New test.

From-SVN: r275681
2019-09-12 09:05:14 +00:00
GCC Administrator e9fbb75d8c Daily bump.
From-SVN: r275677
2019-09-12 00:16:05 +00:00
Jonathan Wakely 8038d0206c Fix Xmethod for shared_ptr::use_count()
This was reported in https://bugzilla.redhat.com/show_bug.cgi?id=1749578

	* python/libstdcxx/v6/xmethods.py (SharedPtrUseCountWorker.__call__):
	Fix syntax error.

From-SVN: r275647
2019-09-11 12:41:36 +01:00
Eric Botcazou 33b4a04318 re PR rtl-optimization/89795 (wrong code with -O2 -fno-dce -fno-forward-propagate -fno-sched-pressure)
PR rtl-optimization/89795
	* rtlanal.c (nonzero_bits1) <SUBREG>: Do not propagate results from
	inner REGs to paradoxical SUBREGs if WORD_REGISTER_OPERATIONS is set.

From-SVN: r275638
2019-09-11 10:44:06 +00:00
GCC Administrator 98c4786a9a Daily bump.
From-SVN: r275619
2019-09-11 00:16:25 +00:00
Iain Sandoe a045089a6c [Darwin, X86, testsuite] Fixes for three PIE tests.
Darwin requires PIC code in order to support PIE; amend the test scan-asms
to match this.

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

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

	* gcc.target/i386/pr39013-1.c: Adjust scan-asms for PIE to
	account for PIC code on Darwin.
	* gcc.target/i386/pr39013-2.c: Likewise.
	* gcc.target/i386/pr64317.c: Likewise.

From-SVN: r275612
2019-09-10 20:43:34 +00:00
Iain Sandoe 21246e0482 [Darwin, X86, testsuite] Amend popcnt spelling for Darwin.
Darwin uses a different spelling for popcnt (popcnt instead of popcntw).
Check for this in the test.

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

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

	* gcc.target/i386/pr59874-3.c: Use the spelling of popcnt
	expected for Darwin.

From-SVN: r275610
2019-09-10 20:39:23 +00:00
GCC Administrator bcb6582ce5 Daily bump.
From-SVN: r275552
2019-09-10 00:16:05 +00:00
Iain Sandoe 145860115a [Darwin, testsuite] Address PR91087 - XFAIL parts of pr16855.C.
The testcase is failing to instrument part of the source because of a bug
in the ordering of static DTORs. It seems unlikely that this is generically
fixable in the toolchain (and given that it's likely to be a dynamic loader
change would not be expected to be applied retrospectively to OS versions
that are out of support). To avoid the testsuite noise, xfail the count lines
that don't match (we can adjust the xfails as/when the upstream bug is fixed).

dejagnu xfails do not seem to work when embedded in a line like:
~Test (void) { .... /* count(1) { xfail ... } */ }
the closing brace seems to confuse the parser. The solution is to exapnd the
text onto three lines.

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

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

	PR gcov-profile/91087
	* g++.dg/gcov/pr16855.C: Xfail the count lines for the DTORs and the
	"final" line for the failure summaries.  Adjust source layout so that
	dejagnu xfail expressions work.

From-SVN: r275547
2019-09-09 20:27:05 +00:00
Iain Sandoe ff22d43b98 [Darwin, testsuite] Fix PR 65364 (uninit-19.c).
This test currently fails on Darwin, because the port inlines fn2 for
both PIC (and non-pic for m32). Fixed by adjusting the target condition.

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

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

	PR testsuite/65364
	* gcc.dg/uninit-19.c (fn1): Adjust target condition for Darwin.
	(fn2): Likewise.

From-SVN: r275546
2019-09-09 20:21:30 +00:00
Iain Sandoe f6f6687975 [Darwin, X86, testsuite] Adjust match strings.
Some of the i386.exp tests fail on Darwin  because their scan-asm
match strings are too general.  In some cases the strings also match
instances in the .file and size directives or in comment output. This
makes the match strings more specific.

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

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

	* gcc.target/i386/pr66819-3.c: Specifically, check that there is no
	call to "bar".
	* gcc.target/i386/pr66819-4.c: Likewise.

From-SVN: r275545
2019-09-09 20:13:24 +00:00
Iain Sandoe 93cb94ccd6 [Darwin, X86, testsuite] Adjust labels for USER_LABEL_PREFIX.
A couple of the i386.exp tests fail because the label spelling
used is different between ELF and Mach-O targets. Adjusted here.

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

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

	* gcc.target/i386/pr67985-2.c: Adjust label checks for
	Darwin.
	* gcc.target/i386/pr77881.c: Likewise.

From-SVN: r275543
2019-09-09 20:07:18 +00:00
Iain Sandoe 28a1c6ba46 [Darwin, X86, testsuite] Disable tests that cannot pass.
Some of the i386.exp target tests cannot pass on Darwin because
either the port doesn't support a feature, or the ABI demands
sufficiently different codegen that matching the output with
scan-asms would require a different test.  Skip these.

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

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

	* gcc.target/i386/pr70738-7.c: Skip for Darwin.
	* gcc.target/i386/pr24414.c: Likewise.

From-SVN: r275542
2019-09-09 19:58:23 +00:00
Jakub Jelinek 7fd1e6110d re PR target/87853 (_mm_cmpgt_epi8 broken with -funsigned-char)
PR target/87853
	* config/i386/emmintrin.h (_mm_cmpeq_epi8): Use casts to __v16qi
	instead of __v16qs.

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

From-SVN: r275516
2019-09-09 13:44:17 +02:00
Jakub Jelinek cb3e2b248b re PR target/91704 ([X86] Codegen for _mm256_cmpgt_epi8 is affected by -funsigned-char)
PR target/91704
	* config/i386/avxintrin.h (__v32qs): New typedef.
	* config/i386/avx2intrin.h (_mm256_cmpgt_epi8): Use casts to __v32qs
	instead of __v32qi.

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

From-SVN: r275515
2019-09-09 13:43:08 +02:00
GCC Administrator a1df926eb2 Daily bump.
From-SVN: r275498
2019-09-09 00:16:21 +00:00
Iain Sandoe dd4845f15a [Darwin, X86, testsuite] Add xfails for PR90396.
We don't have support for -mcmodel={medium, large, kernel} so don't
expect tests for those things to work.

For now mark them as xfail where possible and skip where that isn't.
These changes will be logged onto the PR and therefore can be backed
out when the facility is implemented.

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

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

	PR target/90698
	* gcc.target/i386/pr49866.c: XFAIL for Darwin.
	* gcc.target/i386/pr63538.c: Likewise.
	* gcc.target/i386/pr61599-1.c: Skip for Darwin.

From-SVN: r275496
2019-09-08 19:49:27 +00:00
Iain Sandoe e98846d786 [X86, testsuite] Fix PR rtl-optimisation/64895 XPASSes.
These tests had started to XPASS on pic targets where the codegen
is now as expected.

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

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

	PR rtl-optimisation/64895
	* gcc.target/i386/fuse-caller-save-rec.c: Remove XFAILs.
	* gcc.target/i386/fuse-caller-save.c: Likewise.
	* gcc.target/i386/fuse-caller-save-xmm.c: Adjust tests for
	PIC cases, remove XFAILs.

From-SVN: r275495
2019-09-08 19:41:20 +00:00
Iain Sandoe f57249e39c [Darwin, X86] Backport fix for .ident tests.
The c-c++-common tests fail (or XPASS depending on which) on Darwin
because if doesn't emit a.ident marker. For X86 Darwin, this is a
trivial oversight; the assembler supports the directive. We can
therefore use the default target hook there.

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

	Backport from mainline
	2018-12-23  Iain Sandoe  <iain@sandoe.co.uk>

	* config/i386/darwin.h (TARGET_ASM_OUTPUT_IDENT): New.

From-SVN: r275494
2019-09-08 19:32:43 +00:00
GCC Administrator 0f0a929b08 Daily bump.
From-SVN: r275490
2019-09-08 00:16:19 +00:00
GCC Administrator 2b43a1a0b4 Daily bump.
From-SVN: r275479
2019-09-07 00:16:13 +00:00
Iain Sandoe 5502ed98e9 [Ada, Darwin, PPC] PPC Darwin has stack check probes.
On PPC, Darwin uses the same code as other parts of the port

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

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

	* system-darwin-ppc.ads: Set Stack_Check_Probes True for
	PPC Darwin.

From-SVN: r275471
2019-09-06 16:11:09 +00:00
Iain Sandoe 0e21ccadb9 [Ada] Push -shared-libgcc where needed.
Gnatlink has code that checks for duplicate '-shared-libgcc’ switches (but not
duplicate ‘static-libgcc’) and also pushes ’static-libgcc' onto the link line for
targets that default to static linking, provided '-shared-libgcc' is not present.

For targets that should use a shared libgcc we need the same process to be
applied (in inverse), in the event that they do not default to providing the
shared flag implicitly.

So this adds the complementary set of tests for the shared case and pushes
the shared flag as needed. As a minor tidy-up there’s no need push duplicates
of the libgcc switch onto the link line when one has already been seen (given by
the user).

The patch does not alter any of the platform defaults for static/shared libgcc,
but it ensures that the intent of the link is explicit.

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

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

	* gnatlink.adb (Link_Step): Push -shared-libgcc explicitly, when it
	is the target default (unless overidden by the static flag).
	When the user has put an instance of shared/static-libgcc do not push
	a duplicate of this.

From-SVN: r275470
2019-09-06 16:08:08 +00:00
Iain Sandoe 2735b4e660 [Darwin, testsuite] Fix PR27221.
The test can't succeed on 32b powerpc Darwin since the
ABI demands a different result to the tested one. (So XFAIL it).

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

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

	PR testsuite/27221
	* g++.dg/ext/alignof2.C: XFAIL for 32bit Darwin.

From-SVN: r275469
2019-09-06 16:03:42 +00:00
Iain Sandoe e32aa33638 [Darwin, testsuite] Fix PR67958.
These tests require specific scan-asms in some cases because
of the different codegen for Dawin.  Added some explanations
too.

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

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

	PR testsuite/67958
	* gcc.target/i386/pr32219-1.c: Adjust scan-asms for Darwin, comment
	the differences.
	* 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-5.c: Likewise.
	* gcc.target/i386/pr32219-6.c: Likewise.
	* gcc.target/i386/pr32219-7.c: Likewise.
	* gcc.target/i386/pr32219-8.c: Likewise.

From-SVN: r275468
2019-09-06 15:59:54 +00:00
Iain Sandoe d7f3a0b0c2 [Darwin, testsuite] Fix PR63891 (darwin-weakimport-3).
This is a testcase failing because one part of the codegen is
(correctly) generating the scan-asm-not signature.

Fixed by altering the build options.

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

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

	PR target/63891
	* gcc.dg/darwin-weakimport-3.c: Adjust options and explain
	the reasons.

From-SVN: r275467
2019-09-06 15:56:18 +00:00
Iain Sandoe 4685195843 [Darwin, testsuite ] Fix for PR58321.
Darwin doesn't emit a .file directive by default
and one of the scan-asm hits for ELF targets comes from
this directive. Adjust for Darwin and explain.

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

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

	PR testsuite/58321
	* gcc.target/i386/memcpy-strategy-3.c: Adjust count for Darwin and
	add a comment as to the reason for the difference.
	* gcc.target/i386/memset-strategy-1.c: Likewise.

From-SVN: r275466
2019-09-06 15:51:01 +00:00
Iain Sandoe 788f740a47 [Darwin, X86] Backport fix for tests using .p2align.
This fixes a number of testcases that expect use of .p2align, which
was somehow omitted from the darwin X86 port (but is available in all
assemblers used with it).

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

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

	* config/i386/darwin.h (ASM_OUTPUT_MAX_SKIP_ALIGN): New.

From-SVN: r275465
2019-09-06 15:45:53 +00:00
GCC Administrator 160c854cf2 Daily bump.
From-SVN: r275446
2019-09-06 00:16:23 +00:00
Iain Sandoe d1915aa228 [Darwin, PPC, testsuite] Require stabs support for a test.
The test fails if the assembler doesn't support stabs.

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

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

	* gcc.target/powerpc/stabs-attrib-vect-darwin.c: Require stabs
	support.

From-SVN: r275440
2019-09-05 19:55:27 +00:00
Iain Sandoe fa8428f093 [Darwin, PPC, testsuite] Skip tests for unimplemented functionality.
The -mno-speculate-indirect-jumps functionality is not implemented for
Darwin.

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

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

	* gcc.target/powerpc/safe-indirect-jump-1.c: Skip for Darwin.
	* gcc.target/powerpc/safe-indirect-jump-7.c: Likewise.

From-SVN: r275439
2019-09-05 19:53:12 +00:00
Iain Sandoe 2d11e0f929 [Darwin, PPC, testsuite] Fix builtins-2 Darwin.
This cannot pass for current Darwin, since it requires VSX and we
don't have any hardware supporting that. Add a dg-requires clause
for this.

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

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

	* gcc.target/powerpc/builtins-2.c: Require VSX hardware support.

From-SVN: r275438
2019-09-05 19:50:50 +00:00
Iain Sandoe 3b96333b0e [Darwin, PPC, testsuite] Fix pr80125 testcase for Darwin.
Darwin (unlike most of the members of the PowerPC port family)
defaults to signed chars, so the test was failing to compile with
a "mismatched parameters" error.

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

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

	* gcc.target/powerpc/pr80125.c (foo): Use an unsigned char
	vector explicitly for the vec_perm.

From-SVN: r275437
2019-09-05 19:47:27 +00:00
Iain Sandoe 20e364d053 [Darwin, PPC, testsuite] Fix pr71785 testcase for Darwin.
Firstly, we adjust the test conditions to use non-PIC code for Darwin.
Secondly, we have to account for out-of-line GPR restores which gives
a false positive on one of the scan-assembler-not. Lastly, we make the
test a bit more specific for Darwin - that it looks for absence of
branches to local labels.

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

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

	* gcc.target/powerpc/pr71785.c: For Darwin, make test non-PIC,
	expect the out-of-line GPR restore, and test specifically for
	absence of branches to local labels.

From-SVN: r275436
2019-09-05 19:42:59 +00:00
Iain Sandoe a8c28a9b9a [Darwin, PPC, testsuite] Add requires for DFP to two tests.
The two tests use decimal floating point, add the relevant dg-requires
so that they are unsupported on platforms without DFP.

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

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

	* gcc.target/powerpc/pr64205.c: Require effective target dfp.
	* gcc.target/powerpc/pr79909.c: Likewise.

From-SVN: r275435
2019-09-05 19:40:20 +00:00
Iain Sandoe e832856977 [Darwin, PPC, testsuite] Fix darwin-bool-1.c.
This test is failing because of a pedantic warning that is unrelated to the
purpose of the test. Fixed by suppressing that warning.

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

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

	* gcc.target/powerpc/darwin-bool-1.c: Suppress the pedantic
	warning about _Bool.

From-SVN: r275434
2019-09-05 19:37:30 +00:00
Iain Sandoe 5e19ff7bbd [Darwin, PPC] Fix fail of cpp/assert4.c
This test needs the cpu and machine asserts to be implemented
which hadn't been done for PPC Darwin. We also need to emit
__PPC__ for 32/64b and __PPC64__, __powerpc64__ (64bit) as per
the other members of the PowerPC port.

2019-08-27 Iain Sandoe <iain@sandoe.co.uk>

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

* config/rs6000/darwin.h (TARGET_OS_CPP_BUILTINS): Add asserts
for cpu and machine. Factor 64/32b builtins.

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

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

	* config/rs6000/darwin.h (TARGET_OS_CPP_BUILTINS): Add asserts
	for cpu and machine.  Factor 64/32b builtins.

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

	* config/rs6000/darwin.h: (__PPC__, __PPC64__): New.

From-SVN: r275433
2019-09-05 19:33:01 +00:00
Iain Sandoe e451b91356 [c-family] Backport fix for PCH / PR61250.
When we are parsing a source file, the very first token might
be a PRAGMA_GCC_PCH_PREPROCESS. This indicates that we are going
read in a PCH file (named as the value of the pragma). If we don't
see this pragma, then we know that it's OK to release any resources
that the host might have set aside for the PCH file.

There is a thinko in the current implementation, in that the decision
to release resources is happening unconditionally right after the first
token is extracted but before it's been checked or acted upon.

This leads to the pch bug on Darwin, because we actually do release
resources - which are subsequently (reasonably) assumed to be available
when reading a PCH file. We then get random crashes or hangs depending
on the interaction between unmmap and malloc.

The bug is present everywhere but doesn't show on (say) Linux, since
the release of PCH resources is a NOP there.

This effects all the c-family front ends, because they all use
c_lex_with_flags () to implement this.

The solution is to check for the PRAGMA_GCC_PCH_PREPROCESS and only call
c_common_no_more_pch () when that is not the first token.

A secondary effect of the collection is that the name of the PCH file
can be collected during the ggc_pch_read() reset of state. Therefore
we should issue any diagnostic that might name the file before the
collections are triggered.

gcc/

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

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

	PR pch/61250
	* ggc-page.c (ggc_pch_read): Read the ggc_pch_ondisk structure
	and issue any diagnostics needed before collecting the pre-PCH
	state.

gcc/c-family/

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

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

	PR pch/61250
	* c-lex.c (c_lex_with_flags):  Don't call
	c_common_no_more_pch () from here.

gcc/c

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

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

	PR pch/61250
	* c-parser.c (c_parse_file): Call c_common_no_more_pch ()
	after determining that the first token is not
	PRAGMA_GCC_PCH_PREPROCESS.

gcc/cp/

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

	Backported from mainline
	2019-08-23  Iain Sandoe  <iain@sandoe.co.uk>

	PR pch/61250
	* parser.c (cp_parser_initial_pragma): Call c_common_no_more_pch ()
	after determining that the first token is not
	PRAGMA_GCC_PCH_PREPROCESS.

From-SVN: r275431
2019-09-05 19:27:31 +00:00
Iain Sandoe e3b3d2b9dc [Darwin, X86, testsuite] Provide an asm shim for AVX512F tests.
Without this the tests fail to build.

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

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

	* gcc.target/x86_64/abi/avx512f/abi-avx512f.exp: Darwin is
	now tested.
	* gcc.target/x86_64/abi/avx512f/asm-support-darwin.s: New.

From-SVN: r275430
2019-09-05 19:19:46 +00:00
Iain Sandoe f8b3e1ef29 [Darwin] Fix PR87030 and tidy config fragments.
This is about 32/64b host and multilib support across the range of Darwin
systems.

Prior to Darwin8 (OS X 10.4), the toolchains support only PowerPC and only 32b.

On Darwin8 it is possible to target a 64b multilib, but with support limited
to a few of the main libraries on the system (not a recommended configuration).

From Darwin9 to Darwin17 (OSX 10.5 to 10.13) it is possible to have either
32 or 64b hosted toolchains, with support for a 64 or 32b multilib respectively.

On Darwin9 the kernel is 32b, but with support for 64b executables, so it's
conventional to build a 32b host toolchain supporting a 64b multilib. However
this is not enforced (merely a convention).

There is also some platform hardware supporting Darwin10/11 which is only 32b
and for which the same situation applies. However, from Darwin10 to Darwin17,
the majority of platform hardware supports a 64b kernel and it's conventional
to build a 64b host toolchain with support for a 32b multilib.

On/from Darwin18 (OS X 10.14), the development headers (in the SDK) no longer
expose the interfaces for the 32b multilib support (although sufficient runtime
support remains installed that the testsuite can be run for a 32b multilib).

The PR is raised against this latter situation since the absence of exposed
interfaces causes a 'default' bootstrap fail regardless of the availability of
the runtimes. Given the number of permutations, I felt it warranted a general
solution, especially since the current scheme of target headers and t-make
fragments has become somewhat messy.

The changes here enforce the single 32b PowerPC multilib for Darwin < 8 and the
single X86 64b multilib for Darwin >= 18. This means that there is no longer
any need to configure Darwin18+ '--disable-multilib', but also that if you want
to use the ability to continue to test the compiler's 32b multilib there, you
need to make a configuration targeting an earlier OS version (and using the
SDK from that).

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

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

	PR bootstrap/87030
	* config/i386/darwin.h (REAL_LIBGCC_SPEC): Revert change from r273749.

	PR bootstrap/87030
	* config/i386/darwin.h (REAL_LIBGCC_SPEC): Move from here...
	* config/i386/darwin32-biarch.h .. to here.
	* config/i386/darwin64-biarch.h: Adjust comments.
	* config/rs6000/darwin32-biarch.h: Likewise.
	* config/rs6000/darwin64-biarch.h: Likewise.
	* config.gcc: Missed commit from r273746
	(*-*-darwin*): Don't include CPU t-darwin here.
	(i[34567]86-*-darwin*): Adjust to use biarch files. Produce
	an error message if i686-darwin configuration is attempted for
	Darwin >= 18.

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

	PR bootstrap/87030
	* config.gcc (*-*-darwin*): Don't include CPU t-darwin here.
	(i[34567]86-*-darwin*): Adjust to use biarch files. Produce
	an error message if i686-darwin configuration is attempted for
	Darwin >= 18.
	(x86_64-*-darwin*): Switch to single multilib for Darwin >= 18.
	(powerpc-*-darwin*): Use biarch files where needed.
	(powerpc64-*-darwin*): Likewise.
	* config/i386/darwin.h (REAL_LIBGCC_SPEC): Move to new biarch file.
	(DARWIN_ARCH_SPEC, DARWIN_SUBARCH_SPEC): Revise for default single
	arch case.
	* config/i386/darwin32-biarch.h: New.
	* config/i386/darwin64.h: Rename.
	* gcc/config/i386/darwin64-biarch.h: To this.
	* config/i386/t-darwin: Rename.
	* gcc/config/i386/t-darwin32-biarch: To this.
	* config/i386/t-darwin64: Rename.
	* gcc/config/i386/t-darwin64-biarch: To this.
	* config/rs6000/darwin32-biarch.h: New.
	* config/rs6000/darwin64.h: Rename.
	* config/rs6000/darwin64-biarch.h: To this.
	(DARWIN_ARCH_SPEC, DARWIN_SUBARCH_SPEC): Revise for default single
	arch case.
	* config/rs6000/t-darwin8: Rename.
	* config/rs6000/t-darwin32-biarch: To this.
	* config/rs6000/t-darwin64 Rename.
	* config/rs6000/t-darwin64-biarch: To this.

From-SVN: r275429
2019-09-05 19:14:35 +00:00
Iain Sandoe dd1936cc55 [ObjC] Recognise 'instancetype' as equivalent to 'id'.
This is primarily about fixing a number of testsuite fails, it
implements the parsing of 'instancetype' but doesn't alter the
code gen (relative to using id in the same position). It is
part of the work-arounds for PR90709.

gcc/objc/

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

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

	* objc/objc-act.h (OCTI_INSTANCE_TYPE, OCTI_INSTANCETYPE_NAME): New.
	(objc_global_trees): Add instance type and name.
	(INSTANCE_TYPEDEF_NAME): New.
	* objc/objc-act.c (synth_module_prologue): Build decls for
	objc_instancetype_type and objc_instancetype_name.

gcc/testsuite/

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

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

	* objc.dg/instancetype-0.m: New.

From-SVN: r275428
2019-09-05 19:06:44 +00:00
Richard Biener 4be09c5d81 backport: [multiple changes]
2019-09-05  Richard Biener  <rguenther@suse.de>

	* lto-streamer.h (LTO_minor_version): Bump.

	Backport from mainline
	2019-05-06  Richard Biener  <rguenther@suse.de>

	PR tree-optimization/90328
	* tree-data-ref.h (dr_may_alias_p): Pass in the actual loop nest.
	* tree-data-ref.c (dr_may_alias_p): Check whether the clique
	is valid in the loop nest before using it.
	(initialize_data_dependence_relation): Adjust.
	* graphite-scop-detection.c (build_alias_set): Pass the SCOP enclosing
	loop as loop-nest to dr_may_alias_p.

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

	2019-03-08  Richard Biener  <rguenther@suse.de>

	PR middle-end/89578
	* cfgloop.h (struct loop): Add owned_clique field.
	* cfgloopmanip.c (copy_loop_info): Copy it.
	* tree-cfg.c (gimple_duplicate_bb): Do not remap owned_clique
	cliques.
	* tree-inline.c (copy_loops): Remap owned_clique.
	* lto-streamer-in.c (input_cfg): Stream owned_clique.
	* lto-streamer-out.c (output_cfg): Likewise.

	2019-02-22  Richard Biener  <rguenther@suse.de>

	PR tree-optimization/87609
	* tree-cfg.c (gimple_duplicate_bb): Only remap inlined cliques.

	2019-02-22  Richard Biener  <rguenther@suse.de>

	PR middle-end/87609
	* cfghooks.h (dependence_hash): New typedef.
	(struct copy_bb_data): New type.
	(cfg_hooks::duplicate_block): Adjust to take a copy_bb_data argument.
	(duplicate_block): Likewise.
	* cfghooks.c (duplicate_block): Pass down copy_bb_data.
	(copy_bbs): Create and pass down copy_bb_data.
	* cfgrtl.c (cfg_layout_duplicate_bb): Adjust.
	(rtl_duplicate_bb): Likewise.
	* tree-cfg.c (gimple_duplicate_bb): If the copy_bb_data arg is not NULL
	remap dependence info.

	* gcc.dg/torture/restrict-7.c: New testcase.

	2019-02-22  Richard Biener  <rguenther@suse.de>

	PR tree-optimization/87609
	* tree-core.h (tree_base): Document special clique values.
	* tree-inline.c (remap_dependence_clique): Do not use the
	special clique value of one.
	(maybe_set_dependence_info): Use clique one.
	(clear_dependence_clique): New callback.
	(compute_dependence_clique): Clear clique one from all refs
	before assigning it (again).

From-SVN: r275405
2019-09-05 12:11:52 +00:00
GCC Administrator d9d74f5051 Daily bump.
From-SVN: r275392
2019-09-05 00:16:10 +00:00
Iain Sandoe 9c62fcdbb8 [Darwin] Make a final check on PIC options.
Final check on PCI options; for Darwin these are not dependent on the PIE
ones, although PIE does require PIC to support it. Specifically, for Darwin,
'-fPIC -fno-PIE' should result in the same as '-fno-PIE -fPIC'.

This is a workaround for the situation in which a 'stock-built' GCC is
unable to bootstrap m32 Darwin unless it's done '-mdynamic-no-pic'. So
this fixes a bootstrap fail in that case.

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

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

	* config/darwin.c (darwin_override_options): Make a final check on PIC
	options.

From-SVN: r275386
2019-09-04 19:30:44 +00:00
Iain Sandoe aa915404e7 [Darwin] Don't jam symbol stubs on for kernel code.
Fix wrong code.
Symbol stubs are needed only for m32 PPC, code and that is handled in
rs6000.c.
Symbol stubs should never have been generated for any X86 kernel-mode
case.

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

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

	* config/darwin.c (darwin_override_options): Don't jam symbol stubs
	on for kernel code.

From-SVN: r275385
2019-09-04 19:27:40 +00:00
Iain Sandoe 25df28cc40 [Darwin, PPC] Do not use longcall for 64b code.
Fix wrong codegen; the 'native' tools do no emit the longcall in this
position.

2019-09-04  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): Do not
	use longcall for 64b code.

From-SVN: r275384
2019-09-04 19:24:42 +00:00
Iain Sandoe ff2eece548 [Darwin, PPC, libgcc] Ensure unwinder is built with altivec enabled.
Fix bootstrap fail when building for 10.4.

When libgcc is built on Darwin, it is usually built for the earliest potential
target (Darwin8, 10.4). Build for that revision default to assuming that the
processor might be G3 (without vector ops) and there is an outlined function
used for save/restore that checks whether the processor is G3 or G4+ at run-
time. However, the unwinder itself needs to be built with the assumption of
vector usage so that the relevant outlined functions are called.

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

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

	* config/rs6000/t-darwin: Ensure that the unwinder is built with
	altivec enabled.

From-SVN: r275383
2019-09-04 19:21:07 +00:00
Iain Sandoe c5a0440d8f [Darwin, Driver] Fix driver crashes with valid command line input.
Backport Improve processing of macosx-version-min=

For PR target/63810 some improvements were made in the parsing of
the version string at the point it's used to define the built-in
__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__. This is fine, but the
specs processing also uses the version, and specs version-compare
doesn't like leading zeros on components. This means that while we
succeed in processing -mmacosx-version-min=010.00002.000099 on compile
lines, it fails for any other line that uses the value as part of a spec
(in particular, link lines fail).

To fix this, we need to apply a bit of clean-up to the version that's
presented to the driver, and push that back into the command line opts.

The value can come from four places:
1. User-entered on the command line
2. User-entered as MACOSX_DEPLOYMENT_TARGET= environment var.
3. Absent those two
3a For self-hosting systems, look-up from the kernel
3b For cross-compilers, as a default supplied at configure time.

We apply the clean-up to all 4 (although it shouldn't really be needed
for the cases under 3).

We also supply a test-case that adapts to the target-version of the
system, so that the link requirements are met by the SDK in use (if you
try to link i686-darwin9 on an x86-64-darwin18 SDK, it will fail).

gcc/

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

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

	* config/darwin-driver.c (darwin_driver_init): Fix off-by-one errors
	in computing the number of options to be moved.

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

	* config/darwin-driver.c (validate_macosx_version_min): New.
	(darwin_default_min_version): Cleanup and validate supplied version.
	(darwin_driver_init): Likewise and push cleaned version into opts.

gcc/testsuite/

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

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

	* gcc.dg/darwin-minversion-link.c: New test.

From-SVN: r275382
2019-09-04 19:17:41 +00:00
Iain Sandoe 32426744fe [Darwin, fixincludes] Backport fix for PR83531
There is no reasonable chance that the SDKs in question will be re-
issued, so the only viable solution is a fixincludes.

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

	Backport from mainline.
	2019-08-18  C.G. Dogan  <gcc+cgdogan.00@gmail.com>
		    Iain Sandoe  <iain@sandoe.co.uk>

	PR target/83531
	* inclhack.def (darwin_api_availability): New; strip leading
	underscores from API_XXXX defines.
	* fixincl.x: Regenerate.
	* tests/base/os/availability.h: New file.

From-SVN: r275381
2019-09-04 19:11:08 +00:00
Iain Sandoe 318c48d7d7 [Darwin, fixincludes] Backport fix for Darwin9/10 TR1 test fails.
Darwin has had long long functions for some considerable time and these are
exposed in Darwin8 and Darwin11+ headers. However, for some reason it was
elected to hide them behind __STRICT_ANSI__ and __STDC_VERSION__ on Darwin9
and Darwin10. This is a problem for G++/libstdc++ that expects the functions
to be available for strict ansi (-std=c++14, for example) and without
defining __STDC_VERSION__. The fix here follows the pattern used in
Darwin11+ headers where the functions may be explicitly hidden by defining
__DARWIN_NO_LONG_LONG.

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

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

	* inclhack.def: Replace the complex test using __STRICT_ANSI__ and
	__STDC_VERSION__ with a test using __DARWIN_NO_LONG_LONG.
	Ensure that the top level math.h uses <> to wrap included headers
	rather than "".
	* fixincl.x: Regenerated.
	* tests/base/architecture/ppc/math.h: Update test to include the
	__DARWIN_NO_LONG_LONG case.

From-SVN: r275379
2019-09-04 19:06:36 +00:00
Iain Sandoe 28629080f3 [Darwin, fixincludes] Backport fixes Darwin14 header issues.
There are two issues with the Darwin14 (SDK) headers in which unguarded
advanced syntax elements causes any code including these headers to fail.
This fixes build fails on Darwin14 systems.

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

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

	* inclhack.def: Guard __has_attribute and __has_extension in
	os/base.h.
	Guard Apple blocks syntax in dispatch/object.h.
	* fixincl.x: Regenerate.
	* tests/base/dispatch/object.h: New file.
	* tests/base/os/base.h: New file.

From-SVN: r275378
2019-09-04 19:01:49 +00:00
Richard Biener d586ffcdee backport: re PR tree-optimization/81740 (wrong code at -O3 in both 32-bit and 64-bit modes on x86_64-linux-gnu)
2019-09-04  Richard Biener  <rguenther@suse.de>

	Backport from mainline
	2019-03-26  Bin Cheng  <bin.cheng@linux.alibaba.com>

	PR tree-optimization/81740
	* tree-vect-data-refs.c (vect_analyze_data_ref_dependence):
	In case of outer loop vectorization, check for backward dependence
	at the inner loop if outer loop dependence is reversed.

	* gcc.dg/vect/pr81740-1.c: New testcase.
	* gcc.dg/vect/pr81740-2.c: Likewise.

From-SVN: r275372
2019-09-04 11:56:15 +00:00
Richard Biener f671f26a19 backport: re PR tree-optimization/88149 (ICE in vect_transform_stmt since r265959)
2019-09-04  Richard Biener  <rguenther@suse.de>

	Backport from mainline
	2018-11-23  Richard Biener  <rguenther@suse.de>

	PR tree-optimization/88149
	* tree-vect-slp.c (vect_slp_analyze_node_operations): Detect
	the case where there are two different def types for the
	same operand at different operand position in the same stmt.

	* g++.dg/torture/pr88149.C: New testcase.

From-SVN: r275370
2019-09-04 10:51:02 +00:00
Richard Biener a55f48e0e4 Backport PRs 87929, 88030, 88415, 88448, 88903, 89698, 90006
2019-09-04  Richard Biener  <rguenther@suse.de>

	Backport from mainline
	2019-04-09  Richard Sandiford  <richard.sandiford@arm.com>

	* tree-vect-data-refs.c (vect_get_smallest_scalar_type): Always
	use gimple_expr_type for load and store calls.  Skip over the
	condition argument in a conditional internal function.
	Protect use of TREE_INT_CST_LOW.

	2019-04-08  Richard Biener  <rguenther@suse.de>

	PR tree-optimization/90006
	* tree-vect-data-refs.c (vect_get_smallest_scalar_type): Handle
	calls like lrint.

	* gcc.dg/vect/bb-slp-pr90006.c: New testcase.

	2019-03-14  Richard Biener  <rguenther@suse.de>

	PR middle-end/89698
	* fold-const.c (operand_equal_p): For INDIRECT_REF check
	that the access types are similar.

	* g++.dg/torture/pr89698.C: New testcase.

	2019-01-18  Richard Biener  <rguenther@suse.de>

	PR tree-optimization/88903
	* tree-vect-stmts.c (vectorizable_shift): Verify we see all
	scalar stmts a SLP shift amount is composed of when detecting
	shifts by scalars.

	* gcc.dg/vect/pr88903-1.c: New testcase.
	* gcc.dg/vect/pr88903-2.c: Likewise.

	2018-12-11  Richard Biener  <rguenther@suse.de>

	PR middle-end/88448
	PR middle-end/88415
	* tree-complex.c (update_complex_assignment): Properly transfer
	or clean EH info around gimple_assign_set_rhs_with_ops.

	* gcc.dg/gomp/pr88415.c: New testcase.

	2018-11-15  Richard Biener  <rguenther@suse.de>

	PR tree-optimization/88030
	* tree-complex.c (need_eh_cleanup): New global.
	(update_complex_assignment): Mark blocks that need EH update.
	(expand_complex_comparison): Likewise.
	(tree_lower_complex): Allocate and deallocate need_eh_cleanup,
	perform EH cleanup and schedule CFG cleanup if that did anything.

	* gcc.dg/tsan/pr88030.c: New testcase.

	2018-11-08  Richard Biener  <rguenther@suse.de>

	PR tree-optimization/87929
	* tree-complex.c (expand_complex_comparison): Clean EH.

	* gcc.dg/pr87929.c: New testcase.

	2017-07-25  Eric Botcazou  <ebotcazou@adacore.com>

	* gimple.c (gimple_assign_set_rhs_with_ops): Do not ask gsi_replace
	to update EH info here.

From-SVN: r275366
2019-09-04 08:06:24 +00:00
GCC Administrator d2d8c3477c Daily bump.
From-SVN: r275359
2019-09-04 00:16:19 +00:00
Iain Sandoe 73f1f584a3 [Darwin, Objective-C] Don't prepend a sysroot for the gnu-objc headers.
Darwin is able to use two runtimes for objective-c; the
default is its native NeXT runtime, but also it can build
code using the gnu-runtime. In order to do this, we have to
be able to find the gnu-runtime headers (which are installed
into the compiler's tree).

The process to do this was erroneously prepending the sysroot
to this when a sysroot is in force. The gnu-runtime headers have
never been installed in a Darwin (MacOS) SDK so we must make
sure that they are found local to the compiler.

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

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

	* config/darwin-c.c (darwin_register_objc_includes): Do not
	prepend the sysroot when building gnu-runtime header search
	paths.

From-SVN: r275350
2019-09-03 19:18:30 +00:00
Iain Sandoe 825c1d10fa [Darwin, Objective-C] Switch Objective-C meta-data sections properly.
We were emitting the directives to switch, but not recording the change
in varasm. This means that subsequent switches might be omitted (since
varasm incorrectly concludes that the wrong section is current).

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

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

	* config/darwin.c (darwin_file_end): Use switch_to_section ()
	instead of direct output of the asm.

From-SVN: r275349
2019-09-03 19:13:23 +00:00
Iain Sandoe de935e9c93 [Darwin, PPC] Fix .machine directive in vecsave asm.
The asm file fails to build if we use a modern assembler
which checks that the machine is consistent with the
filetype. Fixed by adjusting in a similar manner to
other assembler.

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

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

	* config/rs6000/darwin-vecsave.S: Set .machine appropriately.

From-SVN: r275348
2019-09-03 19:08:38 +00:00
Iain Sandoe 02c8660f11 [Darwin] Fix lto options.
These had been changed in gcc/gcc.c without being synchronised
to config/darwin.h leading to some fails.

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

	Backport from mainline
	2018-08-22 Iain Sandoe <iain@sandoe.co.uk>

	* config/darwin.h (LINK_COMMAND_SPEC_A): Update lto options
	to match gcc/gcc.c.

From-SVN: r275347
2019-09-03 19:02:01 +00:00
GCC Administrator 23038ad8d9 Daily bump.
From-SVN: r275325
2019-09-03 00:16:22 +00:00
Richard Biener 77406e353b Backport PRs 89135, 89296, 89392, 89572, 89710
2019-09-02  Richard Biener  <rguenther@suse.de>

	Backport from mainline
	2019-03-14  Richard Biener  <rguenther@suse.de>

	PR tree-optimization/89710
	* tree-ssa-loop-ch.c (should_duplicate_loop_header_p): Use
	safe_dyn_cast.

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

	2019-03-14  Richard Biener  <rguenther@suse.de>

	PR middle-end/89572
	* tree-scalar-evolution.c (get_loop_exit_condition): Use
	safe_dyn_cast.
	* tree-ssa-loop-ivcanon.c (canonicalize_loop_induction_variables):
	Use gimple_location_safe.

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

	2019-02-18  Richard Biener  <rguenther@suse.de>

	PR tree-optimization/89296
	* tree-ssa-loop-ch.c (ch_base::copy_headers): Restrict setting
	of no-warning flag to cases that might emit the bogus warning.

	* gcc.dg/uninit-pr89296.c: New testcase.

	2019-02-21  Richard Biener  <rguenther@suse.de>

	PR middle-end/89392
	cp/
	* vtable-class-hierarchy.c (vtv_generate_init_routine): Do not
	make symtab process new functions here.

	2019-01-31  Richard Biener  <rguenther@suse.de>

	PR tree-optimization/89135
	* tree-ssa-phiprop.c (pass_phiprop::execute): Skip blocks
	with abnormal preds.

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

From-SVN: r275319
2019-09-02 14:14:14 +00:00
Richard Biener 19bb99ceaa Backport PRs 90020, 90278, 91126, 91131, 91162, 91200
2019-09-02  Richard Biener  <rguenther@suse.de>

	Backport from mainline
	2019-07-19  Richard Biener  <rguenther@suse.de>

	PR tree-optimization/91200
	* tree-ssa-phiopt.c (cond_store_replacement): Check we have
	no PHI nodes in middle-bb.

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

	2019-07-15  Richard Biener  <rguenther@suse.de>

	PR middle-end/91162
	* tree-cfg.c (move_block_to_fn): When releasing a virtual PHI
	node make sure to replace all uses with something valid.

	* gcc.dg/autopar/pr91162.c: New testcase.

	2019-07-11  Richard Biener  <rguenther@suse.de>

	PR middle-end/91131
	* gimplify.c (gimplify_compound_literal_expr): Force a temporary
	when the object is volatile and we have not cleared it even though
	there are no nonzero elements.

	* gcc.target/i386/pr91131.c: New testcase.

	2019-07-10  Richard Biener  <rguenther@suse.de>

	PR tree-optimization/91126
	* tree-ssa-sccvn.c (n_walk_cb_data::push_partial_def): Adjust
	native encoding offset for BYTES_BIG_ENDIAN.
	(vn_reference_lookup_3): Likewise.

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

	2019-07-10  Richard Biener  <rguenther@suse.de>

	PR tree-optimization/91126
	* tree-ssa-sccvn.c (vn_reference_lookup_3): Adjust
	native encoding offset for BYTES_BIG_ENDIAN.

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

	2019-04-29  Richard Biener  <rguenther@suse.de>

	PR tree-optimization/90278
	* tree-ssa-forwprop.c (pass_forwprop::execute): Transfer/clean
	EH on comparison simplification.

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

	2019-04-11  Richard Biener  <rguenther@suse.de>

	PR tree-optimization/90020
	* tree-ssa-sccvn.c (vn_reference_may_trap): New function.
	* tree-ssa-sccvn.h (vn_reference_may_trap): Declare.
	* tree-ssa-pre.c (compute_avail): Use it to not put
	possibly trapping references after a call that might not
	return into EXP_GEN.
	* gcse.c (compute_hash_table_work): Do not elide
	marking a block containing a call if the call might not
	return.

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

From-SVN: r275317
2019-09-02 12:56:24 +00:00
Jonathan Wakely d01db3fd34 PR middle-end/89303 add testcase for std::enable_shared_from_this
PR middle-end/89303
	* testsuite/20_util/enable_shared_from_this/89303.cc: New test.

From-SVN: r275312
2019-09-02 12:10:08 +01:00
Jonathan Wakely 40358976ba PR libstdc++/91308 fix constraints on unique_ptr assignment
* testsuite/20_util/unique_ptr/assign/48635_neg.cc: Replace dg-error
	with dg-prune-output for enable_if failure.
	* testsuite/20_util/unique_ptr/cons/cv_qual_neg.cc: Add
	dg-prune-output for enable_if failure.

Backport from mainline
2019-07-31  Jonathan Wakely  <jwakely@redhat.com>

	PR libstdc++/91308
	* include/bits/unique_ptr.h (unique_ptr::__safe_conversion_up): Remove
	constraints on deleter that should only apply to the constructor.
	(unique_ptr<T[], D>::__safe_conversion_up): Likewise.
	(unique_ptr<T[], D>::unique_ptr(unique_ptr<U, D>&&)): Restore
	constraints on deleter here.
	* testsuite/20_util/unique_ptr/assign/91308.cc: New test.

From-SVN: r275311
2019-09-02 12:10:04 +01:00
Jonathan Wakely e78c591612 PR libstdc++/51333 Define recursive_init_error constructor non-inline
The recursive_init_error class is defined in a header, with an inline
constructor, but the definition of the vtable and destructor are not
exported from the shared library. With -fkeep-inline-functions the
constructor gets emitted in user code, and requires the (non-exported)
vtable. This fails to link.

As far as I can tell, the recursive_init_error class definition was
moved into <cxxabi.h> so it could be documented with Doxygen, not for
any technical reason. But now it's there (and documented), somebody
could be relying on it, by catching that type and possibly performing
derived-to-base conversions to the std::exception base class. So the
conservative fix is to leave the class definition in the header but make
the constructor non-inline. This still allows the type to be caught and
still defines its base class.

Backport from mainline
2019-07-29  Jonathan Wakely  <jwakely@redhat.com>

	PR libstdc++/51333
	* libsupc++/cxxabi.h (__gnu_cxx::recursive_init_error): Do not define
	constructor inline.
	* libsupc++/guard_error.cc (__gnu_cxx::recursive_init_error): Define
	constructor.
	* testsuite/18_support/51333.cc: New test.

From-SVN: r275309
2019-09-02 12:10:00 +01:00
Jonathan Wakely 9fb59c7837 PR libstdc++/90770 fix missing src/debug/Makefile
Backport from mainline
2019-06-07  Jonathan Wakely  <jwakely@redhat.com>

	PR libstdc++/90770
	* src/Makefile.am (stamp-debug): Also test for missing makefile.
	* src/Makefile.in: Regenerate.

From-SVN: r275308
2019-09-02 12:09:55 +01:00
Jonathan Wakely 99d2cb921d Backport documentation fixes
Backport from mainline
2019-05-21  Jonathan Wakely  <jwakely@redhat.com>

	* doc/xml/manual/shared_ptr.xml: Fix names of lock policy constants.

Backport from mainline
2019-06-20  Jonathan Wakely  <jwakely@redhat.com>

	* doc/xml/manual/status_cxx2017.xml: Fix outdated reference to
	C++17 working draft.

Backport from mainline
2019-05-23  Jonathan Wakely  <jwakely@redhat.com>

	* doc/xml/manual/status_cxx2017.xml: Add feature test macro for
	P0040R3.
	* doc/html/*: Regenerate.

From-SVN: r275307
2019-09-02 12:09:51 +01:00
Jonathan Wakely 70d9e4e555 Fix uses of non-reserved names for template parameters
Backport from mainline
2019-05-17  Jonathan Wakely  <jwakely@redhat.com>

	* include/bits/random.h (seed_seq::param): Fix non-reserved name.
	* include/experimental/type_traits (is_detected_exact)
	(is_detected_exact_v): Likewise.
	* testsuite/17_intro/names.cc: Check for more non-reserved names.
	* testsuite/experimental/names.cc: New test.

From-SVN: r275306
2019-09-02 12:09:45 +01:00
Bin Cheng 9acf8b1fe2 backport: re PR tree-optimization/91137 (Wrong code with -O3)
Backport from mainline
	2019-07-18  Bin Cheng  <bin.linux@linux.alibaba.com>

	PR tree-optimization/91137
	* tree-ssa-loop-ivopts.c (struct ivopts_data): New field.
	(tree_ssa_iv_optimize_init, alloc_iv, tree_ssa_iv_optimize_finalize):
	Init, use and fini the above new field.
	(determine_base_object_1): New function.
	(determine_base_object): Reimplement using walk_tree.

	2019-07-18  Bin Cheng  <bin.linux@linux.alibaba.com>

	PR tree-optimization/91137
	* gcc.c-torture/execute/pr91137.c: New test.

From-SVN: r275304
2019-09-02 10:10:44 +00:00
GCC Administrator 7aeb97d4e0 Daily bump.
From-SVN: r275287
2019-09-02 00:16:24 +00:00
GCC Administrator 3652c5e66c Daily bump.
From-SVN: r275261
2019-09-01 00:16:28 +00:00
Segher Boessenkool a93bc7cc30 rs6000: Fix darn-3.c for GCC 8 and GCC 7
Apparently I didn't properly test the testcase backport to GCC 8 and
GCC 7.  This makes it not fail there.


	PR target/91481
	* gcc.target/powerpc/darn-3.c: Fix testcase.

From-SVN: r275245
2019-08-31 21:01:52 +02:00
GCC Administrator c970ce6048 Daily bump.
From-SVN: r275232
2019-08-31 00:16:32 +00:00
Richard Biener f2814a59d0 Backport PRs 89677, 90071, 90194, 90213, 90474, 90637, 90930
2019-08-30  Richard Biener  <rguenther@suse.de>

	Backport from mainline
	2019-05-27  Richard Biener  <rguenther@suse.de>

	PR tree-optimization/90637
	* tree-ssa-sink.c (statement_sink_location): Honor the
	computed sink location for single-uses.

	* gcc.dg/gomp/pr90637.c: New testcase.

	2019-06-21  Richard Biener  <rguenther@suse.de>

	PR tree-optimization/90930
	* tree-ssa-reassoc.c (rewrite_expr_tree_parallel): Set visited
	flag on new stmts to avoid re-processing them.

	2019-05-15  Richard Biener  <rguenther@suse.de>

	PR c/90474
	* c-common.c (c_common_mark_addressable_vec): Also mark
	a COMPOUND_LITERAL_EXPR_DECL addressable similar to
	c_mark_addressable.

	2019-04-25  Richard Biener  <rguenther@suse.de>

	PR middle-end/90194
	* match.pd: Add pattern to simplify view-conversion of an
	empty constructor.

	* g++.dg/torture/pr90194.C: New testcase.

	2019-04-24  Richard Biener  <rguenther@suse.de>

	PR middle-end/90213
	* gimple-fold.c (fold_const_aggregate_ref_1): Do multiplication
	by size and BITS_PER_UNIT on poly-wide-ints.

	2019-04-15  Richard Biener  <rguenther@suse.de>

	PR tree-optimization/90071
	* tree-ssa-reassoc.c (init_range_entry): Do not pick up
	abnormal operands from def stmts.

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

	2019-03-13  Richard Biener  <rguenther@suse.de>

	PR middle-end/89677
	* tree-scalar-evolution.c (simplify_peeled_chrec): Do not
	throw FP expressions at tree-affine.

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

From-SVN: r275208
2019-08-30 16:44:17 +00:00
Segher Boessenkool 3ae1245ec8 backport: re PR target/91481 (POWER9 "DARN" RNG intrinsic produces repeated output (CVE-2019-15847))
Backport from trunk
	2019-08-23  Segher Boessenkool  <segher@kernel.crashing.org>

gcc/testsuite/
	PR target/91481
	* gcc.target/powerpc/darn-3.c: New testcase.

From-SVN: r275186
2019-08-30 16:25:36 +02:00
Segher Boessenkool 7b382b64cb backport: re PR target/91481 (POWER9 "DARN" RNG intrinsic produces repeated output (CVE-2019-15847))
Backport from trunk
	2019-08-22  Segher Boessenkool  <segher@kernel.crashing.org>

	PR target/91481
	* config/rs6000/rs6000.md (unspec): Delete UNSPEC_DARN, UNSPEC_DARN_32,
	and UNSPEC_DARN_RAW.
	(unspecv): New enumerator values UNSPECV_DARN, UNSPECV_DARN_32, and
	UNSPECV_DARN_RAW.
	(darn_32): Use an unspec_volatile, and UNSPECV_DARN_32.
	(darn_raw): Use an unspec_volatile, and UNSPECV_DARN_RAW.
	(darn): Use an unspec_volatile, and UNSPECV_DARN.

From-SVN: r275185
2019-08-30 16:23:55 +02:00
Segher Boessenkool d08d1afd31 backport: altivec.md (unspec): Delete UNSPEC_DARN...
Backport from trunk
	2019-08-22  Segher Boessenkool  <segher@kernel.crashing.org>

	* config/rs6000/altivec.md (unspec): Delete UNSPEC_DARN, UNSPEC_DARN_32,
	UNSPEC_DARN_RAW, UNSPEC_CMPRB, UNSPEC_CMPRB2, UNSPEC_CMPEQB; move to...
	* config/rs6000/rs6000.md (unspec): ... here.
	* config/rs6000/altivec.md (darn_32, darn_raw, darn, cmprb,
	*cmprb_internal, setb_signed, setb_unsigned, cmprb2, *cmprb2_internal,
	cmpeqb, *cmpeqb_internal): Delete, move to...
	* config/rs6000/rs6000.md (darn_32, darn_raw, darn, cmprb,
	*cmprb_internal, setb_signed, setb_unsigned, cmprb2, *cmprb2_internal,
	cmpeqb, *cmpeqb_internal): ... here.

From-SVN: r275184
2019-08-30 16:22:48 +02:00
Jakub Jelinek 7f2a425e2c backport: re PR target/91150 (wrong code with -O -mavx512vbmi due to wrong writemask)
Backported from mainline
	2019-07-30  Jakub Jelinek  <jakub@redhat.com>

	PR target/91150
	* config/i386/i386.c (expand_vec_perm_blend): Change mask type
	from unsigned to unsigned HOST_WIDE_INT.  For E_V64QImode cast
	comparison to unsigned HOST_WIDE_INT before shifting it left.

	* gcc.target/i386/avx512bw-pr91150.c: New test.

From-SVN: r275164
2019-08-30 14:49:27 +02:00
Jakub Jelinek 9c273107de backport: re PR middle-end/78884 ([7/8] ICE when gimplifying VLA in OpenMP SIMD region)
Backported from mainline
	2019-07-04  Jakub Jelinek  <jakub@redhat.com>

	PR middle-end/78884
	* gimplify.c (struct gimplify_omp_ctx): Add add_safelen1 member.
	(gimplify_bind_expr): If seeing TREE_ADDRESSABLE VLA inside of simd
	loop body, set ctx->add_safelen1 instead of making it GOVD_PRIVATE.
	(gimplify_adjust_omp_clauses): Add safelen (1) clause if
	ctx->add_safelen1 is set.

	* gcc.dg/gomp/pr78884.c: New test.

From-SVN: r275163
2019-08-30 14:48:57 +02:00
Jakub Jelinek 881212bb8f backport: re PR rtl-optimization/90756 (g++ ICE in convert_move, at expr.c:218 on i686 and s390x)
Backported from mainline
	2019-07-04  Jakub Jelinek  <jakub@redhat.com>

	PR rtl-optimization/90756
	* explow.c (promote_ssa_mode): Always use TYPE_MODE, don't bypass it
	for VECTOR_TYPE_P.

	* gcc.dg/pr90756.c: New test.

From-SVN: r275162
2019-08-30 14:48:18 +02:00
Jakub Jelinek 06ed0eeddb backport: re PR sanitizer/90954 (ICE: combining undefined behavior sanitizer with openmp)
Backported from mainline
	2019-06-25  Jakub Jelinek  <jakub@redhat.com>

	PR sanitizer/90954
	* c-omp.c (c_finish_omp_atomic): Allow tree_invariant_p in addition
	to SAVE_EXPR in first operand of a COMPOUND_EXPR.

	* c-c++-common/gomp/pr90954.c: New test.

From-SVN: r275161
2019-08-30 14:47:28 +02:00
Jakub Jelinek 630bb153d6 backport: re PR c++/90950 (OpenMP clause handling rejecting references to incomplete types in templates)
Backported from mainline
	2019-06-21  Jakub Jelinek  <jakub@redhat.com>

	PR c++/90950
	* semantics.c (finish_omp_clauses): Don't reject references to
	incomplete types if processing_template_decl.

	* g++.dg/gomp/lastprivate-1.C: New test.

From-SVN: r275160
2019-08-30 14:46:52 +02:00
Jakub Jelinek 2dbbeed4a7 backport: re PR c/90760 (ICE on attributes section and alias in set_section, at symtab.c:1573)
Backported from mainline
	2019-06-12  Jakub Jelinek  <jakub@redhat.com>

	PR c/90760
	* symtab.c (symtab_node::set_section): Allow being called on aliases
	as long as they aren't analyzed yet.

	* gcc.dg/pr90760.c: New test.

From-SVN: r275159
2019-08-30 14:46:13 +02:00
Jakub Jelinek ac6b16bb3b backport: re PR libgomp/90585 (libgomp hsa plugin ftbfs in the x32 multilib variant)
Backported from mainline
	2019-05-24  Jakub Jelinek  <jakub@redhat.com>

	PR libgomp/90585
	* plugin/plugin-hsa.c (print_kernel_dispatch, run_kernel): Use PRIu64
	macro instead of "lu".
	(release_kernel_dispatch): Likewise.  Cast shadow->debug to uintptr_t
	before casting to void *.

From-SVN: r275158
2019-08-30 14:45:31 +02:00
Jakub Jelinek 973b245aac backport: re PR pch/90326 (Using any precompiled header breaks definition of FLT_MAX)
Backported from mainline
	2019-05-10  Jakub Jelinek  <jakub@redhat.com>

	PR pch/90326
cp/
	* config-lang.in (gtfiles): Remove c-family/c-lex.c, add
	c-family/c-cppbuiltin.c.
objcp/
	* config-lang.in (gtfiles): Remove c-family/c-lex.c, add
	c-family/c-cppbuiltin.c.
testsuite/
	* g++.dg/pch/pr90326.C: New test.
	* g++.dg/pch/pr90326.Hs: New file.

From-SVN: r275157
2019-08-30 14:45:01 +02:00
Jakub Jelinek 5aaa64db0a backport: re PR middle-end/90139 (ICE in emit_block_move_hints, at expr.c:1601)
Backported from mainline
	2019-04-19  Jakub Jelinek  <jakub@redhat.com>

	PR middle-end/90139
	* tree-outof-ssa.c (get_temp_reg): If reg_mode is BLKmode, return
	assign_temp instead of gen_reg_rtx.

	* gcc.c-torture/compile/pr90139.c: New test.

From-SVN: r275156
2019-08-30 14:44:03 +02:00
Jakub Jelinek 57bc4de20a backport: re PR target/90811 ([nvptx] ptxas error on OpenMP offloaded code)
Backported from mainline
	2019-06-11  Jakub Jelinek  <jakub@redhat.com>

	PR target/90811
	* config/nvptx/nvptx.c (nvptx_output_softstack_switch): Use and.b%d
	instead of and.u%d.

	* testsuite/libgomp.c/pr90811.c: New test.

From-SVN: r275155
2019-08-30 14:43:04 +02:00
Jakub Jelinek 03d41f75f9 backport: lang.opt (ftail-call-workaround=): Fix a typo - lenghts to lengths.
Backported from mainline
	2019-05-30  Jakub Jelinek  <jakub@redhat.com>

	* lang.opt (ftail-call-workaround=): Fix a typo - lenghts to lengths.

From-SVN: r275154
2019-08-30 14:42:14 +02:00
Jakub Jelinek 01790bdaee backport: re PR fortran/90329 (Incompatibility between gfortran and C lapack calls)
Backported from mainline
	2019-05-29  Jakub Jelinek  <jakub@redhat.com>

	PR fortran/90329
	* lto-streamer.h (LTO_minor_version): Bump to 1.

	Backported from mainline
	2019-05-16  Jakub Jelinek  <jakub@redhat.com>

	PR fortran/90329
	* tree-core.h (struct tree_decl_common): Document
	decl_nonshareable_flag for PARM_DECLs.
	* tree.h (DECL_HIDDEN_STRING_LENGTH): Define.
	* calls.c (expand_call): Don't try tail call if caller
	has any DECL_HIDDEN_STRING_LENGTH PARM_DECLs that are or might be
	passed on the stack and callee needs to pass any arguments on the
	stack.
	* tree-streamer-in.c (unpack_ts_decl_common_value_fields): Use
	else if instead of series of mutually exclusive ifs.  Handle
	DECL_HIDDEN_STRING_LENGTH for PARM_DECLs.
	* tree-streamer-out.c (pack_ts_decl_common_value_fields): Likewise.

	* lang.opt (fbroken-callers): Remove.
	(ftail-call-workaround, ftail-call-workaround=): New options.
	* gfortran.h (struct gfc_namespace): Add implicit_interface_calls.
	* interface.c (gfc_procedure_use): Set implicit_interface_calls
	for calls to implicit interface procedures.
	* trans-decl.c (create_function_arglist): Use flag_tail_call_workaround
	instead of flag_broken_callers.  If it is not 2, also require
	sym->ns->implicit_interface_calls.
	* invoke.texi (fbroken-callers): Remove documentation.
	(ftail-call-workaround, ftail-call-workaround=): Document.

	2019-05-19  Thomas Koenig  <tkoenig@gcc.gnu.org>

	PR fortran/90329
	* invoke.texi: Document -fbroken-callers.
	* lang.opt: Add -fbroken-callers.
	* trans-decl.c (create_function_arglist): Only set
	DECL_HIDDEN_STRING_LENGTH if flag_broken_callers is set.

	2019-05-16  Jakub Jelinek  <jakub@redhat.com>

	PR fortran/90329
	* trans-decl.c (create_function_arglist): Set
	DECL_HIDDEN_STRING_LENGTH on hidden string length PARM_DECLs if
	len is constant.

From-SVN: r275153
2019-08-30 14:41:43 +02:00
Jakub Jelinek 2f3f6ecaff backport: re PR target/90187 (ICE in extract_insn, at recog.c:2304 x86_64)
Backported from mainline
	2019-04-24  Jakub Jelinek  <jakub@redhat.com>

	PR target/90187
	* config/i386/i386.c (ix86_expand_sse_fp_minmax): Force if_true into
	a register if both if_true and if_false are MEMs.

	* g++.dg/opt/pr90187.C: New test.

From-SVN: r275152
2019-08-30 14:39:50 +02:00
Jakub Jelinek 74870a4e38 backport: re PR tree-optimization/90208 (error: EH landing pad label)
Backported from mainline
	2019-04-24  Jakub Jelinek  <jakub@redhat.com>

	PR tree-optimization/90208
	* tree-cfg.c (remove_bb): Move forced labels from removed bbs
	after labels of new_bb, not before them.

	* gcc.dg/tsan/pr90208-2.c: New test.

From-SVN: r275151
2019-08-30 14:39:09 +02:00
Jakub Jelinek 79797c9781 backport: re PR c++/90108 (ICE: Segmentation fault (in c_tree_chain_next))
Backported from mainline
	2019-04-19  Jakub Jelinek  <jakub@redhat.com>

	PR c++/90108
	* c-decl.c (merge_decls): If remove is main variant and
	DECL_ORIGINAL_TYPE is some other type, remove a DECL_ORIGINAL_TYPE
	variant that has newdecl as TYPE_NAME if any.

	* decl.c (duplicate_decls): If remove is main variant and
	DECL_ORIGINAL_TYPE is some other type, remove a DECL_ORIGINAL_TYPE
	variant that has newdecl as TYPE_NAME if any.

	* c-c++-common/pr90108.c: New test.

From-SVN: r275150
2019-08-30 14:38:31 +02:00
Jakub Jelinek 08924d873b backport: re PR rtl-optimization/90082 (ICE in delete_unmarked_insns, at dce.c:653)
Backported from mainline
	2019-04-16  Jakub Jelinek  <jakub@redhat.com>

	PR rtl-optimization/90082
	* dce.c (can_delete_call): New function.
	(deletable_insn_p, mark_insn): Use it.

	* gcc.dg/pr90082.c: New test.

From-SVN: r275149
2019-08-30 14:37:28 +02:00
Jakub Jelinek cffcee79a1 backport: re PR tree-optimization/90090 (ICE in mark_reachable_handlers, at tree-eh.c:3938 since r219202)
Backported from mainline
	2019-04-16  Jakub Jelinek  <jakub@redhat.com>

	PR tree-optimization/90090
	* tree-ssa-math-opts.c (is_division_by): Ignore divisions that can
	throw internally.

	* g++.dg/opt/pr90090.C: New test.

From-SVN: r275148
2019-08-30 14:36:49 +02:00
Jakub Jelinek a779fe47e6 backport: re PR c/89933 (ICE in merge_decls, at c/c-decl.c:2517)
Backported from mainline
	2019-04-12  Jakub Jelinek  <jakub@redhat.com>

	PR c/89933
	* c-decl.c (merge_decls): When newdecl's type is its main variant,
	don't try to remove it from the variant list, but instead assert
	it has no variants.

	* decl.c (duplicate_decls): When newdecl's type is its main variant,
	don't try to remove it from the variant list, but instead assert
	it has no variants.

	* c-c++-common/pr89933.c: New test.

From-SVN: r275147
2019-08-30 14:36:05 +02:00
Jakub Jelinek a460e19ced backport: re PR middle-end/89998 (ICE: verify_gimple failed in printf-return-value)
Backported from mainline
	2019-04-09  Jakub Jelinek  <jakub@redhat.com>

	PR tree-optimization/89998
	* gimple-ssa-sprintf.c (try_substitute_return_value): Use lhs type
	instead of integer_type_node if possible, don't add ranges if return
	type is not compatible with int.
	* gimple-fold.c (gimple_fold_builtin_sprintf,
	gimple_fold_builtin_snprintf): Use lhs type instead of hardcoded
	integer_type_node.

	* gcc.c-torture/compile/pr89998-1.c: New test.
	* gcc.c-torture/compile/pr89998-2.c: New test.

From-SVN: r275146
2019-08-30 14:35:05 +02:00
Jakub Jelinek 8247363d9a backport: re PR sanitizer/89869 (-fsanitize=undefined miscompilation)
Backported from mainline
	2019-03-29  Jakub Jelinek  <jakub@redhat.com>

	PR sanitizer/89869
	* typeck.c: Include gimplify.h.
	(cp_build_modify_expr) <case COND_EXPR>: Unshare rhs before using it
	for second time.  Formatting fixes.

	* g++.dg/ubsan/vptr-14.C: New test.

From-SVN: r275145
2019-08-30 14:34:19 +02:00
Jakub Jelinek da2620146d backport: re PR c/89872 (GCC does not generate read access to volatile compound literal)
Backported from mainline
	2019-03-29  Jakub Jelinek  <jakub@redhat.com>

	PR c/89872
	* gimplify.c (gimplify_compound_literal_expr): Don't optimize a
	non-addressable complit into its initializer if it is volatile.

	* gcc.dg/tree-ssa/pr89872.c: New test.

From-SVN: r275144
2019-08-30 14:33:40 +02:00
Jakub Jelinek 47687c5d71 backport: re PR middle-end/89621 (ICE with allocatable character and openmp)
Backported from mainline
	2019-03-28  Jakub Jelinek  <jakub@redhat.com>

	PR middle-end/89621
	* tree-inline.h (struct copy_body_data): Add
	dont_remap_vla_if_no_change flag.
	* tree-inline.c (remap_type_3, remap_type_2): New functions.
	(remap_type): Don't remap vla types if id->dont_remap_vla_if_no_change
	and remap_type_2 returns false.
	* omp-low.c (new_omp_context): Set ctx->cb.dont_remap_vla_if_no_change.

	* gfortran.dg/gomp/pr89621.f90: New test.

From-SVN: r275143
2019-08-30 14:33:00 +02:00
Jakub Jelinek 3e4b4ded2f backport: re PR c++/89796 (Incorrect warning generated with OpenMP atomic capture)
Backported from mainline
	2019-03-26  Jakub Jelinek  <jakub@redhat.com>

	PR c++/89796
	* semantics.c (finish_omp_atomic): Add warning_sentinel for
	-Wunused-value around finish_expr_stmt call.

	* g++.dg/gomp/pr89796.C: New test.
	* gcc.dg/gomp/pr89796.c: New test.

From-SVN: r275142
2019-08-30 14:32:15 +02:00
Jakub Jelinek 87f03d0691 backport: re PR c++/60702 (thread_local initialization)
Backported from mainline
	2019-03-25  Jakub Jelinek  <jakub@redhat.com>

	PR c++/60702
	* g++.dg/tls/thread_local11.C: Remove scan-tree-dump-times directives
	for _ZTH* calls.
	* g++.dg/tls/thread_local11a.C: New test.

From-SVN: r275141
2019-08-30 14:31:21 +02:00
Jakub Jelinek 249dc8418e backport: re PR c++/60702 (thread_local initialization)
Backported from mainline
	2019-03-22  Jakub Jelinek  <jakub@redhat.com>

	PR c++/60702
	* cp-tree.h (get_tls_wrapper_fn): Remove declaration.
	(maybe_get_tls_wrapper_call): Declare.
	* decl2.c (get_tls_wrapper_fn): Make static.
	(maybe_get_tls_wrapper_call): New function.
	* typeck.c (build_class_member_access_expr): Handle accesses to TLS
	variables.
	* semantics.c (finish_qualified_id_expr): Likewise.
	(finish_id_expression_1): Use maybe_get_tls_wrapper_call.
	* pt.c (tsubst_copy_and_build): Likewise.

	* g++.dg/tls/thread_local11.C: New test.
	* g++.dg/tls/thread_local11.h: New test.
	* g++.dg/tls/thread_local12a.C: New test.
	* g++.dg/tls/thread_local12b.C: New test.
	* g++.dg/tls/thread_local12c.C: New test.
	* g++.dg/tls/thread_local12d.C: New test.
	* g++.dg/tls/thread_local12e.C: New test.
	* g++.dg/tls/thread_local12f.C: New test.
	* g++.dg/tls/thread_local12g.C: New test.
	* g++.dg/tls/thread_local12h.C: New test.
	* g++.dg/tls/thread_local12i.C: New test.
	* g++.dg/tls/thread_local12j.C: New test.
	* g++.dg/tls/thread_local12k.C: New test.
	* g++.dg/tls/thread_local12l.C: New test.

From-SVN: r275140
2019-08-30 14:30:48 +02:00
Jakub Jelinek ffaf40c06d backport: re PR c++/89767 (ICE with tuple and optimization)
Backported from mainline
	2019-03-21  Jakub Jelinek  <jakub@redhat.com>

	PR c++/89767
	* parser.c (cp_parser_lambda_introducer): Add ids and first_capture_id
	variables, check for duplicates in this function.
	* lambda.c (add_capture): Don't check for duplicates nor use
	IDENTIFIER_MARKED.
	(register_capture_members): Don't clear IDENTIFIER_MARKED here.

	* g++.dg/cpp1y/lambda-init18.C: New test.
	* g++.dg/cpp1y/lambda-init19.C: New test.
	* g++.dg/cpp1y/pr89767.C: New test.

From-SVN: r275139
2019-08-30 14:29:13 +02:00
Jakub Jelinek a3b2e69ae4 backport: re PR target/89752 (ICE in emit_move_insn, at expr.c:3723)
Backported from mainline
	2019-03-20  Jakub Jelinek  <jakub@redhat.com>

	PR target/89752
	* lra-constraints.c (process_alt_operands) <reg>: For BLKmode, don't
	update this_alternative nor this_alternative_set.

From-SVN: r275138
2019-08-30 14:28:22 +02:00
Jakub Jelinek 862a7d828d backport: re PR rtl-optimization/89768 (ICE in compare_and_jump_seq at loop-unroll.c:838)
Backported from mainline
	2019-03-19  Jakub Jelinek  <jakub@redhat.com>

	PR rtl-optimization/89768
	* loop-unroll.c (unroll_loop_constant_iterations): Use gen_int_mode
	instead of GEN_INT.
	(unroll_loop_runtime_iterations): Likewise.

From-SVN: r275137
2019-08-30 14:27:50 +02:00
Jakub Jelinek 6b8d77b926 backport: re PR target/89752 (ICE in emit_move_insn, at expr.c:3723)
Backported from mainline
	2019-03-19  Jakub Jelinek  <jakub@redhat.com>

	PR target/89752
	* gimplify.c (gimplify_asm_expr): For output argument with
	TREE_ADDRESSABLE type, clear allows_reg if it allows memory, otherwise
	diagnose error.

	* g++.dg/ext/asm15.C: Check for particular diagnostic wording.
	* g++.dg/ext/asm16.C: Likewise.
	* g++.dg/ext/asm17.C: New test.

From-SVN: r275136
2019-08-30 14:27:21 +02:00
Jakub Jelinek 40fadf5399 backport: re PR target/89726 (Incorrect inlined version of 'ceil' for 32bit)
Backported from mainline
	2019-03-19  Jakub Jelinek  <jakub@redhat.com>

	PR target/89726
	* config/i386/i386.c (ix86_expand_floorceildf_32): In ceil
	compensation use x2 += 1 instead of x2 -= -1 and when honoring
	signed zeros, do another copysign after the compensation.

	* gcc.target/i386/fpprec-1.c (x): Add 6 new constants.
	(expect_round, expect_rint, expect_floor, expect_ceil, expect_trunc):
	Add expected results for them.

From-SVN: r275135
2019-08-30 14:26:30 +02:00
Jakub Jelinek 2d51e5a7af backport: re PR c/89734 (const qualifier on return type not erased inside __typeof__)
Backported from mainline
	2019-03-19  Jakub Jelinek  <jakub@redhat.com>

	PR c/89734
	* c-decl.c (grokdeclarator): Call c_build_qualified_type on function
	return type even if quals_used is 0.  Formatting fixes.

	* gcc.dg/pr89734.c: New test.

From-SVN: r275134
2019-08-30 14:25:43 +02:00
Jakub Jelinek 59ab6dc89f backport: re PR debug/89704 (ICE in add_const_value_attribute, at dwarf2out.c:19685)
Backported from mainline
	2019-03-15  Jakub Jelinek  <jakub@redhat.com>

	PR debug/89704
	* dwarf2out.c (add_const_value_attribute): Return false for MINUS,
	SIGN_EXTEND and ZERO_EXTEND.

	* gcc.dg/debug/pr89704.c: New test.

From-SVN: r275133
2019-08-30 14:20:12 +02:00
Jakub Jelinek fa03ad48fe backport: re PR rtl-optimization/89679 (wrong code with -Og -frerun-cse-after-loop -fno-tree-fre)
Backported from mainline
	2019-03-14  Jakub Jelinek  <jakub@redhat.com>

	PR rtl-optimization/89679
	* expmed.c (expand_mult_const): Don't add a REG_EQUAL note if it
	would contain a paradoxical SUBREG.

	* gcc.dg/pr89679.c: New test.

From-SVN: r275132
2019-08-30 14:19:33 +02:00
Jakub Jelinek 15a04f92b3 backport: re PR tree-optimization/89703 (ICE in compare_values_warnv, at tree-vrp.c:997)
Backported from mainline
	2019-03-14  Jakub Jelinek  <jakub@redhat.com>

	PR tree-optimization/89703
	* tree-ssa-strlen.c (valid_builtin_call): Punt if stmt call types
	aren't compatible also with builtin_decl_explicit.  Check pure
	or non-pure status of BUILT_IN_STR{{,N}CMP,N{LEN,{CAT,CPY}{,_CHK}}}
	and BUILT_IN_STPNCPY{,_CHK}.

	* gcc.c-torture/compile/pr89703-1.c: New test.
	* gcc.c-torture/compile/pr89703-2.c: New test.

From-SVN: r275131
2019-08-30 14:18:54 +02:00
Jakub Jelinek de06c17135 backport: re PR c++/89512 (ICE in get_expr_operands, at tree-ssa-operands.c:882)
Backported from mainline
	2019-03-14  Jakub Jelinek  <jakub@redhat.com>

	PR c++/89512
	* semantics.c (finish_qualified_id_expr): Reject variable templates.

	* g++.dg/cpp1y/var-templ61.C: New test.

From-SVN: r275130
2019-08-30 14:18:01 +02:00
Jakub Jelinek b56c01ffe7 backport: re PR middle-end/88588 (ICE in make_decl_rtl, at varasm.c:1329)
Backported from mainline
	2019-03-13  Jakub Jelinek  <jakub@redhat.com>

	PR middle-end/88588
	* omp-simd-clone.c (ipa_simd_modify_stmt_ops): Handle PHI args.
	(ipa_simd_modify_function_body): Handle PHIs.

	* c-c++-common/gomp/pr88588.c: New test.

From-SVN: r275129
2019-08-30 14:17:22 +02:00
Jakub Jelinek eff13a51b2 backport: re PR middle-end/89663 (ICE in expand_builtin_int_roundingfn_2, at builtins.c:2831)
Backported from mainline
	2019-03-12  Jakub Jelinek  <jakub@redhat.com>

	PR middle-end/89663
	* builtins.c (expand_builtin_int_roundingfn,
	expand_builtin_int_roundingfn_2): Return NULL_RTX instead of
	gcc_unreachable if validate_arglist fails.

	* gcc.c-torture/compile/pr89663-1.c: New test.
	* gcc.c-torture/compile/pr89663-2.c: New test.

From-SVN: r275128
2019-08-30 14:16:43 +02:00
Jakub Jelinek 5a9111961c backport: re PR fortran/89651 (OpenMP private array uninitialized warning with -O flag)
Backported from mainline
	2019-03-11  Jakub Jelinek  <jakub@redhat.com>

	PR fortran/89651
	* trans-openmp.c (gfc_omp_clause_default_ctor): Set TREE_NO_WARNING
	on decl if adding COND_EXPR for allocatable.
	(gfc_omp_clause_copy_ctor): Set TREE_NO_WARNING on dest.

	* gfortran.dg/gomp/pr89651.f90: New test.

From-SVN: r275127
2019-08-30 14:15:50 +02:00
Jakub Jelinek a881d03a67 backport: re PR c/88568 ('dllimport' no longer implies 'extern' in C)
Backported from mainline
	2019-03-09  Jakub Jelinek  <jakub@redhat.com>

	PR c/88568
	* tree.c (handle_dll_attribute): Don't clear TREE_STATIC for
	dllimport on VAR_DECLs with RECORD_TYPE or UNION_TYPE DECL_CONTEXT.

	* g++.dg/other/pr88568.C: New test.

From-SVN: r275126
2019-08-30 14:14:46 +02:00
Jakub Jelinek c349eb3a4e backport: re PR c++/82075 (structured binding fails with empty base class)
Backported from mainline
	2019-03-08  Jakub Jelinek  <jakub@redhat.com>

	PR c++/82075
	* g++.dg/cpp1z/decomp49.C: New test.

From-SVN: r275125
2019-08-30 14:14:10 +02:00
Jakub Jelinek ffe2051bba backport: re PR c++/87148 (backward compatibility issue to take char [] as incomplete type)
Backported from mainline
	2019-03-06  Jakub Jelinek  <jakub@redhat.com>

	PR c++/87148
	* init.c (build_value_init_noctor): Ignore flexible array members.

	* g++.dg/ext/flexary34.C: New test.

From-SVN: r275124
2019-08-30 14:13:40 +02:00
Jakub Jelinek bc36366b46 backport: re PR target/89587 (gcc's rs6000 configuration unconditionally sets MULTIARCH_DIRNAME, even when multiarch is disabled)
Backported from mainline
	2019-03-05  Jakub Jelinek  <jakub@redhat.com>

	PR target/89587
	* config/rs6000/t-linux (MULTIARCH_DIRNAME): Set to non-empty only
	if_multiarch.

From-SVN: r275123
2019-08-30 14:12:56 +02:00
Jakub Jelinek 32ef027313 backport: re PR middle-end/89590 (ICE in maybe_emit_free_warning)
Backported from mainline
	2019-03-05  Jakub Jelinek  <jakub@redhat.com>

	PR middle-end/89590
	* builtins.c (maybe_emit_free_warning): Punt if free doesn't have
	exactly one argument.

	* gcc.dg/pr89590.c: New test.

From-SVN: r275122
2019-08-30 14:12:24 +02:00
Jakub Jelinek 920647ea41 backport: re PR c/89521 (ICE in expand_builtin_int_roundingfn, at builtins.c:2697)
Backported from mainline
	2019-02-28  Jakub Jelinek  <jakub@redhat.com>

	PR c/89521
	* gcc.dg/pr89521-1.c: New test.
	* gcc.dg/pr89521-2.c: New test.

From-SVN: r275121
2019-08-30 14:11:38 +02:00
Jakub Jelinek 6921a7ba09 backport: re PR c/89520 (ICE tree check: accessed operand 4 of call_expr with 3 operands in convert_to_integer_1, at convert.c:668)
Backported from mainline
	2019-02-28  Jakub Jelinek  <jakub@redhat.com>

	PR c/89520
	* convert.c (convert_to_real_1, convert_to_integer_1): Punt for
	builtins if they don't have a single scalar floating point argument.
	Formatting fixes.

	* gcc.dg/pr89520-1.c: New test.
	* gcc.dg/pr89520-2.c: New test.

From-SVN: r275120
2019-08-30 14:11:06 +02:00
Jakub Jelinek f40240efc5 backport: re PR c++/89403 (ICE in maybe_clone_body, at cp/optimize.c:693)
Backported from mainline
	2019-02-20  Jakub Jelinek  <jakub@redhat.com>

	PR c++/89403
	* decl2.c (c_parse_final_cleanups): Move TREE_ASM_WRITTEN setting
	for flag_syntax_only from here...
	* semantics.c (expand_or_defer_fn_1): ... here.

	* g++.dg/cpp0x/pr89403.C: New test.

From-SVN: r275119
2019-08-30 14:10:10 +02:00
Jakub Jelinek 9f2c4b6fe0 backport: re PR middle-end/89412 (gcc ICE in simplify_subreg, at simplify-rtx.c:6273 on i686-linux-gnu)
Backported from mainline
	2019-02-20  Jakub Jelinek  <jakub@redhat.com>

	PR middle-end/89412
	* expr.c (expand_assignment): If result is a MEM, use change_address
	instead of simplify_gen_subreg.

	* gcc.c-torture/compile/pr89412.c: New test.

From-SVN: r275118
2019-08-30 14:08:46 +02:00
Jakub Jelinek 752b667e80 backport: re PR middle-end/89091 (ICE: Segmentation fault (in tree_class_check))
Backported from mainline
	2019-02-20  Jakub Jelinek  <jakub@redhat.com>
		    David Malcolm  <dmalcolm@redhat.com>

	PR middle-end/89091
	* fold-const.c (decode_field_reference): Return NULL_TREE if
	lang_hooks.types.type_for_size returns NULL.  Check it before
	overwriting *exp_.  Use return NULL_TREE instead of return 0.

	* gcc.dg/torture/pr89091.c: New test.

From-SVN: r275117
2019-08-30 14:08:04 +02:00
Jakub Jelinek 20a5373742 backport: re PR tree-optimization/88074 (g++ hangs on math expression)
Backported from mainline
	2019-02-20  Jakub Jelinek  <jakub@redhat.com>

	PR middle-end/88074
	PR middle-end/89415
	* toplev.c (do_compile): Double the emin/emax exponents to workaround
	buggy mpc_norm.

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

        PR middle-end/88074
	* toplev.c (do_compile): Initialize mpfr's exponent range
	based on available float modes.

	2019-02-20  Jakub Jelinek  <jakub@redhat.com>

	PR middle-end/88074
	PR middle-end/89415
	* gcc.dg/pr88074-2.c: New test.

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

        PR middle-end/88074
	* gcc.dg/pr88074.c: New testcase.

From-SVN: r275116
2019-08-30 14:07:12 +02:00
Jakub Jelinek 75d9a171c9 backport: re PR target/89361 (s390 broken without S390_USE_TARGET_ATTRIBUTE, likely since r257489)
Backported from mainline
	2019-02-18  Jakub Jelinek  <jakub@redhat.com>
 
	PR target/89361
	* config/s390/s390.c (s390_indirect_branch_attrvalue,
	s390_indirect_branch_settings): Define unconditionally.
	(s390_set_current_function): Likewise, but guard the whole body except
	the s390_indirect_branch_settings call with
	#if S390_USE_TARGET_ATTRIBUTE.
	(TARGET_SET_CURRENT_FUNCTION): Redefine unconditionally.

From-SVN: r275115
2019-08-30 14:05:07 +02:00
Jakub Jelinek 10868b44bd backport: re PR middle-end/89303 (memory leak with shared_ptr and enable_shared_from_this)
Backported from mainline
	2019-02-19  Jakub Jelinek  <jakub@redhat.com>

	PR middle-end/89303
	* g++.dg/torture/pr89303.C: Move everything from std namespace to my
	namespace.

From-SVN: r275114
2019-08-30 14:02:30 +02:00
Jakub Jelinek b84dee85b9 backport: re PR tree-optimization/89278 (ICE in gimplify_modify_expr, at gimplify.c:5821)
Backported from mainline
	2019-02-15  Richard Biener  <rguenther@suse.de>
		    Jakub Jelinek  <jakub@redhat.com>

	PR tree-optimization/89278
	* tree-loop-distribution.c: Include tree-eh.h.
	(generate_memset_builtin, generate_memcpy_builtin): Call
	rewrite_to_non_trapping_overflow on builtin->size before passing it
	to force_gimple_operand_gsi.

	* gcc.dg/pr89278.c: New test.

From-SVN: r275113
2019-08-30 14:02:02 +02:00
Jakub Jelinek 901cdebac4 backport: re PR other/89342 (ICE in maybe_default_option, at opts.c:347)
Backported from mainline
	2019-02-15  Jakub Jelinek  <jakub@redhat.com>

	PR other/89342
	* optc-save-gen.awk: Handle optimize_fast like optimize_size or
	optimize_debug.
	* opth-gen.awk: Likewise.

	* gcc.dg/pr89342.c: New test.

From-SVN: r275112
2019-08-30 14:01:02 +02:00
Jakub Jelinek 983b120124 backport: re PR rtl-optimization/89354 (Combine pass yields wrong code with -O2 and -msse2 for 32bit target)
Backported from mainline
	2019-02-14  Jakub Jelinek  <jakub@redhat.com>

	PR rtl-optimization/89354
	* combine.c (make_extraction): Punt if extraction_mode is narrower
	than len bits.

	* gcc.dg/pr89354.c: New test.

From-SVN: r275111
2019-08-30 13:59:10 +02:00
Jakub Jelinek ec97cf390e backport: re PR tree-optimization/89314 (ICE in wide_int_to_tree_1, at tree.c:1561)
Backported from mainline
	2019-02-14  Jakub Jelinek  <jakub@redhat.com>

	PR tree-optimization/89314
	* fold-const.c (fold_binary_loc): Cast strlen argument to
	const char * before dereferencing it.  Formatting fixes.

	* gcc.dg/pr89314.c: New test.

From-SVN: r275110
2019-08-30 13:52:29 +02:00
Jakub Jelinek 2fe18111fa backport: re PR middle-end/89303 (memory leak with shared_ptr and enable_shared_from_this)
Backported from mainline
	2019-02-13  Jakub Jelinek  <jakub@redhat.com>

	PR middle-end/89303
	* tree-ssa-structalias.c (set_uids_in_ptset): Or in vi->is_heap_var
	into pt->vars_contains_escaped_heap instead of setting
	pt->vars_contains_escaped_heap to it.

	2019-02-13  Jonathan Wakely  <jwakely@redhat.com>
		    Jakub Jelinek  <jakub@redhat.com>

	PR middle-end/89303
	* g++.dg/torture/pr89303.C: New test.

From-SVN: r275109
2019-08-30 13:51:36 +02:00
Jakub Jelinek 7595616309 backport: re PR middle-end/89281 (gcc/optabs.c:3901:30: runtime error: shift exponent 32 is too large for 32-bit type 'int')
Backported from mainline
	2019-02-13  Jakub Jelinek  <jakub@redhat.com>

	PR middle-end/89281
	* optabs.c (prepare_cmp_insn): Use UINTVAL (size) instead of
	INTVAL (size), compare it to GET_MODE_MASK instead of
	1 << GET_MODE_BITSIZE.

From-SVN: r275108
2019-08-30 13:50:35 +02:00
Jakub Jelinek 6695f27e93 backport: re PR middle-end/89246 (LTO produces references to cloned symbols which the compiler failed to clone)
Backported from mainline
	2019-02-09  Jakub Jelinek  <jakub@redhat.com>

	PR middle-end/89246
	* config/i386/i386.c (ix86_simd_clone_compute_vecsize_and_simdlen):
	If !node->definition and TYPE_ARG_TYPES is non-NULL, use
	TYPE_ARG_TYPES instead of DECL_ARGUMENTS.

	* gcc.dg/gomp/pr89246-1.c: New test.
	* gcc.dg/gomp/pr89246-2.c: New test.

From-SVN: r275107
2019-08-30 13:50:04 +02:00
Jakub Jelinek 2317cf064a backport: re PR target/88861 (ICE in calc_dfs_tree, at dominance.c:458)
Backported from mainline
	2019-01-16  David Malcolm  <dmalcolm@redhat.com>

	PR target/88861
	* combine.c (delete_noop_moves): Convert to "bool" return,
	returning true if any edges are eliminated.
	(combine_instructions): Also return true if delete_noop_moves
	returns true.

	* g++.dg/opt/pr89188.C: Include ../torture/pr88861.C.

	2019-01-16  David Malcolm  <dmalcolm@redhat.com>

	PR target/88861
	* g++.dg/torture/pr88861.C: New test.

From-SVN: r275106
2019-08-30 13:49:11 +02:00
Jakub Jelinek 046d004057 backport: re PR rtl-optimization/89234 (ICE in get_eh_region_and_lp_from_rtx at gcc/except.c:1824)
Backported from mainline
	2019-02-08  Jakub Jelinek  <jakub@redhat.com>

	PR rtl-optimization/89234
	* except.c (copy_reg_eh_region_note_forward): Return if note_or_insn
	is a NOTE, CODE_LABEL etc. - rtx_insn * other than INSN_P.
	(copy_reg_eh_region_note_backward): Likewise.

	* g++.dg/ubsan/pr89234.C: New test.

From-SVN: r275105
2019-08-30 13:46:29 +02:00
Jakub Jelinek 12f1ae47de backport: re PR c++/89187 (ICE in initialize_argument_information, at calls.c:2023)
Backported from mainline
	2019-02-05  Jakub Jelinek  <jakub@redhat.com>

	PR c++/89187
	* optimize.c (maybe_thunk_body): Clear TREE_ADDRESSABLE on
	PARM_DECLs of the thunk.
	* lambda.c (maybe_add_lambda_conv_op): Likewise.

	* g++.dg/opt/pr89187.C: New test.

From-SVN: r275104
2019-08-30 13:43:53 +02:00
Jakub Jelinek ddb4546b61 backport: re PR rtl-optimization/11304 (Wrong code production with -fomit-frame-pointer)
Backported from mainline
	2019-02-05  Jakub Jelinek  <jakub@redhat.com>

	PR rtl-optimization/11304
	* gcc.target/i386/call-1.c (set_eax): Add "eax" clobber.
	* gcc.target/i386/call-2.c: New test.

From-SVN: r275102
2019-08-30 13:43:04 +02:00
Jakub Jelinek 034762a665 backport: re PR target/89188 (ICE in pre_and_rev_post_order_compute, at cfganal.c:1055)
Backported from mainline
	2019-02-05  Jakub Jelinek  <jakub@redhat.com>

	PR target/89188
	* dce.c (delete_unmarked_insns): Don't remove no-op moves if they
	can throw, non-call exceptions are enabled and we can't delete
	dead exceptions or alter cfg.  Set must_clean if
	delete_insn_and_edges returns true, don't set it blindly for calls.

	* g++.dg/opt/pr89188.C: New test.

From-SVN: r275101
2019-08-30 13:42:17 +02:00
Jakub Jelinek e8a5c7b370 backport: re PR rtl-optimization/89195 (Corrupted stack offset after combine)
Backported from mainline
	2019-02-05  Jakub Jelinek  <jakub@redhat.com>

	PR rtl-optimization/89195
	* combine.c (make_extraction): For MEMs, don't extract bytes outside
	of the original MEM.

	* gcc.c-torture/execute/pr89195.c: New test.

From-SVN: r275099
2019-08-30 13:38:28 +02:00
Jakub Jelinek a4bdd1e70d backport: re PR target/89186 (ICE in mark_addressable at gcc/gimple-expr.c:894 since r268138)
Backported from mainline
	2019-02-05  Jakub Jelinek  <jakub@redhat.com>

	PR target/89186
	* optabs.c (prepare_cmp_insn): Pass x and y to
	emit_block_comp_via_libcall rather than XEXP (x, 0) and XEXP (y, 0).

	* g++.dg/ext/vector36.C: New test.

From-SVN: r275098
2019-08-30 13:37:41 +02:00
Jakub Jelinek 3b24f248b6 backport: re PR middle-end/87887 (ICE in make_ssa_name_fn, at tree-ssanames.c:269)
Backported from mainline
	2019-02-02  Jakub Jelinek  <jakub@redhat.com>

	PR middle-end/87887
	* config/i386/i386.c (ix86_simd_clone_compute_vecsize_and_simdlen):
	Punt with warning on aggregate return or argument types.  Ignore
	type/mode checking for uniform arguments.

	* gcc.dg/gomp/pr87887-1.c: New test.
	* gcc.dg/gomp/pr87887-2.c: New test.

From-SVN: r275097
2019-08-30 13:36:58 +02:00
Jakub Jelinek ff4e9fafa1 backport: re PR fortran/83246 (internal compiler error or loader problem might be related to a PARAMETER statement being in a BLOCK)
Backported from mainline
	2019-02-01  Jakub Jelinek  <jakub@redhat.com>

	PR fortran/83246
	PR fortran/89084
	* trans-decl.c (generate_local_decl): Add referenced FL_PARAMETERs
	if sym->ns->construct_entities rather than if
	sym->ns->parent->code->op == EXEC_BLOCK.

	* gfortran.dg/pr89084.f90: New test.
	* gfortran.dg/lto/pr89084_0.f90: New test.
	* gfortran.dg/pr83246.f90: New test.

From-SVN: r275096
2019-08-30 13:36:10 +02:00
Jakub Jelinek 231ab4cd97 backport: re PR tree-optimization/88107 (ICE in find_outermost_region_in_block, at tree-cfg.c:7157)
Backported from mainline
	2019-02-01  Jakub Jelinek  <jakub@redhat.com>

	PR tree-optimization/88107
	* tree-cfg.c (find_outermost_region_in_block): Add ALL argument,
	instead of assertion that eh_region_outermost is non-NULL, if it
	is NULL, set *ALL to true and return NULL.
	(move_sese_region_to_fn): Adjust caller, if all is set, call
	duplicate_eh_regions with NULL region.

	* gcc.dg/gomp/pr88107.c: New test.

From-SVN: r275095
2019-08-30 13:35:08 +02:00
Jakub Jelinek 36536c8b85 backport: re PR c++/66676 (pragma omp simd aligned(x) results in "internal compiler error: Segmentation fault")
Backported from mainline
	2019-01-29  Jakub Jelinek  <jakub@redhat.com>

	PR c++/66676
	PR ipa/89104
	* omp-simd-clone.c (simd_clone_clauses_extract)
	<case OMP_CLAUSE_ALIGNED>: Ignore clauses with NULL
	OMP_CLAUSE_ALIGNED_ALIGNMENT.

	* gcc.dg/gomp/pr89104.c: New test.

From-SVN: r275094
2019-08-30 13:34:08 +02:00
Jakub Jelinek 345ef95706 backport: re PR middle-end/89002 (ICE in scan_omp_1_op, at omp-low.c:3166)
Backported from mainline
	2019-01-28  Jakub Jelinek  <jakub@redhat.com>

	PR middle-end/89002
	* gimplify.c (gimplify_omp_for): When adding OMP_CLAUSE_*_GIMPLE_SEQ
	for lastprivate/linear IV, push gimplify context around gimplify_assign
	and, if it needed any temporaries, pop it into a gimple bind around the
	sequence.

	* testsuite/libgomp.c/pr89002.c: New test.

From-SVN: r275093
2019-08-30 13:33:12 +02:00
Jakub Jelinek 5fbf518398 backport: re PR target/87214 (r263772 miscompiled 520.omnetpp_r in SPEC CPU 2017)
Backported from mainline
	2019-01-27  Jakub Jelinek  <jakub@redhat.com>

	PR target/87214
	* config/i386/sse.md
	(<mask_codefor>avx512dq_shuf_<shuffletype>64x2_1<mask_name>,
	avx512f_shuf_<shuffletype>64x2_1<mask_name>): Ensure the
	first constants in pairs are multiples of 2.  Formatting fixes.
	(avx512vl_shuf_<shuffletype>32x4_1<mask_name>,
	avx512vl_shuf_<shuffletype>32x4_1<mask_name>): Ensure the
	first constants in each quadruple are multiples of 4.  Formatting fixes.

	* gcc.target/i386/avx512vl-pr87214-1.c: New test.
	* gcc.target/i386/avx512vl-pr87214-2.c: New test.

From-SVN: r275092
2019-08-30 13:32:15 +02:00
Jakub Jelinek 419b92b720 backport: re PR c++/88976 (ICE in fold_convert_loc, at fold-const.c:2552)
Backported from mainline
	2019-01-24  Jakub Jelinek  <jakub@redhat.com>

	PR c++/88976
	* semantics.c (finish_omp_cancel): Use maybe_convert_cond when not in
	template or build_x_binary_op otherwise.

	* c-c++-common/gomp/cancel-2.c: New test.
	* gcc.dg/gomp/cancel-1.c: New test.
	* g++.dg/gomp/cancel-1.C: New test.
	* g++.dg/gomp/cancel-2.C: New test.
	* g++.dg/gomp/cancel-3.C: New test.

From-SVN: r275091
2019-08-30 13:31:02 +02:00
Jakub Jelinek fcf0c689a6 Backport PRs 49429, 49454, 86334, 88906
Backported from mainline
	2019-01-22  Jakub Jelinek  <jakub@redhat.com>

	PR rtl-optimization/49429
	PR target/49454
	PR rtl-optimization/86334
	PR target/88906
	* expr.c (emit_block_move_hints): Move marking of MEM_EXPRs
	addressable from here...
	(emit_block_op_via_libcall): ... to here.

	* gcc.target/i386/pr86334.c: New test.
	* gcc.target/i386/pr88906.c: New test.

From-SVN: r275090
2019-08-30 13:29:57 +02:00
Jakub Jelinek ee2d155f24 backport: re PR c++/88949 (ICE in expand_expr_real_1, at expr.c:10001 with -fopenmp)
Backported from mainline
	2019-01-21  Jakub Jelinek  <jakub@redhat.com>

	PR c++/88949
	* optimize.c (cxx_copy_decl): New function.
	(clone_body): Use it instead of copy_decl_no_change.

	* g++.dg/gomp/pr88949.C: New test.

From-SVN: r275089
2019-08-30 13:29:04 +02:00
Jakub Jelinek 47eab6cb44 backport: re PR fortran/88902 (ICE: Segmentation fault (in DFS::DFS_write_tree_body))
Backported from mainline
	2019-01-19  Jakub Jelinek  <jakub@redhat.com>

	PR fortran/88902
	* trans-decl.c (gfc_get_symbol_decl): Don't add length to function
	or parent function if it has been added there already.

	* gfortran.dg/pr88902.f90: New test.

From-SVN: r275088
2019-08-30 13:28:22 +02:00
Jakub Jelinek fec06b67af backport: re PR rtl-optimization/88870 (ICE: Segmentation fault (in df_worklist_propagate_backward))
Backported from mainline
	2019-01-17  Jakub Jelinek  <jakub@redhat.com>

	PR rtl-optimization/88870
	* dce.c (deletable_insn_p): Never delete const/pure calls that can
	throw if we can't alter the cfg or delete dead exceptions.
	(mark_insn): Don't call find_call_stack_args for such calls.

	* gcc.dg/pr88870.c: New test.

From-SVN: r275087
2019-08-30 13:27:33 +02:00
Jakub Jelinek 190a7b0624 backport: re PR c/88568 ('dllimport' no longer implies 'extern' in C)
Backported from mainline
	2019-01-10  Jakub Jelinek  <jakub@redhat.com>

	PR c/88568
	* tree.c (handle_dll_attribute): Clear TREE_STATIC after setting
	DECL_EXTERNAL.

	* gcc.dg/pr88568.c: New test.

From-SVN: r275086
2019-08-30 13:26:42 +02:00
Jakub Jelinek caef3d1cbd backport: re PR middle-end/82564 (ICE at -O1 and above: in assign_stack_temp_for_type, at function.c:783)
Backported from mainline
	2019-01-05  Jakub Jelinek  <jakub@redhat.com>

	PR middle-end/82564
	PR target/88620
	* expr.c (expand_assignment): For calls returning VLA structures
	if to_rtx is not a MEM, force it into a stack temporary.

	* gcc.dg/nested-func-12.c: New test.
	* gcc.c-torture/compile/pr82564.c: New test.

From-SVN: r275085
2019-08-30 13:26:01 +02:00
Jakub Jelinek f0ea2c335a backport: re PR target/88594 (ICE in int_mode_for_mode, at stor-layout.c:403)
Backported from mainline
	2019-01-04  Jakub Jelinek  <jakub@redhat.com>

	PR target/88594
	* config/i386/i386.c (ix86_expand_divmod_libfunc): Use mode instead
	of GET_MODE (opN) as modes of the libcall arguments.

	* gcc.dg/pr88594.c: New test.

From-SVN: r275084
2019-08-30 13:25:16 +02:00
Jakub Jelinek c14f4d769a backport: re PR debug/88644 (Unexpected pub type info eliminated after r246973 (causes pubtypes-*.c to regress).)
Backported from mainline
	2019-01-03  Jakub Jelinek  <jakub@redhat.com>

	PR debug/88644
	* dwarf2out.c (modified_type_die): If type is equal to sizetype,
	change it to qualified_type.

	* gcc.dg/debug/dwarf2/pr88644.c: New test.

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

	* gcc.dg/pubtypes-2.c: Adjust expected pubtypes length.
	* gcc.dg/pubtypes-3.c: Likewise.
	* gcc.dg/pubtypes-4.c: Likewise.

From-SVN: r275083
2019-08-30 13:24:34 +02:00
Jakub Jelinek 81b669729b backport: re PR middle-end/85594 (ICE during expand when compiling with -fwrapv -fopenmp)
Backported from mainline
	2018-12-21  Jakub Jelinek  <jakub@redhat.com>

	PR middle-end/85594
	PR middle-end/88553
	* omp-expand.c (extract_omp_for_update_vars): Regimplify the condition
	if needed.
	(expand_omp_for_generic): Don't clobber t temporary for ordered loops.

	* gcc.dg/gomp/pr85594.c: New test.
	* gcc.dg/gomp/pr88553.c: New test.

From-SVN: r275082
2019-08-30 13:23:16 +02:00
Jakub Jelinek 8d1d869964 backport: re PR rtl-optimization/88563 (wrong code with -O2 -fno-code-hoisting -fno-tree-ccp -fno-tree-dominator-opts -fno-tree-forwprop -fno-tree-fre -fno-tree-pre -fno-tree-vrp)
Backported from mainline
	2018-12-21  Jakub Jelinek  <jakub@redhat.com>

	PR rtl-optimization/88563
	* expr.c (expand_expr_real_2) <case WIDEN_MULT_EXPR>: Swap innermode
	and mode arguments to convert_modes.  Likewise swap mode and word_mode
	arguments.  Handle both arguments with VOIDmode before convert_modes
	of one of them.  Formatting fixes.

	* gcc.dg/pr88563.c: New test.

From-SVN: r275081
2019-08-30 13:22:27 +02:00
Jakub Jelinek 7ff105fdae backport: re PR rtl-optimization/88470 (ICE in maybe_record_trace_start, at dwarf2cfi.c:2354)
Backported from mainline
	2018-12-13  Jakub Jelinek  <jakub@redhat.com>

	PR rtl-optimization/88470
	* cfgcleanup.c (outgoing_edges_match): If the function is
	shrink-wrapped and bb1 ends with a JUMP_INSN with a single fake
	edge to EXIT, return false.

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

From-SVN: r275080
2019-08-30 13:21:45 +02:00
Jakub Jelinek 4cdad636dd backport: re PR rtl-optimization/88416 (ICE in in df_uses_record, at df-scan.c:3013)
Backported from mainline
	2018-12-13  Jakub Jelinek  <jakub@redhat.com>

	PR rtl-optimization/88416
	* valtrack.c (cleanup_auto_inc_dec): Handle pre/post-inc/dec/modify
	even if !AUTO_INC_DEC.

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

From-SVN: r275079
2019-08-30 13:20:47 +02:00
Jakub Jelinek 67747d8355 backport: re PR c++/86669 (Complete object constructor clone omits length for a c++11 braced initialiser)
Backported from mainline
	2018-12-07  Jakub Jelinek  <jakub@redhat.com>

	PR c++/86669
	* call.c (make_temporary_var_for_ref_to_temp): Call pushdecl even for
	automatic vars.

	* g++.dg/cpp0x/initlist105.C: New test.
	* g++.dg/cpp0x/initlist106.C: New test.
	* g++.dg/other/pr86669.C: New test.

From-SVN: r275078
2019-08-30 13:20:08 +02:00
Jakub Jelinek 19dfbd5380 backport: re PR target/85593 (GCC on ARM allocates R3 for local variable when calling naked function with O2 optimizations enabled)
Backported from mainline
	2018-12-07  Jakub Jelinek  <jakub@redhat.com>

	PR target/85593
	* final.c (rest_of_handle_final): Don't call collect_fn_hard_reg_usage
	for functions with naked attribute.

From-SVN: r275077
2019-08-30 13:19:17 +02:00
Jakub Jelinek 42aed577cf backport: re PR fortran/88377 (ICE in gfc_omp_clause_copy_ctor, at fortran/trans-openmp.c:614)
Backported from mainline
	2018-12-07  Jakub Jelinek  <jakub@redhat.com>

	PR fortran/88377
	* trans-openmp.c (gfc_omp_clause_default_ctor,
	gfc_omp_clause_copy_ctor, gfc_omp_clause_assign_op,
	gfc_omp_clause_linear_ctor, gfc_omp_clause_dtor): Only consider
	GFC_DECL_GET_SCALAR_ALLOCATABLE vars as scalar allocatables if they
	have pointer type.

	* gfortran.dg/gomp/pr88377.f90: New test.

From-SVN: r275076
2019-08-30 13:18:41 +02:00
Jakub Jelinek cc1f52a224 backport: re PR c++/87506 (ICE with inherited constexpr constructor with const argument)
Backported from mainline
	2018-12-07  Jakub Jelinek  <jakub@redhat.com>

	PR c++/87506
	* constexpr.c (adjust_temp_type): Handle EMPTY_CLASS_EXPR.

	* g++.dg/cpp0x/constexpr-87506.C: New test.

From-SVN: r275075
2019-08-30 13:17:41 +02:00
Jakub Jelinek 14ffeb1c37 backport: re PR c++/88103 (Wrong value category when conditional expression result is used as object expression)
Backported from mainline
	2018-12-04  Jakub Jelinek  <jakub@redhat.com>

	PR c++/88103
	* typeck.c (build_class_member_access_expr): If unary_complex_lvalue
	turned xvalue_p into non-xvalue_p, call move on it.

	* g++.dg/cpp0x/rv-cond3.C: New test.

From-SVN: r275074
2019-08-30 13:16:55 +02:00
Jakub Jelinek ee9212971f backport: re PR tree-optimization/71109 (gcc ICE at -O3 on valid code on x86_64-linux-gnu in "maybe_record_trace_start")
Backported from mainline
	2018-12-03  Jakub Jelinek  <jakub@redhat.com>

	PR tree-optimization/71109
	* gcc.c-torture/compile/pr71109.c: New test.

From-SVN: r275073
2019-08-30 13:16:10 +02:00
Jakub Jelinek 8f674ddf82 backport: re PR debug/85550 (-fdebug-types-section broken with DW_OP_addr in DW_AT_location)
Backported from mainline
	2018-11-30  Jakub Jelinek  <jakub@redhat.com>

	PR debug/85550
	* g++.dg/debug/dwarf2/pr85550.C: New test.

From-SVN: r275072
2019-08-30 13:15:39 +02:00
Jakub Jelinek 17981e7baa backport: re PR c++/88181 (ICE: verify_type failed (error: type variant differs by TYPE_PACKED))
Backported from mainline
	2018-11-27  Jakub Jelinek  <jakub@redhat.com>

	PR c++/88181
	* class.c (fixup_attribute_variants): Also propagate TYPE_PACKED
	to variants.

	* g++.dg/debug/pr88181.C: New test.

From-SVN: r275071
2019-08-30 13:14:56 +02:00
Jakub Jelinek 5ba94a17e7 backport: re PR tree-optimization/87895 (ICE in purge_dead_edges, at cfgrtl.c:3246)
Backported from mainline
	2018-11-20  Jakub Jelinek  <jakub@redhat.com>

	PR tree-optimization/87895
	* omp-simd-clone.c (ipa_simd_modify_function_body): When removing
	or replacing GIMPLE_RETURN, set EDGE_FALLTHRU on the edge to EXIT.
	(simd_clone_adjust): Don't set EDGE_FALLTHRU here. In a loop that
	redirects edges to EXIT to edges to incr_bb, iterate while EXIT
	has any preds and always use EDGE_PRED (, 0).

	* gcc.dg/gomp/pr87895-1.c: New test.
	* gcc.dg/gomp/pr87895-2.c: New test.
	* gcc.dg/gomp/pr87895-3.c: New test.

From-SVN: r275070
2019-08-30 13:12:23 +02:00
Jakub Jelinek d690951022 backport: re PR c++/60994 (gcc does not recognize hidden/shadowed enumeration as valid nested-name-specifier)
Backported from mainline
	2018-11-19  Jakub Jelinek  <jakub@redhat.com>

	PR c++/60994
	* g++.dg/lookup/pr60994.C: New test.

From-SVN: r275068
2019-08-30 13:09:57 +02:00
Jakub Jelinek 1d58d86b20 backport: re PR fortran/87725 (OpenMP 4.5 clause schedule(simd,monotonic:static) not understood)
Backported from mainline
	2018-10-25  Jakub Jelinek  <jakub@redhat.com>

	PR fortran/87725
	* openmp.c (gfc_match_omp_clauses): Parse simd, monotonic and
	nonmonotonic modifiers regardless of if they have been parsed
	already or if the opposite one has.  Fix up check whether
	comma after modifier should be parsed.
	(resolve_omp_clauses): Diagnose schedule modifier restrictions.

	* c-c++-common/gomp/schedule-modifiers-1.c (bar): Separate modifier
	from kind with a colon rather than comma.
	* gfortran.dg/gomp/schedule-modifiers-1.f90: New test.
	* gfortran.dg/gomp/schedule-modifiers-2.f90: New test.

From-SVN: r275067
2019-08-30 13:09:22 +02:00
Jakub Jelinek 20940c0e02 backport: re PR middle-end/87647 (ICE on valid code in decode_addr_const, at varasm.c:2958)
Backported from mainline
	2018-10-20  Jakub Jelinek  <jakub@redhat.com>

	PR middle-end/87647
	* varasm.c (decode_addr_const): Handle COMPOUND_LITERAL_EXPR.

	* gcc.c-torture/compile/pr87647.c: New test.

From-SVN: r275066
2019-08-30 13:08:10 +02:00
Jakub Jelinek 6e56fdebe6 backport: re PR middle-end/85488 (segmentation fault when compiling code using the ordered(n) clause in OpenMP 4.5)
Backported from mainline
	2018-10-19  Jakub Jelinek  <jakub@redhat.com>

	PR middle-end/85488
	PR middle-end/87649
	* omp-low.c (check_omp_nesting_restrictions): Diagnose ordered without
	depend closely nested inside of loop with ordered clause with
	a parameter.

	* c-c++-common/gomp/doacross-2.c: New test.
	* c-c++-common/gomp/sink-3.c: Expect another error during error
	recovery.

From-SVN: r275065
2019-08-30 13:07:22 +02:00
GCC Administrator b62c170e60 Daily bump.
From-SVN: r275056
2019-08-30 00:16:05 +00:00
GCC Administrator 1696db918c Daily bump.
From-SVN: r275018
2019-08-29 00:16:05 +00:00
GCC Administrator d170a707c8 Daily bump.
From-SVN: r274977
2019-08-28 00:16:05 +00:00
GCC Administrator 2dbfc8c9db Daily bump.
From-SVN: r274941
2019-08-27 00:16:13 +00:00
GCC Administrator 19e0fef1d5 Daily bump.
From-SVN: r274916
2019-08-26 00:16:09 +00:00
Uros Bizjak dcccb54b91 re PR target/91533 (abs pattern generates MMX instructions but fails to call EMMS)
PR target/91533
	Backport from mainline
	2019-06-30  Uroš Bizjak  <ubizjak@gmail.com>

	* config/i386/sse.md (ssse3_abs<mode>2): Rename from abs<mode>2.
	* config/i386/i386-builtin.def (__builtin_ia32_pabsb):
	Use CODE_FOR_ssse3_absv8qi2.
	(__builtin_ia32_pabsw): Use CODE_FOR_ssse3_absv4hi2.
	(__builtin_ia32_pabsd): Use CODE_FOR_ssse3_absv2si2.

From-SVN: r274914
2019-08-25 21:51:45 +02:00
GCC Administrator 84fc2e352d Daily bump.
From-SVN: r274904
2019-08-25 00:16:29 +00:00
GCC Administrator 98828017cc Daily bump.
From-SVN: r274895
2019-08-24 00:16:23 +00:00
GCC Administrator 14d944c028 Daily bump.
From-SVN: r274840
2019-08-23 00:16:34 +00:00
GCC Administrator 95f55ecec3 Daily bump.
From-SVN: r274813
2019-08-22 00:16:05 +00:00
Richard Biener af7b538019 re PR tree-optimization/91510 (r253207 fixed a wrong-code bug)
2019-08-21  Richard Biener  <rguenther@suse.de>

	PR tree-optimization/91510
	Backport from mainline
	2017-09-26  Martin Jambor  <mjambor@suse.cz>

	* tree-sra.c (compare_access_positions): Put integral types first,
	stabilize sorting of integral types, remove conditions putting
	non-full-precision integers last.
	(sort_and_splice_var_accesses): Disable scalarization if a
	non-integert would be represented by a non-full-precision integer.

From-SVN: r274798
2019-08-21 13:44:45 +00:00
GCC Administrator 6e4d3a51c3 Daily bump.
From-SVN: r274760
2019-08-21 00:16:05 +00:00
Eric Botcazou 21f952df3a * gcc.c-torture/execute/20190820-1.c: Fix typos.
From-SVN: r274713
2019-08-20 09:22:32 +00:00
Eric Botcazou 181cb4095f * gcc.c-torture/execute/20190820-1.c: Do not use attribute noipa.
From-SVN: r274712
2019-08-20 09:21:28 +00:00
Eric Botcazou f146d69ec2 re PR rtl-optimization/91347 (hppa: wrong code generated with tail call optimisation)
PR rtl-optimization/91347
	* dse.c (scan_insn): Call add_wild_read for non-const/memset tail calls
	before reload if HARD_FRAME_POINTER_IS_ARG_POINTER.

From-SVN: r274711
2019-08-20 09:17:04 +00:00
GCC Administrator e8ee5a5166 Daily bump.
From-SVN: r274686
2019-08-20 00:16:05 +00:00
GCC Administrator 3cd059781f Daily bump.
From-SVN: r274626
2019-08-19 00:16:05 +00:00
GCC Administrator 7626963e24 Daily bump.
From-SVN: r274615
2019-08-18 00:16:06 +00:00
GCC Administrator 2b8c717a45 Daily bump.
From-SVN: r274592
2019-08-17 00:16:05 +00:00
Uros Bizjak fc64d8d60f test_summary: Do not escape "=".
* test_summary: Do not escape "=".

From-SVN: r274568
2019-08-16 14:08:27 +02:00
GCC Administrator 7a9eb58858 Daily bump.
From-SVN: r274552
2019-08-16 00:16:05 +00:00
GCC Administrator 2532dbb46c Daily bump.
From-SVN: r274498
2019-08-15 00:16:12 +00:00
GCC Administrator 05b9bad948 Daily bump.
From-SVN: r274407
2019-08-14 00:16:08 +00:00
GCC Administrator 78ad0dba3f Daily bump.
From-SVN: r274324
2019-08-13 00:16:04 +00:00
GCC Administrator 4e5f12397e Daily bump.
From-SVN: r274269
2019-08-12 00:16:13 +00:00
GCC Administrator 9e3a3bdc87 Daily bump.
From-SVN: r274258
2019-08-11 00:16:09 +00:00
GCC Administrator ab1f5bde48 Daily bump.
From-SVN: r274245
2019-08-10 00:16:07 +00:00
GCC Administrator b5b029b833 Daily bump.
From-SVN: r274221
2019-08-09 00:16:04 +00:00
GCC Administrator 4198ea7113 Daily bump.
From-SVN: r274202
2019-08-08 00:16:05 +00:00
GCC Administrator 5c05399efd Daily bump.
From-SVN: r274152
2019-08-07 00:16:10 +00:00
GCC Administrator b0f71fda75 Daily bump.
From-SVN: r274131
2019-08-06 00:16:05 +00:00
GCC Administrator 2aad163f47 Daily bump.
From-SVN: r274100
2019-08-05 00:16:10 +00:00
GCC Administrator 14b9471d28 Daily bump.
From-SVN: r274051
2019-08-04 00:16:04 +00:00
Thomas Koenig 242f918fff backport: re PR fortran/90786 (ICE on procedure pointer assignment to function with class pointer result)
2019-08-03  Thomas Koenig  <tkoenig@gcc.gnu.org>
	Paul Thomas <pault@gcc.gnu.org>

	Backport from trunk
	PR fortran/90786
	PR fortran/90813
	* trans-expr.c (pointer_assignment_is_proc_pointer) Remove as
	it is very simple and only called from one place.
	(gfc_trans_pointer_assignment): Rename non_proc_pointer_assign
	as non_proc_ptr_assign. Assign to it directly, rather than call
	to above, deleted function and use gfc_expr_attr instead of
	only checking the reference chain.
	* trans-decl.c (sym_identifier): New function.
	(mangled_identifier): New function, doing most of the work
	of gfc_sym_mangled_identifier.
	(gfc_sym_mangled_identifier): Use mangled_identifier.  Add mangled
	identifier to global symbol table.
	(get_proc_pointer_decl): Use backend decl from global identifier
	if present.

2019-08-03  Thomas Koenig  <tkoenig@gcc.gnu.org>
	Paul Thomas <pault@gcc.gnu.org>

	Backport from trunk
	PR fortran/90786
	PR fortran/90813
	* gfortran.dg/proc_ptr_51.f90: New test.


Co-Authored-By: Paul Thomas <pault@gcc.gnu.org>

From-SVN: r274038
2019-08-03 11:50:39 +00:00
GCC Administrator 65352cb43c Daily bump.
From-SVN: r274034
2019-08-03 00:16:04 +00:00
GCC Administrator 319cda624f Daily bump.
From-SVN: r273990
2019-08-02 00:16:04 +00:00
GCC Administrator 8f9d8e9999 Daily bump.
From-SVN: r273957
2019-08-01 00:16:05 +00:00
GCC Administrator f580d4c76a Daily bump.
From-SVN: r273917
2019-07-31 00:16:11 +00:00
GCC Administrator 8d6ec79a14 Daily bump.
From-SVN: r273893
2019-07-30 00:16:05 +00:00
GCC Administrator eba31a20ff Daily bump.
From-SVN: r273861
2019-07-29 00:16:06 +00:00
GCC Administrator 8db20c1678 Daily bump.
From-SVN: r273847
2019-07-28 00:16:39 +00:00
GCC Administrator 889444834d Daily bump.
From-SVN: r273840
2019-07-27 00:16:16 +00:00
GCC Administrator b0c43bd066 Daily bump.
From-SVN: r273820
2019-07-26 00:16:04 +00:00
Richard Biener 7e56430617 re PR plugins/90924 (lto-plugin/lto-plugin.c heap memory corruption due to insufficient sanitization.)
2019-07-25  Richard Biener  <rguenther@suse.de>

	PR lto/90924
	Backport from mainline
	2019-07-12  Ren Kimura  <rkx1209dev@gmail.com>

	* simple-object-elf.c (simple_object_elf_match): Check zero value
	shstrndx.

From-SVN: r273795
2019-07-25 10:50:47 +00:00
GCC Administrator 7f4c2d7179 Daily bump.
From-SVN: r273779
2019-07-25 00:16:05 +00:00
GCC Administrator 9a24b925ae Daily bump.
From-SVN: r273750
2019-07-24 00:16:13 +00:00
GCC Administrator 8fa3b6aceb Daily bump.
From-SVN: r273709
2019-07-23 00:16:06 +00:00
Martin Liska b5a7b9f065 Backport r273660
2019-07-22  Martin Liska  <mliska@suse.cz>

	Backport from mainline
	2019-07-22  Martin Liska  <mliska@suse.cz>

	PR driver/91172
	* opts-common.c (decode_cmdline_option): Decode
	argument of -Werror and check it for a wrong language.
	* opts-global.c (complain_wrong_lang): Remove such case.
2019-07-22  Martin Liska  <mliska@suse.cz>

	Backport from mainline
	2019-07-22  Martin Liska  <mliska@suse.cz>

	PR driver/91172
	* gcc.dg/pr91172.c: New test.

From-SVN: r273666
2019-07-22 09:38:26 +00:00
GCC Administrator fa30b0b595 Daily bump.
From-SVN: r273653
2019-07-22 00:16:11 +00:00
GCC Administrator 2ba94df744 Daily bump.
From-SVN: r273637
2019-07-21 00:16:05 +00:00
GCC Administrator 6f7fb68233 Daily bump.
From-SVN: r273612
2019-07-20 00:16:04 +00:00
GCC Administrator e8b0e92e60 Daily bump.
From-SVN: r273587
2019-07-19 00:16:11 +00:00
GCC Administrator dfb982ac17 Daily bump.
From-SVN: r273559
2019-07-18 00:16:24 +00:00
GCC Administrator 662cb3d666 Daily bump.
From-SVN: r273538
2019-07-17 00:16:05 +00:00
Wilco Dijkstra 560c38ab99 [ARM] Fix PR89222
The GCC optimizer can generate symbols with non-zero offset from simple
if-statements. Bit zero is used for the Arm/Thumb state bit, so relocations
with offsets fail if it changes bit zero and the relocation forces bit zero
to true.  The fix is to disable offsets on function pointer symbols.  

    gcc/
	PR target/89222
	* config/arm/arm.md (movsi): Use targetm.cannot_force_const_mem
	to decide when to split off a non-zero offset from a symbol.
	* config/arm/arm.c (arm_cannot_force_const_mem): Disallow offsets
	in function symbols.

    testsuite/
	PR target/89222
	* gcc.target/arm/pr89222.c: Add new test.

From-SVN: r273527
2019-07-16 13:13:26 +00:00
GCC Administrator 4884a22c7d Daily bump.
From-SVN: r273502
2019-07-16 00:16:29 +00:00
Andreas Krebbel 5f4019044f S/390: Fix vector shift count operand
We currently use subst definitions to handle the different variants of shift
count operands. Unfortunately, in the vector shift pattern the shift count
operand is used directly. Without it being adjusted for the 'subst' variants the
displacement value is omitted resulting in a wrong shift count being applied.

This patch needs to be applied to older branches as well.

gcc/ChangeLog:

2019-07-15  Andreas Krebbel  <krebbel@linux.ibm.com>

	Backport from mainline
	2019-07-01  Andreas Krebbel  <krebbel@linux.ibm.com>

	* config/s390/vector.md: Fix shift count operand printing.

gcc/testsuite/ChangeLog:

2019-07-15  Andreas Krebbel  <krebbel@linux.ibm.com>

	Backport from mainline
	2019-07-01  Andreas Krebbel  <krebbel@linux.ibm.com>

	* gcc.target/s390/vector/vec-shift-2.c: New test.

From-SVN: r273494
2019-07-15 14:31:37 +00:00
GCC Administrator 4e0c1fdbe6 Daily bump.
From-SVN: r273485
2019-07-15 00:16:05 +00:00
GCC Administrator 92f56fec1a Daily bump.
From-SVN: r273471
2019-07-14 00:16:06 +00:00
GCC Administrator 62100726fe Daily bump.
From-SVN: r273460
2019-07-13 00:16:06 +00:00
Wilco Dijkstra bac7047654 Turn off ipa-ra in builtins test (PR91059)
The gcc.c-torture/execute/builtins/lib directory contains a reimplementation
of many C library string functions, which causes non-trivial register allocation
bugs with LTO and static linked libraries.  To fix this long-standing test issue,
turn off ipa-ra which avoids the register corruption across calls.  All builtin
torture tests now pass on aarch64-none-elf.  Committed as obvious.
See PR78529 for more details.

    testsuite/
	PR testsuite/78529
	* gcc.c-torture/execute/builtins/builtins.exp: Add -fno-ipa-ra.

From-SVN: r273453
2019-07-12 17:15:13 +00:00
Eric Botcazou e26d4208a9 re PR rtl-optimization/91136 (incorrect move of instruction to delay slot causes application crash in exception handling)
PR rtl-optimization/91136
	* df-core.c (ACCESSING REFS): Fix typos in comment.
	* resource.c (mark_target_live_reg): Add artificial defs that occur at
	the beginning of the block to the initial set of live registers.

From-SVN: r273439
2019-07-12 10:17:42 +00:00
GCC Administrator c12809273f Daily bump.
From-SVN: r273426
2019-07-12 00:16:05 +00:00
GCC Administrator d7f9f42f84 Daily bump.
From-SVN: r273372
2019-07-11 00:16:05 +00:00
GCC Administrator 6be224935c Daily bump.
From-SVN: r273318
2019-07-10 00:16:05 +00:00
GCC Administrator 29ac74f037 Daily bump.
From-SVN: r273257
2019-07-09 00:16:05 +00:00
GCC Administrator 4b22431c76 Daily bump.
From-SVN: r273187
2019-07-08 00:16:11 +00:00
GCC Administrator c49dfb05b9 Daily bump.
From-SVN: r273170
2019-07-07 00:16:10 +00:00
GCC Administrator 937a7eef0e Daily bump.
From-SVN: r273151
2019-07-06 00:16:10 +00:00
GCC Administrator fe5bcbc234 Daily bump.
From-SVN: r273097
2019-07-05 00:16:05 +00:00
GCC Administrator d4cafe05ad Daily bump.
From-SVN: r273028
2019-07-04 00:16:09 +00:00
GCC Administrator 7befb8b98a Daily bump.
From-SVN: r272950
2019-07-03 00:16:05 +00:00
GCC Administrator 6011c6b0ad Daily bump.
From-SVN: r272913
2019-07-02 00:16:04 +00:00
GCC Administrator 1dcdb4400d Daily bump.
From-SVN: r272836
2019-07-01 00:16:05 +00:00
GCC Administrator 13e710e45c Daily bump.
From-SVN: r272828
2019-06-30 00:16:07 +00:00
Eric Botcazou a5374f3737 trans.c (mark_visited_r): Set TYPE_SIZES_GIMPLIFIED on the main variant of a type, if any.
* gcc-interface/trans.c (mark_visited_r): Set TYPE_SIZES_GIMPLIFIED on
	the main variant of a type, if any.

From-SVN: r272818
2019-06-29 07:39:11 +00:00
Eric Botcazou 1fb5a6163d decl.c (set_nonaliased_component_on_array_type): Add missing guard for the presence of TYPE_CANONICAL.
* gcc-interface/decl.c (set_nonaliased_component_on_array_type): Add
	missing guard for the presence of TYPE_CANONICAL.
	(set_reverse_storage_order_on_array_type): Likewise.

From-SVN: r272814
2019-06-29 07:32:09 +00:00
GCC Administrator ead7354efa Daily bump.
From-SVN: r272805
2019-06-29 00:16:05 +00:00
Jeff Law cebf79e0ba re PR tree-optimization/90949 (null pointer check removed)
PR tree-optimization/90949
	* tree-ssa-copy.c (fini_copy_prop): Use reset_flow_sensitive_info.
	* tree-ssanames.c (reset_flow_sensitive_info): Reset non-null state.

	* gcc.c-torture/execute/pr90949.c: New test.

From-SVN: r272798
2019-06-28 15:01:56 -06:00
GCC Administrator 1e646edab2 Daily bump.
From-SVN: r272771
2019-06-28 00:16:04 +00:00
Martin Jambor 4c6899741d [PR 90939] Remove outdated assert in ipcp_bits_lattice::meet_with
2019-06-27  Martin Jambor  <mjambor@suse.cz>

	PR ipa/90939
	* ipa-cp.c (ipcp_bits_lattice::meet_with): Remove assert.

From-SVN: r272747
2019-06-27 13:26:52 +02:00
GCC Administrator d992cef5e1 Daily bump.
From-SVN: r272720
2019-06-27 00:16:04 +00:00
Jonathan Wakely 3e63f32924 PR libstdc++/90634 reduce allocations in filesystem::path construction
Backport from mainline
2019-05-28  Jonathan Wakely  <jwakely@redhat.com>

	PR libstdc++/90634
	* include/experimental/bits/fs_path.h (path::path(path&&)): Only call
	_M_split_cmpts() for a path with multiple components.
	(path::_S_is_dir_sep()): Add missing 'static' keyword to function.
	* src/filesystem/path.cc (path::_M_split_cmpts()): Count number of
	components and reserve space in vector. Return early when there is
	only one component.
	* testsuite/experimental/filesystem/path/construct/90634.cc: New test.

From-SVN: r272697
2019-06-26 16:12:15 +01:00
GCC Administrator 263426472e Daily bump.
From-SVN: r272662
2019-06-26 00:16:04 +00:00
GCC Administrator ef07709144 Daily bump.
From-SVN: r272629
2019-06-25 00:16:05 +00:00
GCC Administrator 3acb30e029 Daily bump.
From-SVN: r272610
2019-06-24 00:16:04 +00:00
GCC Administrator 3b8210f0d4 Daily bump.
From-SVN: r272596
2019-06-23 00:16:04 +00:00
GCC Administrator a0592209d6 Daily bump.
From-SVN: r272580
2019-06-22 00:16:06 +00:00
Thomas Koenig 0cce86841f backport: re PR fortran/90937 (ICE: in gfc_get_symbol_decl, at fortran/trans-decl.c:1538)
2019-06-21  Thomas Koenig  <tkoenig@gcc.gnu.org>

	Backport from trunk
	PR fortran/90937
	* trans-types.c (get_formal_from_actual_arglist): Get symbol from
	current namespace so it will be freed later.  If symbol is of type
	character, get an empty character length.

2019-06-21  Thomas Koenig  <tkoenig@gcc.gnu.org>

	Backport from trunk
	PR fortran/90937
	* gfortran.dg/external_procedure_4.f90: New test.

From-SVN: r272566
2019-06-21 19:32:23 +00:00
GCC Administrator a3b18472c2 Daily bump.
From-SVN: r272535
2019-06-21 00:16:09 +00:00
GCC Administrator 06b785235b Daily bump.
From-SVN: r272492
2019-06-20 00:16:04 +00:00
GCC Administrator 03f85f689f Daily bump.
From-SVN: r272461
2019-06-19 00:16:19 +00:00
GCC Administrator cce1ac97c4 Daily bump.
From-SVN: r272401
2019-06-18 00:16:04 +00:00
GCC Administrator 849613c014 Daily bump.
From-SVN: r272367
2019-06-17 00:16:05 +00:00
John David Anglin af2bd0c725 re PR middle-end/64242 (Longjmp expansion incorrect)
PR middle-end/64242
	* config/pa/pa.md (nonlocal_goto): Restore frame pointer last.  Add
	frame clobbers and schedule block.
	(builtin_longjmp): Likewise.

From-SVN: r272364
2019-06-16 21:49:19 +00:00
GCC Administrator 3c6af0e3c9 Daily bump.
From-SVN: r272334
2019-06-16 00:16:04 +00:00
GCC Administrator 736ed20d52 Daily bump.
From-SVN: r272315
2019-06-15 00:16:05 +00:00
GCC Administrator 0faf4d1427 Daily bump.
From-SVN: r272277
2019-06-14 00:16:05 +00:00
Thomas Koenig 14a98949af re PR fortran/90870 (new test case gfortran.dg/deferred_character_33.f90 fails)
2019-06-13  Thomas Koenig  <tkoenig@gcc.gnu.org>

    PR fortran/90870
    * gfortran.dg/deferred_character_33.f90: Remove failing test.
    * gfortran.dg/deferred_character_33a.f90: Likewise.

From-SVN: r272249
2019-06-13 17:00:22 +00:00
GCC Administrator a13ee38e9e Daily bump.
From-SVN: r272225
2019-06-13 00:16:04 +00:00
Thomas Koenig 07f8a70834 backport: re PR fortran/90744 (Bogus length for character temporaries passed to external procedures since r268992)
2019-06-12  Thomas Koenig  <tkoenig@gcc.gnu.org>
    Tomáš Trnka  <trnka@scm.com>

    Backport from trunk
    PR fortran/90744
    * trans-types.c (get_formal_from_actual_arglist): Unset typespec
    flags which make no sense for procedures without explicit
    interface.

2019-06-12  Thomas Koenig  <tkoenig@gcc.gnu.org>
    Tomáš Trnka  <trnka@scm.com>

    Backport from trunk
    PR fortran/90744
    * gfortran.dg/deferred_character_33.f90: New test.
    * gfortran.dg/deferred_character_33a.f90: New test.


Co-Authored-By: Tomáš Trnka <trnka@scm.com>

From-SVN: r272214
2019-06-12 20:08:38 +00:00
GCC Administrator f9425a119b Daily bump.
From-SVN: r272174
2019-06-12 00:16:05 +00:00
GCC Administrator 0ae25b52be Daily bump.
From-SVN: r272138
2019-06-11 00:16:05 +00:00
GCC Administrator 57e1d005c9 Daily bump.
From-SVN: r272099
2019-06-10 00:16:04 +00:00
GCC Administrator 5f9ea41efc Daily bump.
From-SVN: r272086
2019-06-09 00:16:07 +00:00
GCC Administrator 7926568bfb Daily bump.
From-SVN: r272064
2019-06-08 00:16:05 +00:00
GCC Administrator 65c3f4a944 Daily bump.
From-SVN: r272024
2019-06-07 00:16:08 +00:00
GCC Administrator bb8d6f0abb Daily bump.
From-SVN: r271979
2019-06-06 00:16:05 +00:00
GCC Administrator 44c2a9ec4e Daily bump.
From-SVN: r271941
2019-06-05 00:16:05 +00:00
Iain Sandoe a7d98a3091 Darwin, backport fix for regressed testcase.
2019-06-04  Iain Sandoe  <iain@sandoe.co.uk>

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

	* g++.dg/ext/instantiate2.C: Remove special-casing for Darwin.

From-SVN: r271925
2019-06-04 19:08:03 +00:00
GCC Administrator 60f98b5f23 Daily bump.
From-SVN: r271896
2019-06-04 00:16:05 +00:00
Iain Sandoe b49756bf04 Darwin, backport fixes for PR 89864 (with 90379 included)
2019-06-03  Iain Sandoe  <iain@sandoe.co.uk>

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

	PR bootstrap/89864
	* inclhack.def (darwin_ucred__Atomic): Do not supply test_text
	for wrap fixes.
	* fixincl.x: Regenerated.

	Backport from mainline.
	2019-04-18  Erik Schnetter  <schnetter@gmail.com>
		    Jakub Jelinek  <jakub@redhat.com>
		    Iain Sandoe  <iain@sandoe.co.uk>

	PR bootstrap/89864
	* inclhack.def (darwin_ucred__Atomic): New, work around _Atomic keyword
	use in headers included by C++.
	* fixincl.x: Regenerated.

From-SVN: r271881
2019-06-03 19:13:46 +00:00
GCC Administrator 3f70f815a3 Daily bump.
From-SVN: r271849
2019-06-03 00:16:05 +00:00
GCC Administrator e154eb8345 Daily bump.
From-SVN: r271840
2019-06-02 00:16:09 +00:00
GCC Administrator 272abffc7e Daily bump.
From-SVN: r271829
2019-06-01 00:16:05 +00:00
GCC Administrator 8398c2371b Daily bump.
From-SVN: r271792
2019-05-31 00:16:05 +00:00
GCC Administrator b8d1276df9 Daily bump.
From-SVN: r271757
2019-05-30 00:16:06 +00:00
GCC Administrator e9fbda76bd Daily bump.
From-SVN: r271723
2019-05-29 00:16:06 +00:00
Martin Liska 17d2f0bd97 Backport r270476
2019-05-28  Martin Liska  <mliska@suse.cz>

	Backport from mainline
	2019-04-20  Sandra Loosemore  <sandra@codesourcery.com>

	* g++.dg/ipa/pr89009.C: Add dg-require-effective-target fpic.

From-SVN: r271699
2019-05-28 11:55:05 +00:00
Martin Liska 63ec7ca7ef Backport r269278
2019-05-28  Martin Liska  <mliska@suse.cz>

	Backport from mainline
	2019-02-28  John David Anglin  <danglin@gcc.gnu.org>

	PR testsuite/89441
	* g++.dg/ipa/pr89009.C: Update symbol visibility.

From-SVN: r271698
2019-05-28 11:54:45 +00:00
Martin Liska 71d615bc71 Backport r268762 (test-suite)
2019-05-28  Martin Liska  <mliska@suse.cz>

	Backport from mainline
	2019-02-11  Martin Liska  <mliska@suse.cz>

	PR ipa/89009
	* g++.dg/ipa/pr89009.C: New test.

From-SVN: r271697
2019-05-28 11:54:33 +00:00
Eric Botcazou a76f56652f trans.c (walk_nesting_tree): New static function.
* gcc-interface/trans.c (walk_nesting_tree): New static function.
	(finalize_nrv): Use it to walk the entire nesting tree.

From-SVN: r271688
2019-05-28 08:09:39 +00:00
GCC Administrator c3577c2979 Daily bump.
From-SVN: r271674
2019-05-28 00:16:04 +00:00
GCC Administrator 08c9b986ad Daily bump.
From-SVN: r271641
2019-05-27 00:16:05 +00:00
GCC Administrator 277265f3ca Daily bump.
From-SVN: r271624
2019-05-26 00:16:04 +00:00
GCC Administrator a95126922c Daily bump.
From-SVN: r271615
2019-05-25 00:16:04 +00:00
John David Anglin 9ac8cee079 re PR target/90530 (Invalid SUBREG insn generated by reload)
PR target/90530
	* config/pa/pa.c (pa_cannot_change_mode_class): Accept mode changes
	from DImode to SImode in floating-point registers on 64-bit target.
	* config/pa/pa.md (umulsidi3): Change nonimmediate_operand to
	register_operand in xmpyu patterns.

From-SVN: r271614
2019-05-24 23:20:25 +00:00
GCC Administrator 64839957c7 Daily bump.
From-SVN: r271585
2019-05-24 00:16:05 +00:00
Jonathan Wakely c858c79e3a PR libstdc++/89466 avoid slow xsltproc command in configure
Certain broken versions of xsltproc ignore the --nonet option and will
attempt to fetch the docbook stylesheet from the WWW when it isn't in
the local XML catalog.

This patch checks for the local stylesheet directory first, and doesn't
use xsltproc if no local stylesheets are found. Checking for the local
directory is done using xmlcatalog if available, only checking the
hardcoded list of directories if xmlcatalog fails. The right directory
for Suse is added to the hardcoded list.

This should avoid doing an xsltproc check that would need to download
the stylesheet, so no network connection is made even if a broken
xsltproc is present.

Backport from mainline
2019-02-27  Jonathan Wakely  <jwakely@redhat.com>

	PR libstdc++/89466
	* acinclude.m4 (GLIBCXX_CONFIGURE_DOCBOOK): Reorder check for local
	stylesheet directories before check for xsltproc. Try to use
	xmlcatalog to find local stylesheet directory before trying hardcoded
	paths. Add path used by suse to hardcoded paths. Adjust xsltproc
	check to look for the same stylesheet as doc/Makefile.am uses. Don't
	use xsltproc if xmlcatalog fails to find a local stylesheet.
	* configure.ac: Check for xmlcatalog.
	* Makefile.in: Regenerate.
	* configure: Likewise.
	* doc/Makefile.in: Likewise.
	* include/Makefile.in: Likewise.
	* libsupc++/Makefile.in: Likewise.
	* po/Makefile.in: Likewise.
	* python/Makefile.in: Likewise.
	* src/Makefile.in: Likewise.
	* src/c++11/Makefile.in: Likewise.
	* src/c++17/Makefile.in: Likewise.
	* src/c++98/Makefile.in: Likewise.
	* src/filesystem/Makefile.in: Likewise.
	* testsuite/Makefile.in: Likewise.

From-SVN: r271570
2019-05-23 16:34:42 +01:00
Jonathan Wakely a0f9800cd3 PR libstdc++/88740 Print assertion messages to stderr
Backport from mainline
2019-01-22  Jonathan Wakely  <jwakely@redhat.com>

	PR libstdc++/88740
	* testsuite/util/testsuite_hooks.h [stderr] (VERIFY): Use fprintf to
	write to stderr instead of using printf.

From-SVN: r271569
2019-05-23 16:34:37 +01:00
Jonathan Wakely 610306767b Make any_cast compare typeinfo as well as function pointers
It's possible for the function pointer comparison to fail even though
the type is correct, because the function could be defined multiple
times with different addresses when shared libraries are in use.

Retain the function pointer check for the common case where the check
succeeds, but compare typeinfo (if RTTI is enabled) if the first check
fails.

Backport from mainline
2019-05-23  Jonathan Wakely  <jwakely@redhat.com>

	* include/experimental/any (__any_caster): Use RTTI if comparing
	addresses fails, to support non-unique addresses in shared libraries.
	* include/std/any (__any_caster): Likewise.
	* testsuite/experimental/any/misc/any_cast_neg.cc: Use 0 for dg-error
	line number.

From-SVN: r271566
2019-05-23 16:09:02 +01:00
Jonathan Wakely f82a8e0a73 PR libstdc++/90220 Fix any_cast for non-object types
Backport from mainline
2019-04-24  Jonathan Wakely  <jwakely@redhat.com>

	PR libstdc++/90220 (partial)
	* include/std/any (any_cast<T>(any*), any_cast<T>(const any*)): Do
	not attempt ill-formed static_cast to pointers to non-object types.
	* testsuite/20_util/any/misc/any_cast.cc: Test std::any_cast with
	function types.

Backport from mainline
2019-04-24  Jonathan Wakely  <jwakely@redhat.com>

	PR libstdc++/90220
	* include/std/any (__any_caster): Use remove_cv_t instead of decay_t.
	Avoid a runtime check for types that can never be stored in std::any.
	* testsuite/20_util/any/misc/any_cast.cc: Test std::any_cast with
	array types.

Backport from mainline
2019-05-23  Jonathan Wakely  <jwakely@redhat.com>

	PR libstdc++/90220
	* include/experimental/any (__any_caster): Constrain to only be
	callable for object types. Use remove_cv_t instead of decay_t.
	If the type decays or isn't copy constructible, compare the manager
	function to a dummy specialization.
	(__any_caster): Add overload constrained for non-object types.
	(any::_Manager_internal<_Op>): Add dummy specialization.
	* testsuite/experimental/any/misc/any_cast.cc: Test function types
	and array types.

From-SVN: r271565
2019-05-23 16:08:58 +01:00
Jonathan Wakely 7b39855ba1 Fix missing or incorrect feature test macros
Backported from mainline
2019-01-15  Jonathan Wakely  <jwakely@redhat.com>

	* doc/xml/manual/status_cxx2017.xml: Document P0032R3 and P0307R2
	status.
	* include/bits/stl_uninitialized.h (__cpp_lib_raw_memory_algorithms):
	Define.
	* include/std/any (__cpp_lib_any): Define as 201606L, because P0032R3
	changes are supported.
	* include/std/optional (__cpp_lib_optional): Likewise.
	* include/std/variant (__cpp_lib_variant): Likewise.

From-SVN: r271564
2019-05-23 16:08:52 +01:00
Uros Bizjak 3b96e89dd8 backport: re PR target/90547 (ICE in gen_lowpart_general, at rtlhooks.c:63)
Backported from mainline
	2019-05-21  Uroš Bizjak  <ubizjak@gmail.com>

	* config/i386/cpuid.h (__cpuid): For 32bit targets, zero
	%ebx and %ecx bafore calling cpuid with leaf 1 or
	non-constant leaf argument.

	2019-05-21  Uroš Bizjak  <ubizjak@gmail.com>

	PR target/90547
	* config/i386/i386.md (anddi_1 to andsi_1_zext splitter):
	Avoid calling gen_lowpart with CONST operand.

testsuite/ChangeLog:

	Backported from mainline
	2019-05-21  Uroš Bizjak  <ubizjak@gmail.com>

	PR target/90547
	* gcc.target/i386/pr90547.c: New test.

From-SVN: r271537
2019-05-23 06:55:40 +02:00
GCC Administrator 9c3bd90133 Daily bump.
From-SVN: r271531
2019-05-23 00:16:05 +00:00
GCC Administrator 68618e3ec0 Daily bump.
From-SVN: r271493
2019-05-22 00:16:05 +00:00
GCC Administrator 6befdbc28e Daily bump.
From-SVN: r271446
2019-05-21 00:16:05 +00:00
Kelvin Nilsen 6d54d9c2b6 backport: re PR middle-end/89765 (Multiple problems with vec-insert implementation on PowerPC)
gcc/ChangeLog:

2019-05-20  Kelvin Nilsen  <kelvin@gcc.gnu.org>

	Backport from mainline.
	2019-05-07  Kelvin Nilsen  <kelvin@gcc.gnu.org>

	PR target/89765
	* config/rs6000/rs6000-c.c (altivec_resolve_overloaded_builtin):
	In handling of ALTIVEC_BUILTIN_VEC_INSERT, use modular arithmetic
	to compute vector element selector for both constant and variable
	operands.

gcc/testsuite/ChangeLog:

2019-05-20  Kelvin Nilsen  <kelvin@gcc.gnu.org>

	Backport from mainline.
	2019-05-07  Kelvin Nilsen  <kelvin@gcc.gnu.org>

	PR target/89765
	* gcc.target/powerpc/pr89765-mc.c: New test.
	* gcc.target/powerpc/vsx-builtin-10c.c: New test.
	* gcc.target/powerpc/vsx-builtin-10d.c: New test.
	* gcc.target/powerpc/vsx-builtin-11c.c: New test.
	* gcc.target/powerpc/vsx-builtin-11d.c: New test.
	* gcc.target/powerpc/vsx-builtin-12c.c: New test.
	* gcc.target/powerpc/vsx-builtin-12d.c: New test.
	* gcc.target/powerpc/vsx-builtin-13c.c: New test.
	* gcc.target/powerpc/vsx-builtin-13d.c: New test.
	* gcc.target/powerpc/vsx-builtin-14c.c: New test.
	* gcc.target/powerpc/vsx-builtin-14d.c: New test.
	* gcc.target/powerpc/vsx-builtin-15c.c: New test.
	* gcc.target/powerpc/vsx-builtin-15d.c: New test.
	* gcc.target/powerpc/vsx-builtin-16c.c: New test.
	* gcc.target/powerpc/vsx-builtin-16d.c: New test.
	* gcc.target/powerpc/vsx-builtin-17c.c: New test.
	* gcc.target/powerpc/vsx-builtin-17d.c: New test.
	* gcc.target/powerpc/vsx-builtin-18c.c: New test.
	* gcc.target/powerpc/vsx-builtin-18d.c: New test.
	* gcc.target/powerpc/vsx-builtin-19c.c: New test.
	* gcc.target/powerpc/vsx-builtin-19d.c: New test.
	* gcc.target/powerpc/vsx-builtin-20c.c: New test.
	* gcc.target/powerpc/vsx-builtin-20d.c: New test.
	* gcc.target/powerpc/vsx-builtin-9c.c: New test.
	* gcc.target/powerpc/vsx-builtin-9d.c: New test.

From-SVN: r271436
2019-05-20 20:07:12 +00:00
GCC Administrator 9e1951d0de Daily bump.
From-SVN: r271391
2019-05-20 00:16:19 +00:00
Iain Sandoe 22162dc171 darwin - fix PR86215 by backporting 80556.
The backport had been missed.

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

	PR target/86215
	Backport from mainline
	2017-09-25  Iain Sandoe  <iain@codesourcery.com>

	PR target/80556
	* config/i386/darwin.h (REAL_LIB_SPEC): New; put libSystem ahead
	of libgcc_eh for m64.
	* config/i386/darwin64.h: Likewise.

From-SVN: r271381
2019-05-19 16:03:17 +00:00
GCC Administrator bf500f45fa Daily bump.
From-SVN: r271372
2019-05-19 00:16:04 +00:00
GCC Administrator 86424efca2 Daily bump.
From-SVN: r271365
2019-05-18 00:16:04 +00:00
GCC Administrator b22d9c9ee4 Daily bump.
From-SVN: r271304
2019-05-17 00:16:04 +00:00
GCC Administrator 3e12d38c04 Daily bump.
From-SVN: r271272
2019-05-16 00:16:06 +00:00
David Edelsohn 908c3c73b6 backport: re PR target/61976 (aix64: Data corruption in struct passed by value)
Backport from mainline
        2019-04-11  David Edelsohn  <dje.gcc@gmail.com>
        * xcoffout.h (xcoff_private_rodata_section_name): Declare.
        * xcoffout.c (xcoff_private_rodata_section_name): Define.
        * config/rs6000/rs6000.c (rs6000_xcoff_asm_init_sections): Create
        read_only_private_data_section using coff_private_rodata_section_name.
        (rs6000_xcoff_file_start): Generate coff_private_rodata_section_name.

        2018-12-04  David Edelsohn  <dje.gcc@gmail.com>
        2018-12-13  David Edelsohn  <dje.gcc@gmail.com>
        PR target/61976
        * config/rs6000/rs6000.c (rs6000_function_arg): Don't pass aggregates
        in FPRs on AIX. Ensure type is non-NULL.
        (rs6000_arg_partial_bytes): Same.

From-SVN: r271257
2019-05-15 13:11:31 -04:00
GCC Administrator adff581212 Daily bump.
From-SVN: r271194
2019-05-15 00:16:05 +00:00
Sebastian Huber e2de085dca [RTEMS] Change multilibs for ARM
Account for Cortex-M3 Errata 602117.  The -mfix-cortex-m3-ldrd option is
enabled by default, if -mcpu=cortex-m3 is used.

gcc/

	* config/arm/t-rtems: Replace -march=armv7-m multilibs with
	-mcpu=cortex-m3 and -mcpu=cortex-m4 multilibs.

From-SVN: r271148
2019-05-14 05:15:38 +00:00
GCC Administrator 02b00b0808 Daily bump.
From-SVN: r271141
2019-05-14 00:16:04 +00:00
Kelvin Nilsen fd00b98cf0 backport: re PR target/89424 (__builtin_vec_ext_v1ti (v, i) results in ICE with variable i (RS6000))
gcc/ChangeLog:

2019-05-13  Kelvin Nilsen  <kelvin@gcc.gnu.org>

	Backport from mainline.
	2019-05-06  Kelvin Nilsen  <kelvin@gcc.gnu.org>

	PR target/89424
	* config/rs6000/rs6000.c (rs6000_expand_vector_extract): Add
	handling of V1TImode.

gcc/testsuite/ChangeLog:

2019-05-13  Kelvin Nilsen  <kelvin@gcc.gnu.org>

	Backport from mainline.
	2019-05-06  Kelvin Nilsen  <kelvin@gcc.gnu.org>

	PR target/89424
	* gcc.target/powerpc/pr89424-0.c: New test.
	* gcc.target/powerpc/vsx-builtin-13a.c: Define macro PR89424 to
	enable testing of newly patched capability.
	* gcc.target/powerpc/vsx-builtin-13b.c: Likewise.
	* gcc.target/powerpc/vsx-builtin-20a.c: Likewise.
	* gcc.target/powerpc/vsx-builtin-20b.c: Likewise.

From-SVN: r271137
2019-05-13 21:27:29 +00:00
GCC Administrator 9fd467d364 Daily bump.
From-SVN: r271112
2019-05-13 00:16:05 +00:00
GCC Administrator 2478ee2f7c Daily bump.
From-SVN: r271102
2019-05-12 00:16:07 +00:00
GCC Administrator 046b3c8398 Daily bump.
From-SVN: r271084
2019-05-11 00:16:06 +00:00
GCC Administrator 9bb80d16ba Daily bump.
From-SVN: r271048
2019-05-10 00:16:04 +00:00
GCC Administrator 73c6551070 Daily bump.
From-SVN: r271023
2019-05-09 00:16:05 +00:00
Jonathan Wakely a2fb1fb666 PR libstdc++/90105 make forward_list::sort stable
While testing the fix I also discovered that operator== assumes the
elements are comparable with operator!= which is not required.

Backport from mainline
2019-04-17  Jonathan Wakely  <jwakely@redhat.com>

	PR libstdc++/90105
	* include/bits/forward_list.tcc (operator==): Do not use operator!= to
	compare elements.
	(forward_list<T, A>::sort(Comp)): When elements are equal take the one
	earlier in the list, so that sort is stable.
	* testsuite/23_containers/forward_list/operations/90105.cc: New test.
	* testsuite/23_containers/forward_list/comparable.cc: Test with
	types that meet the minimum EqualityComparable and LessThanComparable
	requirements. Remove irrelevant comment.

From-SVN: r271010
2019-05-08 13:17:26 +01:00
Jonathan Wakely 67bfe1e90e PR libstdc++/89629 fix _Hash_bytes for lengths > INT_MAX
Backport from mainline
2019-03-11  Jonathan Wakely  <jwakely@redhat.com>

	PR libstdc++/89629
	* libsupc++/hash_bytes.cc [__SIZEOF_SIZE_T__ == 8] (_Hash_bytes):
	Use correct type for len_aligned.
	* testsuite/20_util/hash/89629.cc: New test.

From-SVN: r271009
2019-05-08 13:17:20 +01:00
GCC Administrator b891046d97 Daily bump.
From-SVN: r270994
2019-05-08 00:16:05 +00:00
Rainer Orth 2167cab72d Fix make install-gcc-specs with empty GCC_SPECS_FILES
* gcc-interface/Makefile.in (install-gcc-specs): Use foreach.
	Honor DESTDIR.

From-SVN: r270950
2019-05-07 15:24:43 +00:00
Richard Sandiford 2121a64bb7 Fix output_constructor_bitfield handling of wide bitfields (PR89037)
The testcase was failing because we were trying to access
TREE_INT_CST_ELT (x, 1) of a 128-bit integer that was small enough
to need only a single element.

2019-05-07  Richard Sandiford  <richard.sandiford@arm.com>

gcc/
	Backport from mainline:
	2019-01-25  Richard Sandiford  <richard.sandiford@arm.com>

	PR middle-end/89037
	* varasm.c (output_constructor_bitfield): Use wi::extract_uhwi
	instead of accessing TREE_INT_CST_ELT directly.

gcc/testsuite/
	Backport from mainline:
	2019-01-25  Richard Sandiford  <richard.sandiford@arm.com>

	PR middle-end/89037
	* gcc.dg/pr89037.c: New test.

From-SVN: r270936
2019-05-07 08:49:05 +00:00
GCC Administrator 0816ebde61 Daily bump.
From-SVN: r270930
2019-05-07 00:16:11 +00:00
GCC Administrator bce20df8e4 Daily bump.
From-SVN: r270889
2019-05-06 00:16:05 +00:00
Thomas Koenig fb55065fd7 [multiple changes]
2019-05-05  Thomas Koenig  <tkoenig@gcc.gnu.org>

	PR fortran/90344
	* frontend-passes.c (create_var): Bring into sync with gcc 8.

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

	PR fortran/90344
	* gfortran.dg/pr90344.f90: New test

From-SVN: r270883
2019-05-05 14:01:51 +00:00
GCC Administrator 931b724a8b Daily bump.
From-SVN: r270878
2019-05-05 00:16:07 +00:00
GCC Administrator 8d12fb9896 Daily bump.
From-SVN: r270864
2019-05-04 00:16:05 +00:00
GCC Administrator b15df560d9 Daily bump.
From-SVN: r270828
2019-05-03 00:16:04 +00:00
GCC Administrator 50d40bcb43 Daily bump.
From-SVN: r270783
2019-05-02 00:16:05 +00:00
Ramana Radhakrishnan c9bd45d6aa [Patch AArch64] Add __ARM_FEATURE_ATOMICS
This keeps coming up repeatedly and the ACLE has finally added
__ARM_FEATURE_ATOMICS for the LSE feature in GCC. This is now part of
the latest ACLE release
(https://developer.arm.com/docs/101028/latest/5-feature-test-macros)

I know it's late for GCC-9 but this is a simple macro which need not
wait  for another year.

Ok for trunk and to backport to all release branches ?

Tested with a simple build and a smoke test.

Backport from mainline.
PR target/86538
* config/aarch64/aarch64-c.c (aarch64_update_cpp_builtins): Define
__ARM_FEATURE_ATOMICS

From-SVN: r270770
2019-05-01 15:27:40 +00:00
GCC Administrator 41e0e38b22 Daily bump.
From-SVN: r270760
2019-05-01 00:16:04 +00:00
Srinath Parvathaneni aa96a565a7 PR target/90075 Prefer bsl/bit/bif for copysignf. (backport GCC-7)
This patch is to fix the ICE caused by expand pattern of copysignf 
builtin. This is a back port to r267019 of trunk.

gcc:

2019-04-30  Srinath Parvathaneni  <srinath.parvathaneni@arm.com>

	PR target/90075
	* config/aarch64/iterators.md (V_INT_EQUIV): Add mode for
	integer equivalent of floating point values.

	Backport from mainline
	2018-12-11  Richard Earnshaw  <Richard.Earnshaw@arm.com>

	PR target/37369
	* config/aarch64/iterators.md (sizem1): Add sizes for
	SFmode and DFmode.
	(Vbtype): Add SFmode mapping.
	* config/aarch64/aarch64.md (copysigndf3, copysignsf3): Delete.
	(copysign<GPF:mode>3): New expand pattern.
	(copysign<GPF:mode>3_insn): New insn pattern.

testsuite:

2019-04-30  Srinath Parvathaneni  <srinath.parvathaneni@arm.com>

	PR target/90075
	* gcc.target/aarch64/pr90075.c: New test.

From-SVN: r270684
2019-04-30 09:31:04 +00:00
GCC Administrator ec644dcdd5 Daily bump.
From-SVN: r270669
2019-04-30 00:16:04 +00:00
GCC Administrator abfdee4953 Daily bump.
From-SVN: r270634
2019-04-29 00:16:06 +00:00
GCC Administrator ad73117fc6 Daily bump.
From-SVN: r270627
2019-04-28 00:16:05 +00:00
GCC Administrator 08bbfb94ac Daily bump.
From-SVN: r270617
2019-04-27 00:16:06 +00:00
GCC Administrator 973d40284c Daily bump.
From-SVN: r270589
2019-04-26 00:16:04 +00:00
Xiong Hu Luo 18043d5ca9 vsx-vector-6.p8.c: Fix failure caused by typo.
gcc/testsuite/ChangeLog:

2019-04-25  Xiong Hu Luo  <luoxhu@linux.ibm.com>

       * gcc.target/powerpc/vsx-vector-6.p8.c: Fix failure caused by typo.

From-SVN: r270565
2019-04-25 01:18:43 +00:00
GCC Administrator 8fbb2f40b9 Daily bump.
From-SVN: r270561
2019-04-25 00:16:04 +00:00
GCC Administrator 017284176b Daily bump.
From-SVN: r270528
2019-04-24 00:16:04 +00:00
GCC Administrator a85e3c9ff5 Daily bump.
From-SVN: r270496
2019-04-23 00:16:05 +00:00
Kelvin Nilsen 23011067ba backport: re PR target/87532 (bad results from vec_extract(unsigned char, foo) dependent upon function inline)
gcc/ChangeLog:

2019-04-22  Kelvin Nilsen  <kelvin@gcc.gnu.org>

	Backport from mainline
	2019-03-15  Kelvin Nilsen  <kelvin@gcc.gnu.org>

	PR target/87532
	* config/rs6000/rs6000-c.c (altivec_resolve_overloaded_builtin):
	When handling vec_extract, use modular arithmetic to allow
	constant selectors greater than vector length.
	* config/rs6000/rs6000.c (rs6000_expand_vector_extract): Allow
	V1TImode vectors to have constant selector values greater than 0.
	Use modular arithmetic to compute vector index.
	(rs6000_split_vec_extract_var): Use modular arithmetic to compute
	index for in-memory vectors.  Correct code generation for
	in-register vectors.  Use inner mode of vector rather than mode of
	destination for move instruction.
	(altivec_expand_vec_ext_builtin): Use modular arithmetic to
	compute index.

	2019-04-12  Kelvin Nilsen  <kelvin@gcc.gnu.org>

	PR target/87532
	* config/rs6000/vsx.md (*vsx_extract_<mode>_<VS_scalar>mode_var):
	Use QI inner mode with V16QI vector mode.

gcc/testsuite/ChangeLog:

2019-04-22  Kelvin Nilsen  <kelvin@gcc.gnu.org>

	Backport from mainline
	2019-03-15  Kelvin Nilsen  <kelvin@gcc.gnu.org>

	PR target/87532
	* gcc.target/powerpc/pr87532-mc.c: New test.
	* gcc.target/powerpc/pr87532.c: New test.
	* gcc.target/powerpc/vec-extract-v16qiu-v2.h: New test.
	* gcc.target/powerpc/vec-extract-v16qiu-v2a.c: New test.
	* gcc.target/powerpc/vec-extract-v16qiu-v2b.c: New test.
	* gcc.target/powerpc/vsx-builtin-10a.c: New test.
	* gcc.target/powerpc/vsx-builtin-10b.c: New test.
	* gcc.target/powerpc/vsx-builtin-11a.c: New test.
	* gcc.target/powerpc/vsx-builtin-11b.c: New test.
	* gcc.target/powerpc/vsx-builtin-12a.c: New test.
	* gcc.target/powerpc/vsx-builtin-12b.c: New test.
	* gcc.target/powerpc/vsx-builtin-13a.c: New test.
	* gcc.target/powerpc/vsx-builtin-13b.c: New test.
	* gcc.target/powerpc/vsx-builtin-14a.c: New test.
	* gcc.target/powerpc/vsx-builtin-14b.c: New test.
	* gcc.target/powerpc/vsx-builtin-15a.c: New test.
	* gcc.target/powerpc/vsx-builtin-15b.c: New test.
	* gcc.target/powerpc/vsx-builtin-16a.c: New test.
	* gcc.target/powerpc/vsx-builtin-16b.c: New test.
	* gcc.target/powerpc/vsx-builtin-17a.c: New test.
	* gcc.target/powerpc/vsx-builtin-17b.c: New test.
	* gcc.target/powerpc/vsx-builtin-18a.c: New test.
	* gcc.target/powerpc/vsx-builtin-18b.c: New test.
	* gcc.target/powerpc/vsx-builtin-19a.c: New test.
	* gcc.target/powerpc/vsx-builtin-19b.c: New test.
	* gcc.target/powerpc/vsx-builtin-20a.c: New test.
	* gcc.target/powerpc/vsx-builtin-20b.c: New test.
	* gcc.target/powerpc/vsx-builtin-9a.c: New test.
	* gcc.target/powerpc/vsx-builtin-9b.c: New test.

	2019-03-19  Kelvin Nilsen  <kelvin@gcc.gnu.org>

	PR target/89736
	* gcc.target/powerpc/pr87532-mc.c: Modify dejagnu directives to
	restrict this test to vsx targets.

From-SVN: r270493
2019-04-22 16:09:13 +00:00
GCC Administrator 0e38199ed2 Daily bump.
From-SVN: r270486
2019-04-22 00:16:08 +00:00
GCC Administrator 1a9f2a6b14 Daily bump.
From-SVN: r270473
2019-04-21 00:16:04 +00:00
GCC Administrator e3df808982 Daily bump.
From-SVN: r270464
2019-04-20 00:16:10 +00:00
Xiong Hu Luo 226a15e6cd backport r257541, r259936, r260294, r260623, r261098, r261333, r268585 from trunk
These patches are followed changes for r255555 on testcases
vsx-vector-6*.c.  Backport them to update file names and fix regressions
for GCC7 on power9.
See e.g. https://gcc.gnu.org/ml/gcc-testresults/2019-04/msg00159.html
for the failures this patch fixes; the patch is for GCC 7.

gcc/ChangeLog:

2019-04-19  Xiong Hu Luo  <luoxhu@linux.ibm.com>

	Backport from trunk
	2018-05-23  Segher Boessenkool  <segher@kernel.crashing.org>

	* doc/sourcebuild.texi (Endianness): New subsubsection.

gcc/testsuite/ChangeLog:

2019-04-19  Xiong Hu Luo  <luoxhu@linux.ibm.com>

	Backport from trunk
	2018-02-07  Will Schmidt  <will_schmidt@vnet.ibm.com>

	* gcc.target/powerpc/vsx-vector-6-le.c: Update CPU target.
	* gcc.target/powerpc/vsx-vector-6-le.p9.c: New.

	Backport from trunk
	2018-05-04  Carl Love  <cel@us.ibm.com>
	* gcc.target/powerpc/vsx-vector-6.h (foo): Add test for vec_max,
	vec_trunc.
	* gcc.target/powerpc/vsx-vector-6-le.c (dg-final): Update xvcmpeqdp,
	xvcmpgtdp, xvcmpgedp counts. Add xxsel counts.
	* gcc.target/powerpc/vsx-vector-6-be.c (dg-final): Update xvcmpgtdp,
	xvcmpgedp counts. Add xxsel counts.

	Backport from trunk
	2018-05-16  Carl Love  <cel@us.ibm.com>
	* gcc.target/powerpc/vsx-vector-6-be.c: Remove file.
	* gcc.target/powerpc/vsx-vector-6-be.p7.c: New test file.
	* gcc.target/powerpc/vsx-vector-6-be.p8.c: New test file.
	* gcc.target/powerpc/vsx-vector-6-le.c (dg-final): Update counts for
	xvcmpeqdp., xvcmpgtdp., xvcmpgedp., xxlxor, xvrdpi.

	Backport from trunk
	2018-05-23  Segher Boessenkool  <segher@kernel.crashing.org>

	* lib/target-supports.exp (check_effective_target_be): New.
	(check_effective_target_le): New.

	Backport from trunk
	2018-06-01  Carl Love  <cel@us.ibm.com>

	* gcc.target/powerpc/altivec-7-be.c: Delete file.
	* gcc.target/powerpc/altivec-7-le.c: Delete file.
	* gcc.target/powerpc/vsx-7-be.c: Remove file.

	Backport from trunk
	2018-06-01  Carl Love  <cel@us.ibm.com>

	Commit 260294 on 2018-05-16 by Carl Love was supposed to add the
	following files.

	* gcc.target/powerpc/vsx-vector-6-be.p7.c: New test file.
	* gcc.target/powerpc/vsx-vector-6-be.p8.c: New test file.

	Backport from trunk
	2018-06-08  Carl Love  <cel@us.ibm.com>

	* gcc.target/powerpc/vsx-vector-6-be.p7.c: Rename this file to
	vsx-vector-6.p7.c.
	* gcc.target/powerpc/vsx-vector-6-le.p9.c: Rename this file to
	vsx-vector-6.p9.c.
	* gcc.target/powerpc/vsx-vector-6-be.p8.c: Move instruction counts
	for BE system that are different then for an LE system from this file
	into vsx-vector-6-le.c using be target qualifier.  Remove this file.
	* gcc.target/powerpc/vsx-vector-6-le.c: Add le qualifiers as needed for
	the various instruction counts.  Rename file to vsx-vector-6.p8.c.

	Backport from trunk
	2019-02-06  Bill Seurer  <seurer@linux.vnet.ibm.com>

	* gcc.target/powerpc/vsx-vector-6.p7.c: Update instruction
	counts and target.
	* gcc.target/powerpc/vsx-vector-6.p8.c: Update instruction
	counts and target.
	* gcc.target/powerpc/vsx-vector-6.p9.c: Update instruction
	counts and target.

From-SVN: r270452
2019-04-19 03:30:33 +00:00
GCC Administrator 1e0457f55c Daily bump.
From-SVN: r270449
2019-04-19 00:16:11 +00:00
GCC Administrator 9ed4310d31 Daily bump.
From-SVN: r270428
2019-04-18 00:16:05 +00:00
John David Anglin ba3209c010 re PR libfortran/79540 (FAIL: gfortran.dg/fmt_fw_d.f90 -O0 execution test)
PR libgfortran/79540
	* io/write_float.def (build_float_string): Don't copy digits when
	ndigits is negative.

From-SVN: r270402
2019-04-17 00:22:23 +00:00
GCC Administrator 300e391440 Daily bump.
From-SVN: r270399
2019-04-17 00:16:04 +00:00
GCC Administrator 395c61c524 Daily bump.
From-SVN: r270374
2019-04-16 00:16:05 +00:00
GCC Administrator 3965b2f7a8 Daily bump.
From-SVN: r270356
2019-04-15 00:16:10 +00:00
Thomas Koenig f537563bd4 re PR fortran/87352 (Large stack usage with new gfortran)
2019-04-14  Thomas Koenig  <tkoenig@gcc.gnu.org>

	PR fortran/87352
	Backport from trunk
	* gfortran.h (gfc_component): Add finalized field.
	* class.c (finalize_component): If the component is already
	finalized, return early.  Set component->finalized on exit.

2019-04-14  Thomas Koenig  <tkoenig@gcc.gnu.org>

	Backport from trunk
	PR fortran/87352
	* gfortran.dg/finalize_28.f90: Adjust count of __builtin_free.
	* gfortran.dg/finalize_34.f90: New test.

From-SVN: r270352
2019-04-14 12:27:44 +00:00
GCC Administrator a6ce895f7e Daily bump.
From-SVN: r270342
2019-04-14 00:16:08 +00:00
GCC Administrator e8b70e36f1 Daily bump.
From-SVN: r270333
2019-04-13 00:16:26 +00:00
GCC Administrator 77a3a76a73 Daily bump.
From-SVN: r270297
2019-04-12 00:16:21 +00:00
Martin Liska 15dc6451c6 Backport r269492
2019-04-11  Martin Liska  <mliska@suse.cz>

	Backport from mainline
	2019-03-08  Martin Liska  <mliska@suse.cz>

	PR target/86952
	* config/i386/i386.c (ix86_option_override_internal): Disable
	jump tables when retpolines are used.
2019-04-11  Martin Liska  <mliska@suse.cz>

	Backport from mainline
	2019-03-08  Martin Liska  <mliska@suse.cz>

	PR target/86952
	* gcc.target/i386/pr86952.c: New test.
	* gcc.target/i386/indirect-thunk-7.c: Use jump tables to match
	scanned pattern.
	* gcc.target/i386/indirect-thunk-inline-7.c: Likewise.

From-SVN: r270277
2019-04-11 08:59:48 +00:00
GCC Administrator af65093b66 Daily bump.
From-SVN: r270269
2019-04-11 00:16:15 +00:00
Harald Anlauf b4969e7028 backport: re PR fortran/89904 (ICE in gfortran starting with r270045)
2019-04-10  Harald Anlauf  <anlauf@gmx.de>

	Backport from trunk
	PR fortran/89904
	* check.c (gfc_check_transfer): Reject procedures as actual
	arguments for SOURCE and MOLD of TRANSFER intrinsic.

	PR fortran/89904
	* gfortran.dg/pr85797.f90: Adjust testcase.

From-SVN: r270268
2019-04-10 21:02:02 +00:00
Matthew Malcomson fbb48581be Backport of r270226 from mainline to gcc-7-branch
The "*neon_mov<mode>" patterns for 128 bit sized quantities uses the "Dn"
constraint to match vmov.f32 and vmov.i<vec-width> patterns.
This constraint boils down to using the `neon_immediate_valid` function.
Once the constraint has matched, the output C statement asserts that function
passes.

The output C statement calls `neon_immediate_valid` with the mode taken from the
iterator, while the constraint takes the mode from the operand.
This can cause a discrepency when the operand is a CONST_INT, as the constraint
passes VOIDmode which `neon_immediate_valid` treats as DImode, while the C
statement passes the mode of the iterator which can be TImode.
When this happens, the `neon_immediate_valid` can fail in the second call (if
e.g. the CONST_INT is a valid immediate in DImode but not TImode) which would
trigger the assertion.

The testcase added with this patch triggers this when compiled with an arm cross
compiler using the command line below.
gcc -march=armv8-a -c neon-immediate-timode.c -O1 -mfloat-abi=hard -mfpu=neon-fp-armv8

This patch splits the original "Dn" constraint into three new constraints, "DN"
for TImode CONST_INT, "Dn" for DImode CONST_INT, and "Dm" for CONST_VECTOR.
Splitting things up this way requires using one extra alternative in the
"*neon_mov<mode>" patterns, but makes it clear from the constraint what mode is
being used.

We also remove the behaviour of treating VOIDmode as DImode in
`neon_valid_immediate` since the original "Dn" constraint was the only place
that functionality was used.  VOIDmode is now never passed to that function.
An assertion has been added to the function to ensure this problem is caught
earlier on.

bootstrapped and regtested on arm-none-linux-gnueabihf

gcc/ChangeLog:

2019-04-10  Matthew Malcomson  <matthew.malcomson@arm.com>

	PR target/90024
	* config/arm/arm.c (neon_valid_immediate): Disallow VOIDmode parameter.
	* config/arm/constraints.md (Dm, DN, Dn): Split previous Dn constraint
	into three.
	* config/arm/neon.md (*neon_mov<mode>): Account for TImode and DImode
	differences directly.
	(*smax<mode>3_neon, vashl<mode>3, vashr<mode>3_imm): Use Dm constraint.

gcc/testsuite/ChangeLog:

2019-04-10  Matthew Malcomson  <matthew.malcomson@arm.com>

	PR target/90024
	* gcc.dg/torture/neon-immediate-timode.c: New test.

From-SVN: r270253
2019-04-10 13:34:54 +00:00
GCC Administrator 840ba6903a Daily bump.
From-SVN: r270243
2019-04-10 00:16:05 +00:00
Eric Botcazou 82a3e966f4 c-ada-spec.c (print_destructor): Deal with deleting destructors.
* c-ada-spec.c (print_destructor): Deal with deleting destructors.
	(dump_ada_declaration) <FUNCTION_DECL>: Likewise.

From-SVN: r270241
2019-04-09 19:30:57 +00:00
GCC Administrator 286129f758 Daily bump.
From-SVN: r270217
2019-04-09 00:16:11 +00:00
Uros Bizjak 277ebd864b re PR target/89945 (ICE in gen_lowpart_general, at rtlhooks.c:63)
PR target/89945
	* config/i386/i386.md (anddi_1 to andsi_1_zext splitter):
	Avoid calling gen_lowpart with SYMBOL_REF and LABEL_REF operand.

testsuite/ChangeLog:

	PR target/89945
	* gcc.target/i386/pr89945.c: New test.

From-SVN: r270197
2019-04-08 07:33:01 +02:00
GCC Administrator ab42423014 Daily bump.
From-SVN: r270193
2019-04-08 00:16:06 +00:00
GCC Administrator ffdb6c3f17 Daily bump.
From-SVN: r270185
2019-04-07 00:16:05 +00:00
Eric Botcazou e99fd71a93 backport: rtlanal.c (get_initial_register_offset): Fall back to the estimate as long as the epilogue isn't completed.
Backport from mainline
	2019-02-19  Eric Botcazou  <ebotcazou@adacore.com>

	* rtlanal.c (get_initial_register_offset): Fall back to the estimate
	as long as the epilogue isn't completed.

From-SVN: r270183
2019-04-06 21:44:33 +00:00
GCC Administrator 90d8e0fd7b Daily bump.
From-SVN: r270179
2019-04-06 00:16:04 +00:00
GCC Administrator fecfa999e5 Daily bump.
From-SVN: r270156
2019-04-05 00:16:06 +00:00
GCC Administrator 87a94c285f Daily bump.
From-SVN: r270139
2019-04-04 00:16:04 +00:00
Richard Biener 960df6cc8e re PR lto/89896 (-flto=4 is confused by presence of 'all.c' in a local directory. -flto=1 is not.)
2019-04-03  Richard Biener  <rguenther@suse.de>

	PR lto/89896
	* lto-wrapper.c (run_gcc): Avoid implicit rules making
	the all target phony.

From-SVN: r270114
2019-04-03 08:47:19 +00:00
GCC Administrator 02fcaf68c1 Daily bump.
From-SVN: r270108
2019-04-03 00:16:04 +00:00
Xiong Hu Luo f0671e83b1 This is a backport of r250477, r255555, r257253 and r258137 from trunk to
gcc-7-branch to support built-in functions.

gcc/ChangeLog:

2019-04-02  Xiong Hu Luo <luoxhu@linux.ibm.com>

	Backport from trunk r250477.

	2017-07-24  Carl Love  <cel@us.ibm.com>

	* config/rs6000/rs6000-c.c: Add support for built-in functions
	vector float vec_extract_fp32_from_shorth (vector unsigned short);
	vector float vec_extract_fp32_from_shortl (vector unsigned short);
	* config/rs6000/altivec.h (vec_extract_fp_from_shorth,
	vec_extract_fp_from_shortl): Add defines for the two builtins.
	* config/rs6000/rs6000-builtin.def (VEXTRACT_FP_FROM_SHORTH,
	VEXTRACT_FP_FROM_SHORTL): Add BU_P9V_OVERLOAD_1 and BU_P9V_VSX_1
	new builtins.
	* config/rs6000/vsx.md vsx_xvcvhpsp): Add define_insn.
	(vextract_fp_from_shorth, vextract_fp_from_shortl): Add define_expands.
	* doc/extend.texi: Update the built-in documentation file for the
	new built-in function.

	Backport from trunk r255555.

	2017-12-11  Carl Love  <cel@us.ibm.com>

	* config/rs6000/altivec.h (vec_extract_fp32_from_shorth,
	vec_extract_fp32_from_shortl]): Add #defines.
	* config/rs6000/rs6000-builtin.def (VSLDOI_2DI): Add macro expansion.
	* config/rs6000/rs6000-c.c (ALTIVEC_BUILTIN_VEC_UNPACKH,
	ALTIVEC_BUILTIN_VEC_UNPACKL, ALTIVEC_BUILTIN_VEC_AND,
	ALTIVEC_BUILTIN_VEC_SLD, ALTIVEC_BUILTIN_VEC_SRL,
	ALTIVEC_BUILTIN_VEC_SRO, ALTIVEC_BUILTIN_VEC_SLD,
	ALTIVEC_BUILTIN_VEC_SLL): Add expansions.
	* doc/extend.texi: Add documentation for the added builtins.

gcc/testsuite/ChangeLog:

2019-04-02  Xiong Hu Luo <luoxhu@linux.ibm.com>

	Backport from trunk r250477.

	2017-07-24  Carl Love  <cel@us.ibm.com>

	* gcc.target/powerpc/builtins-3-p9-runnable.c: Add new test file for
	the new built-ins.

	Backport from trunk r255555.

	2017-12-11  Carl Love  <cel@us.ibm.com>
	* gcc.target/powerpc/altivec-7.c: Renamed altivec-7.h.
	* gcc.target/powerpc/altivec-7.h (main): Add testcases for vec_unpackl.
	Add dg-final tests for the instructions generated.
	* gcc.target/powerpc/altivec-7-be.c: New file to test on big endian.
	* gcc.target/powerpc/altivec-7-le.c: New file to test on little endian.
	* gcc.target/powerpc/altivec-13.c (foo): Add vec_sld, vec_srl,
	 vec_sro testcases. Add dg-final tests for the instructions generated.
	* gcc.target/powerpc/builtins-3-p8.c (test_vsi_packs_vui,
	test_vsi_packs_vsi, test_vsi_packs_vssi, test_vsi_packs_vusi,
	test_vsi_packsu-vssi, test_vsi_packsu-vusi, test_vsi_packsu-vsll,
	test_vsi_packsu-vull, test_vsi_packsu-vsi, test_vsi_packsu-vui): Add
	testcases. Add dg-final tests for new instructions.
	* gcc.target/powerpc/p8vector-builtin-2.c (vbschar_eq, vbchar_eq,
	vuchar_eq, vbint_eq, vsint_eq, viint_eq, vuint_eq, vbool_eq, vbint_ne,
	vsint_ne, vuint_ne, vbool_ne, vsign_ne, vuns_ne, vbshort_ne): Add
	tests.
	Add dg-final instruction tests.
	* gcc.target/powerpc/vsx-vector-6.c: Renamed vsx-vector-6.h.
	* gcc.target/powerpc/vsx-vector-6.h (vec_andc,vec_nmsub, vec_nmadd,
	vec_or, vec_nor, vec_andc, vec_or, vec_andc, vec_msums): Add tests.
	Add dg-final tests for the generated instructions.
	* gcc.target/powerpc/builtins-3.c (test_sll_vsc_vsc_vsuc,
	test_sll_vuc_vuc, test_sll_vsi_vsi_vuc, test_sll_vui_vui_vuc,
	test_sll_vbll_vull, test_sll_vbll_vbll_vus, test_sll_vp_vp_vuc,
	test_sll_vssi_vssi_vuc, test_sll_vusi_vusi_vuc, test_slo_vsc_vsc_vsc,
	test_slo_vuc_vuc_vsc, test_slo_vsi_vsi_vsc, test_slo_vsi_vsi_vuc,
	test_slo_vui_vui_vsc, test_slo_vui_vui_vuc, test_slo_vsll_slo_vsll_vsc,
	test_slo_vsll_slo_vsll_vuc, test_slo_vull_slo_vull_vsc,
	test_slo_vull_slo_vull_vuc, test_slo_vp_vp_vsc, test_slo_vp_vp_vuc,
	test_slo_vssi_vssi_vsc, test_slo_vssi_vssi_vuc, test_slo_vusi_vusi_vsc,
	test_slo_vusi_vusi_vuc, test_slo_vusi_vusi_vuc, test_slo_vf_vf_vsc,
	test_slo_vf_vf_vuc, test_cmpb_float): Add tests.

	Backport from trunk r257253.

	2018-01-31  Will Schmidt  <will_schmidt@vnet.ibm.com>

	* gcc.target/powerpc/altivec-13.c: Remove VSX-requiring built-ins.
	* gcc.target/powerpc/vsx-13.c: New.

	Backport from trunk r258137.

	2018-03-02  Will Schmidt  <will_schmidt@vnet.ibm.com>

	* gcc.target/powerpc/altivec-7-be.c: Remove VSX content, allow
	32-bit target.
	* gcc.target/powerpc/altivec-7.h: Remove VSX content.
	* gcc.target/powerpc/vsx-7-be.c: New test (VSX content).
	* gcc.target/powerpc/vsx-7.h: New include (VSX content).
	* gcc.target/powerpc/altivec-7-le.c: Add vsx-7.h include.

From-SVN: r270073
2019-04-02 01:08:31 +00:00
GCC Administrator afa4cdc0b1 Daily bump.
From-SVN: r270070
2019-04-02 00:16:14 +00:00
GCC Administrator 9e510e60dd Daily bump.
From-SVN: r270049
2019-04-01 00:16:09 +00:00
Harald Anlauf 79ee952200 backport: re PR fortran/83515 (ICE: Invalid expression in gfc_element_size)
2019-03-31  Harald Anlauf  <anlauf@gmx.de>

	Backport from trunk
	PR fortran/83515
	PR fortran/85797
	* trans-types.c (gfc_typenode_for_spec): Handle conversion for
	procedure pointers.
	* target-memory.c (gfc_element_size): Handle size determination
	for procedure pointers.

	PR fortran/83515
	PR fortran/85797
	* gfortran.dg/pr85797.f90: New test.

From-SVN: r270047
2019-03-31 19:21:37 +00:00
GCC Administrator a63e72d6fe Daily bump.
From-SVN: r270039
2019-03-31 00:16:07 +00:00
GCC Administrator 0dddef68d8 Daily bump.
From-SVN: r270027
2019-03-30 00:16:09 +00:00
GCC Administrator ad54bd55f8 Daily bump.
From-SVN: r270010
2019-03-29 00:16:10 +00:00
Martin Liska e792a30bb3 Backport r265786
2019-03-28  Martin Liska  <mliska@suse.cz>

	Backport from mainline
	2018-11-05  Martin Liska  <mliska@suse.cz>

	PR web/87829
	* doc/invoke.texi: Remove options that are
	not disabled with -Os.

From-SVN: r269987
2019-03-28 08:53:49 +00:00
GCC Administrator c0f5208df6 Daily bump.
From-SVN: r269981
2019-03-28 00:16:06 +00:00
GCC Administrator 1fc135beb0 Daily bump.
From-SVN: r269956
2019-03-27 00:16:06 +00:00
Richard Biener c300b13330 backport: [multiple changes]
2019-02-26  Richard Biener  <rguenther@suse.de>

	Backport from mainline
	2019-02-12  Richard Biener  <rguenther@suse.de>

	PR tree-optimization/89253
	* tree-ssa-loop-split.c (tree_ssa_split_loops): Check we can
	duplicate the loop.

	* gfortran.dg/pr89253.f: New testcase.

	2019-02-08  Richard Biener  <rguenther@suse.de>

	PR middle-end/89223
	* tree-data-ref.c (initialize_matrix_A): Fail if constant
	doesn't fit in HWI.
	(analyze_subscript_affine_affine): Handle failure from
	initialize_matrix_A.

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

	2019-01-28  Richard Biener  <rguenther@suse.de>

	PR tree-optimization/88739
	* tree-ssa-sccvn.c (vn_reference_lookup_3): Avoid generating
	BIT_FIELD_REFs of non-mode-precision integral operands.

	* gcc.c-torture/execute/pr88739.c: New test.

From-SVN: r269942
2019-03-26 13:18:23 +00:00
Richard Biener b53faa7a51 backport: [multiple changes]
2019-03-26  Richard Biener  <rguenther@suse.de>

	Backport from mainline
	2019-01-08  Richard Biener  <rguenther@suse.de>

	PR tree-optimization/86554
	* tree-ssa-sccvn.c (visit_nary_op): When value-numbering to
	expressions with different overflow behavior make sure there's an
	available expression on the path.

	* gcc.dg/torture/pr86554-1.c: New testcase.
	* gcc.dg/torture/pr86554-2.c: Likewise.

	2018-11-20  Richard Biener  <rguenther@suse.de>
 
	PR tree-optimization/88105
	* tree-ssa-dom.c (pass_dominator::execute): Do not walk
	backedges.

	* gcc.dg/gomp/pr88105.c: New testcase.

	2018-03-08  Richard Biener  <rguenther@suse.de>

	PR middle-end/84552
	* tree-scalar-evolution.c: Include tree-into-ssa.h.
	(follow_copies_to_constant): Do not follow SSA names registered
	for update.

	* gcc.dg/graphite/pr84552.c: New testcase.

From-SVN: r269939
2019-03-26 11:18:26 +00:00
GCC Administrator d624117d14 Daily bump.
From-SVN: r269929
2019-03-26 00:16:06 +00:00
Janus Weil eafa1d853a re PR fortran/71861 ([F03] ICE in write_symbol(): bad module symbol)
fix PR 71861

2019-03-25  Janus Weil  <janus@gcc.gnu.org>

	PR fortran/71861
	* symbol.c (check_conflict): ABSTRACT attribute conflicts with
	INTRINSIC attribute.

2019-03-25  Janus Weil  <janus@gcc.gnu.org>

	PR fortran/71861
	* gfortran.dg/interface_abstract_5.f90: New test case.

From-SVN: r269922
2019-03-25 20:58:04 +01:00
GCC Administrator 6dc563e7fc Daily bump.
From-SVN: r269903
2019-03-25 00:16:24 +00:00
GCC Administrator b996ae52ce Daily bump.
From-SVN: r269892
2019-03-24 00:16:07 +00:00
Thomas Koenig a75aba69e6 re PR fortran/68009 (prototype for gfortran_runtime_error with inline matmul)
2019-03-23  Thomas Koenig  <tkoeng@gcc.gnu.org>

    PR fortran/68009
    Backport from trunk
    * iresolve.c: Include trans.h.
    (gfc_resolve_fe_runtine_error): Set backend_decl on
    resolved_sym.

From-SVN: r269890
2019-03-23 16:01:57 +00:00
GCC Administrator 957189dea2 Daily bump.
From-SVN: r269883
2019-03-23 00:16:05 +00:00
GCC Administrator 0dd7d4d48d Daily bump.
From-SVN: r269864
2019-03-22 00:16:06 +00:00
Thomas Schwinge c57f5f2c12 [testsuite] Fix 'dg-compile-aux-modules' diagnostic
gcc/testsuite/
	PR fortran/56408
	* gcc.target/powerpc/ppc-fortran/ppc-fortran.exp
	(dg-compile-aux-modules): Fix diagnostic.
	* gfortran.dg/coarray/caf.exp (dg-compile-aux-modules): Likewise.
	* gfortran.dg/dg.exp (dg-compile-aux-modules): Likewise.

trunk r269851

From-SVN: r269853
2019-03-21 20:31:30 +01:00
Thomas Schwinge 43d616dedc [testsuite, Fortran] Apply DejaGnu 1.4.4 work-around also to 'gfortran.dg/coarray/caf.exp:dg-compile-aux-modules'
See trunk r215293.  This unifies all 'dg-compile-aux-modules' instances.

	gcc/testsuite/
	PR fortran/56408
	* gfortran.dg/coarray/caf.exp (dg-compile-aux-modules): Workaround
	missing nexted dg-test call support in dejaGNU 1.4.4.

trunk r269848

From-SVN: r269850
2019-03-21 20:17:12 +01:00
Thomas Schwinge 4ad6536a93 [testsuite, Fortran] Consistently set 'DEFAULT_FFLAGS'
In the same 'runtest' instance, 'global' variables persist from one '*.exp'
file to another.

All other '*.exp' files are using " -pedantic-errors" instead of the empty
string as the default for 'DEFAULT_FFLAGS'.  Thus this setting of
'DEFAULT_FFLAGS' is not idempotent, depends on whether
'gfortran.dg/ieee/ieee.exp', or an other defining '*.exp' file is executed
first.

	gcc/testsuite/
	PR fortran/29383
	* gfortran.dg/ieee/ieee.exp (DEFAULT_FFLAGS): Set the same as in
	other '*.exp' files.

trunk r269845

From-SVN: r269847
2019-03-21 19:57:56 +01:00
Bill Schmidt 726bf18a0f rs6000.c (rs6000_analyze_swaps): Rebuild ud- and du-chains between phases.
2019-03-21  Bill Schmidt  <wschmidt@linux.ibm.com>

	* config/rs6000/rs6000.c (rs6000_analyze_swaps): Rebuild
	ud- and du-chains between phases.

From-SVN: r269843
2019-03-21 17:13:55 +00:00
Matthias Klose 64963d46e5 backport: re PR tree-optimization/89505 (LibreOffice miscompilation starting with r260383)
2019-03-21  Matthias Klose  <doko@ubuntu.com>

        Backport from mainline
        2019-02-26  Richard Biener  <rguenther@suse.de>

        PR tree-optimization/89505
        * tree-ssa-structalias.c (compute_dependence_clique): Make sure
        to handle restrict pointed-to vars with multiple subvars
        correctly.

2019-03-21  Matthias Klose  <doko@ubuntu.com>

        Backport from mainline
        2019-02-26  Richard Biener  <rguenther@suse.de>

        PR tree-optimization/89505
        * gcc.dg/torture/pr89505.c: New testcase.

From-SVN: r269836
2019-03-21 12:28:26 +00:00
GCC Administrator 77d2ec444d Daily bump.
From-SVN: r269829
2019-03-21 00:16:05 +00:00
GCC Administrator 943c997c6a Daily bump.
From-SVN: r269815
2019-03-20 00:16:09 +00:00
GCC Administrator 15b03dc128 Daily bump.
From-SVN: r269786
2019-03-19 00:16:04 +00:00
GCC Administrator 7340e87fc4 Daily bump.
From-SVN: r269747
2019-03-18 00:16:07 +00:00
Thomas Koenig 41557ae3d5 re PR fortran/84394 (compiler error when using modules with derived types in block data subprograms)
2019-03-17  Thomas Koenig  <tkoenig@gcc.gnu.org>

	PR fortran/84394
	Backport from trunk
	* symbol.c (gfc_add_subroutine): If we are encountering a
	subrtoutine within a BLOCK DATA and the name starts with an
	underscore, do not check.

2019-03-17  Thomas Koenig  <tkoenig@gcc.gnu.org>

	PR fortran/84394
	Backport from trunk
	* gfortran.dg/blockdata_11.f90: New test.

From-SVN: r269741
2019-03-17 12:54:29 +00:00
H.J. Lu face721e11 x32: Add addr32 prefix to VSIB address
32-bit indices in VSIB address are sign-extended to 64 bits.  In x32,
when 32-bit indices are used as addresses, like in

vgatherdps %ymm7, 0(,%ymm9,1), %ymm6

32-bit indices, 0xf7fa3010, is sign-extended to 0xfffffffff7fa3010 which
is invalid address.  Add addr32 prefix to UNSPEC_VSIBADDR instructions
for x32 if there is no base register nor symbol.

This fixes 175.vpr and 254.gap in SPEC CPU 2000 on x32 with

-Ofast -funroll-loops -march=haswell

gcc/

	Backport from mainline
	2019-03-14  H.J. Lu  <hongjiu.lu@intel.com>

	PR target/89523
	* config/i386/i386.c (ix86_print_operand): Handle 'M' to add
	addr32 prefix to VSIB address for X32.
	* config/i386/sse.md (*avx512pf_gatherpf<mode>sf_mask): Prepend
	"%M2" to opcode.
	(*avx512pf_gatherpf<mode>df_mask): Likewise.
	(*avx512pf_scatterpf<mode>sf_mask): Likewise.
	(*avx512pf_scatterpf<mode>df_mask): Likewise.
	(*avx2_gathersi<mode>): Prepend "%M3" to opcode.
	(*avx2_gathersi<mode>_2): Prepend "%M2" to opcode.
	(*avx2_gatherdi<mode>): Prepend "%M3" to opcode.
	(*avx2_gatherdi<mode>_2): Prepend "%M2" to opcode.
	(*avx2_gatherdi<mode>_3): Prepend "%M3" to opcode.
	(*avx2_gatherdi<mode>_4): Prepend "%M2" to opcode.`
	(*avx512f_gathersi<mode>): Prepend "%M4" to opcode.
	(*avx512f_gathersi<mode>_2): Prepend "%M3" to opcode.
	(*avx512f_gatherdi<mode>): Prepend "%M4" to opcode.
	(*avx512f_gatherdi<mode>_2): Prepend "%M3" to opcode.
	(*avx512f_scattersi<mode>): Prepend "%M0" to opcode.
	(*avx512f_scatterdi<mode>): Likewise.

gcc/testsuite/

	Backport from mainline
	2019-03-14  H.J. Lu  <hongjiu.lu@intel.com>

	PR target/89523
	* gcc.target/i386/pr89523-1a.c: New test.
	* gcc.target/i386/pr89523-1b.c: Likewise.
	* gcc.target/i386/pr89523-2.c: Likewise.
	* gcc.target/i386/pr89523-3.c: Likewise.
	* gcc.target/i386/pr89523-4.c: Likewise.
	* gcc.target/i386/pr89523-5.c: Likewise.
	* gcc.target/i386/pr89523-6.c: Likewise.
	* gcc.target/i386/pr89523-7.c: Likewise.
	* gcc.target/i386/pr89523-8.c: Likewise.
	* gcc.target/i386/pr89523-9.c: Likewise.

From-SVN: r269739
2019-03-17 02:27:56 -07:00
GCC Administrator a32ffe2b8f Daily bump.
From-SVN: r269735
2019-03-17 00:16:06 +00:00
Thomas Koenig 7bbc571861 re PR fortran/66089 (elemental dependency mishandling when class array are involved)
2019-03-16  Thomas Koenig  <tkoenig@gcc.gnu.org>

	PR fortran/66089
	Backport from trunk
	* trans-array.c (gfc_scalar_elemental_arg_saved_as_reference):
	Return false if a scalar tempoary is needed.
	(gfc_walk_variable_expr): Fix up class refs.

2019-03-16  Thomas Koenig  <tkoenig@gcc.gnu.org>

	PR fortran/66089
	Backport from trunk
	* gfortran.dg/dependency_53.f90: New test.
	* gfortran.dg/assumed_type_2.f90: Adapted tree dumps.
	* gfortran.dg/no_arg_check_2.f90: Likewise.

From-SVN: r269725
2019-03-16 14:03:00 +00:00
Thomas Koenig d21a6375f6 re PR fortran/66695 ([F03] ICE with binding-name equal to the name of a use-associated procedure)
2019-03-16  Thomas Koenig  <tkoenig@gcc.gnu.org>

	PR fortran/66695
	PR fortran/77746
	PR fortran/79485
	Backport from trunk
	* gfortran.h (gfc_symbol): Add bind_c component.
	(gfc_get_gsymbol): Add argument bind_c.
	* decl.c (add_global_entry): Add bind_c argument to
	gfc_get_symbol.
	* parse.c (parse_block_data): Likewise.
	(parse_module): Likewise.
	(add_global_procedure): Likewise.
	(add_global_program): Likewise.
	* resolve.c (resolve_common_blocks): Likewise.
	(resolve_global_procedure): Likewise.
	(gfc_verify_binding_labels): Likewise.
	* symbol.c (gfc_get_gsymbol): Add argument bind_c. Set bind_c
	in gsym.
	* trans-decl.c (gfc_get_module_backend_decl): Add bind_c argument
	to gfc_get_symbol.
	(gfc_get_extern_function_decl): If the sym has a binding label
	and it cannot be found in the global symbol tabel, it is the wrong
	one and vice versa.

2019-03-16 Thomas Koenig  <tkoenig@gcc.gnu.org>

	PR fortran/66695
	PR fortran/77746
	PR fortran/79485
	Backport from trunk
	* gfortran.dg/binding_label_tests_30.f90: New test.
	* gfortran.dg/binding_label_tests_31.f90: New test.
	* gfortran.dg/binding_label_tests_32.f90: New test.
	* gfortran.dg/binding_label_tests_33.f90: New test.

From-SVN: r269723
2019-03-16 13:24:40 +00:00
GCC Administrator d847242760 Daily bump.
From-SVN: r269718
2019-03-16 00:16:14 +00:00
GCC Administrator 5b3e3ac85b Daily bump.
From-SVN: r269696
2019-03-15 00:16:04 +00:00
Martin Jambor 618e48ada6 Zero local estimated benefit for cloning extern inline function
2019-03-14  Martin Jambor  <mjambor@suse.cz>

	Backport from mainline
	2019-03-07  Martin Jambor  <mjambor@suse.cz>

	PR lto/87525
	* ipa-cp.c (perform_estimation_of_a_value): Account zero time benefit
	for extern inline functions.

	testsuite/
	* gcc.dg/ipa/ipcp-5.c: New test.

From-SVN: r269688
2019-03-14 17:54:43 +01:00
Richard Biener c7b96091a3 backport: re PR target/84272 (AddressSanitizer: heap-use-after-free ../../gcc/config/aarch64/cortex-a57-fma-steering.c:519 in fma_node::get_parity())
2019-03-14  Richard Biener  <rguenther@suse.de>

	Backport from mainline
	2018-02-16  Jakub Jelinek  <jakub@redhat.com>
 
	PR target/84272
	* config/aarch64/cortex-a57-fma-steering.c (fma_forest::merge_forest):
	Use ++iter rather than iter++ for std::list iterators.
	(func_fma_steering::dfs): Likewise.  Don't delete nodes right away,
	defer deleting them until all nodes in the forest are processed.  Do
	free even leaf nodes.  Change to_process into auto_vec.

	* g++.dg/opt/pr84272.C: New test.

From-SVN: r269676
2019-03-14 09:18:07 +00:00
GCC Administrator 50c932bb80 Daily bump.
From-SVN: r269668
2019-03-14 00:16:09 +00:00
Thomas Koenig e001a79f80 re PR fortran/87673 (Errors caused by using function for character length in allocate with typespec)
2019-03-13  Thomas Koenig  <tkoenig@gcc.gnu.org>

	PR fortran/87673
	Backport from trunk
	* match.c (gfc_match_type_spec): Remove call to
	gfc_resolve_expr for character length.

2019-03-13  Thomas Koenig  <tkoenig@gcc.gnu.org>

	PR fortran/87673
	Backport from trunk
	* gfortran.dg/charlen_17.f90: New test.

From-SVN: r269666
2019-03-13 22:15:33 +00:00
Andre Vieira a0604a3d48 Backport of r269499 and related testism fix r269596.
gcc/ChangeLog:
2019-03-13  Andre Vieira  <andre.simoesdiasvieira@arm.com>

	Backport from mainline
	2019-03-08  Andre Vieira  <andre.simoesdiasvieira@arm.com>

	* config/arm/arm.h (TARGET_FP16_TO_DOUBLE): Add TARGET_VFP_DOUBLE
	requirement.

gcc/testsuite/ChangeLog:
2019-03-13  Andre Vieira  <andre.simoesdiasvieira@arm.com>

	Backport from mainline
	2019-03-08  Andre Vieira  <andre.simoesdiasvieira@arm.com>

	* gcc.target/arm/f16_f64_conv_no_dp.c: New test.

	Backport from mainline
	2019-03-11  Christophe Lyon  <christophe.lyon@linaro.org>

	* gcc.target/arm/f16_f64_conv_no_dp.c: Add arm_fp16_ok effective
	target.

From-SVN: r269647
2019-03-13 11:46:56 +00:00
GCC Administrator 02b0f5b0ea Daily bump.
From-SVN: r269629
2019-03-13 00:16:05 +00:00
GCC Administrator 76b3ff257e Daily bump.
From-SVN: r269599
2019-03-12 00:16:04 +00:00
Martin Liska 0123e51781 Backport r268981
2019-03-11  Martin Liska  <mliska@suse.cz>

	Backport from mainline
	2019-02-18  Martin Liska  <mliska@suse.cz>

	PR c++/89383
	* line-map.c (linemap_line_start): Use 1UL in order
	to not overflow.

From-SVN: r269577
2019-03-11 11:18:22 +00:00
Martin Liska df68f66c32 Backport r268789
2019-03-11  Martin Liska  <mliska@suse.cz>

	Backport from mainline
	2019-02-11  David Malcolm  <dmalcolm@redhat.com>

	PR lto/88147
	* input.c (selftest::test_line_offset_overflow): New selftest.
	(selftest::input_c_tests): Call it.
2019-03-11  Martin Liska  <mliska@suse.cz>

	Backport from mainline
	2019-02-11  Martin Liska  <mliska@suse.cz>

	PR lto/88147
	* line-map.c (linemap_line_start): Don't reuse the existing line
	map if the line offset is sufficiently large to cause overflow
	when computing location_t values.

From-SVN: r269576
2019-03-11 11:18:08 +00:00
GCC Administrator 7e010b1d22 Daily bump.
From-SVN: r269563
2019-03-11 00:16:05 +00:00
Thomas Koenig 4ed0f84e48 re PR fortran/71544 (gfortran compiler optimization bug when dealing with c-style pointers)
2019-03-10  Thomas Koenig  <tkoenig@gcc.gnu.org>

	PR fortran/71544
	Backport from trunk
	* trans-types.c (gfc_typenode_for_spec) Set ts->is_c_interop of
	C_PTR and C_FUNPTR.
	(create_fn_spec): Mark argument as escaping if ts->is_c_interop is set.

2019-03-10  Thomas Koenig  <tkoenig@gcc.gnu.org>

	PR fortran/71544
	Backport from trunk
	* gfortran.dg/c_ptr_tests_19.f90: New test.

From-SVN: r269552
2019-03-10 11:26:25 +00:00
Thomas Koenig 87f20bdbb0 re PR fortran/87734 (ICE in is_illegal_recursion check for character len= parameter)
2019-03-10  Thomas Koenig  <tkoenig@gcc.gnu.org>
	Steven G. Kargl  <kargl@gcc.gnu.org>

	PR fortran/87734
	Backort from trunk
	* symbol.c (gfc_add_procedure): Only throw an error if the
	procedure has not been declared either PUBLIC or PRIVATE.
	* resolve.c (is_illegal_recursion): Remove an assert().

2019-03-10  Thomas Koenig  <tkoenig@gcc.gnu.org>

	PR fortran/87734
	Backport from trunk
	* gfortran.dg/public_private_module_10.f90: New test.


Co-Authored-By: Steven G. Kargl <kargl@gcc.gnu.org>

From-SVN: r269550
2019-03-10 11:09:30 +00:00
Matthias Klose 599aabbf0a backport: re PR c++/89585 (GCC 8.3: asm volatile no longer accepted at file scope)
gcc/cp/

2019-04-10  Matthias Klose  <doko@ubuntu.com>

	Backport from the gcc-8 branch
	2019-03-07  Jakub Jelinek  <jakub@redhat.com>

	PR c++/89585
	* parser.c (cp_parser_asm_definition): Parse asm qualifiers even
	at toplevel, but diagnose them.

gcc/testsuite/

2019-04-10  Matthias Klose  <doko@ubuntu.com>

	Backport from the gcc-8 branch
	2019-03-07  Jakub Jelinek  <jakub@redhat.com>

	PR c++/89585
	* g++.dg/asm-qual-3.C: Adjust expected diagnostics.

From-SVN: r269546
2019-03-10 07:25:13 +00:00
GCC Administrator 7e510c1492 Daily bump.
From-SVN: r269543
2019-03-10 00:16:08 +00:00
GCC Administrator ec40200207 Daily bump.
From-SVN: r269518
2019-03-09 00:16:05 +00:00
GCC Administrator bf8ec4e768 Daily bump.
From-SVN: r269474
2019-03-08 00:16:21 +00:00
Xiong Hu Luo 3eccf8460c backport r268834 from mainline to gcc-7-branch
Backport r268834 of "Add support for the vec_sbox_be, vec_cipher_be etc."
from mainline to gcc-7-branch.

gcc/ChangeLog:
2019-03-07  Xiong Hu Luo  <luoxhu@linux.ibm.com>

	Backport of r268834 from mainline to gcc-7-branch.
	2019-02-13  Xiong Hu Luo  <luoxhu@linux.vnet.ibm.com>

	* config/rs6000/altivec.h (vec_sbox_be, vec_cipher_be,
	vec_cipherlast_be, vec_ncipher_be, vec_ncipherlast_be): New #defines.
	* config/rs6000/crypto.md (CR_vqdi): New define_mode_iterator.
	(crypto_vsbox_<mode>, crypto_<CR_insn>_<mode>): New define_insns.
	* config/rs6000/rs6000-builtin.def (VSBOX_BE): New BU_CRYPTO_1.
	(VCIPHER_BE, VCIPHERLAST_BE, VNCIPHER_BE, VNCIPHERLAST_BE):
	New BU_CRYPTO_2.
	* config/rs6000/rs6000.c (builtin_function_type)
	<CRYPTO_BUILTIN_VSBOX_BE, CRYPTO_BUILTIN_VCIPHER_BE,
	CRYPTO_BUILTIN_VCIPHERLAST_BE, CRYPTO_BUILTIN_VNCIPHER_BE,
	CRYPTO_BUILTIN_VNCIPHERLAST_BE>: New switch options.
	* doc/extend.texi (vec_sbox_be, vec_cipher_be, vec_cipherlast_be,
	vec_ncipher_be, vec_ncipherlast_be): New builtin functions.

gcc/testsuite/ChangeLog:
2019-03-07  Xiong Hu Luo  <luoxhu@linux.ibm.com>

	Backport of r268834 from mainline to gcc-7-branch.
	2019-01-23  Xiong Hu Luo  <luoxhu@linux.vnet.ibm.com>

	* gcc.target/powerpc/crypto-builtin-1.c
	(crypto1_be, crypto2_be, crypto3_be, crypto4_be, crypto5_be):
	New testcases.

From-SVN: r269450
2019-03-07 01:54:46 +00:00
GCC Administrator 05e059f1db Daily bump.
From-SVN: r269446
2019-03-07 00:16:12 +00:00
Thomas Koenig 84f1346bb9 re PR fortran/72714 ([Coarray] ICE in gfc_array_init_size, at fortran/trans-array.c:5235)
2019-03-06  Thomas Koenig  <tkoenig@gcc.gnu.org>

	PR fortran/72714
	Backport from trunk
	* resolve.c (resolve_allocate_expr): Add some tests for coarrays.

2019-03-06  Thomas Koenig  <tkoenig@gcc.gnu.org>

	PR fortran/72714
	Backport from trunk
	* gfortran.dg/coarray_allocate_11.f90: New test.

From-SVN: r269441
2019-03-06 20:28:22 +00:00
GCC Administrator 723da2d09c Daily bump.
From-SVN: r269407
2019-03-06 00:16:05 +00:00
GCC Administrator 709900eb06 Daily bump.
From-SVN: r269379
2019-03-05 00:16:18 +00:00
GCC Administrator 4b736fd66b Daily bump.
From-SVN: r269358
2019-03-04 00:16:05 +00:00
Harald Anlauf 874bfe7b42 backport: re PR fortran/77583 (ICE in pp_quoted_string, at pretty-print.c:966)
2019-03-03  Harald Anlauf  <anlauf@gmx.de>
	    Steven G. Kargl  <kargl@gcc.gnu.org>

	Backport from trunk
	PR fortran/77583
	* symbol.c (check_conflict): Check for valid procedure name
	passed to error reporting routine.

	PR fortran/77583
	* gfortran.dg/pr77583.f90: New test.


Co-Authored-By: Steven G. Kargl <kargl@gcc.gnu.org>

From-SVN: r269355
2019-03-03 20:36:12 +00:00
Thomas Koenig e5ec6ea927 re PR fortran/87689 (PowerPC64 ELFv2 function parameter passing violation)
2019-03-03  Thomas Koenig  <tkoenig@gcc.gnu.org>

    PR fortran/87689
    Backport from trunk
    * trans-decl.c (gfc_get_extern_function_decl): Add argument
    actual_args and pass it through to gfc_get_function_type.
    * trans-expr.c (conv_function_val): Add argument actual_args
    and pass it on to gfc_get_extern_function_decl.
    (conv_procedure_call): Pass actual arguments to conv_function_val.
    * trans-types.c (get_formal_from_actual_arglist): New function.
    (gfc_get_function_type): Add argument actual_args.  Generate
    formal args from actual args if necessary.
    * trans-types.h (gfc_get_function_type): Add optional argument.
    * trans.h (gfc_get_extern_function_decl): Add optional argument.

2019-03-03  Thomas Koenig  <tkoenig@gcc.gnu.org>

    PR fortran/87689
    Backport from trunk
    * gfortran.dg/lto/20091028-1_0.f90: Add -Wno-lto-type-mismatch to
    options.
    * gfortran.dg/lto/20091028-2_0.f90: Likewise.
    * gfortran.dg/lto/pr87689_0.f: New file.
    * gfortran.dg/lto/pr87689_1.f: New file.
    * gfortran.dg/altreturn_9_0.f90: New file.
    * gfortran.dg/altreturn_9_1.f90: New file.

From-SVN: r269350
2019-03-03 09:20:09 +00:00
GCC Administrator f75fa4140b Daily bump.
From-SVN: r269345
2019-03-03 00:16:13 +00:00
GCC Administrator 247454e48a Daily bump.
From-SVN: r269334
2019-03-02 00:16:10 +00:00
GCC Administrator b4dad9385d Daily bump.
From-SVN: r269295
2019-03-01 00:16:06 +00:00
GCC Administrator 4e099a1636 Daily bump.
From-SVN: r269268
2019-02-28 00:16:05 +00:00
Uros Bizjak e053aaac50 re PR target/89397 (ICE in build_call_expr_loc_array at gcc/tree.c:11563 since r229082)
PR target/89397
	* config/i386/i386.c (ix86_atomic_assign_expand_fenv): Check
	TARGET_SSE in addition to TARGET_SSE_MATH.

	(ix86_excess_precision): Ditto.
	(ix86_float_exceptions_rounding_supported_p): Ditto.
	(use_rsqrt_p): Ditto.
	* config/i386/sse.md (rsqrt<mode>2): Ditto.

From-SVN: r269263
2019-02-27 20:33:15 +01:00
GCC Administrator 1d5aacff61 Daily bump.
From-SVN: r269237
2019-02-27 00:16:22 +00:00
Eric Botcazou de4e663d34 re PR ada/81956 (call to null procedure not optimized away)
PR ada/81956
	Backport from mainline
	2017-09-06  Ed Schonberg  <schonberg@adacore.com>

	* exp_ch6.adb (Expand_Call_Helper): Do not optimize calls to
	null procedures when GNAT coverage is used, so that their (empty)
	bodies are properly covered.

	2017-09-06  Ed Schonberg  <schonberg@adacore.com>

	* exp_ch6.adb (Expand_Call_Helper): Replace call to null
	procedure by a single null statement, after evaluating the
	actuals that require it.

From-SVN: r269205
2019-02-26 08:12:21 +00:00
GCC Administrator 512b3845d3 Daily bump.
From-SVN: r269199
2019-02-26 00:16:12 +00:00
GCC Administrator e08eb991a1 Daily bump.
From-SVN: r269181
2019-02-25 00:16:06 +00:00
GCC Administrator 766572a133 Daily bump.
From-SVN: r269171
2019-02-24 00:16:06 +00:00
Paul Thomas 83fc627e05 backport: re PR fortran/88117 (ICE in gimplify_var_or_parm_decl, at gimplify.c:2697)
2019-02-23  Paul Thomas  <pault@gcc.gnu.org>

	Backport from trunk
	PR fortran/88117
	* resolve.c (deferred_op_assign): Return if the lhs expression
	has the pointer attribute.

2019-02-23  Paul Thomas  <pault@gcc.gnu.org>

	Backport from trunk
	PR fortran/88117
	* gfortran.dg/deferred_character_32.f90 : New test

From-SVN: r269163
2019-02-23 18:44:54 +00:00
Thomas Koenig 4d384d2632 re PR fortran/71066 (ICE in set_loop_bounds, at fortran/trans-array.c:4680)
2019-02-23  Thomas Koenig  <tkoenig@gcc.gnu.org>

	PR fortran/71066
	Backport from trunk
	* trans-decl.c (generate_coarray_sym_init):  For an array
	constructor in a DATA statement of a coarray variable, set the
	rank to 1 to avoid confusion later on.  If the constructor
	contains only one value, use that for initiailizig.

2019-02-23  Thomas Koenig  <tkoenig@gcc.gnu.org>

	PR fortran/71066
	Backport from trunk
	* gfortran.dg/coarray_data_1.f90: New test.

From-SVN: r269155
2019-02-23 11:49:47 +00:00
Eric Botcazou 0c47a0a6e1 re PR ada/89349 (segfault when building GCC 7 & 8 branch with GCC master)
PR ada/89349
	Backport from mainline
	2018-05-25  Arnaud Charlet  <charlet@adacore.com>

	* osint.ads (Unknown_Attributes): No longer pretend this is a constant.
	(No_File_Info_Cache): Initialize separately.
	* osint.adb (No_File_Info_Cache): Update initializer.

From-SVN: r269154
2019-02-23 10:04:41 +00:00
Jonathan Wakely cfba47dda2 PR libstdc++/89446 fix null pointer dereference in char_traits
PR libstdc++/89446
	* include/bits/char_traits.h (__constant_char_array): Check index is
	in range before dereferencing.
	* testsuite/21_strings/basic_string_view/operators/char/89446.cc:
	New test.

From-SVN: r269143
2019-02-23 01:01:56 +00:00
GCC Administrator bfa35db31c Daily bump.
From-SVN: r269140
2019-02-23 00:16:18 +00:00
GCC Administrator 6c3ecfd782 Daily bump.
From-SVN: r269083
2019-02-22 00:16:10 +00:00
GCC Administrator a981ee340d Daily bump.
From-SVN: r269060
2019-02-21 00:16:14 +00:00
GCC Administrator 4d8befc17a Daily bump.
From-SVN: r269029
2019-02-20 00:16:31 +00:00
GCC Administrator a86c39f40f Daily bump.
From-SVN: r269000
2019-02-19 00:16:06 +00:00
GCC Administrator f0558cbb06 Daily bump.
From-SVN: r268975
2019-02-18 00:16:47 +00:00
GCC Administrator 4c32a1a7b0 Daily bump.
From-SVN: r268965
2019-02-17 00:16:19 +00:00
GCC Administrator 5b5ca2fa90 Daily bump.
From-SVN: r268953
2019-02-16 00:16:22 +00:00
Martin Liska d90ca69856 Backport r268873
2019-02-15  Martin Liska  <mliska@suse.cz>

	Backport from mainline
	2019-02-14  Martin Liska  <mliska@suse.cz>

	PR rtl-optimization/89242
	* dce.c (delete_unmarked_insns): Call free_dominance_info we
	process a transformation.
2019-02-15  Martin Liska  <mliska@suse.cz>

	Backport from mainline
	2019-02-14  Martin Liska  <mliska@suse.cz>

	PR rtl-optimization/89242
	* g++.dg/pr89242.C: New test.

From-SVN: r268938
2019-02-15 10:59:02 +00:00
Martin Liska 75babf8b3b Backport r268762
2019-02-15  Martin Liska  <mliska@suse.cz>

	Backport from mainline
	2019-02-11  Martin Liska  <mliska@suse.cz>

	PR ipa/89009
	* ipa-cp.c (build_toporder_info): Remove usage of a param.
	* ipa-inline.c (inline_small_functions): Likewise.
	* ipa-pure-const.c (propagate_pure_const): Likewise.
	(propagate_nothrow): Likewise.
	* ipa-reference.c (propagate): Likewise.
	* ipa-utils.c (struct searchc_env): Remove unused field.
	(searchc): Always search across AVAIL_INTERPOSABLE.
	(ipa_reduced_postorder): Always allow AVAIL_INTERPOSABLE as
	the only called IPA pure const can properly not propagate
	across interposable boundary.
	* ipa-utils.h (ipa_reduced_postorder): Remove param.
2019-02-15  Martin Liska  <mliska@suse.cz>

	Backport from mainline
	2019-02-11  Martin Liska  <mliska@suse.cz>

	PR ipa/89009
	* g++.dg/ipa/pr89009.C: New test.

From-SVN: r268937
2019-02-15 10:58:49 +00:00
Eric Botcazou f09d4c9b7d * gcc.target/sparc/struct-ret-check-1.c: Add -fno-pie option.
From-SVN: r268936
2019-02-15 10:56:13 +00:00
GCC Administrator 40bc05b966 Daily bump.
From-SVN: r268918
2019-02-15 00:16:18 +00:00
GCC Administrator c5f00170b9 Daily bump.
From-SVN: r268857
2019-02-14 00:16:23 +00:00
GCC Administrator 329f93b411 Daily bump.
From-SVN: r268831
2019-02-13 00:16:04 +00:00
GCC Administrator 3ef5fd2607 Daily bump.
From-SVN: r268786
2019-02-12 00:16:05 +00:00
Stefan Agner f05287cc46 ARM: fix -masm-syntax-unified (PR88648)
Backport from mainline.
	2019-01-10  Stefan Agner  <stefan@agner.ch>

	PR target/88648
	* config/arm/arm.c (arm_option_override_internal): Force
	opts->x_inline_asm_unified to true only if TARGET_THUMB2_P.

	* gcc.target/arm/pr88648-asm-syntax-unified.c: Add test to
	check if -masm-syntax-unified gets applied properly.

From-SVN: r268765
2019-02-11 09:31:13 +00:00
GCC Administrator 35a1544d0a Daily bump.
From-SVN: r268756
2019-02-11 00:16:04 +00:00
Harald Anlauf b0201e0a4b backport: re PR fortran/89077 (ICE using * as len specifier for character parameter)
2019-02-10  Harald Anlauf  <anlauf@gmx.de>

	Backport from trunk
	PR fortran/89077
	* decl.c (add_init_expr_to_sym): Copy length of string initializer
	to declared symbol.

	PR fortran/89077
	* gfortran.dg/pr89077.f90: New test.

From-SVN: r268753
2019-02-10 20:05:34 +00:00
Thomas Koenig ddcb4f31c9 re PR fortran/71723 ([F08] ICE on invalid pointer initialization)
2019-02-10  Thomas Koenig  <tkoenig@gcc.gnu.org>

	PR fortran/71723
	Backport from trunk
	* expr.c (gfc_check_assign): Add argument is_init_expr.  If we are
	looking at an init expression, issue error if the target is not a
	TARGET and we are not looking at a procedure pointer.
	* gfortran.h (gfc_check_assign): Add optional argument
	is_init_expr.

2019-02-10  Thomas Koenig  <tkoenig@gcc.gnu.org>

	PR fortran/71723
	Backport from trunk
	* gfortran.dg/pointer_init_2.f90: Adjust error messages.
	* gfortran.dg/pointer_init_6.f90: Likewise.
	* gfortran.dg/pointer_init_9.f90: New test.

From-SVN: r268751
2019-02-10 18:41:03 +00:00
GCC Administrator 5c5f48a006 Daily bump.
From-SVN: r268733
2019-02-10 00:16:25 +00:00
Thomas Koenig c17d740147 re PR fortran/71860 ([OOP] ICE on pointing to null(mold), verify_gimple failed)
2019-02-09  Thomas Koenig  <tkoenig@gcc.gnu.org>

    PR fortran/71860
    Backport from trunk
    * gfortran.dg/null_10.f90: New test.

From-SVN: r268731
2019-02-09 20:09:56 +00:00
Alan Modra e08292047c [RS6000] Correct save_reg_p
PR target/88343
	* config/rs6000/rs6000.c (rs6000_reg_live_or_pic_offset_p): Match
	logic in rs6000_emit_prologue emitting pic_offset_table setup.

From-SVN: r268722
2019-02-09 23:14:02 +10:30
GCC Administrator f79c0ee284 Daily bump.
From-SVN: r268710
2019-02-09 00:16:21 +00:00
Eric Botcazou 915a3e97e3 Fix function name
From-SVN: r268677
2019-02-08 11:22:53 +00:00
Eric Botcazou 14e88f9f2b trans.c (Regular_Loop_to_gnu): Replace tests on individual flag_unswitch_loops and flag_tree_loop_vectorize...
* gcc-interface/trans.c (Regular_Loop_to_gnu): Replace tests on
	individual flag_unswitch_loops and flag_tree_loop_vectorize switches
	with test on global optimize switch.
	(Raise_Error_to_gnu): Likewise.

From-SVN: r268673
2019-02-08 11:08:07 +00:00
Eric Botcazou 53e07674f9 backport: re PR target/85755 (PowerPC Gcc's -mupdate produces inefficient code on power8/power9 machines)
Backport from mainline
	2018-06-11  Segher Boessenkool  <segher@kernel.crashing.org>

	PR target/85755
	* config/rs6000/rs6000.md (*movdi_internal32): Put constraint modifiers
	on the correct operand.
	(*movdi_internal64): Ditto.

From-SVN: r268670
2019-02-08 10:37:15 +00:00
GCC Administrator f5d12960f6 Daily bump.
From-SVN: r268660
2019-02-08 00:16:09 +00:00
Eric Botcazou b0e7f9ed8e * s-linux-sparc.ads (ETIMEDOUT): Set to correct value.
From-SVN: r268654
2019-02-07 16:29:48 +00:00
GCC Administrator 268263d27b Daily bump.
From-SVN: r268599
2019-02-07 00:16:15 +00:00
Eric Botcazou 7117446421 backport: decl.c (annotate_value): Tidy up.
Backport from mainline
	2017-09-05  Eric Botcazou  <ebotcazou@adacore.com>

	* gcc-interface/decl.c (annotate_value): Tidy up.
	<INTEGER_CST>: Set TCODE instead of recursing.
	<COMPONENT_REF>: Set TCODE instead of calling Create_Node manually.
	<MULT_EXPR, PLUS_EXPR>: Fold conversions into inner operations.
	<BIT_AND_EXPR>: Adjust.
	<CALL_EXPR>: Do not fall through.

From-SVN: r268598
2019-02-06 23:28:34 +00:00
Kelvin Nilsen 19a953fb60 backport: rs6000-c.c (altivec-resolve_overloaded_builtin): Change handling of ALTIVEC_BUILTIN_VEC_EXTRACT.
gcc/ChangeLog:

2019-02-06  Kelvin Nilsen  <kelvin@gcc.gnu.org>

	Backport from mainline.
	2019-01-30  Kelvin Nilsen  <kelvin@gcc.gnu.org>
	* config/rs6000/rs6000-c.c (altivec-resolve_overloaded_builtin):
	Change handling of ALTIVEC_BUILTIN_VEC_EXTRACT.  Coerce result to
	type of vector element when vec_extract is implemented by direct
	move.

gcc/testsuite/ChangeLog:

2019-02-06  Kelvin Nilsen  <kelvin@gcc.gnu.org>

	2019-02-05  Kelvin Nilsen  <kelvin@gcc.gnu.org>
	* gcc.target/powerpc/vec-extract-slong-1.c: Require p8 execution
	hardware.
	* gcc.target/powerpc/vec-extract-schar-1.c: Likewise.
	* gcc.target/powerpc/vec-extract-sint128-1.c: Likewise.
	* gcc.target/powerpc/vec-extract-sshort-1.c: Likewise.
	* gcc.target/powerpc/vec-extract-ulong-1.c: Likewise.
	* gcc.target/powerpc/vec-extract-uchar-1.c: Likewise.
	* gcc.target/powerpc/vec-extract-sint-1.c: Likewise.
	* gcc.target/powerpc/vec-extract-uint128-1.c: Likewise.
	* gcc.target/powerpc/vec-extract-ushort-1.c: Likewise.
	* gcc.target/powerpc/vec-extract-uint-1.c: Likewise.

	Backport from mainline.
	2019-01-30  Kelvin Nilsen  <kelvin@gcc.gnu.org>
	* gcc.target/powerpc/vec-extract-schar-1.c: New test.
	* gcc.target/powerpc/vec-extract-sint-1.c: New test.
	* gcc.target/powerpc/vec-extract-sint128-1.c: New test.
	* gcc.target/powerpc/vec-extract-slong-1.c: New test.
	* gcc.target/powerpc/vec-extract-sshort-1.c: New test.
	* gcc.target/powerpc/vec-extract-uchar-1.c: New test.
	* gcc.target/powerpc/vec-extract-uint-1.c: New test.
	* gcc.target/powerpc/vec-extract-uint128-1.c: New test.
	* gcc.target/powerpc/vec-extract-ulong-1.c: New test.
	* gcc.target/powerpc/vec-extract-ushort-1.c: New test.

From-SVN: r268596
2019-02-06 21:35:44 +00:00
Eric Botcazou 52dc62100b i386.c (ix86_expand_prologue): Emit a memory blockage after restoring registers saved to allocate the frame on...
* config/i386/i386.c (ix86_expand_prologue): Emit a memory blockage
	after restoring registers saved to allocate the frame on Windows.

From-SVN: r268595
2019-02-06 21:10:19 +00:00
GCC Administrator 8ce34f480b Daily bump.
From-SVN: r268568
2019-02-06 00:16:05 +00:00
Thomas Koenig a735a93496 re PR fortran/67679 (-Wunitialized reports on compiler-generated variables)
2019-02-05  Thomas Koenig  <tkoenig@gcc.gnu.org>

	PR fortran/67679
	Backport from trunk
	* trans-array.c (gfc_array_allocate):  For setting the bounds on
	the new array, add a condition for a not previously allocated
	variable.

2019-02-05  Thomas Koenig  <tkoenig@gcc.gnu.org>

	PR fortran/67679
	Backport from trunk
	* gfortran.dg/warn_undefined_1.f90: New test.
	* gfortran.dg/coarray_lock_7.f90: Fix patterns in test.

From-SVN: r268560
2019-02-05 21:23:07 +00:00
Andreas Krebbel 617eb3a96c S/390: Remove load and test fp splitter
gcc/ChangeLog:

2019-02-05  Andreas Krebbel  <krebbel@linux.ibm.com>

	Backport from mainline
	2019-02-05  Andreas Krebbel  <krebbel@linux.ibm.com>

	PR target/88856
	* config/s390/s390.md: Remove load and test FP splitter.

From-SVN: r268552
2019-02-05 17:19:26 +00:00
GCC Administrator 7ef57a5a91 Daily bump.
From-SVN: r268526
2019-02-05 00:16:06 +00:00
Bill Schmidt 34ac433ca0 backport: [multiple changes]
2019-02-04  Bill Schmidt  <wshmidt@linux.ibm.com>

	PR target/87064
	Backport from mainline

	2019-01-30  Bill Schmidt  <wschmidt@linux.ibm.com>

	PR target/87064
	* config/rs6000/vsx.md (*vsx_reduc_<VEC_reduc_name>_v4sf_scalar):
	Disable for little-endian.

	2019-01-22  Jakub Jelinek  <jakub@redhat.com>

	PR target/87064
	* config/rs6000/vsx.md (*vsx_reduc_<VEC_reduc_name>_v2df_scalar):
	Disable for little endian.

From-SVN: r268524
2019-02-04 16:48:30 +00:00
GCC Administrator 225331c8db Daily bump.
From-SVN: r268505
2019-02-04 00:16:19 +00:00
Paul Thomas dc7d643c4d backport: re PR fortran/88393 ([OOP] Segfault with type-bound assignment)
2019-02-03  Paul Thomas  <pault@gcc.gnu.org>

	Backport from trunk
	PR fortran/88393
	* trans-expr.c (gfc_conv_procedure_call): For derived entities,
	passed in parentheses to class formals, invert the order of
	copying allocatable components to taking the _data of the
	class expression.

2019-02-03  Paul Thomas  <pault@gcc.gnu.org>

	Backport from trunk
	PR fortran/88393
	* gfortran.dg/alloc_comp_assign_16.f03 : New test.

From-SVN: r268501
2019-02-03 18:23:25 +00:00
Uros Bizjak cd8d35ec8a re PR fortran/88678 (Many gfortran.dg/ieee/ieee_X.f90 test cases fail starting with r267465)
2019-02-03  Uroš Bizjak  <ubizjak@gmail.com>

	PR libfortran/88678
	Revert:
	2016-11-16  Szabolcs Nagy  <szabolcs.nagy@arm.com>

	PR libfortran/78314
	* config/fpu-glibc.h (support_fpu_trap): Use feenableexcept.

2019-02-03  Uroš Bizjak  <ubizjak@gmail.com>

	PR libfortran/88678
	* config/fpu-glibc.h (set_fpu_trap_exceptions): Clear stalled
	exception flags before changing trap mode.  Optimize to call
	feenableexcept and fedisableexcept only once.

From-SVN: r268493
2019-02-03 17:21:06 +01:00
GCC Administrator 620e386ae5 Daily bump.
From-SVN: r268481
2019-02-03 00:16:05 +00:00
Thomas Koenig 70081fe64a re PR fortran/88298 (Bogus conversion warning for CSHIFT with -fno-range-check -m64)
2019-02-02  Thomas Koenig  <tkoenig@gcc.gnu.org>

	PR fortran/88298
	Backport from trunk
	* arith.c (gfc_int2int): Do not warn if src->do_not_warn is set.
	* gfortran.h (gfc_expr): Add flag do_not_warn.
	* intrinsic.c (gfc_convert_type_warn): Set expr->do_not_warn if
	no warning is desired.

2019-02-02  Thomas Koenig  <tkoenig@gcc.gnu.org>

	PR fortran/88298
	Backport from trunk
	* gfortran.dg/warn_conversion_10.f90: New test.

From-SVN: r268479
2019-02-02 17:07:40 +00:00
Thomas Koenig 5a89ffe708 re PR fortran/57048 (Handling of C_PTR and C_FUNPTR leads to reject valid)
2019-02-02  Thomas Koenig  <tkoenig@gcc.gnu.org>

	PR fortran/57048
	Backport from trunk
	* interface.c (gfc_compare_types): If a derived type and an
	integer both have a derived type, and they are identical,
	this is a C binding type and compares equal.

2019-02-02  Thomas Koenig  <tkoenig@gcc.gnu.org>

	PR fortran/57048
	Backport from trunk
	* gfortran.dg/c_funptr_1.f90: New file.
	* gfortran.dg/c_funptr_1_mod.f90: New file.

From-SVN: r268478
2019-02-02 16:57:39 +00:00
GCC Administrator 0430654873 Daily bump.
From-SVN: r268467
2019-02-02 00:16:04 +00:00
GCC Administrator 35c866d2d0 Daily bump.
From-SVN: r268435
2019-02-01 00:16:05 +00:00
Bill Schmidt 16d6c1df72 backport: re PR middle-end/89008 (O2 and O1 results differ for simple test)
2018-01-31  Bill Schmidt  <wschmidt@linux.ibm.com>

	Backport from mainline
	2018-01-31  Bill Schmidt  <wschmidt@linux.ibm.com>

	PR tree-optimization/89008
	* gimple-ssa-strength-reduction.c (slsr_process_mul): Don't
	process anything of the form X * 0.

From-SVN: r268431
2019-01-31 21:55:45 +00:00
Richard Biener fb8700b9b4 backport: [multiple changes]
2019-01-31  Richard Biener  <rguenther@suse.de>

	Backport from mainline
	2019-01-31  Richard Biener  <rguenther@suse.de>

	PR rtl-optimization/89115
	* lra.c (lra_rtx_hash): Properly hash CONST_INT values.

	2019-01-30  Richard Biener  <rguenther@suse.de>

	PR rtl-optimization/89115
	* opts.c (default_options_optimization): Reduce
	PARAM_MAX_DSE_ACTIVE_LOCAL_STORES by a factor of 10 at -O1.
	Make PARAM_LOOP_INVARIANT_MAX_BBS_IN_LOOP reduction relative
	to the default.

From-SVN: r268418
2019-01-31 12:05:19 +00:00
GCC Administrator ceeedfe8c3 Daily bump.
From-SVN: r268408
2019-01-31 00:16:17 +00:00
Manfred Schwarb 13d26826f6 pr68318_1.f90: Fix a dg directive.
2019-01-30  Manfred Schwarb  <manfred99@gmx.ch>

	* gfortran.dg/pr68318_1.f90: Fix a dg directive.

From-SVN: r268393
2019-01-30 16:07:38 +01:00
Kewen Lin 045e28d433 backport: [multiple changes]
2019-01-30  Kewen Lin  <linkw@gcc.gnu.org>
    Backport from mainline.
    gcc/

        2019-01-17  Kewen Lin  <linkw@gcc.gnu.org>
        * doc/extend.texi: Add four new prototypes for vec_ld and seven new
        prototypes for vec_st.
        * config/rs6000/rs6000-c.c (altivec_overloaded_builtins): Add entries
        for scalar address type variants of altivec_vec_ld/altivec_vec_st,
        mainly on signed/unsigned long long and double.

    gcc/testsuite/
        
        2019-01-20  Kewen Lin  <linkw@gcc.gnu.org>
        * gcc.target/powerpc/altivec_vld_vst_addr.c: Remove, split into
        altivec_vld_vst_addr-1.c and altivec_vld_vst_addr-2.c.
        * gcc.target/powerpc/altivec_vld_vst_addr-1.c: New test.
        * gcc.target/powerpc/altivec_vld_vst_addr-2.c: Ditto.
        
        2019-01-17  Kewen Lin  <linkw@gcc.gnu.org>
        * gcc.target/powerpc/altivec_vld_vst_addr.c: New test.

From-SVN: r268383
2019-01-30 08:18:05 +00:00
GCC Administrator 4939512cb5 Daily bump.
From-SVN: r268373
2019-01-30 00:16:20 +00:00
GCC Administrator ece19b481a Daily bump.
From-SVN: r268351
2019-01-29 00:16:20 +00:00
GCC Administrator ea7f3fbf0e Daily bump.
From-SVN: r268328
2019-01-28 00:16:10 +00:00
Uros Bizjak f09270f1b9 re PR fortran/70696 ([Coarray] ICE on EVENT POST of host-associated EVENT_TYPE coarray)
PR fortran/70696
	* gfortran.dg/coarray/event_3.f0: Add save attribue to x.

From-SVN: r268327
2019-01-27 21:53:30 +01:00
Paul Thomas 7eb40d62a1 Backport PRs 56386, 58906, 77385, 80260, 82077
2019-01-27  Paul Thomas  <pault@gcc.gnu.org>

	Backport from trunk
	PR fortran/56386
	PR fortran/58906
	PR fortran/77385
	PR fortran/80260
	PR fortran/82077
	* resolve.c (resolve_variable): Fix up expressions with array
	associate names, where the parser did not detect that this is
	array and there was no array part_ref in the expression.
	* trans-expr.c (gfc_find_and_cut_at_last_class_ref): base_expr
	should be a copy of e and not the initialization expr.

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

	Backport from trunk
	PR fortran/56386
	PR fortran/58906
	PR fortran/77385
	* gfortran.dg/associate_44.f90 : New test.

	PR fortran/80260
	* gfortran.dg/select_type_45.f90 : New test.

	PR fortran/82077
	* gfortran.dg/select_type_46.f90 : New test.

From-SVN: r268317
2019-01-27 18:53:47 +00:00
Eric Botcazou 917c0e9176 decl.c (array_type_has_nonaliased_component): Return the same value for every dimension of a multidimensional array type.
* gcc-interface/decl.c (array_type_has_nonaliased_component): Return
	the same value for every dimension of a multidimensional array type.

From-SVN: r268316
2019-01-27 18:16:23 +00:00
Uros Bizjak f678b215e3 re PR rtl-optimization/88948 (ICE in elimination_costs_in_insn, at reload1.c:3640 since r264148)
PR target/88948
	* rtl.h (prepare_copy_insn): New prototype.
	* gcse.c (prepare_copy_insn): New function, split out from
	process_insert_insn.
	(process_insert_insn): Use prepare_copy_insn.
	* store-motion.c (replace_store_insn): Use prepare_copy_insn
	instead of gen_move_insn.

testsuite/ChangeLog:

	PR target/88948
	* gcc.target/i386/pr88948.c: New test.

From-SVN: r268312
2019-01-27 18:42:58 +01:00
GCC Administrator d880316e49 Daily bump.
From-SVN: r268306
2019-01-27 00:16:13 +00:00
Eric Botcazou 3ba9569b7b trans.c (gnat_to_gnu): Use DECL_SIZE_UNIT instead of TYPE_SIZE_UNIT for the size to be assigned by a...
* gcc-interface/trans.c (gnat_to_gnu) <N_Assignment_Statement>: Use
	DECL_SIZE_UNIT instead of TYPE_SIZE_UNIT for the size to be assigned
	by a call to memset if the LHS is a DECL.

From-SVN: r268298
2019-01-26 16:03:42 +00:00
Dominique d'Humieres 4692b23002 re PR fortran/85579 (accepts invalid fortran test case gfortran.dg/pr51434.f90)
2019-01-26  Dominique d'Humieres  <dominiq@gcc.gnu.org>

	PR fortran/85579
	* gfortran.dg/pr51434.f90: Fix the TRANSFER argument.

From-SVN: r268295
2019-01-26 16:25:45 +01:00
Manfred Schwarb 3595da2810 2019-01-26 Manfred Schwarb <manfred99@gmx.ch>
* gfortran.dg/array_function_5.f90
	* gfortran.dg/class_66.f90
	* gfortran.dg/dec_structure_12.f90
	* gfortran.dg/dec_structure_14.f90
	* gfortran.dg/dec_structure_15.f90
	* gfortran.dg/extends_11.f03
	* gfortran.dg/pr58968.f
	* gfortran.dg/pr78259.f90
	* gfortran.dg/debug/pr35154-stabs.f

From-SVN: r268294
2019-01-26 16:09:52 +01:00
Eric Botcazou 655e887b53 trans.c (struct loop_info_d): Remove artificial field.
* gcc-interface/trans.c (struct loop_info_d): Remove artificial field.
	(Loop_Statement_to_gnu): Do not set it.

From-SVN: r268292
2019-01-26 12:03:12 +00:00
Eric Botcazou 720a687a9b decl.c (annotate_value): Use test on the sign bit instead of on the sign of the value.
* gcc-interface/decl.c (annotate_value) <INTEGER_CST>: Use test on
	the sign bit instead of on the sign of the value.
	<PLUS_EXPR>: Turn addition of negative constant into subtraction.
	<BIT_AND_EXPR>: Simplify.

From-SVN: r268288
2019-01-26 11:36:05 +00:00
GCC Administrator 1e42cf1fb5 Daily bump.
From-SVN: r268282
2019-01-26 00:16:18 +00:00
GCC Administrator 12ac96b796 Daily bump.
From-SVN: r268254
2019-01-25 00:16:21 +00:00
Uros Bizjak f327612124 re PR target/88998 (bad codegen with mmx instructions for unordered_map)
PR target/88998
	* config/i386/sse.md (sse2_cvtpi2pd): Add SSE alternatives.
	Disparage MMX alternative.
	(sse2_cvtpd2pi): Ditto.
	(sse2_cvttpd2pi): Ditto.

testsuite/ChangeLog:

	PR target/88998
	* g++.dg/pr88998.c: New test.

From-SVN: r268244
2019-01-24 20:14:58 +01:00
Richard Biener 5402bc4ab8 backport: re PR middle-end/89008 (O2 and O1 results differ for simple test)
2019-01-24  Richard Biener  <rguenther@suse.de>

	Backport from mainline
	2019-01-23  Richard Biener  <rguenther@suse.de>

	PR tree-optimization/89008
	* tree-ssa-reassoc.c (eliminate_using_constants): For * 0 do
	not leave another stray operand.

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

From-SVN: r268235
2019-01-24 11:07:19 +00:00
GCC Administrator 3068600f90 Daily bump.
From-SVN: r268223
2019-01-24 00:16:07 +00:00
GCC Administrator 75c8fdd953 Daily bump.
From-SVN: r268172
2019-01-23 00:16:06 +00:00
Uros Bizjak f693957cbe re PR target/88938 (ICE in extract_insn, at recog.c:2304)
PR target/88938
	* config/i386/i386.c (ix86_expand_builtin) [case IX86_BUILTIN_BEXTRI32,
	case IX86_BUILTIN_BEXTRI64]: Sanitize operands.

testsuite/ChangeLog:

	PR target/88938
	* gcc.target/i386/pr88938.c: New test.

From-SVN: r268157
2019-01-22 17:35:53 +01:00
GCC Administrator 542035d0b0 Daily bump.
From-SVN: r268132
2019-01-22 00:16:27 +00:00
GCC Administrator 66459d06af Daily bump.
From-SVN: r268108
2019-01-21 00:16:22 +00:00
GCC Administrator 43beccd048 Daily bump.
From-SVN: r268099
2019-01-20 00:16:18 +00:00
GCC Administrator b30181d896 Daily bump.
From-SVN: r268087
2019-01-19 00:16:25 +00:00
Uros Bizjak 0b7420cc6c alpha.c (alpha_gimplify_va_arg): Handle split indirect COMPLEX_TYPE arguments.
* config/alpha/alpha.c (alpha_gimplify_va_arg):
	Handle split indirect COMPLEX_TYPE arguments.

From-SVN: r268081
2019-01-18 17:46:47 +01:00
GCC Administrator e3989953b4 Daily bump.
From-SVN: r268051
2019-01-18 00:16:28 +00:00
GCC Administrator a2893e2219 Daily bump.
From-SVN: r267997
2019-01-17 00:16:17 +00:00
Joseph Myers 10396eea18 Fix diagnostics for never-defined inline and nested functions (PR c/88720, PR c/88726).
Bugs 88720 and 88726 report issues where a function is declared inline
in an inner scope, resulting in spurious diagnostics about it being
declared but never defined when that scope is left (possibly in some
cases also wrongly referring to the function as a nested function).
These are regressions that were introduced with the support for C99
inline semantics in 4.3 (they don't appear with 4.2; it's possible
some aspects of the bugs might have been introduced later than 4.3).

For the case of functions being wrongly referred to as nested,
DECL_EXTERNAL was not the right condition for a function being
non-nested; TREE_PUBLIC is appropriate for the case of non-nested
functions with external linkage, while !b->nested means this is the
outermost scope in which the function was declared and so avoids
catching the case of a file-scope static being redeclared inline
inside a function.

For the non-nested, external-linkage case, the code attempts to avoid
duplicate diagnostics by diagnosing only when scope != external_scope,
but actually scope == external_scope is more appropriate, as it's only
when the file and external scopes are popped that the code can
actually tell whether a function ended up being defined, and all such
functions will appear in the (GCC-internal) external scope.

Bootstrapped with no regressions on x86_64-pc-linux-gnu.

gcc/c:
	Backport from mainline
	2019-01-07  Joseph Myers  <joseph@codesourcery.com>

	PR c/88720
	PR c/88726
	* c-decl.c (pop_scope): Use TREE_PUBLIC and b->nested to determine
	whether a function is nested, not DECL_EXTERNAL.  Diagnose inline
	functions declared but never defined only for external scope, not
	for other scopes.

gcc/testsuite:
	Backport from mainline
	2019-01-07  Joseph Myers  <joseph@codesourcery.com>

	PR c/88720
	PR c/88726
	* gcc.dg/inline-40.c, gcc.dg/inline-41.c: New tests.

From-SVN: r267987
2019-01-16 21:40:33 +00:00
Martin Jambor a8a204051a [PR 88214] Check that an argument is a pointer
2019-01-16  Martin Jambor  <mjambor@suse.cz>

	Backported from mainline
	2018-12-10  Martin Jambor  <mjambor@suse.cz>

	PR ipa/88214
	* ipa-prop.c (determine_locally_known_aggregate_parts): Make sure
	we check pointers against pointers.

	testsuite/
	* gcc.dg/ipa/pr88214.c: New test.

From-SVN: r267975
2019-01-16 16:41:07 +01:00
GCC Administrator 63999586cf Daily bump.
From-SVN: r267959
2019-01-16 00:16:09 +00:00
Steven G. Kargl 70d6a121a2 re PR fortran/81849 (Size of automatic array argument specified by host-associated variable.)
2019-01-15  Steven G. Kargl  <kargl@gcc.gnu.org>

	PR fortran/81849
	* resolve.c (resolve_symbol): Host associated varaibles can appear
	in the specification statement of a RESULT array.

2019-01-15  Steven G. Kargl  <kargl@gcc.gnu.org>

	PR fortran/81849
	* gfortran.dg/pr81849.f90: New test.

From-SVN: r267952
2019-01-15 20:53:13 +00:00
GCC Administrator 5933e00998 Daily bump.
From-SVN: r267927
2019-01-15 00:16:06 +00:00
Jerry DeLisle 7c24d270be re PR libfortran/88776 (Namelist read from stdin: loss of data)
2019-01-13  Jerry DeLisle  <jvdelisle@gcc.gnu.org>

	PR libfortran/88776
	* io/list_read.c (namelist_read): Use nml_err_ret path on read error
	not based on stdin_unit.
	* io/open.c (newunit): Free format buffer if the unit specified is for
	stdin, stdout, or stderr.

	* gfortran.dg/namelist_96.f90: New test.

From-SVN: r267911
2019-01-14 01:12:27 +00:00
GCC Administrator 8e58a56495 Daily bump.
From-SVN: r267907
2019-01-14 00:16:05 +00:00
GCC Administrator 71137e778f Daily bump.
From-SVN: r267899
2019-01-13 00:16:08 +00:00
Steven G. Kargl 1195efaf15 re PR fortran/35031 (ELEMENTAL procedure with BIND(C))
2019-01-11  Steven G. Kargl  <kargl@gcc.gnu.org>

	PR fortran/35031
	* decl.c (gfc_match_entry): Check for F2018:C1546.  Fix nearby
	mis-indentation.
 
2019-01-11  Steven G. Kargl  <kargl@gcc.gnu.org>

	PR fortran/35031
	* gfortran.dg/pr35031.f90: new test.

From-SVN: r267874
2019-01-12 00:33:01 +00:00
GCC Administrator c6decb1019 Daily bump.
From-SVN: r267870
2019-01-12 00:16:05 +00:00
GCC Administrator c9f9a216a2 Daily bump.
From-SVN: r267826
2019-01-11 00:16:06 +00:00
GCC Administrator 154e30e083 Daily bump.
From-SVN: r267790
2019-01-10 00:16:05 +00:00
Eric Botcazou be67240281 re PR target/84010 (problematic TLS code generation on 64-bit SPARC)
PR target/84010
	* config/sparc/sparc.c (sparc_legitimize_tls_address): Only use Pmode
	consistently in TLS address generation and adjust code to the renaming
	of patterns.  Mark calls to __tls_get_addr as const.
	* config/sparc/sparc.md (tgd_hi22): Turn into...
	(tgd_hi22<P:mode>): ...this and use Pmode throughout.
	(tgd_lo10): Turn into...
	(tgd_lo10<P:mode>): ...this and use Pmode throughout.
	(tgd_add32): Merge into...
	(tgd_add64): Likewise.
	(tgd_add<P:mode>): ...this and use Pmode throughout.
	(tldm_hi22): Turn into...
	(tldm_hi22<P:mode>): ...this and use Pmode throughout.
	(tldm_lo10): Turn into...
	(tldm_lo10<P:mode>): ...this and use Pmode throughout.
	(tldm_add32): Merge into...
	(tldm_add64): Likewise.
	(tldm_add<P:mode>): ...this and use Pmode throughout.
	(tldm_call32): Merge into...
	(tldm_call64): Likewise.
	(tldm_call<P:mode>): ...this and use Pmode throughout.
	(tldo_hix22): Turn into...
	(tldo_hix22<P:mode>): ...this and use Pmode throughout.
	(tldo_lox10): Turn into...
	(tldo_lox10<P:mode>): ...this and use Pmode throughout.
	(tldo_add32): Merge into...
	(tldo_add64): Likewise.
	(tldo_add<P:mode>): ...this and use Pmode throughout.
	(tie_hi22): Turn into...
	(tie_hi22<P:mode>): ...this and use Pmode throughout.
	(tie_lo10): Turn into...
	(tie_lo10<P:mode>): ...this and use Pmode throughout.
	(tie_ld64): Use DImode throughout.
	(tie_add32): Merge into...
	(tie_add64): Likewise.
	(tie_add<P:mode>): ...this and use Pmode throughout.
	(tle_hix22_sp32): Merge into...
	(tle_hix22_sp64): Likewise.
	(tle_hix22<P:mode>): ...this and use Pmode throughout.
	(tle_lox22_sp32): Merge into...
	(tle_lox22_sp64): Likewise.
	(tle_lox22<P:mode>): ...this and use Pmode throughout.
	(*tldo_ldub_sp32): Merge into...
	(*tldo_ldub_sp64): Likewise.
	(*tldo_ldub<P:mode>): ...this and use Pmode throughout.
	(*tldo_ldub1_sp32): Merge into...
	(*tldo_ldub1_sp64): Likewise.
	(*tldo_ldub1<P:mode>): ...this and use Pmode throughout.
	(*tldo_ldub2_sp32): Merge into...
	(*tldo_ldub2_sp64): Likewise.
	(*tldo_ldub2<P:mode>): ...this and use Pmode throughout.
	(*tldo_ldsb1_sp32): Merge into...
	(*tldo_ldsb1_sp64): Likewise.
	(*tldo_ldsb1<P:mode>): ...this and use Pmode throughout.
	(*tldo_ldsb2_sp32): Merge into...
	(*tldo_ldsb2_sp64): Likewise.
	(*tldo_ldsb2<P:mode>): ...this and use Pmode throughout.
	(*tldo_ldub3_sp64): Use DImode throughout.
	(*tldo_ldsb3_sp64): Likewise.
	(*tldo_lduh_sp32): Merge into...
	(*tldo_lduh_sp64): Likewise.
	(*tldo_lduh<P:mode>): ...this and use Pmode throughout.
	(*tldo_lduh1_sp32): Merge into...
	(*tldo_lduh1_sp64): Likewise.
	(*tldo_lduh1<P:mode>): ...this and use Pmode throughout.
	(*tldo_ldsh1_sp32): Merge into...
	(*tldo_ldsh1_sp64): Likewise.
	(*tldo_ldsh1<P:mode>): ...this and use Pmode throughout.
	(*tldo_lduh2_sp64): Use DImode throughout.
	(*tldo_ldsh2_sp64): Likewise.
	(*tldo_lduw_sp32): Merge into...
	(*tldo_lduw_sp64): Likewise.
	(*tldo_lduw<P:mode>): ...this and use Pmode throughout.
	(*tldo_lduw1_sp64): Use DImode throughout.
	(*tldo_ldsw1_sp64): Likewise.
	(*tldo_ldx_sp64): Likewise.
	(*tldo_stb_sp32): Merge into...
	(*tldo_stb_sp64): Likewise.
	(*tldo_stb<P:mode>): ...this and use Pmode throughout.
	(*tldo_sth_sp32): Merge into...
	(*tldo_sth_sp64): Likewise.
	(*tldo_sth<P:mode>): ...this and use Pmode throughout.
	(*tldo_stw_sp32): Merge into...
	(*tldo_stw_sp64): Likewise.
	(*tldo_stw<P:mode>): ...this and use Pmode throughout.
	(*tldo_stx_sp64): Use DImode throughout.

Co-Authored-By: James Clarke <jrtc27@jrtc27.com>

From-SVN: r267773
2019-01-09 14:41:55 +00:00
Eric Botcazou 768dd81d69 invoke.texi (-Os): Add reference to -finline-functions.
* doc/invoke.texi (-Os): Add reference to -finline-functions.
	(-finline-small-functions): Add references to -O3 and -Os.
	(-findirect-inlining): Likewise.
	(-finline-functions): Add references to -Os, -fprofile-use and
	-fauto-profile.

From-SVN: r267755
2019-01-09 08:25:55 +00:00
GCC Administrator 8c440e4399 Daily bump.
From-SVN: r267748
2019-01-09 00:16:06 +00:00
GCC Administrator 0ab2c9fccd Daily bump.
From-SVN: r267668
2019-01-08 00:16:18 +00:00
GCC Administrator 4a2777d69a Daily bump.
From-SVN: r267617
2019-01-07 00:16:17 +00:00
GCC Administrator 907420ee01 Daily bump.
From-SVN: r267604
2019-01-06 00:16:17 +00:00
Dominique d'Humieres cdb8f61fa0 re PR target/60563 (FAIL: g++.dg/ext/sync-4.C on *-apple-darwin*)
2019-01-05  Dominique d'Humieres  <dominiq@gcc.gnu.org>

	PR target/60563
	* g++.dg/ext/sync-4.C: Add dg-xfail-run-if for darwin.

From-SVN: r267597
2019-01-05 13:44:12 +01:00
GCC Administrator 887445cac6 Daily bump.
From-SVN: r267586
2019-01-05 00:16:20 +00:00
GCC Administrator cb6ad2e8e9 Daily bump.
From-SVN: r267566
2019-01-04 00:16:23 +00:00
Iain Sandoe b68f362a29 revert fix for pr88343
causes problems with soft-fp in GLIBC, see pr comment 11

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

	revert:
	2018-12-30  Iain Sandoe  <iain@sandoe.co.uk>

	backport from mainline.
	2018-12-12 Segher Boessenkool  <segher@kernel.crashing.org>
		   Iain Sandoe  <iain@sandoe.co.uk>

	PR target/88343
	* config/rs6000/rs6000.c (save_reg_p): Do not save the picbase reg
	unless it has been used.
	(first_reg_to_save): Remove dead code.

From-SVN: r267542
2019-01-03 08:34:41 +00:00
GCC Administrator a84152fc60 Daily bump.
From-SVN: r267538
2019-01-03 00:16:23 +00:00
Segher Boessenkool ba1cce8ea2 Backport of the "asm inline" patches
From-SVN: r267536
2019-01-02 23:49:04 +01:00
GCC Administrator f262721148 Daily bump.
From-SVN: r267500
2019-01-02 00:16:05 +00:00
GCC Administrator 45b5b0bb45 Daily bump.
From-SVN: r267489
2019-01-01 00:16:05 +00:00
GCC Administrator 05b1d7009e Daily bump.
From-SVN: r267479
2018-12-31 00:16:05 +00:00
Iain Sandoe 8abc77022e fix PR target/88343 for 32b powerpc.
2018-12-30  Iain Sandoe  <iain@sandoe.co.uk>

	backport from mainline.
	2018-12-12 Segher Boessenkool  <segher@kernel.crashing.org>
		   Iain Sandoe  <iain@sandoe.co.uk>

	PR target/88343
	* config/rs6000/rs6000.c (save_reg_p): Do not save the picbase reg
	unless it has been used.
	(first_reg_to_save): Remove dead code.

From-SVN: r267477
2018-12-30 13:20:19 +00:00
Dominique d'Humieres 01d54747a6 re PR tree-optimization/68356 (FAIL: gcc.dg/torture/pr68264.c -O* execution test on x86_64-apple-darwin1(0|4))
2018-12-30  Dominique d'Humieres  <dominiq@gcc.gnu.org>

	PR tree-optimization/68356
	PR target/81210
	* gcc.dg/torture/pr68264.c: Skip on darwin.
	* gcc.dg/torture/pr68037-1.c: Likewise.
	* gcc.dg/torture/pr68037-2.c: Likewise.
	* gcc.dg/torture/pr68037-3.c: Likewise.

From-SVN: r267476
2018-12-30 13:28:54 +01:00
GCC Administrator 8bbbe76e9c Daily bump.
From-SVN: r267471
2018-12-30 00:16:04 +00:00
Paul Thomas 8ededf6bd1 re PR fortran/82550 (program using submodules fails to link)
2018-12-29  Paul Thomas  <pault@gcc.gnu.org>

	PR fortran/82550
	* trans_decl.c (gfc_get_symbol_decl): Procedure symbols that
	have the 'used_in_submodule' attribute should be processed by
	'gfc_get_extern_function_decl'.

2018-12-29  Paul Thomas  <pault@gcc.gnu.org>

	PR fortran/82550
	* gfortran.dg/submodule_30.f08 : New test.

From-SVN: r267466
2018-12-29 18:21:39 +00:00
GCC Administrator 51877201df Daily bump.
From-SVN: r267458
2018-12-29 00:16:18 +00:00
GCC Administrator 58c86cfb69 Daily bump.
From-SVN: r267439
2018-12-28 00:16:05 +00:00
GCC Administrator a402a6cae9 Daily bump.
From-SVN: r267424
2018-12-27 00:16:08 +00:00
GCC Administrator 9ec1abf6c8 Daily bump.
From-SVN: r267419
2018-12-26 00:16:06 +00:00
GCC Administrator a685b5c4f7 Daily bump.
From-SVN: r267416
2018-12-25 00:16:25 +00:00
Iain Sandoe 48f3e7e93a Fix target/67974 for Darwin by adding AVX asm shim.
2018-12-24  Iain Sandoe  <iain@sandoe.co.uk>

	Backport from mainline
	2018-12-24  Iain Sandoe  <iain@sandoe.co.uk>

	PR testsuite/67974
	* gcc.target/x86_64/abi/avx/asm-support-darwin.s: New.

From-SVN: r267411
2018-12-24 13:41:16 +00:00
Iain Sandoe 2329198d40 Fix Ada boostrap for Darwin9 and earlier.
2018-12-24  Iain Sandoe  <iain@sandoe.co.uk>

	* adaint.c [__APPLE__] (__gnat_lwp_self): Ensure that the system
	interface used is available on the target.

From-SVN: r267410
2018-12-24 13:35:32 +00:00
Iain Sandoe b2e72faf99 Fix PR c++/87380 (ABI breakage) for Darwin.
2018-12-24  Iain Sandoe  <iain@sandoe.co.uk>

	Backport from mainline
	2018-12-06  Iain Sandoe  <iain@sandoe.co.uk>

	PR c++/87380
	* config/darwin.h (TARGET_WEAK_NOT_IN_ARCHIVE_TOC) Remove, use the
	default.
	* config/rs6000/darwin7.h (TARGET_WEAK_NOT_IN_ARCHIVE_TOC): New.

From-SVN: r267409
2018-12-24 13:17:28 +00:00
Iain Sandoe a77add8771 Fix build warnigns on Darwin, don't try to export construction vtable symbols.
2018-12-24  Iain Sandoe  <iain@sandoe.co.uk>

	Backport from mainline
	2018-12-06  Iain Sandoe  <iain@sandoe.co.uk>

	* scripts/make_exports.pl (check names): Don’t try to export
	construction vtable symbols.

From-SVN: r267408
2018-12-24 13:09:39 +00:00
Iain Sandoe 116a4b616a Fix libstdc++/64883 for Darwin.
2018-12-24  Iain Sandoe  <iain@sandoe.co.uk>

	Backport from mainline
	2018-12-06  Jonathan Wakely  <jwakely@redhat.com>
		    Iain Sandoe  <iain@sandoe.co.uk>

	PR libstdc++/64883
	* testsuite/17_intro/headers/c++1998/all_attributes.cc: Don't test
	always_inline on Darwin.
	* testsuite/17_intro/headers/c++2011/all_attributes.cc: Likewise.
	* testsuite/17_intro/headers/c++2014/all_attributes.cc: Likewise.
	* testsuite/17_intro/headers/c++2017/all_attributes.cc: Likewise.
	* testsuite/17_intro/headers/c++2020/all_attributes.cc: Likewise.

From-SVN: r267407
2018-12-24 13:01:04 +00:00
Iain Sandoe 615bf7d905 Fix target/78444 on x86/Darwin.
2018-12-24  Iain Sandoe  <iain@sandoe.co.uk>

	Backport from mainline
	2018-12-06  Iain Sandoe  <iain@sandoe.co.uk>

	PR target/78444
	* config/i386/darwin.h (STACK_BOUNDARY): Remove macro.
	* config/i386/i386.c (ix86_compute_frame_layout): Ensure at least 128b
	stack alignment in non-leaf functions.

From-SVN: r267406
2018-12-24 12:47:58 +00:00
Iain Sandoe ec4d7f527b Don't try to use pthread_barrier in tests on Darwin.
This was optional in SUSv6 and isn't implemented on Darwin.

2018-12-24  Iain Sandoe  <iain@sandoe.co.uk>

	2018-08-16  Iain Sandoe <iain@sandoe.co.uk>
 
	* g++.dg/torture/pr44295.C : Skip for Darwin.

From-SVN: r267405
2018-12-24 12:42:16 +00:00
Iain Sandoe d99c0500af Fix three tests for targets using _USER_LABEL_PREFIX_
2018-12-24  Iain Sandoe  <iain@sandoe.co.uk>

	Backport from mainline
	2018-08-22  Iain Sandoe  <iain@sandoe.co.uk>

	* gcc.dg/lto/pr85248_0.c (test_alias):
	Stringify __USER_LABEL_PREFIX__.
	(test_noreturn): Likewise.

	2018-08-16  Iain Sandoe <iain@sandoe.co.uk>
 
	* gcc.dg/memcmp-1.c (lib_memcmp): Apply __USER_LABEL_PREFIX__.
	(lib_strncmp): Likewise.

	2018-08-16  Iain Sandoe  <iain@sandoe.co.uk>

	* gcc.dg/asan/pr81923.c: Stringify __USER_LABEL_PREFIX__.

From-SVN: r267404
2018-12-24 12:38:51 +00:00
Iain Sandoe a69da9af9e Fix tree-prof section tests on Darwin.
Add Darwin section names.

2018-12-24  Iain Sandoe  <iain@sandoe.co.uk>

	Backport from mainline
	2018-08-16  Iain Sandoe <iain@sandoe.co.uk>

	PR testsuite/78544
	* gcc.dg/tree-prof/section-attr-1.c: Add Darwin-specific section
	attributes and matching.
	* gcc.dg/tree-prof/section-attr-2.c: Likewise.
	* gcc.dg/tree-prof/section-attr-3.c: Likewise.

From-SVN: r267403
2018-12-24 12:30:24 +00:00
Iain Sandoe f02c19cf9b Fix Darwin PR libstdc++/70694
2018-12-24  Iain Sandoe  <iain@sandoe.co.uk>

	Backport from mainline
	2018-08-25  Iain Sandoe  <iain@sandoe.co.uk>

	PR libstdc++/70694
	* configure.host (OPT_LDFLAGS): Don't append
	-fvisibility-inlines-hidden for newer Darwin.

From-SVN: r267402
2018-12-24 12:26:11 +00:00
Iain Sandoe ae19099556 fix Darwin target/81685
2018-12-24  Iain Sandoe  <iain@sandoe.co.uk>

	Backport from mainline
	2018-08-15  Iain Sandoe  <iain@sandoe.co.uk>

	PR target/81685
	* config/darwin.h: (DEBUG_STR_OFFSETS_SECTION, DEBUG_LOCLISTS_SECTION,
	DEBUG_RNGLISTS_SECTION) new macros.  (DEBUG_PUBNAMES_SECTION,
	DEBUG_PUBTYPES_SECTION) update to include GNU variant.

From-SVN: r267401
2018-12-24 12:20:18 +00:00
GCC Administrator f272b433e5 Daily bump.
From-SVN: r267389
2018-12-24 00:16:04 +00:00
Paul Thomas 59925de353 re PR fortran/77703 (ICE on assignment to pointer function)
2018-12-23  Paul Thomas  <pault@gcc.gnu.org>

	PR fortran/77703
	* resolve.c (get_temp_from_expr): Use the string length of
	constant character expressions.

2018-12-23  Paul Thomas  <pault@gcc.gnu.org>

	PR fortran/77703
	* gfortran.dg/ptr_func_assign_5.f08 : New test.

From-SVN: r267383
2018-12-23 20:01:44 +00:00
GCC Administrator 27634a64b0 Daily bump.
From-SVN: r267364
2018-12-23 00:16:13 +00:00
Steven G. Kargl 3ae9367ba2 re PR fortran/85798 (ICE in get_array_index, at fortran/data.c:69)
2018-12-22  Steven G . Kargl  <kargl@gcc.gnu.org>

	PR fortran/85798
	* decl.c (gfc_match_data): If a component of a derived type entity
	appears in data statement, check that does not have the allocatable
	attribute.
 
2018-12-22  Steven G . Kargl  <kargl@gcc.gnu.org>

	PR fortran/85798
	* gfortran.dg/pr85798.f90: New test.

From-SVN: r267362
2018-12-22 23:23:02 +00:00
Thomas Koenig 6e5003db5f backport: re PR fortran/85544 (ICE in gfc_conv_scalarized_array_ref, at fortran/trans-array.c:3385)
2018-12-22  Thomas Koenig  <tkoenig@gcc.gnu.org>

	Backport from trunk
	PR fortran/85544
	* frontend-passes.c (optimize_power): Remove.
	(optimize_op): Remove call to optimize_power.
	* trans-expr.c (gfc_conv_power_op): Handle cases of 1**integer,
	(2|4|8|16) ** integer and (-1) ** integer.

2018-12-22  Thomas Koenig  <tkoenig@gcc.gnu.org>

	Backport from trunk
	PR fortran/85544
	* gfortran.dg/power_7.f90: New test.

From-SVN: r267360
2018-12-22 20:16:22 +00:00
Steven G. Kargl 63a0aca90e re PR fortran/88169 (Rejects USE rename of namelist group)
2018-12-21  Steven G. Kargl  <kargl@gcc.gnu.org>

	PR fortran/88169
	* module.c (mio_namelist): Remove an error condition/message that
	is contrary to the Fortran standard.

2018-12-21  Steven G. Kargl  <kargl@gcc.gnu.org>

	PR fortran/88169
	* gfortran.dg/pr88169_1.f90: new test.
	* gfortran.dg/pr88169_2.f90: Ditto.
	* gfortran.dg/pr88169_3.f90: Ditto.

From-SVN: r267354
2018-12-22 18:09:19 +00:00
GCC Administrator 414ef24c67 Daily bump.
From-SVN: r267344
2018-12-22 00:16:19 +00:00
Uros Bizjak 9a3f341435 * ChangeLog: Add my last entry.
From-SVN: r267335
2018-12-21 19:15:49 +01:00
Uros Bizjak 06a9272de1 backport: re PR target/88418 (ICE in extract_insn, at recog.c:2305 (error: unrecognizable insn))
Backport from mainline
	2018-12-10  Uros Bizjak  <ubizjak@gmail.com>

	PR target/88418
	* config/i386/i386.c (ix86_expand_sse_cmp): For vector modes,
	check operand 1 with vector_operand predicate.
	(ix86_expand_sse_movcc): For vector modes, check op_true with
	vector_operand, not nonimmediate_operand.

testsuite/ChangeLog:

	Backport from mainline
	2018-12-10  Uros Bizjak  <ubizjak@gmail.com>

	PR target/88418
	* gcc.target/i386/pr88418.c: New test.

From-SVN: r267332
2018-12-21 19:11:04 +01:00
GCC Administrator 19a83dd2ad Daily bump.
From-SVN: r267315
2018-12-21 00:16:22 +00:00
GCC Administrator ea943bb9cb Daily bump.
From-SVN: r267289
2018-12-20 00:16:33 +00:00
Bill Schmidt 01ba73bce3 backport: extend.texi (PowerPC Altivec/VSX Built-in Functions): Describe when a typedef name can be used as the type specifier for a vector type...
2018-12-19  Bill Schmidt  <wschmidt@linux.ibm.com>

	Backport from mainline
	2018-12-18  Bill Schmidt  <wschmidt@linux.ibm.com>

	* doc/extend.texi (PowerPC Altivec/VSX Built-in Functions):
	Describe when a typedef name can be used as the type specifier for
	a vector type, and when it cannot.

From-SVN: r267284
2018-12-19 18:34:25 +00:00
Segher Boessenkool bc70153fd4 backport: re PR target/88213 (ICE in change_address_1, at emit-rtl.c:2286)
Backport from trunk
	2018-12-19  Segher Boessenkool  <segher@kernel.crashing.org>

	PR target/88213
	* config/rs6000/vsx.md (*vsx_extract_<P:mode>_<VSX_D:mode>_load):
	Require TARGET_POWERPC64.

From-SVN: r267265
2018-12-19 15:04:22 +01:00
GCC Administrator 04a3f22985 Daily bump.
From-SVN: r267246
2018-12-19 00:16:05 +00:00
GCC Administrator 24efbaf8cf Daily bump.
From-SVN: r267223
2018-12-18 00:16:23 +00:00
Senthil Kumar Selvaraj 80ad71d189 backport: re PR rtl-optimization/88253 (Inlining of function incorrectly deletes volatile register access when using XOR in avr-gcc)
2018-12-17  Senthil Kumar Selvaraj  <senthilkumar.selvaraj@microchip.com>

	Backport from trunk
	2018-12-17  Senthil Kumar Selvaraj  <senthilkumar.selvaraj@microchip.com>

	PR rtl-optimization/88253
	* combine.c (combine_simplify_rtx): Test for side-effects before
	substituting by zero.

2018-12-17  Senthil Kumar Selvaraj  <senthilkumar.selvaraj@microchip.com>

	Backport from trunk
	2018-12-17  Senthil Kumar Selvaraj  <senthilkumar.selvaraj@microchip.com>

	PR rtl-optimization/88253
	* gcc.target/avr/pr88253.c: New test.

From-SVN: r267201
2018-12-17 13:26:50 +00:00
GCC Administrator 791ee32f70 Daily bump.
From-SVN: r267193
2018-12-17 00:16:41 +00:00
GCC Administrator e3c096b85c Daily bump.
From-SVN: r267181
2018-12-16 00:16:05 +00:00
Steven G. Kargl b5c448f284 re PR fortran/88138 (ICE in gfc_arith_concat, at fortran/arith.c:1007)
2018-12-15  Steven G. Kargl  <kargl@gcc.gnu.org>

	PR fortran/88138
	* decl.c (variable_decl): Check that a derived isn't being assigned
	an incompatible entity in an initialization.
 
2018-12-15  Steven G. Kargl  <kargl@gcc.gnu.org>

	PR fortran/88138
	* gfortran.dg/pr88138.f90: new test.

From-SVN: r267180
2018-12-15 23:57:03 +00:00
Segher Boessenkool f3654355b5 backport: re PR rtl-optimization/88001 (ASMCONS cannot handle properly UNSPEC(CONST))
Backport from trunk
	2018-12-14  Segher Boessenkool  <segher@kernel.crashing.org>

	PR rtl-optimization/88001
	* function.c (match_asm_constraints_1): Don't invalidly share RTL.

From-SVN: r267172
2018-12-15 13:07:42 +01:00
GCC Administrator b8a72f92ee Daily bump.
From-SVN: r267161
2018-12-15 00:16:12 +00:00
GCC Administrator 3be468ab8a Daily bump.
From-SVN: r267115
2018-12-14 00:16:21 +00:00
Peter Bergner 5241690ceb backport: target.h (htm_available): Add support for PPC_FEATURE2_HTM_NO_SUSPEND.
libitm/
	Backport from mainline
	2018-12-13  Peter Bergner  <bergner@linux.ibm.com>

	* config/powerpc/target.h (htm_available):  Add support for
	PPC_FEATURE2_HTM_NO_SUSPEND.  Use __builtin_cpu_supports if available.

From-SVN: r267103
2018-12-13 12:08:47 -06:00
Andreas Krebbel 6304f16966 S/390: Fix zvector vec_double builtin
The (unsigned) long int to double vector conversion instructions
expect 2 immediate parameters. One for the inexact suppression
control and another one for the rounding mode.  However, the
vec_double builtin has just the vector source operand.  The 2
addtional operands need to be added with an intermediate expander.
The expanders were already there but unfortunately not wired up
correctly to the builtin.

gcc/ChangeLog:

2018-12-13  Andreas Krebbel  <krebbel@linux.ibm.com>

	Backport from mainline
	2018-12-13  Andreas Krebbel  <krebbel@linux.ibm.com>

	* config/s390/s390-builtins.def (s390_vec_double_s64): Map to
	s390_vec_double_s64 instead of s390_vcdgb.
	(s390_vec_double_u64): Map to s390_vec_double_u64 instead of
	s390_vcdlgb.

gcc/testsuite/ChangeLog:

2018-12-13  Andreas Krebbel  <krebbel@linux.ibm.com>

	Backport from mainline
	2018-12-13  Andreas Krebbel  <krebbel@linux.ibm.com>

	* gcc.target/s390/zvector/vec-double-1.c: New test.
	* gcc.target/s390/zvector/vec-double-2.c: New test.

From-SVN: r267088
2018-12-13 12:07:58 +00:00
Andreas Krebbel b248b013d2 S/390: Use VEC_INEXACT/VEC_NOINEXACT instead of magic numbers.
2018-12-13  Andreas Krebbel  <krebbel@linux.ibm.com>

	Backport from mainline
	2018-12-13  Andreas Krebbel  <krebbel@linux.ibm.com>

	* config/s390/vx-builtins.md ("vec_ctd_s64", "vec_ctd_u64")
	("vec_ctsl", "vec_ctul"): Replace 0 with VEC_NOINEXACT.
	("vec_double_s64", "vec_double_u64"): Replace 4 with VEC_INEXACT.

From-SVN: r267087
2018-12-13 12:06:40 +00:00
GCC Administrator e5f668fb33 Daily bump.
From-SVN: r267072
2018-12-13 00:16:10 +00:00
Peter Bergner 3054517e78 backport: re PR target/87496 (ICE in aggregate_value_p at gcc/function.c:2046)
gcc/
	Backport from mainline
	2018-12-07  Peter Bergner  <bergner@linux.ibm.com>

	PR target/87496
	* config/rs6000/rs6000.c (rs6000_option_override_internal): Disallow
	-mabi=ieeelongdouble and -mabi=ibmlongdouble without -mlong-double-128.
	Do not error for -mabi=ibmlongdouble and no ISA 2.06 support.
	* doc/invoke.texi: Document -mabi=ibmlongdouble and -mabi=ieeelongdouble
	require -mlong-double-128.

gcc/testsuite/
	Backport from mainline
	2018-12-07  Peter Bergner  <bergner@linux.ibm.com>

	PR target/87496
	* gcc.target/powerpc/pr87496-1.c: New test.
	* gcc.target/powerpc/pr87496-2.c: New test.
	* gcc.target/powerpc/pr87496-3.c: New test.

From-SVN: r267062
2018-12-12 11:20:41 -06:00
Steven G. Kargl b66944b934 re PR fortran/88155 (ICE in gfc_format_decoder, at fortran/error.c:947)
2018-12-11  Steven G. Kargl  <kargl@gcc.gnu.org>

	PR fortran/88155
	* primary.c (gfc_match_structure_constructor):  Set the locus of
	an expression to avoid a NULL pointer dereference.

2018-12-11  Steven G. Kargl  <kargl@gcc.gnu.org>

	PR fortran/88155
	* gfortran.dg/pr70870_1.f90: Update testcase to use -std=gnu.
	* gfortran.dg/pr88155.f90: New test.

From-SVN: r267043
2018-12-12 01:26:12 +00:00
GCC Administrator f94e50b3a7 Daily bump.
From-SVN: r267038
2018-12-12 00:16:09 +00:00
Steven G. Kargl 9974020e48 re PR fortran/88249 (ICE in gfc_resolve_filepos, at fortran/io.c:2853)
2018-12-11  Steven G. Kargl  <kargl@gcc.gnu.org>

	PR fortran/88249
	* gfortran.h: Update prototype for gfc_resolve_filepos().
	* io.c (gfc_resolve_filepos): Check for UNIT number if ERR= is present.
	Use passed in locus for error message.
	* resolve.c (gfc_resolve_code): Pass locus in gfc_resolve_filepos()
	call.

2018-12-11  Steven G. Kargl  <kargl@gcc.gnu.org>

	PR fortran/88249
	* gfortran.dg/pr88249.f90: New test.

From-SVN: r267037
2018-12-12 00:08:12 +00:00
GCC Administrator cba889a6ea Daily bump.
From-SVN: r266964
2018-12-11 00:16:18 +00:00
Steven G. Kargl f7b3c0032f re PR fortran/88269 (ICE in gfc_format_decoder, at fortran/error.c:947)
2018-12-10  Steven G. Kargl  <kargl@gcc.gnu.org>

	PR fortran/88269
	* io.c (io_constraint): Update macro. If locus line buffer is NULL,
	use gfc_current_locus in error messages.
	(check_io_constraints): Catch missing IO UNIT in write and read
	statements.  io_constraint macro is incompatible here.

2018-12-10  Steven G. Kargl  <kargl@gcc.gnu.org>

	PR fortran/88269
	* gfortran.dg/pr88269.f90: New test.

From-SVN: r266962
2018-12-10 20:03:32 +00:00
Steven G. Kargl 40540bf8fc re PR fortran/88205 (ICE in gfc_wide_strncasecmp, at fortran/scanner.c:249)
2018-12-09  Steven G. Kargl  <kargl@gcc.gnu.org>

	PR fortran/88205
	* io.c (gfc_match_open): Move NEWUNIT checks to after STATUS checks.

2018-12-09  Steven G. Kargl  <kargl@gcc.gnu.org>

	PR fortran/88205
	* gfortran.dg/pr88205.f90: New unit.

From-SVN: r266941
2018-12-10 01:25:47 +00:00
GCC Administrator 8175acafb4 Daily bump.
From-SVN: r266937
2018-12-10 00:16:24 +00:00
Steven G. Kargl 22bdb5bdc4 re PR fortran/88206 (ICE in gfc_match_type_spec, at fortran/match.c:2229)
2018-12-09  Steven G. Kargl  <kargl@gcc.gnu.org>

	PR fortran/88206
	* match.c (gfc_match_type_spec): REAL can be an intrinsic function.

2018-12-09  Steven G. Kargl  <kargl@gcc.gnu.org>

	PR fortran/88206
	* gfortran.dg/pr88206.f90: New test.

From-SVN: r266934
2018-12-09 20:23:06 +00:00
Steven G. Kargl 1703682cc5 [multiple changes]
2018-12-09  Fritz Reese  <fritzoreese@gmail.com>

	PR fortran/88228
	* resolve.c (resolve_operator):  Do not call resolve_function.
	Break like other cases.

2018-12-09  Steven G. Kargl  <kargl@gcc.gnu.org>

	PR fortran/88228
	* gfortran.dg/pr88228.f90: New test.

From-SVN: r266928
2018-12-09 18:32:01 +00:00
GCC Administrator 4bb97e219b Daily bump.
From-SVN: r266910
2018-12-09 00:16:24 +00:00
GCC Administrator 3789c937ef Daily bump.
From-SVN: r266901
2018-12-08 00:16:20 +00:00
GCC Administrator e35f06cde2 Daily bump.
From-SVN: r266882
2018-12-07 00:16:13 +00:00
Janne Blomqvist 4c11935a35 Initialize backtrace state once
From backtrace.h for backtrace_create_state:

   Calling this function allocates resources that can not be freed.
   There is no backtrace_free_state function.  The state is used to
   cache information that is expensive to recompute.  Programs are
   expected to call this function at most once and to save the return
   value for all later calls to backtrace functions.

So instead of calling backtrace_create_state every time we wish to
show a backtrace, do it once and store the result in a static
variable.  libbacktrace allows multiple threads to access the state,
so no need to use TLS, but use atomic load/store to access the static
variable.

Regtested on x86_64-pc-linux-gnu.

libgfortran/ChangeLog:

2018-12-06  Janne Blomqvist  <jb@gcc.gnu.org>

	Backport from trunk
	PR libfortran/88137
	* runtime/backtrace.c (show_backtrace): Store backtrace state in a
	static variable, initialize once.

From-SVN: r266858
2018-12-06 17:38:25 +02:00
Richard Biener cefd53ccca BASE-VER: Increment to 7.4.1.
2018-12-06  Richard Biener  <rguenther@suse.de>

        * BASE-VER: Increment to 7.4.1.

From-SVN: r266849
2018-12-06 11:02:34 +00:00
Richard Biener adafdb1e72 Update ChangeLog and version files for release
From-SVN: r266844
2018-12-06 10:00:03 +00:00
GCC Administrator 1f42849d79 Daily bump.
From-SVN: r266835
2018-12-06 00:16:14 +00:00
GCC Administrator cc92654f0a Daily bump.
From-SVN: r266808
2018-12-05 00:16:10 +00:00
GCC Administrator 91ad9d4dcf Daily bump.
From-SVN: r266767
2018-12-04 00:16:07 +00:00
GCC Administrator 166f8a0928 Daily bump.
From-SVN: r266730
2018-12-03 00:16:13 +00:00
GCC Administrator b307104c04 Daily bump.
From-SVN: r266715
2018-12-02 00:16:05 +00:00
GCC Administrator 3ce09b6227 Daily bump.
From-SVN: r266703
2018-12-01 00:16:30 +00:00
GCC Administrator a668abc3d3 Daily bump.
From-SVN: r266655
2018-11-30 00:16:06 +00:00
GCC Administrator 950512a211 Daily bump.
From-SVN: r266595
2018-11-29 00:16:06 +00:00
Richard Biener 87ac68c8e5 re PR tree-optimization/79351 (Invalid tree PRE optimization around compound literal)
2018-11-28  Richard Biener  <rguenther@suse.de>

	PR tree-optimization/79351
	* tree-ssa-sccvn.c (vn_reference_lookup_3): For assignments from
	empty CONSTRUCTORs ensure the store is at a constant position.

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

From-SVN: r266556
2018-11-28 12:57:58 +00:00
François Dumont 4e070cb28f re PR libstdc++/88199 (memory leak on unordered container move assignment)
2018-11-28  François Dumont  <fdumont@gcc.gnu.org>

	PR libstdc++/88199
	* include/bits/hashtable.h
	(_Hashtable<>::_M_move_assign(_Hashtable&&, false_type)): Deallocate
	former buckets after assignment.
	* testsuite/23_containers/unordered_set/allocator/move_assign.cc
	(test03): New.

From-SVN: r266542
2018-11-28 06:19:38 +00:00
GCC Administrator 33ffc7f3ac Daily bump.
From-SVN: r266538
2018-11-28 00:16:10 +00:00
GCC Administrator a7daa2258a Daily bump.
From-SVN: r266497
2018-11-27 00:16:13 +00:00
Iain Sandoe f236bc59e4 darwin - backport r263763 to fix PR81033
2018-11-26  Iain Sandoe  <iain@sandoe.co.uk>

	Backport from mainline
	2018-08-22  Iain Sandoe  <iain@sandoe.co.uk>

	PR bootstrap/81033
	PR target/81733
	PR target/52795
	* gcc/dwarf2out.c (FUNC_SECOND_SECT_LABEL): New.
	(dwarf2out_switch_text_section): Generate a local label for the second
	function sub-section and apply it as the second FDE start label.
	* gcc/final.c (final_scan_insn_1): Emit second FDE label after the second
	sub-section start.

From-SVN: r266478
2018-11-26 19:49:19 +00:00
Iain Sandoe 7f96173776 darwin - backport r26355, remove unused target hook.
2018-11-26  Iain Sandoe  <iain@sandoe.co.uk>

	Backport from mainline
	2018-08-15  Iain Sandoe  <iain@sandoe.co.uk>
 
	* config/darwin.c
	(darwin_function_switched_text_sections): Delete.
	* gcc/config/darwin.h
	(TARGET_ASM_FUNCTION_SWITCHED_TEXT_SECTIONS): Likewise.

From-SVN: r266477
2018-11-26 19:46:24 +00:00
Richard Biener 1a2397397d re PR c++/84281 (Heap grows indefinitely)
PR c++/84281

2018-02-12  Richard Biener  <rguenther@suse.de>

	* constexpr.c (cxx_eval_vec_init_1): Use a RANGE_EXPR to compact
	uniform constructors and delay allocating them fully.

From-SVN: r266469
2018-11-26 10:53:48 -05:00
Jason Merrill b37b6c65f8 PR c++/87075 - ICE with constexpr array initialization.
My patch of 2016-08-26 to avoid calling a trivial default constructor
introduced TARGET_EXPRs initialized with void_node to express trivial
initialization.  But when this shows up in a VEC_INIT_EXPR, we weren't
prepared to handle it.  Fixed by handling it explicitly in
cxx_eval_vec_init_1.

	* constexpr.c (cxx_eval_vec_init_1): Handle trivial initialization.

From-SVN: r266468
2018-11-26 10:53:43 -05:00
Andreas Krebbel 78015f6b32 S/390: Fix flogr RTX.
The flogr instruction uses a 64 bit register pair target operand.  In
the RTX we model this as a write to a TImode register.  Unfortunately
the RTX's being assigned to the two parts of the target operand were
swapped.  This is no problem if in the end the flogr instruction will
be emitted since the instruction still does what the clzdi expander
expects.  However, a problem arises when the RTX is used to optimize
CLZ for a constant input operand.  Even then it matters only if the
expression couldn't be folded on tree level already.

In the testcase this happened thanks to loop unrolling on RTL level.
The iteration variable is used as an argument to the clz
builtin. Due to the loop unrolling it becomes a constant and after
folding the broken RTX leads to a wrong assumption.

gcc/ChangeLog:

2018-11-26  Andreas Krebbel  <krebbel@linux.ibm.com>

	Backport from mainline
	2018-11-20  Andreas Krebbel  <krebbel@linux.ibm.com>

	* config/s390/s390.md ("clztidi2"): Swap the RTX's written to the
	DImode parts of the target operand.

gcc/testsuite/ChangeLog:

2018-11-26  Andreas Krebbel  <krebbel@linux.ibm.com>

	Backport from mainline
	2018-11-20  Andreas Krebbel  <krebbel@linux.ibm.com>

	* gcc.target/s390/flogr-1.c: New test.

From-SVN: r266466
2018-11-26 15:29:27 +00:00
Andreas Krebbel d2fd70ca30 S/390: Document z14/arch12 -march option.
gcc/ChangeLog:

2018-11-26  Andreas Krebbel  <krebbel@linux.ibm.com>

	Backport from mainline
	2018-11-26  Andreas Krebbel  <krebbel@linux.ibm.com>

	* doc/invoke.texi: Document z14/arch12 -march option.

From-SVN: r266464
2018-11-26 15:08:49 +00:00
Richard Biener ed567c8b5d re PR tree-optimization/87645 (gcc hangs up on vr_values::vrp_visit_assignment_or_call)
2018-10-19  Richard Biener  <rguenther@suse.de>

	PR middle-end/87645
	Backport from mainline
	2018-07-12  Richard Biener  <rguenther@suse.de>

	* gimple-match-head.c (gimple_resimplify1): Apply recursion
	limit.
	(gimple_resimplify2): Likewise.
	(gimple_resimplify3): Likewise.
	(gimple_resimplify4): Likewise.

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

From-SVN: r266461
2018-11-26 14:16:01 +00:00
Richard Biener a3ca04d305 backport: [multiple changes]
2018-11-26  Richard Biener  <rguenther@suse.de>

	Backport from mainline
	2018-10-15  Richard Biener  <rguenther@suse.de>

	PR middle-end/87610
	* tree-ssa-structalias.c (struct vls_data): Add escaped_p member.
	(visit_loadstore): When a used restrict tag escaped verify that
	the points-to solution of "other" pointers do not include
	escaped.
	(compute_dependence_clique): If a used restrict tag escaped
	communicated that down to visit_loadstore.

	* gcc.dg/torture/restrict-6.c: New testcase.

	2018-10-25  Richard Biener  <rguenther@suse.de>

	PR tree-optimization/87665
	PR tree-optimization/87745
	* tree-vectorizer.h (get_earlier_stmt): Remove.
	(get_later_stmt): Pick up UID from the original non-pattern stmt.

	* gfortran.dg/20181025-1.f: New testcase.

	2018-10-24  Richard Biener  <rguenther@suse.de>

	PR tree-optimization/87665
	* tree-vect-data-refs.c (vect_preserves_scalar_order_p): Adjust
	to reflect reality.

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

From-SVN: r266460
2018-11-26 13:31:21 +00:00
Richard Biener 6f912a34e7 backport: [multiple changes]
2018-11-26  Richard Biener  <rguenther@suse.de>

	Backport from mainline
	2018-06-14  Richard Biener  <rguenther@suse.de>

	PR middle-end/86139
	* tree-vect-generic.c (build_word_mode_vector_type): Remove
	duplicate and harmful type_hash_canon.

	2018-06-15  Richard Biener  <rguenther@suse.de>

	PR middle-end/86076
	* tree-cfg.c (move_stmt_op): unshare invariant addresses
	before adjusting their block.

	* gcc.dg/pr86076.c: New testcase.

From-SVN: r266458
2018-11-26 11:59:05 +00:00
Matthias Klose 5fb6435b8b test-long-names.c: Fix build with -Wformat-security.
2018-11-26  Matthias Klose  <doko@ubuntu.com>

        * jit.dg/test-long-names.c: Fix build with -Wformat-security.

From-SVN: r266457
2018-11-26 11:57:16 +00:00
GCC Administrator 87fa8ed3e2 Daily bump.
From-SVN: r266442
2018-11-26 00:16:29 +00:00
Thomas Koenig 3262f0e070 backport: re PR fortran/88073 (Internal compiler error compiling WHERE construct with -O or -O2)
2018-11-25  Thomas Koenig  <tkoenig@gcc.gnu.org>

	Backport from trunk
	PR fortran/88073
	* frontend-passes.c (combine_array_constructor): Do not do
	anything if in a WHERE statement.

2018-11-25  Thomas Koenig  <tkoenig@gcc.gnu.org>

	Backport from trunk
	PR fortran/88073
	* gfortran.dg/where_7.f90: New test.

From-SVN: r266437
2018-11-25 15:23:18 +00:00
GCC Administrator 6c36d65d2d Daily bump.
From-SVN: r266432
2018-11-25 00:16:13 +00:00
Paul Thomas 57c426a788 re PR fortran/88143 (ICE in resolve_variable at gcc/fortran/resolve.c:5413 since r253077)
2018-11-24  Paul Thomas  <pault@gcc.gnu.org>

	PR fortran/88143
	* resolve.c (resolve_variable): Check for associate names with
	NULL target.

2018-11-24  Paul Thomas  <pault@gcc.gnu.org>

	PR fortran/88143
	* gfortran.dg/associate_46.f90: New test.

From-SVN: r266431
2018-11-24 18:54:52 +00:00
GCC Administrator 383675636b Daily bump.
From-SVN: r266423
2018-11-24 00:16:15 +00:00
GCC Administrator 78c042d23a Daily bump.
From-SVN: r266398
2018-11-23 00:16:11 +00:00
Uros Bizjak 6f71f1f5d2 * testsuite/ChangeLog: Fix whitespace.
From-SVN: r266394
2018-11-22 23:47:46 +01:00
Uros Bizjak abc6cec873 backport: re PR target/88051 (internal compiler error: in add_clobbers, at config/i386/sync.md:1762)
Backport from mainline
	2018-11-16  Uros Bizjak  <ubizjak@gmail.com>

	PR target/88051
	* config/i386/sse.md (UNSPEC_MOVDI_TO_SSE): New UNSPEC.
	(movdi_to_sse): Rewrite using UNSPEC_MOVDI_TO_SSE unspec.

From-SVN: r266393
2018-11-22 23:46:54 +01:00
Eric Botcazou ce728b0c04 backport: re PR rtl-optimization/85925 (compilation of masking with 257 goes wrong in combine at -02)
Backport from mainline
	2018-11-21  Jakub Jelinek  <jakub@redhat.com>

	PR rtl-optimization/85925
	* gcc.c-torture/execute/20181120-1.c: Require effective target
	int32plus.
	(u): New variable.
	(main): Compare d against u.f1 rather than 0x101.  Use 0x4030201
	instead of 0x10101.

From-SVN: r266384
2018-11-22 16:29:50 +00:00
Tom de Vries df1ccb446d Backport "[vms] Add missing vmsdbgout_early_finish"
2018-11-22  Tom de Vries  <tdevries@suse.de>

	backport from trunk:
	2017-11-19  Tom de Vries  <tom@codesourcery.com>

	PR target/82961
	* vmsdbgout.c (vmsdbgout_early_finish): New function.
	(vmsdbg_debug_hooks): Set early_finish field to vmsdbgout_early_finish.

From-SVN: r266375
2018-11-22 13:12:41 +00:00
GCC Administrator e525707a8c Daily bump.
From-SVN: r266362
2018-11-22 00:16:06 +00:00
Mihail Ionescu 5178702f1c backport: [multiple changes]
2018-11-21  Mihail Ionescu  <mihail.ionescu@arm.com>

gcc/
	PR target/87867
	Backport from mainiline
	2018-09-26  Eric Botcazou  <ebotcazou@adacore.com>

	* config/arm/arm.c (arm_reorg): Skip Thumb reorg pass for thunks.
	(arm32_output_mi_thunk): Deal with long calls.

gcc/testsuite/
	PR target/87867
	Backport from mainiline
	2018-09-17  Eric Botcazou  <ebotcazou@adacore.com>

	* g++.dg/other/thunk2a.C: New test.
	* g++.dg/other/thunk2b.C: Likewise.

From-SVN: r266348
2018-11-21 16:50:37 +00:00
GCC Administrator 614af7de4b Daily bump.
From-SVN: r266330
2018-11-21 00:16:16 +00:00
Richard Biener 19319573cd backport: [multiple changes]
2018-11-20  Richard Biener  <rguenther@suse.de>

	Backport from mainline
	2018-03-12  Richard Biener  <rguenther@suse.de>

	PR tree-optimization/84777
	* tree-ssa-loop-ch.c (should_duplicate_loop_header_p): For
	force-vectorize loops ignore whether we are optimizing for size.

	2018-01-26  Richard Biener  <rguenther@suse.de>

	PR rtl-optimization/84003
	* dse.c (record_store): Only record redundant stores when
	the earlier store aliases at least all accesses the later one does.

	* g++.dg/torture/pr77745.C: Mark foo noinline to trigger
	latent bug in DSE if NOINLINE is appropriately defined.
	* g++.dg/torture/pr77745-2.C: New testcase including pr77745.C
	and defining NOINLINE.

From-SVN: r266318
2018-11-20 14:47:49 +00:00
Xuepeng Guo 8c3290e6f3 backport: re PR target/87853 (_mm_cmpgt_epi8 broken with -funsigned-char)
Backport from mainline
        2018-11-05  Xuepeng Guo  <xuepeng.guo@intel.com>

        PR target/87853
        * config/i386/emmintrin.h (__v16qs): New to cope with option
        -funsigned-char.
        (_mm_cmpeq_epi8): Replace __v16qi with __v16qs.
        (_mm_cmplt_epi8): Likewise.
        (_mm_cmpgt_epi8): Likewise.

From-SVN: r266317
2018-11-20 14:35:43 +00:00
Eric Botcazou 0d0d194c74 re PR rtl-optimization/85925 (compilation of masking with 257 goes wrong in combine at -02)
2018-11-20  Eric Botcazou  <ebotcazou@adacore.com>

	PR rtl-optimization/85925
	* rtl.h (word_register_operation_p): New predicate.
	* combine.c (record_dead_and_set_regs_1): Only apply specific handling
	for WORD_REGISTER_OPERATIONS targets to word_register_operation_p RTX.
	* rtlanal.c (nonzero_bits1): Likewise.  Adjust couple of comments.
	(num_sign_bit_copies1): Likewise.

From-SVN: r266304
2018-11-20 09:04:12 +00:00
GCC Administrator 137bbd5413 Daily bump.
From-SVN: r266291
2018-11-20 00:16:28 +00:00
GCC Administrator 441031756f Daily bump.
From-SVN: r266257
2018-11-19 00:16:23 +00:00
Uros Bizjak effe5b750c backport: re PR target/87928 (ICE in ix86_compute_frame_layout, at config/i386/i386.c:11161 since r228607)
Backport from mainline
	2018-11-11  Uros Bizjak  <ubizjak@gmail.com>

	PR target/87928
	* config/i386/i386.h (STACK_BOUNDARY): Use TARGET_64BIT_MS_ABI
	instead of (TARGET_64BIT && ix86_abi == MS_ABI).
	* config/i386/darwin.h (STACK_BOUNDARY): Ditto.
	* config/i386/cygming.h (STACK_BOUNDARY): Remove.

testsuite/ChangeLog:

	Backport from mainline
	2018-11-11  Uros Bizjak  <ubizjak@gmail.com>

	PR target/87928
	* gcc.target/i386/pr87928.c: New test.

From-SVN: r266254
2018-11-18 22:36:30 +01:00
GCC Administrator 46e7b61679 Daily bump.
From-SVN: r266243
2018-11-18 00:16:17 +00:00
GCC Administrator eda372a0fd Daily bump.
From-SVN: r266227
2018-11-17 00:16:18 +00:00
GCC Administrator ce68261484 Daily bump.
From-SVN: r266196
2018-11-16 00:16:11 +00:00
Nathan Sidwell 17cfe4f1ae [debug/88006] -fdebug-types-section gives undefined ref
https://gcc.gnu.org/ml/gcc-patches/2018-11/msg01280.html
	PR debug/88006
	PR debug/87462
	* dwarf2out.c (dwarf2out_finish): Apply resolve_addr to comdat
	type list.

	* g++.dg/debug/dwarf2/pr87462.C: New.
	* g++.dg/debug/dwarf2/pr88006.C: New.

From-SVN: r266185
2018-11-15 14:31:35 +00:00
Eric Botcazou 848b45772e misc.c (gnat_init_gcc_eh): Do not override the switch -fnon-call-exceptions passed on the command line in...
* gcc-interface/misc.c (gnat_init_gcc_eh): Do not override the switch
	-fnon-call-exceptions passed on the command line in -gnatp mode.

From-SVN: r266178
2018-11-15 12:06:55 +00:00
GCC Administrator 9ce3b8d17e Daily bump.
From-SVN: r266165
2018-11-15 00:16:07 +00:00
GCC Administrator 37ef40f182 Daily bump.
From-SVN: r266094
2018-11-14 00:16:20 +00:00
Eric Botcazou 805bbc611e misc.c (gnat_init_gcc_eh): Set -fnon-call-exceptions for the runtime on platforms where...
* gcc-interface/misc.c (gnat_init_gcc_eh): Set -fnon-call-exceptions
	for the runtime on platforms where System.Machine_Overflow is true.

From-SVN: r266059
2018-11-13 09:03:34 +00:00
GCC Administrator fd2acfe3ce Daily bump.
From-SVN: r266040
2018-11-13 00:16:06 +00:00
GCC Administrator 008fbe0fef Daily bump.
From-SVN: r266021
2018-11-12 00:16:15 +00:00
Uros Bizjak af4dbfeef6 backport: re PR c++/58372 (internal compiler error: ix86_compute_frame_layout)
Backport from mainline
	2018-11-04  Uros Bizjak  <ubizjak@gmail.com>

	PR middle-end/58372
	* cfgexpand.c (pass_expand::execute): Move the call to
	finish_eh_generation in front of the call to expand_stack_alignment.

testsuite/ChangeLog:

	Backport from mainline
	2018-11-04  Uros Bizjak  <ubizjak@gmail.com>

	PR middle-end/58372
	* g++.dg/pr58372.C: New test.

From-SVN: r266015
2018-11-11 18:44:43 +01:00
GCC Administrator b8bc73e8a8 Daily bump.
From-SVN: r266005
2018-11-11 00:16:16 +00:00
GCC Administrator 14d921073d Daily bump.
From-SVN: r265999
2018-11-10 00:16:37 +00:00
Ian Lance Taylor a18d07f968 syscall: change RLIM_INFINITY from 0xffffffffffffffff to -1
For compatibility with the gc toolchain's syscall package.
    
    Fixes golang/go#28665
    
    Reviewed-on: https://go-review.googlesource.com/c/148697

From-SVN: r265972
2018-11-09 15:29:15 +00:00
GCC Administrator 71905e119b Daily bump.
From-SVN: r265943
2018-11-09 00:16:27 +00:00
Eric Botcazou 2df023972c fe.h (Suppress_Checks): Declare.
* fe.h (Suppress_Checks): Declare.
	* gcc-interface/misc.c (gnat_init_gcc_eh): Set -fnon-call-exceptions
	only if checks are not suppressed and -faggressive-loop-optimizations
	only if they are.
	* gcc-interface/trans.c (struct loop_info_d): Remove has_checks and
	warned_aggressive_loop_optimizations fields.
	(gigi): Do not clear warn_aggressive_loop_optimizations here.
	(Raise_Error_to_gnu): Do not set has_checks.
	(gnat_to_gnu) <N_Indexed_Component>: Remove support for aggressive
	loop optimizations.

From-SVN: r265923
2018-11-08 15:58:16 +00:00
GCC Administrator 8cc2ef4e91 Daily bump.
From-SVN: r265900
2018-11-08 00:16:31 +00:00
Max Filippov 98d8583ac6 gcc: xtensa: don't force PIC for uclinux target
xtensa-uclinux uses bFLT executable file format that cannot relocate
fields representing offsets from data to code. C++ objects built as PIC
use offsets to encode FDE structures. As a result C++ exception handling
doesn't work correctly on xtensa-uclinux. Don't use PIC by default on
xtensa-uclinux.

gcc/
2018-11-07  Max Filippov  <jcmvbkbc@gmail.com>

	Backport from mainline
	2018-11-05  Max Filippov  <jcmvbkbc@gmail.com>

	* config/xtensa/uclinux.h (XTENSA_ALWAYS_PIC): Change to 0.

From-SVN: r265889
2018-11-07 20:52:29 +00:00
GCC Administrator c12d748686 Daily bump.
From-SVN: r265854
2018-11-07 00:16:37 +00:00
GCC Administrator bab143d1ed Daily bump.
From-SVN: r265824
2018-11-06 00:16:23 +00:00
Ian Lance Taylor 62aec8fdd6 compiler: handle abstract type in builtin numeric const value
Builtin_call_expression::do_numeric_constant_value can be called by
    Array_type::verify_length before the determine types pass, so accept
    an abstract type.
    
    Test case is https://golang.org/cl/147537.
    
    Fixes golang/go#28601
    
    Reviewed-on: https://go-review.googlesource.com/c/147442

From-SVN: r265818
2018-11-05 20:59:38 +00:00
GCC Administrator 01103e281c Daily bump.
From-SVN: r265781
2018-11-05 00:16:31 +00:00
GCC Administrator 0f7e2175c1 Daily bump.
From-SVN: r265771
2018-11-04 00:16:33 +00:00
Tobias Burnus e92ff3894f backport: re PR fortran/87597 (wrong result with matmul inlining)
2019-11-03  Tobias Burnus  <burnus@net-b.de>
	Thomas Koenig  <tkoenig@gcc.gnu.org>

	Backport from trunk
	PR fortran/87597
	* expr.c (gfc_simplify_expr): Avoid simplifying
	the 'array' argument to lbound/ubound/lcobound/
	ucobound.

2018-11-03  Tobias Burnus  <burnus@net-b.de>
	Thomas Koenig  <tkoenig@gcc.gnu.org>

	Backport from trunk
	PR fortran/87597
	* gfortran.dg/inline_matmul_24.f90: New.


Co-Authored-By: Thomas Koenig <tkoenig@gcc.gnu.org>

From-SVN: r265769
2018-11-03 14:49:33 +00:00
GCC Administrator 9f887ef15e Daily bump.
From-SVN: r265764
2018-11-03 00:16:41 +00:00
GCC Administrator ce988f1927 Daily bump.
From-SVN: r265736
2018-11-02 00:16:57 +00:00
GCC Administrator af31aac33c Daily bump.
From-SVN: r265705
2018-11-01 00:16:44 +00:00
Jonathan Wakely b1e70deacb PR libstdc++/87822 fix layout change for nested std::pair
The introduction of the empty __pair_base base class for PR 86751
changed the layout of std::pair<std::pair<...>, ...>. The outer pair and
its first member both have a base class of the same type, which cannot
exist at the same address. This causes the first member to be at a
non-zero offset.

The solution is to make the base class depend on the template
parameters, so that each pair type has a different base class type,
which allows the base classes of the outer pair and its first member to
have the same address.

	PR libstdc++/87822
	* include/bits/stl_pair.h (__pair_base): Change to class template.
	(pair): Make base class type depend on template parameters.
	* testsuite/20_util/pair/87822.cc: New test.

From-SVN: r265683
2018-10-31 13:16:10 +00:00
GCC Administrator 410ac2f6ed Daily bump.
From-SVN: r265650
2018-10-31 00:16:59 +00:00
GCC Administrator fd1c659170 Daily bump.
From-SVN: r265612
2018-10-30 00:16:23 +00:00
GCC Administrator fd8dd53997 Daily bump.
From-SVN: r265579
2018-10-29 00:16:29 +00:00
GCC Administrator 960fb2af7d Daily bump.
From-SVN: r265562
2018-10-28 00:16:08 +00:00
GCC Administrator 1f7bcefdef Daily bump.
From-SVN: r265552
2018-10-27 00:16:32 +00:00
Bill Schmidt 0f0a708aa1 backport: re PR tree-optimization/87473 (ICE in create_add_on_incoming_edge, at gimple-ssa-strength-reduction.c:2344)
[gcc]

2018-10-26  Bill Schmidt  <wschmidt@linux.ibm.com>

	Backport from mainline
	2018-10-19  Bill Schmidt  <wschmidt@linux.ibm.com>

	PR tree-optimization/87473
	* gimple-ssa-strength-reduction.c (record_phi_increments): For
	phi arguments identical to the base expression of the phi
	candidate, record a phi-adjust increment of zero minus the index
	expression of the hidden basis.
	(phi_incr_cost): For phi arguments identical to the base
	expression of the phi candidate, the difference to compare against
	the increment is zero minus the index expression of the hidden
	basis, and there is no potential savings from replacing the (phi)
	statement.
	(ncd_with_phi): For phi arguments identical to the base expression
	of the phi candidate, the difference to compare against the
	increment is zero minus the index expression of the hidden basis.
	(all_phi_incrs_profitable): For phi arguments identical to the
	base expression of the phi candidate, the increment to be checked
	for profitability is zero minus the index expression of the hidden
	basis.

[gcc/testsuite]

2018-10-26  Bill Schmidt  <wschmidt@linux.ibm.com>

	Backport from mainline
	2018-10-19  Bill Schmidt  <wschmidt@linux.ibm.com>

	PR tree-optimization/87473
	* gcc.c-torture/compile/pr87473.c: New file.

From-SVN: r265547
2018-10-26 19:38:45 +00:00
GCC Administrator 78765edf93 Daily bump.
From-SVN: r265512
2018-10-26 00:16:38 +00:00
Jonathan Wakely 8bf26f7091 PR libstdc++/87749 fix (and optimize) string move construction
The move constructor for the SSO string uses assign(const basic_string&)
when either:

(1) the source string is "local" and so the contents of the small string
buffer need to be copied, or

(2) the allocator does not propagate and is_always_equal is false.

Case (1) is suboptimal, because the assign member is not noexcept and
the compiler isn't smart enough to see it won't actually throw in this
case. This causes extra code in the move assignment operator so that any
exception will be turned into a call to std::terminate. This can be
fixed by copying small strings inline instead of calling assign.

Case (2) is a bug, because the specific instances of the allocators
could be equal even if is_always_equal is false. This can result in an
unnecessary deep copy (and potentially-throwing allocation) when the
storage should be moved. This can be fixed by simply checking if the
allocators are equal.

	PR libstdc++/87749
	* include/bits/basic_string.h [_GLIBCXX_USE_CXX11_ABI]
	(basic_string::operator=(basic_string&&)): For short strings copy the
	buffer inline. Only fall back to using assign(const basic_string&) to
	do a deep copy when reallocation is needed.
	* testsuite/21_strings/basic_string/modifiers/assign/char/87749.cc:
	New test.
	* testsuite/21_strings/basic_string/modifiers/assign/char/
	move_assign_optim.cc: New test.
	* testsuite/21_strings/basic_string/modifiers/assign/wchar_t/87749.cc:
	New test.
	* testsuite/21_strings/basic_string/modifiers/assign/wchar_t/
	move_assign_optim.cc: New test.

From-SVN: r265497
2018-10-25 17:32:47 +01:00
GCC Administrator 6c75d8ac50 Daily bump.
From-SVN: r265476
2018-10-25 00:16:12 +00:00
GCC Administrator 8733a0bfeb Daily bump.
From-SVN: r265446
2018-10-24 00:16:46 +00:00
Jonathan Wakely e1400f0bbb PR libstdc++/87704 fix unique_ptr(nullptr_t) constructors
Using a delegating constructor to implement these constructors means
that they instantiate the destructor, which requires the element_type to
be complete. In C++11 and C++14 they were specified to be delegating,
but that was changed as part of LWG 2801 so in C++17 they don't require
a complete type (as was intended all along).

	PR libstdc++/87704
	* include/bits/unique_ptr.h (unique_ptr::unique_ptr(nullptr_t)): Do
	not delegate to default constructor.
	(unique_ptr<T[], D>::unique_ptr(nullptr_t)): Likewise.
	* testsuite/20_util/unique_ptr/cons/incomplete.cc: New test.

From-SVN: r265429
2018-10-23 16:55:05 +01:00
Tom de Vries 03a5b5013f backport "[c++] Fix DECL_BY_REFERENCE of clone parms"
Consider test.C compiled at -O0 -g:
...
class string {
public:
  string (const char *p) { this->p = p ; }
  string (const string &s) { this->p = s.p; }

private:
  const char *p;
};

class foo {
public:
  foo (string dir_hint) {}
};

int
main (void)
{
  std::string s = "This is just a string";
  foo bar(s);
  return 0;
}
...

When parsing foo::foo, the dir_hint parameter gets a DECL_ARG_TYPE of
'struct string & restrict'.  Then during finish_struct, we call
clone_constructors_and_destructors and create clones for foo::foo, and
set the DECL_ARG_TYPE in the same way.

Later on, during finish_function, cp_genericize is called for the original
foo::foo, which sets the type of parm dir_hint to DECL_ARG_TYPE, and sets
DECL_BY_REFERENCE of dir_hint to 1.

After that, during maybe_clone_body update_cloned_parm is called with:
...
(gdb) call debug_generic_expr (parm.typed.type)
struct string & restrict
(gdb) call debug_generic_expr (cloned_parm.typed.type)
struct string
...
The type of the cloned_parm is then set to the type of parm, but
DECL_BY_REFERENCE is not set.

When doing cp_genericize for the clone later on,
TREE_ADDRESSABLE (TREE_TYPE ()) is no longer true for the updated type for
the parm, so DECL_BY_REFERENCE is not set there either.

The missing DECL_BY_REFERENCE on cloned_parm causes incorrect debug info to be
generated.

This patch fixes the problem by copying DECL_BY_REFERENCE in update_cloned_parm.

Bootstrapped and reg-tested on x86_64.

2018-10-23  Tom de Vries  <tdevries@suse.de>

	backport from trunk:
	2018-07-31  Tom de Vries  <tdevries@suse.de>

	PR debug/86687
	* optimize.c (update_cloned_parm): Copy DECL_BY_REFERENCE.

	* g++.dg/guality/pr86687.C: New test.

From-SVN: r265427
2018-10-23 15:06:17 +00:00
GCC Administrator 6d06f59b49 Daily bump.
From-SVN: r265406
2018-10-23 00:16:54 +00:00
Eric Botcazou 44eabe0c88 utils.c (unchecked_convert): Use local variables for the biased and reverse SSO attributes of both types.
* gcc-interface/utils.c (unchecked_convert): Use local variables for
	the biased and reverse SSO attributes of both types.
	Further extend the processing of integral types in the presence of
	reverse SSO to all scalar types.

From-SVN: r265383
2018-10-22 11:09:11 +00:00
Eric Botcazou 6ead6140be trans.c (Pragma_to_gnu): Use a simple memory constraint in all cases.
* gcc-interface/trans.c (Pragma_to_gnu) <Pragma_Inspection_Point>: Use
	a simple memory constraint in all cases.

From-SVN: r265380
2018-10-22 10:45:25 +00:00
Jonathan Wakely 268ab32f4a PR libstdc++/79433 no #error for including TS headers with wrong -std
Backport from mainline
2017-09-12  Jonathan Wakely  <jwakely@redhat.com>

	PR libstdc++/79433
	* include/Makefile.am: Remove <bits/c++14_warning.h>.
	* include/Makefile.in: Regenerate.
	* include/bits/c++14_warning.h: Remove.
	* include/experimental/algorithm: Do not include <c++14_warning.h>.
	* include/experimental/any: Likewise.
	* include/experimental/array: Likewise.
	* include/experimental/bits/erase_if.h: Likewise.
	* include/experimental/bits/lfts_config.h: Likewise.
	* include/experimental/bits/shared_ptr.h: Likewise.
	* include/experimental/bits/string_view.tcc: Likewise.
	* include/experimental/chrono: Likewise.
	* include/experimental/deque: Likewise.
	* include/experimental/filesystem: Do not include <c++0x_warning.h>.
	* include/experimental/forward_list: Do not include <c++14_warning.h>.
	* include/experimental/functional: Likewise.
	* include/experimental/iterator: Likewise.
	* include/experimental/list: Likewise.
	* include/experimental/map: Likewise.
	* include/experimental/memory: Likewise.
	* include/experimental/numeric: Likewise.
	* include/experimental/optional: Likewise.
	* include/experimental/propagate_const: Likewise.
	* include/experimental/ratio: Likewise.
	* include/experimental/regex: Likewise.
	* include/experimental/set: Likewise.
	* include/experimental/string: Likewise.
	* include/experimental/string_view: Likewise.
	* include/experimental/system_error: Likewise.
	* include/experimental/tuple: Likewise.
	* include/experimental/type_traits: Likewise.
	* include/experimental/unordered_map: Likewise.
	* include/experimental/unordered_set: Likewise.
	* include/experimental/vector: Likewise.
	* testsuite/experimental/any/misc/any_cast_neg.cc: Adjust dg-error
	line number.
	* testsuite/experimental/array/neg.cc: Likewise.
	* testsuite/experimental/propagate_const/assignment/move_neg.cc:
	Likewise.
	* testsuite/experimental/propagate_const/cons/move_neg.cc: Likewise.
	* testsuite/experimental/propagate_const/requirements2.cc: Likewise.
	* testsuite/experimental/propagate_const/requirements3.cc: Likewise.
	* testsuite/experimental/propagate_const/requirements4.cc: Likewise.
	* testsuite/experimental/propagate_const/requirements5.cc: Likewise.

From-SVN: r265374
2018-10-22 09:47:52 +01:00
GCC Administrator 2787eb0193 Daily bump.
From-SVN: r265364
2018-10-22 00:16:53 +00:00
GCC Administrator b118712e3e Daily bump.
From-SVN: r265347
2018-10-21 00:16:25 +00:00
GCC Administrator 32ea5986b0 Daily bump.
From-SVN: r265337
2018-10-20 00:16:43 +00:00
Andreas Krebbel 37a2c02ed5 S/390: Fix problem with vec_init expander
gcc/ChangeLog:

2018-10-19  Andreas Krebbel  <krebbel@linux.ibm.com>

	Backport from mainline
	2018-10-15  Andreas Krebbel  <krebbel@linux.ibm.com>

	* config/s390/s390.c (s390_expand_vec_init): Force vector element
	into reg if it isn't a general operand.

gcc/testsuite/ChangeLog:

2018-10-19  Andreas Krebbel  <krebbel@linux.ibm.com>

	Backport from mainline
	2018-10-15  Andreas Krebbel  <krebbel@linux.ibm.com>

	* g++.dg/vec-init-1.C: New test.

From-SVN: r265309
2018-10-19 08:55:27 +00:00
GCC Administrator cb84bb766b Daily bump.
From-SVN: r265301
2018-10-19 00:16:55 +00:00
Jonathan Wakely 96be484ff0 PR libstdc++/87641 correctly initialize accumulator in valarray::sum()
Use the value of the first element as the initial value of the
__valarray_sum accumulator. Value-initialization might not create the
additive identity for the value type.

	PR libstdc++/87641
	* include/bits/valarray_array.h (__valarray_sum): Use first element
	to initialize accumulator instead of value-initializing it.
	* testsuite/26_numerics/valarray/87641.cc: New test.

From-SVN: r265285
2018-10-18 20:38:56 +01:00
GCC Administrator 3b5f586483 Daily bump.
From-SVN: r265253
2018-10-18 00:16:31 +00:00
Eric Botcazou ff5ac1211d re PR middle-end/87623 (bytes swapped in register when comparing cause fail when compiled with -O1 or higher)
PR middle-end/87623
	* fold-const.c (fold_truth_andor_1): If the right side is not constant,
	bail out if both sides do not have the same storage order.

From-SVN: r265244
2018-10-17 17:53:02 +00:00
GCC Administrator ac60bbf79b Daily bump.
From-SVN: r265226
2018-10-17 00:16:34 +00:00
Wilco Dijkstra e265431e9f [AArch64] Fix PR87511
As mentioned in PR87511, the shift used in aarch64_mask_and_shift_for_ubfiz_p
should be evaluated as a HOST_WIDE_INT rather than int.

Backported from mainline

    gcc/
	PR target/87511
	* config/aarch64/aarch64.c (aarch64_mask_and_shift_for_ubfiz_p):
	Use HOST_WIDE_INT_1U for shift.

    testsuite/
	PR target/87511
	* gcc.target/aarch64/pr87511.c: Add new test.

From-SVN: r265195
2018-10-16 13:40:57 +00:00
GCC Administrator c1d43968e0 Daily bump.
From-SVN: r265181
2018-10-16 00:16:47 +00:00
Jonathan Wakely 0bc2fbb6c3 Adjust test to pass with latest glibc
Glibc changed the it_IT locales to use thousands separators,
invalidating this test. Use nl_NL instead, as Dutch only uses grouping
for money not numbers.

	* testsuite/22_locale/numpunct/members/char/3.cc: Adjust test to
	account for change to glibc it_IT localedata (glibc bz#10797).

From-SVN: r265167
2018-10-15 15:01:47 +01:00
GCC Administrator 77f9746644 Daily bump.
From-SVN: r265153
2018-10-15 00:16:43 +00:00
GCC Administrator ab4a9d1631 Daily bump.
From-SVN: r265144
2018-10-14 00:16:12 +00:00
Gerald Pfeifer f726711112 backport: close.c: Include <string.h>.
Backport from trunk
	* io/close.c [!HAVE_UNLINK_OPEN_FILE]: Include <string.h>.

From-SVN: r265141
2018-10-13 11:25:11 +00:00
GCC Administrator de4653c0ec Daily bump.
From-SVN: r265137
2018-10-13 00:16:27 +00:00
Jakub Jelinek ed9a7b1da2 backport: re PR target/87550 (Intrinsics for rdpmc (__rdpmc, __builtin_ia32_rdpmc) are interpreted as pure functions)
Backported from mainline
	2018-10-10  Jakub Jelinek  <jakub@redhat.com>

	PR target/87550
	* config/i386/i386-builtin.def (IX86_BUILTIN_RDPMC): Move from args set
	to special_args set.

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

From-SVN: r265112
2018-10-12 16:55:17 +02:00
Jakub Jelinek 914c2dbdce backport: re PR middle-end/87248 (Bad code for masked operations involving signed ints)
Backported from mainline
	2018-09-12  Jakub Jelinek  <jakub@redhat.com>

	PR middle-end/87248
	* fold-const.c (fold_ternary_loc) <case COND_EXPR>: Verify also that
	BIT_AND_EXPR's second operand is a power of two.  Formatting fix.

	* c-c++-common/torture/pr87248.c: New test.

From-SVN: r265111
2018-10-12 16:54:34 +02:00
Jakub Jelinek 9868d33f0e backport: re PR rtl-optimization/87065 (combine causes ICE in trunc_int_for_mode)
Backported from mainline
	2018-08-27  Jakub Jelinek  <jakub@redhat.com>

	PR rtl-optimization/87065
	* combine.c (simplify_if_then_else): Formatting fix.
	(if_then_else_cond): Guard MULT optimization with SCALAR_INT_MODE_P
	check.
	(known_cond): Don't return const_true_rtx for vector modes.  Use
	CONST0_RTX instead of const0_rtx.  Formatting fixes.

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

From-SVN: r265110
2018-10-12 16:53:54 +02:00
Jakub Jelinek 5dd76907d0 backport: re PR middle-end/86627 (Signed 128-bit division by 2 no longer expanded to RTL)
Backported from mainline
	2018-07-24  Jakub Jelinek  <jakub@redhat.com>

	PR middle-end/86627
	* expmed.c (expand_divmod): Punt if d == HOST_WIDE_INT_MIN
	and size > HOST_BITS_PER_WIDE_INT.  For size > HOST_BITS_PER_WIDE_INT
	and abs_d == d, do the power of two handling if profitable.

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

From-SVN: r265109
2018-10-12 16:53:11 +02:00
Jakub Jelinek af899eccd3 backport: re PR middle-end/86542 (wrong-code for collapsed taskloop which needs omp_cpyfn)
Backported from mainline
	2018-07-17  Jakub Jelinek  <jakub@redhat.com>

	PR middle-end/86542
	* omp-low.c (create_task_copyfn): Copy over also fields corresponding
	to _looptemp_ clauses, other than the first two.

	* testsuite/libgomp.c++/pr86542.C: New test.

From-SVN: r265108
2018-10-12 16:52:18 +02:00
Jakub Jelinek 8a171da8b3 backport: re PR middle-end/86539 (OpenMP wrong-code with taskloop and references)
Backported from mainline
	2018-07-17  Jakub Jelinek  <jakub@redhat.com>

	PR middle-end/86539
	* gimplify.c (gimplify_omp_for): Ensure taskloop firstprivatized init
	and cond temporaries don't have reference type if iterator has
	pointer type.  For init use &for_pre_body instead of pre_p if
	for_pre_body is non-empty.

	* testsuite/libgomp.c++/pr86539.C: New test.

From-SVN: r265107
2018-10-12 16:49:32 +02:00
Jakub Jelinek 5f70207f6b backport: re PR fortran/86421 (OpenMP declare simd linear ref in module causes gfortran to bail out)
Backported from mainline
	2018-07-10  Jakub Jelinek  <jakub@redhat.com>

	PR fortran/86421
	* module.c (omp_declare_simd_clauses): Add LINEAR with _REF, _VAL and
	_UVAL suffixes.
	(mio_omp_declare_simd): Save and restore ref, val and uval modifiers
	on linear clauses.  Initialize n->where to gfc_current_locus.

	* gfortran.dg/vect/pr86421.f90: New test.

From-SVN: r265106
2018-10-12 16:47:57 +02:00
Jakub Jelinek 923b01be8e backport: re PR middle-end/86660 (libgomp.c++/for-15.C ICEs with nvptx offloading)
Backported from mainline
	2018-07-26  Jakub Jelinek  <jakub@redhat.com>

	PR middle-end/86660
	* omp-low.c (scan_sharing_clauses): Don't ignore map clauses for
	declare target to variables if they have always,{to,from,tofrom} map
	kinds.

	* testsuite/libgomp.c/pr86660.c: New test.

From-SVN: r265105
2018-10-12 16:46:18 +02:00
Jakub Jelinek 2e8cf16d0b backport: re PR c++/3698 (improper handling of an extern declared inline function)
Backported from mainline
	2018-07-16  Jakub Jelinek  <jakub@redhat.com>

	PR c++/3698
	PR c++/86208
	* cp-gimplify.c (cp_genericize_r): When using extern_decl_map, or
	in TREE_USED flag from stmt to h->to.

	* g++.dg/opt/pr3698.C: New test.

From-SVN: r265103
2018-10-12 16:43:18 +02:00
Richard Biener 91305b1325 backport: [multiple changes]
2018-10-12  Richard Biener  <rguenther@suse.de>

	Backport from mainline
	2018-08-23  Richard Biener  <rguenther@suse.de>

	PR middle-end/87024
	* tree-inline.c (copy_bb): Drop unused __builtin_va_arg_pack_len
	calls.

	* gcc.dg/pr87024.c: New testcase.

	2018-08-17  Richard Biener  <rguenther@suse.de>

	PR middle-end/86505
	* tree-inline.c (copy_bb): When inlining __builtin_va_arg_pack_len ()
	across a va-arg-pack using call adjust its return value accordingly.

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

From-SVN: r265100
2018-10-12 13:41:56 +00:00
Jonathan Wakely 147e606547 PR libstdc++/86751 default assignment operators for std::pair
The solution for PR 77537 causes ambiguities due to the extra copy
assignment operator taking a __nonesuch_no_braces parameter. By making
the base class non-assignable we don't need the extra deleted overload
in std::pair. The copy assignment operator will be implicitly deleted
(and the move assignment operator not declared) as needed. Without the
additional user-provided operator in std::pair the ambiguity is avoided.

Backport from mainline
2018-07-31  Jonathan Wakely  <jwakely@redhat.com>

	PR libstdc++/86751
	* include/bits/stl_pair.h (__pair_base): New class with deleted copy
	assignment operator.
	(pair): Derive from __pair_base.
	(pair::operator=): Remove deleted overload.
	* python/libstdcxx/v6/printers.py (StdPairPrinter): New pretty printer
	so that new base class isn't shown in GDB.
	* testsuite/20_util/pair/86751.cc: New test.
	* testsuite/20_util/pair/ref_assign.cc: New test.

From-SVN: r265096
2018-10-12 13:51:46 +01:00
Jonathan Wakely 894a59843b PR libstdc++/78595 implement insertion into maps in terms of emplace
C++14 simplified the specification of the generic insert function
templates to be equivalent to calling emplace (or emplace_hint).
Defining them in terms of emplace takes care of the problems described
in PR 78595, ensuring a single conversion to value_type is done at the
right time.

Backport from mainline
2018-09-03  Jonathan Wakely  <jwakely@redhat.com>

	PR libstdc++/78595
	* include/bits/stl_map.h (map::insert(_Pair&&))
	(map::insert(const_iterator, _Pair&&)): Do emplace instead of insert.
	* include/bits/stl_multimap.h (multimap::insert(_Pair&&))
	(multimap::insert(const_iterator, _Pair&&)): Likewise.
	* include/bits/unordered_map.h (unordered_map::insert(_Pair&&))
	(unordered_map::insert(const_iterator, _Pair&&))
	(unordered_multimap::insert(_Pair&&))
	(unordered_multimap::insert(const_iterator, _Pair&&)): Likewise.
	* include/std/type_traits (__enable_if_t): Define for C++11.
	* testsuite/23_containers/map/modifiers/insert/78595.cc: New test.
	* testsuite/23_containers/multimap/modifiers/insert/78595.cc: New test.
	* testsuite/23_containers/unordered_map/modifiers/78595.cc: New test.
	* testsuite/23_containers/unordered_multimap/modifiers/78595.cc: New
	test.

From-SVN: r265095
2018-10-12 13:51:40 +01:00
Jonathan Wakely e1bb6d2725 Fix __gnu_cxx::_Pointer_adapter for long long arithmetic
Backport from mainline
2018-08-30  Jonathan Wakely  <jwakely@redhat.com>

	* include/ext/pointer.h (_Pointer_adapter): Define operators for
	pointer arithmetic using long long offsets.
	* testsuite/ext/ext_pointer/1.cc: Test pointer arithmetic using
	long long values.

From-SVN: r265094
2018-10-12 13:51:34 +01:00
Jonathan Wakely 82182d876a Fix experimental::pmr typedefs and add tests
The typedefs in <experimental/regex> and <experimental/string> don't
need to be in the __cxx11 namespace, because they are only aliases and
so will have the same mangled name as the underlying types.

Backport from mainline
2018-08-23  Jonathan Wakely  <jwakely@redhat.com>

	* testsuite/21_strings/basic_string/init-list.cc:
	Require cxx11-abi.
	* testsuite/experimental/polymorphic_allocator/pmr_typedefs_match.cc:
	Likewise.
	* testsuite/experimental/polymorphic_allocator/pmr_typedefs_string.cc:
	Likewise.

Backport from mainline
2018-08-22  Jonathan Wakely  <jwakely@redhat.com>

	PR libstdc++/87061
	* include/experimental/regex [!_GLIBCXX_USE_CXX11_ABI]
	(experimental::pmr::match_results, experimental::pmr::cmatch)
	(experimental::pmr::smatch, experimental::pmr::wcmatch)
	(experimental::pmr::wsmatch): Do not declare for gcc4-compatible ABI,
	because COW strings don't support C++11 allocator model.
	* include/experimental/string [!_GLIBCXX_USE_CXX11_ABI]
	(experimental::pmr::basic_string, experimental::pmr::string)
	(experimental::pmr::u16string, experimental::pmr::u32string)
	(experimental::pmr::wstring): Likewise.

Backport from mainline
2018-08-15  Jonathan Wakely  <jwakely@redhat.com>

	* include/experimental/regex: Remove begin/end macros for namespace.
	* include/experimental/string: Likewise.
	* testsuite/experimental/polymorphic_allocator/pmr_typedefs_deque.cc:
	New test.
	* testsuite/experimental/polymorphic_allocator/
	pmr_typedefs_forward_list.cc: New test.
	* testsuite/experimental/polymorphic_allocator/pmr_typedefs_list.cc:
	New test.
	* testsuite/experimental/polymorphic_allocator/pmr_typedefs_map.cc:
	New test.
	* testsuite/experimental/polymorphic_allocator/pmr_typedefs_match.cc:
	New test.
	* testsuite/experimental/polymorphic_allocator/
	pmr_typedefs_multimap.cc: New test.
	* testsuite/experimental/polymorphic_allocator/
	pmr_typedefs_multiset.cc: New test.
	* testsuite/experimental/polymorphic_allocator/pmr_typedefs_set.cc:
	New test.
	* testsuite/experimental/polymorphic_allocator/pmr_typedefs_string.cc:
	New test.
	* testsuite/experimental/polymorphic_allocator/
	pmr_typedefs_unordered_map.cc: New test.
	* testsuite/experimental/polymorphic_allocator/
	pmr_typedefs_unordered_multimap.cc: New test.
	* testsuite/experimental/polymorphic_allocator/
	pmr_typedefs_unordered_multiset.cc: New test.
	* testsuite/experimental/polymorphic_allocator/
	pmr_typedefs_unordered_set.cc: New test.
	* testsuite/experimental/polymorphic_allocator/pmr_typedefs_vector.cc:
	New test.

From-SVN: r265093
2018-10-12 13:51:29 +01:00
Jonathan Wakely 16f40bcd18 PR libstdc++/70966 make pmr::new_delete_resource() immortal
Construct the program-wide resource objects using placement new. This
means they have dynamic storage duration and won't be destroyed during
termination.

Backport from mainline
2018-07-24  Jonathan Wakely  <jwakely@redhat.com>

	PR libstdc++/70966
	* include/experimental/memory_resource (__get_default_resource): Use
	placement new to create an object with dynamic storage duration.

Backport from mainline
2018-06-20  Jonathan Wakely  <jwakely@redhat.com>

	PR libstdc++/70966
	* include/experimental/memory_resource (__resource_adaptor_imp): Add
	static assertions to enforce requirements on pointer types.
	(__resource_adaptor_imp::get_allocator()): Add noexcept.
	(new_delete_resource, null_memory_resource): Return address of an
	object with dynamic storage duration.
	(__null_memory_resource): Remove.
	* testsuite/experimental/memory_resource/70966.cc: New.

From-SVN: r265092
2018-10-12 13:51:20 +01:00
Jonathan Wakely 273ec65f5b PR libstdc++/77854 document size_type for containers
PR libstdc++/77854
	* doc/xml/manual/status_cxx1998.xml: Document size_type and
	difference_type for containers.
	* doc/html/*: Regenerate.

From-SVN: r265082
2018-10-12 12:36:18 +01:00
GCC Administrator 797830dc9f Daily bump.
From-SVN: r265070
2018-10-12 00:16:35 +00:00
GCC Administrator aad12a337f Daily bump.
From-SVN: r265030
2018-10-11 00:16:46 +00:00
GCC Administrator cf971867d2 Daily bump.
From-SVN: r265001
2018-10-10 00:16:33 +00:00
H.J. Lu 35c011e8c6 i386: Use TImode for BLKmode values in 2 integer registers
When passing and returning BLKmode values in 2 integer registers, use
1 TImode register instead of 2 DImode registers. Otherwise, V1TImode
may be used to move and store such BLKmode values, which prevent RTL
optimizations.

gcc/

	Backport from mainline
	PR target/87370
	* config/i386/i386.c (construct_container): Use TImode for
	BLKmode values in 2 integer registers.

gcc/testsuite/

	Backport from mainline
	PR target/87370
	* gcc.target/i386/pr87370.c: New test.

From-SVN: r264989
2018-10-09 10:23:06 -07:00
Joseph Myers 9956b2213b Use -fno-show-column in libstdc++ installed testing.
<https://gcc.gnu.org/ml/libstdc++/2016-08/msg00006.html> arranged for
libstdc++ tests to use -fno-show-column by default, but only for
build-tree testing.  This patch adds it to the options used for
installed testing as well.

Tested with installed testing for a cross to x86_64-linux-gnu, where
it fixes various test failures.

	Backport from mainline
	2018-10-02  Joseph Myers  <joseph@codesourcery.com>

	* testsuite/lib/libstdc++.exp (libstdc++_init): Use
	-fno-show-column in default cxxflags.

From-SVN: r264953
2018-10-09 12:37:18 +01:00
GCC Administrator b3546480d7 Daily bump.
From-SVN: r264946
2018-10-09 00:16:24 +00:00
H.J. Lu 209fda0e95 i386: Correct _mm512_mask3_fmaddsub_round_pd
Define _mm512_mask3_fmaddsub_round_pd with
__builtin_ia32_vfmaddsubpd512_mask, instead of
__builtin_ia32_vfmaddpd512_mask.

	Backport from mainline
	PR target/87517
	* config/i386/avx512fintrin.h (_mm512_mask_fmaddsub_round_pd):
	Defined with __builtin_ia32_vfmaddsubpd512_mask.

From-SVN: r264937
2018-10-08 08:23:48 -07:00
Jonathan Wakely cacf61c36b PR libstdc++/87538 fix std::not_fn exception specifications
Backport from mainline
2018-10-08  Jonathan Wakely  <jwakely@redhat.com>

	PR libstdc++/87538
	* include/std/functional (_Not_fn::operator()): Check value of
	__is_nothrow_invocable as well.
	* testsuite/20_util/function_objects/not_fn/87538.cc: New test.
	* testsuite/experimental/functional/87538.cc: New test.

From-SVN: r264926
2018-10-08 14:13:06 +01:00
GCC Administrator beda1bd55c Daily bump.
From-SVN: r264908
2018-10-08 00:16:29 +00:00
GCC Administrator 098cc3008b Daily bump.
From-SVN: r264904
2018-10-07 00:16:11 +00:00
GCC Administrator b7c93c154b Daily bump.
From-SVN: r264894
2018-10-06 00:16:55 +00:00
H.J. Lu 30a3702f30 i386: Don't pass -msse2avx to assembler for -mavx
With

gcc -O2 -fPIC -flto -g -c -o a.o a.c
gcc -O2 -fPIC -flto -g -mavx   -c -o b.o b.c
gcc -shared -O2 -fPIC -flto -g -o lib1.so a.o b.o

LTO correctly generates AVX for b.o and SSE for a.o.  But the GCC driver
passes -msse2avx to assembler, which encodes SSE instructions as AVX
instructions.  We shouldn't pass -msse2avx to assembler for -mavx.

	Backport from mainline
	PR target/87522
	* config/i386/gnu-user.h (ASM_SPEC): Don't pass -msse2avx to
	assembler for -mavx.
	* config/i386/gnu-user64.h (ASM_SPEC): Likewise.

From-SVN: r264867
2018-10-05 04:40:59 -07:00
GCC Administrator b75fc43bdc Daily bump.
From-SVN: r264858
2018-10-05 00:16:25 +00:00
GCC Administrator 0d5cc8dfbe Daily bump.
From-SVN: r264829
2018-10-04 00:16:33 +00:00
Uros Bizjak 6927df526d backport: i386.h (SSE_REGNO): Fix check for FIRST_REX_SSE_REG.
Backport from mainline
	2018-09-28  Uros Bizjak  <ubizjak@gmail.com>

	* config/i386/i386.h (SSE_REGNO): Fix check for FIRST_REX_SSE_REG.
	(GET_SSE_REGNO): Rename from SSE_REGNO.  Update all uses for rename.

From-SVN: r264826
2018-10-03 23:49:11 +02:00
Jonathan Wakely f317c21d81 PR other/87353 fix formatting and grammar in manual
The changes to invoke.texi in r242433 left some unwanted spaces that
texi2pod.pl interprets as verbatim formatting. There are also some
grammatical errors due to the removal of references to GCJ, where the
G++ driver is referred to in the plural.

	PR other/87353
	* doc/invoke.texi (Link Options): Fix formatting and grammar.

From-SVN: r264810
2018-10-03 11:58:49 +01:00
GCC Administrator ff39d3d211 Daily bump.
From-SVN: r264802
2018-10-03 00:16:29 +00:00
GCC Administrator 9762f217fd Daily bump.
From-SVN: r264775
2018-10-02 00:16:26 +00:00
Kyrylo Tkachov a424211e58 [arm] Avoid STRD with odd register for TARGET_ARM in output_move_double
2018-10-01  Kyrylo Tkachov  <kyrylo.tkachov@arm.com>

	Backport from mainline
	2018-06-29  Kyrylo Tkachov  <kyrylo.tkachov@arm.com>

	* config/arm/arm.c (output_move_double): Don't allow STRD instructions
	if starting source register is not even.

	Backport from mainline
	2018-07-02  Christophe Lyon  <christophe.lyon@linaro.org>

	* gcc.target/arm/arm-soft-strd-even.c: Skip if -mfloat-abi is
	overriden.
	2018-06-29  Kyrylo Tkachov  <kyrylo.tkachov@arm.com>

	* gcc.target/arm/arm-soft-strd-even.c: New test.

From-SVN: r264746
2018-10-01 12:39:43 +00:00
GCC Administrator 5cca9cb822 Daily bump.
From-SVN: r264729
2018-10-01 00:16:17 +00:00
GCC Administrator 84f5c559ed Daily bump.
From-SVN: r264718
2018-09-30 00:16:12 +00:00
Jakub Jelinek 5c317226c7 re PR target/87467 (Incorrect function parameter for _mm512_abs_pd in `include/avx512fintrin.h`)
PR target/87467
	* config/i386/avx512fintrin.h (_mm512_abs_pd, _mm512_mask_abs_pd): Use
	__m512d type for __A argument rather than __m512.

	* gcc.target/i386/avx512f-abspd-1.c (SIZE): Divide by two.
	(CALC): Use double instead of float.
	(TEST): Adjust to test _mm512_abs_pd and _mm512_mask_abs_pd rather than
	_mm512_abs_ps and _mm512_mask_abs_ps.

From-SVN: r264714
2018-09-29 18:28:53 +02:00
GCC Administrator 6c7a378ee5 Daily bump.
From-SVN: r264707
2018-09-29 00:16:10 +00:00
Michael Meissner 7bc662b401 Backport pr 87033 to gcc 7
From-SVN: r264686
2018-09-28 00:32:46 +00:00
GCC Administrator 945696a491 Daily bump.
From-SVN: r264683
2018-09-28 00:16:34 +00:00
GCC Administrator 561341e1c3 Daily bump.
From-SVN: r264659
2018-09-27 00:16:45 +00:00
GCC Administrator cb40a76447 Daily bump.
From-SVN: r264590
2018-09-26 00:16:48 +00:00
GCC Administrator 659d820cb4 Daily bump.
From-SVN: r264550
2018-09-25 00:16:28 +00:00
Eric Botcazou 3bdfe954af Fix thinko
From-SVN: r264524
2018-09-24 08:15:53 +00:00
GCC Administrator 6108ede45d Daily bump.
From-SVN: r264520
2018-09-24 00:16:22 +00:00
GCC Administrator e7cd668529 Daily bump.
From-SVN: r264508
2018-09-23 00:16:10 +00:00
GCC Administrator 84b0779d82 Daily bump.
From-SVN: r264498
2018-09-22 00:16:31 +00:00
Eric Botcazou 56f9cf9142 rs6000.c (rs6000_function_ok_for_sibcall): Return false if the call takes a static chain.
* config/rs6000/rs6000.c (rs6000_function_ok_for_sibcall): Return false
	if the call takes a static chain.

From-SVN: r264465
2018-09-21 10:06:25 +00:00
GCC Administrator 26a6bcbdae Daily bump.
From-SVN: r264454
2018-09-21 00:16:47 +00:00
John David Anglin 684d698f5b pa.md (atomic_storeqi): Restore deleted expander.
* config/pa/pa.md (atomic_storeqi): Restore deleted expander.
	(atomic_storehi): Likewise.
	(atomic_storesi): Likewise.
	(atomic_loaddi): Restore compare and swap exchange loop code.

From-SVN: r264435
2018-09-20 01:10:47 +00:00
GCC Administrator 0df4420185 Daily bump.
From-SVN: r264430
2018-09-20 00:16:24 +00:00
GCC Administrator cd551c0714 Daily bump.
From-SVN: r264415
2018-09-19 00:16:37 +00:00
Kyrylo Tkachov 3d13b78661 [libgfortran] Fix uninitialized variable use in fallback_access
Backport from trunk
	2018-09-14  Kyrylo Tkachov  <kyrylo.tkachov@arm.com>

	* io/unix.c (fallback_access): Avoid calling close on
	uninitialized file descriptor.

From-SVN: r264384
2018-09-18 09:02:14 +00:00
GCC Administrator 61fb3bb626 Daily bump.
From-SVN: r264378
2018-09-18 00:16:23 +00:00
GCC Administrator 0c8e9728e0 Daily bump.
From-SVN: r264353
2018-09-17 00:16:21 +00:00
GCC Administrator bed081ed0b Daily bump.
From-SVN: r264344
2018-09-16 00:16:34 +00:00
GCC Administrator 3e31fa6dad Daily bump.
From-SVN: r264339
2018-09-15 00:16:17 +00:00
GCC Administrator e0360ce2c3 Daily bump.
From-SVN: r264297
2018-09-14 00:16:36 +00:00
Paul Thomas 75eb31153c re PR fortran/87284 (Allocation of class arrays with mold results in "conditional jump or move depends on uninitialised value")
2018-09-13  Paul Thomas  <pault@gcc.gnu.org>

	PR fortran/87284
	* trans-expr.c (gfc_trans_class_init_assign): Access to
	to array elements of the dynamic type requires that the array
	reference be added to the class expression and not the _data
	component, unlike scalar expressions.

2018-09-13  Paul Thomas  <pault@gcc.gnu.org>

	PR fortran/87284
	* gfortran.dg/allocate_with_mold_2.f90: New test.

From-SVN: r264288
2018-09-13 19:46:05 +00:00
Eric Botcazou e5d5bf9962 backport: s-osinte-solaris.ads (upad64_t): New private type.
Backport from mainline
	2018-07-31  Eric Botcazou  <ebotcazou@adacore.com>

	* s-osinte-solaris.ads (upad64_t): New private type.
	(mutex_t): Use it for 'lock' and 'data' components.
	(cond_t): Likewise for 'data' and use single 'flags' component.

From-SVN: r264266
2018-09-13 10:14:39 +00:00
GCC Administrator 0fbde3fbcb Daily bump.
From-SVN: r264256
2018-09-13 00:16:11 +00:00
Segher Boessenkool b08fb37a27 Backport patch for PR86989 to 7
2018-09-12  Segher Boessenkool  <segher@kernel.crashing.org>

	Backport from trunk
	2018-08-24  Segher Boessenkool  <segher@kernel.crashing.org>

	PR target/86989
	* config/rs6000/rs6000.c (toc_relative_expr_p): Check that the base is
	the TOC register.

From-SVN: r264247
2018-09-12 20:01:11 +02:00
Andreas Krebbel c6ebc6f71b S/390: Use proper rounding mode for DFP to BFD conversions
According to IEEE 754 2008 4.3 'Rounding-direction attributes' the
rounding mode of the target format needs to be used. By not setting
the value so far we have always used the DFP rounding mode.

gcc/ChangeLog:

2018-09-12  Andreas Krebbel  <krebbel@linux.ibm.com>

	Backport from mainline
	2018-09-12  Andreas Krebbel  <krebbel@linux.ibm.com>

	* config/s390/s390.md (PFPO_RND_MODE_DFP, PFPO_RND_MODE_BFP): New
	constants.
	("trunc<BFP:mode><DFP_ALL:mode>2")
	("trunc<DFP_ALL:mode><BFP:mode>2")
	("extend<BFP:mode><DFP_ALL:mode>2")
	("extend<DFP_ALL:mode><BFP:mode>2"): Set proper rounding mode
	according to the target operand type.

gcc/testsuite/ChangeLog:

2018-09-12  Andreas Krebbel  <krebbel@linux.ibm.com>

	Backport from mainline
	2018-09-12  Andreas Krebbel  <krebbel@linux.ibm.com>

	* gcc.target/s390/dfp_to_bfp_rounding.c: New test.

From-SVN: r264236
2018-09-12 11:13:56 +00:00
GCC Administrator 23281ce8e9 Daily bump.
From-SVN: r264224
2018-09-12 00:16:35 +00:00
GCC Administrator cfa0f3ff02 Daily bump.
From-SVN: r264198
2018-09-11 00:16:25 +00:00
GCC Administrator 685323f840 Daily bump.
From-SVN: r264187
2018-09-10 00:16:29 +00:00
GCC Administrator 0d12566fae Daily bump.
From-SVN: r264174
2018-09-09 00:16:28 +00:00
GCC Administrator 92f3b07dc9 Daily bump.
From-SVN: r264165
2018-09-08 00:16:33 +00:00
Janus Weil fd0d765417 backport: re PR fortran/86116 (Ambiguous generic interface not recognised)
2018-09-07  Janus Weil  <janus@gcc.gnu.org>

	Backported from trunk
	PR fortran/86116
	* interface.c (compare_type): Remove a CLASS/TYPE check.
	(compare_type_characteristics): New function that behaves like the old
	'compare_type'.
	(gfc_check_dummy_characteristics, gfc_check_result_characteristics):
	Call 'compare_type_characteristics' instead of 'compare_type'.

2018-09-07  Janus Weil  <janus@gcc.gnu.org>

	Backported from trunk
	PR fortran/86116
	* gfortran.dg/generic_34.f90: New test case.

From-SVN: r264161
2018-09-07 19:33:15 +02:00
GCC Administrator 940a7af901 Daily bump.
From-SVN: r264153
2018-09-07 00:16:22 +00:00
GCC Administrator ccaea5e3ef Daily bump.
From-SVN: r264136
2018-09-06 00:16:31 +00:00
GCC Administrator 1f39f8887d Daily bump.
From-SVN: r264098
2018-09-05 00:16:20 +00:00
Max Filippov 6d447fc0b9 gcc: xtensa: fix NAND code in xtensa_expand_atomic
NAND is ~(a1 & a2), but xtensa_expand_atomic does ~a1 & a2.
That fixes libatomic tests atomic-op-{1,2}.

gcc/
2018-09-04  Max Filippov  <jcmvbkbc@gmail.com>

	Backport from mainline
	2018-09-04  Max Filippov  <jcmvbkbc@gmail.com>

	* config/xtensa/xtensa.c (xtensa_expand_atomic): Reorder AND and
	XOR operations in NAND case.

From-SVN: r264090
2018-09-04 17:59:04 +00:00
Jonathan Wakely c256655f90 Add -Waligned-new to Option Summary
* doc/invoke.texi (Option Summary): Add -Waligned-new.

From-SVN: r264082
2018-09-04 14:33:14 +01:00
GCC Administrator 5883ffeea9 Daily bump.
From-SVN: r264072
2018-09-04 00:16:36 +00:00
Tom de Vries bd3cad80c7 backport "[tail-merge] Fix side-effect test in stmt_local_def"
2018-09-03  Tom de Vries  <tdevries@suse.de>

	backport from trunk:
	2018-06-21  Tom de Vries  <tdevries@suse.de>

	PR tree-optimization/85859
	* tree-ssa-tail-merge.c (stmt_local_def): Copy gimple_is_call
	test with comment from bb_no_side_effects_p.

	* gcc.dg/pr85859.c: New test.

From-SVN: r264054
2018-09-03 10:04:08 +00:00
GCC Administrator b603b8adf7 Daily bump.
From-SVN: r264047
2018-09-03 00:16:40 +00:00
GCC Administrator e86f2723c4 Daily bump.
From-SVN: r264035
2018-09-02 00:16:15 +00:00
GCC Administrator 12824ca6de Daily bump.
From-SVN: r264024
2018-09-01 00:16:30 +00:00
GCC Administrator a8aaec737c Daily bump.
From-SVN: r264004
2018-08-31 00:16:25 +00:00
GCC Administrator 34cf0cfa73 Daily bump.
From-SVN: r263970
2018-08-30 00:16:43 +00:00
GCC Administrator 356669bee1 Daily bump.
From-SVN: r263938
2018-08-29 00:16:26 +00:00
GCC Administrator 783bc8a53f Daily bump.
From-SVN: r263902
2018-08-28 00:16:27 +00:00
GCC Administrator 053c1cc361 Daily bump.
From-SVN: r263865
2018-08-27 00:16:14 +00:00
GCC Administrator 2ae6ca4e26 Daily bump.
From-SVN: r263858
2018-08-26 00:16:42 +00:00
Jozef Lawrynowicz c58e1ae81e backport: re PR target/86662 (msp430-elf segfault with -flto and -mlarge)
Backport from mainline

PR target/86662

        * gcc/tree.c (build_common_tree_nodes): Initialize integer_types array
        with all enabled __intN types.

        * gcc/testsuite/gcc.target/msp430/pr86662.c: New test.

From-SVN: r263852
2018-08-25 11:52:15 +00:00
GCC Administrator 06fb6d6493 Daily bump.
From-SVN: r263847
2018-08-25 00:16:43 +00:00
GCC Administrator cc6face490 Daily bump.
From-SVN: r263825
2018-08-24 00:16:40 +00:00
GCC Administrator 616bb68754 Daily bump.
From-SVN: r263796
2018-08-23 00:16:43 +00:00
GCC Administrator ac5d2991b9 Daily bump.
From-SVN: r263756
2018-08-22 00:16:20 +00:00
H.J. Lu 10e3ee083f x86: Always update EH return address in word_mode
On x86, return address is always popped in word_mode.  eh_return needs
to put EH return address in word_mode on stack.

gcc/

	Backport from mainline
	PR target/87014
	* config/i386/i386.md (eh_return): Always update EH return
	address in word_mode.

gcc/testsuite/

	Backport from mainline
	PR target/87014
	* g++.dg/torture/pr87014.C: New file.

From-SVN: r263744
2018-08-21 09:27:22 -07:00
Szabolcs Nagy 8f60cfe0eb Restrict the pr86763 test to *-*-linux* targets
clock_gettime is not available on some baremetal targets
and may require -lrt on some non-linux targets.

gcc/testsuite/ChangeLog:

	Backport from mainline
	2018-08-21  Szabolcs Nagy  <szabolcs.nagy@arm.com>

	* g++.dg/torture/pr86763.C: Restrict to *-*-linux*.

From-SVN: r263701
2018-08-21 13:20:21 +00:00
GCC Administrator 1bbd651c91 Daily bump.
From-SVN: r263681
2018-08-21 00:16:09 +00:00
GCC Administrator 0164489653 Daily bump.
From-SVN: r263654
2018-08-20 00:16:16 +00:00
GCC Administrator bd94222e48 Daily bump.
From-SVN: r263649
2018-08-19 00:16:10 +00:00
GCC Administrator 54b1406aec Daily bump.
From-SVN: r263642
2018-08-18 00:16:17 +00:00
John David Anglin 9741841c2c backport: pa.md (UNSPEC_MEMORY_BARRIER): New unspec enum.
Backport from mainline
	2018-08-11  John David Anglin  <danglin@gcc.gnu.org>

	gcc
	* config/pa/pa.md (UNSPEC_MEMORY_BARRIER): New unspec enum.
	Update comment for atomic instructions.
	(atomic_storeqi, atomic_storehi, atomic_storesi, atomic_storesf,
	atomic_loaddf, atomic_loaddf_1, atomic_storedf, atomic_storedf_1):
	Remove.
	(atomic_loaddi): Revise fence expansion to only emit fence prior to
	load for __ATOMIC_SEQ_CST model.
	(atomic_loaddi_1): Remove float register target.
	(atomic_storedi): Handle CONST_INT values.
	(atomic_storedi_1): Remove float register source.  Add special case
	for zero value.
	(memory_barrier): New expander and insn.

	libgcc
	* config/pa/linux-atomic.c: Update comment.
	(FETCH_AND_OP_2, OP_AND_FETCH_2, FETCH_AND_OP_WORD, OP_AND_FETCH_WORD,
	COMPARE_AND_SWAP_2, __sync_val_compare_and_swap_4,
	SYNC_LOCK_TEST_AND_SET_2, __sync_lock_test_and_set_4): Use
	__ATOMIC_RELAXED for atomic loads.
	(SYNC_LOCK_RELEASE_1): New define.  Use __sync_synchronize() and
	unordered store to release lock.
	(__sync_lock_release_8): Likewise.
	(SYNC_LOCK_RELEASE_2): Remove define.

From-SVN: r263638
2018-08-17 22:56:33 +00:00
Richard Biener bb094fdeb2 backport: re PR c++/86763 (Wrong code comparing member of copy of a 237 byte object with nontrivial default constructor on x86-64 arch)
2018-08-17  Richard Biener  <rguenther@suse.de>

	Backport from mainline
	2018-08-02  Richard Biener  <rguenther@suse.de>

	PR c++/86763
	* class.c (layout_class_type): Copy TYPE_TYPELESS_STORAGE
	to the CLASSTYPE_AS_BASE.

	* g++.dg/torture/pr86763.C: New testcase.

From-SVN: r263621
2018-08-17 14:17:10 +00:00
GCC Administrator 5eb51dcf95 Daily bump.
From-SVN: r263609
2018-08-17 00:16:23 +00:00
Martin Liska f286ed96cb Backport r263246
2018-08-16  Martin Liska  <mliska@suse.cz>

	Backport from mainline
	2018-08-02  Martin Liska  <mliska@suse.cz>

        PR sanitizer/86022
	* sanitizer_common/sanitizer_linux_libcdep.cc (ThreadDescriptorSize):
        Cherry-pick compiler-rt revision 338606.

From-SVN: r263581
2018-08-16 10:19:16 +00:00
GCC Administrator f2e53d4807 Daily bump.
From-SVN: r263574
2018-08-16 00:16:25 +00:00
GCC Administrator 317ab4f6e2 Daily bump.
From-SVN: r263545
2018-08-15 00:16:30 +00:00
GCC Administrator 26bf747efa Daily bump.
From-SVN: r263525
2018-08-14 00:16:23 +00:00
Jonathan Wakely 67d6bc96ba Revert "libstdc++-v3: Have aligned_alloc() on Newlib"
This reverts commit r263463 / b7edd52337828cc46e469bca12f58288795b78d5
because aligned_alloc is not defined for baremetal newlib targets, see
https://gcc.gnu.org/ml/libstdc++/2018-08/msg00065.html

Revert
2018-08-10  Sebastian Huber  <sebastian.huber@embedded-brains.de>

	PR target/85904
	* configure.ac: Define HAVE_ALIGNED_ALLOC if building for
	Newlib.
	* configure: Regenerate.

From-SVN: r263518
2018-08-13 20:16:02 +01:00
Segher Boessenkool 228bce5e29 backport: re PR rtl-optimization/85645 (ICE in maybe_record_trace_start, at dwarf2cfi.c:2348)
Backport from mainline
	2018-05-09  Segher Boessenkool  <segher@kernel.crashing.org>

	PR rtl-optimization/85645
	* regrename.c (build_def_use): Also kill the chains that include the
	destination of a REG_CFA_REGISTER note.

	PR rtl-optimization/85645
	*  regcprop.c (copyprop_hardreg_forward_1): Don't propagate into an
	insn that has a REG_CFA_REGISTER note.

From-SVN: r263509
2018-08-13 19:05:48 +02:00
GCC Administrator f7f4276997 Daily bump.
From-SVN: r263501
2018-08-13 00:16:10 +00:00
GCC Administrator 72752af0cc Daily bump.
From-SVN: r263490
2018-08-12 00:16:10 +00:00
Jason Merrill 521fb45ca6 PR c++/86728 - C variadic generic lambda.
* parser.c (cp_parser_parameter_declaration): Don't turn 'auto' into
	a pack if it's followed by a declarator-id.

From-SVN: r263486
2018-08-11 07:02:22 -04:00
GCC Administrator a6bf056871 Daily bump.
From-SVN: r263481
2018-08-11 00:16:20 +00:00
Segher Boessenkool bb709d2581 backport: re PR target/86197 (POWERPC: float128 parameter passing)
Backport from mainline
	2018-06-19  Segher Boessenkool  <segher@kernel.crashing.org>

	PR target/86197
	* config/rs6000/rs6000.md (rs6000_discover_homogeneous_aggregate): An
	ieee128 argument takes up only one (vector) register, not two (floating
	point) registers.

From-SVN: r263477
2018-08-10 22:14:11 +02:00
Sebastian Huber fd5c2f349a libstdc++-v3: Have aligned_alloc() on Newlib
While building for Newlib, some configure checks must be hard coded.
The aligned_alloc() is supported since 2015 in Newlib.

libstdc++-v3/

	PR target/85904
	* configure.ac: Define HAVE_ALIGNED_ALLOC if building for
	Newlib.
	* configure: Regenerate.

From-SVN: r263463
2018-08-10 06:31:57 +00:00
GCC Administrator 83a065cfac Daily bump.
From-SVN: r263458
2018-08-10 00:16:19 +00:00
GCC Administrator 41a9a9efca Daily bump.
From-SVN: r263437
2018-08-09 00:16:22 +00:00
Jonathan Wakely 1bdd8c0209 Prevent internal aligned_alloc clashing with libc version
If configure fails to detect aligned_alloc we will try to define our
own in new_opa.cc but that could clash with the libc version in
<stdlib.h>. Use a namespace to keep them distinct.

	* libsupc++/new_opa.cc (aligned_alloc): Declare inside namespace to
	avoid clashing with an ::aligned_alloc function that was not detected
	by configure.

From-SVN: r263426
2018-08-08 16:53:25 +01:00
Jonathan Wakely 6c3d83cc13 Fix Docbook markup to remove empty table cell
* doc/xml/manual/using.xml: Remove empty table cell.
	* doc/html/*: Regenerate.

From-SVN: r263403
2018-08-08 14:52:09 +01:00
Jonathan Wakely 39a0fa68a3 Fix docs on C++17 and LFTS headers
* doc/xml/manual/using.xml: Add missing header to table and fix typo.
	Remove C++17 headers not present on gcc-8-branch.
	* doc/html/*: Regenerate.

From-SVN: r263402
2018-08-08 14:46:29 +01:00
GCC Administrator 3457854bf2 Daily bump.
From-SVN: r263385
2018-08-08 00:16:20 +00:00
Jonathan Wakely beaa526e13 Declare some explicit instantiations for strings in Debug Mode
The empty reps and the I/O functions do not need to be implicitly
instantiated to enable assertions, so declare the explicit
instantiations when _GLIBCXX_EXTERN_TEMPLATE == -1 (i.e. when
_GLIBCXX_ASSERTIONS is defined).

Backport from mainline
2018-06-27  Jonathan Wakely  <jwakely@redhat.com>

	PR libstdc++/86138
	* include/bits/basic_string.tcc: [_GLIBCXX_EXTERN_TEMPLATE < 0]
	Declare explicit instantiations of COW empty reps and I/O functions.

From-SVN: r263383
2018-08-07 23:50:55 +01:00
Jonathan Wakely 3c96f0f28f PR libstdc++/84654 Disable __float128 specializations for -mno-float128
Backport from mainline
2018-05-08  Jonathan Wakely  <jwakely@redhat.com>

	PR libstdc++/85672
	* include/Makefile.am [!ENABLE_FLOAT128]: Change c++config.h entry
	to #undef _GLIBCXX_USE_FLOAT128 instead of defining it to zero.
	* include/Makefile.in: Regenerate.
	* include/bits/c++config (_GLIBCXX_USE_FLOAT128): Move definition
	within conditional block.

Backport from mainline
2018-05-01  Tulio Magno Quites Machado Filho  <tuliom@linux.vnet.ibm.com>

	PR libstdc++/84654
	* acinclude.m4: Set ENABLE_FLOAT128 instead of _GLIBCXX_USE_FLOAT128.
	* config.h.in: Remove references to _GLIBCXX_USE_FLOAT128.
	* configure: Regenerate.
	* include/Makefile.am: Replace the value of _GLIBCXX_USE_FLOAT128
	based on ENABLE_FLOAT128.
	* include/Makefile.in: Regenerate.
	* include/bits/c++config: Define _GLIBCXX_USE_FLOAT128.
	[!defined(__FLOAT128__) && !defined(__SIZEOF_FLOAT128__)]: Undefine
	_GLIBCXX_USE_FLOAT128.

From-SVN: r263382
2018-08-07 23:50:49 +01:00
Jonathan Wakely e552bfaa45 PR libstdc++/80893 Fix null dereference in vector<bool>
Backport from mainline
2017-06-17  Jonathan Wakely  <jwakely@redhat.com>

	PR libstdc++/80893
	* testsuite/23_containers/vector/bool/80893.cc: Add { target c++11 }.

Backport from mainline
2017-05-31  Jonathan Wakely  <jwakely@redhat.com>

	PR libstdc++/80893
	* include/bits/stl_bvector.h (vector<bool>::_M_initialize): Avoid
	null pointer dereference when size is zero.
	* testsuite/23_containers/vector/bool/80893.cc: New.
	* testsuite/util/testsuite_allocator.h (PointerBase::PointerBase):
	Add non-explicit constructor from nullptr.
	(PointerBase::derived() const): Add const-qualified overload.

From-SVN: r263381
2018-08-07 23:50:45 +01:00
Jonathan Wakely 43c6a92ddc PR libstdc++/68519 use native duration to avoid rounding errors
Backport from mainline
2017-12-14  Jonathan Wakely  <jwakely@redhat.com>

	PR libstdc++/68519
	* include/std/condition_variable (condition_variable::wait_for):
	Convert duration to native clock's duration before addition.
	* testsuite/30_threads/condition_variable/members/68519.cc: New test.

From-SVN: r263380
2018-08-07 23:50:40 +01:00
Jonathan Wakely 16c2ce4b4d PR libstdc++/86292 fix exception safety of std::vector<InputIterator> constructor
Backport from mainline
2018-06-25  Jonathan Wakely  <jwakely@redhat.com>

	PR libstdc++/86292
	* include/bits/stl_vector.h (vector::_M_range_initialize<InputIter>):
	Add try-catch block.
	* testsuite/23_containers/vector/cons/86292.cc: New.

From-SVN: r263379
2018-08-07 23:50:33 +01:00
Jonathan Wakely db1e6ce9e8 Improve libstdc++ docs w.r.t newer C++ standards
Instead of repeating all the old headers for every new standard I've
changed the docs to only list the new headers for each standard.

Backport from mainline
2018-07-31  Jonathan Wakely  <jwakely@redhat.com>

	* doc/xml/manual/test.xml: Improve documentation on writing tests for
	newer standards.
	* doc/xml/manual/using.xml: Document all headers for C++11 and later.
	* doc/html/*: Regenerate.

From-SVN: r263378
2018-08-07 23:50:28 +01:00
Jonathan Wakely 3955800f9d PR libstdc++/60555 std::system_category() should recognise POSIX errno values
Backport from mainline
2018-08-03  Jonathan Wakely  <jwakely@redhat.com>

	* src/c++11/system_error.cc
	(system_error_category::default_error_condition): Add workaround for
	ENOTEMPTY and EEXIST having the same value on AIX.
	* testsuite/19_diagnostics/error_category/system_category.cc: Add
	extra testcases for EDOM, EILSEQ, ERANGE, EEXIST and ENOTEMPTY.

Backport from mainline
2018-08-01  Jonathan Wakely  <jwakely@redhat.com>

	PR libstdc++/60555
	* src/c++11/system_error.cc
	(system_error_category::default_error_condition): New override to
	check for POSIX errno values.
	* testsuite/19_diagnostics/error_category/generic_category.cc: New
	* testsuite/19_diagnostics/error_category/system_category.cc: New
	test.

From-SVN: r263377
2018-08-07 23:50:24 +01:00
Jonathan Wakely 6053258aa2 PR libstdc++/86861 Meet precondition for Solaris memalign
Solaris memalign requires alignment to be at least sizeof(int), so
increase it as needed.

Also move the check for valid alignments from the fallback
implementation of aligned_alloc into operator new, as it's required for
all of aligned_alloc, memalign, posix_memalign and __aligned_malloc.

Backport from mainline
2018-08-07  Jonathan Wakely  <jwakely@redhat.com>

	PR libstdc++/86861
	* libsupc++/new_opa.cc [_GLIBCXX_HAVE_MEMALIGN] (aligned_alloc):
	Replace macro with inline function.
	[__sun]: Increase alignment to meet memalign precondition.
	[!HAVE__ALIGNED_MALLOC && !HAVE_POSIX_MEMALIGN && !HAVE_MEMALIGN]
	(aligned_alloc): Move check for valid alignment to operator new.
	Remove redundant check for non-zero size, it's enforced by the caller.
	(operator new): Move check for valid alignment here. Use
	__builtin_expect on check for zero size.

From-SVN: r263376
2018-08-07 23:50:19 +01:00
Jonathan Wakely a2d762245d Add workaround for aligned_alloc bug on AIX
On AIX 7.2.0.0 aligned_alloc incorrectly requires the alignment to be a
multiple of sizeof(void*).

This adds a workaround to the operator new overload taking an alignment
value, to increase the alignment (and size) if needed.

Backport from mainline
2018-07-30  Jonathan Wakely  <jwakely@redhat.com>

	* libsupc++/new_opa.cc (operator new(size_t, align_val_t)): Add
	workaround for aligned_alloc bug on AIX.
	* testsuite/18_support/new_aligned.cc: New test.

From-SVN: r263375
2018-08-07 23:50:15 +01:00
Jonathan Wakely c9ceac07d7 PR libstdc++/86734 use addressof in reverse_iterator::operator->
Backport from mainline
2018-07-30  Jonathan Wakely  <jwakely@redhat.com>

	PR libstdc++/86734
	* include/bits/stl_iterator.h (reverse_iterator::operator->): Use
	addressof (LWG 2188).
	* testsuite/24_iterators/reverse_iterator/dr2188.cc: New test.

From-SVN: r263374
2018-08-07 23:50:11 +01:00
Jonathan Wakely 276da1d4da Fix std::codecvt_utf8<wchar_t> for Mingw
Backport from mainline
2018-05-19  Jonathan Wakely  <jwakely@redhat.com>

	* src/c++11/codecvt.cc (__codecvt_utf8_base<wchar_t>::do_in)
	[__SIZEOF_WCHAR_T__==2 && __BYTE_ORDER__!=__ORDER_BIG_ENDIAN__]: Set
	little_endian element in bitmask.
	* testsuite/22_locale/codecvt/codecvt_utf8/69703.cc: Run all tests.
	* testsuite/22_locale/codecvt/codecvt_utf8/wchar_t/1.cc: New.

From-SVN: r263373
2018-08-07 23:50:06 +01:00
GCC Administrator 74e25f1c71 Daily bump.
From-SVN: r263348
2018-08-07 00:16:21 +00:00
GCC Administrator d9e65f643a Daily bump.
From-SVN: r263322
2018-08-06 00:16:21 +00:00
GCC Administrator 1c84d3ddae Daily bump.
From-SVN: r263314
2018-08-05 00:16:15 +00:00
GCC Administrator d794992a48 Daily bump.
From-SVN: r263303
2018-08-04 00:16:20 +00:00
GCC Administrator ec693a5e81 Daily bump.
From-SVN: r263282
2018-08-03 00:16:09 +00:00
Jozef Lawrynowicz 188bc018cd backport: re PR middle-end/86705 (pr45678-2.c ICE with msp430-elf -mlarge)
2018-08-02  Jozef Lawrynowicz  <jozef.l@mittosystems.com>

	Backport from mainline
	2018-07-31  Jozef Lawrynowicz  <jozef.l@mittosystems.com>
	
	PR middle-end/86705
	* gcc/cfgexpand.c (set_parm_rtl): Use the alignment of Pmode when
	MAX_SUPPORTED_STACK_ALIGNMENT would otherwise be exceeded by the
	requested variable alignment.
	(expand_one_ssa_partition): Likewise.
	(expand_one_var): Likewise.

From-SVN: r263277
2018-08-02 20:36:14 +00:00
GCC Administrator 4618e59d3c Daily bump.
From-SVN: r263241
2018-08-02 00:16:40 +00:00
Richard Biener 2250ca17bd re PR tree-optimization/86724 (Compilation error with new isl 0.20 (missing includes))
2018-08-01  Richard Biener  <rguenther@suse.de>

	PR bootstrap/86724
	* graphite.h: Include isl/id.h and isl/space.h to allow build
	with ISL 0.20.

From-SVN: r263195
2018-08-01 08:07:16 +00:00
GCC Administrator 183b8c025b Daily bump.
From-SVN: r263188
2018-08-01 00:16:12 +00:00
GCC Administrator 4ddebaac1c Daily bump.
From-SVN: r263078
2018-07-31 00:16:09 +00:00
GCC Administrator eddde2b984 Daily bump.
From-SVN: r263057
2018-07-30 00:16:33 +00:00
John David Anglin bb7bdf71cb pa.c (pa_output_addr_vec): Align address table.
* config/pa/pa.c (pa_output_addr_vec): Align address table.
	* config/pa/pa.h (JUMP_TABLES_IN_TEXT_SECTION): Revise comment.
	* config/pa/pa32-linux.h (JUMP_TABLES_IN_TEXT_SECTION): Define.

From-SVN: r263053
2018-07-29 16:03:58 +00:00
GCC Administrator 487034e36a Daily bump.
From-SVN: r263048
2018-07-29 00:16:15 +00:00
GCC Administrator c74d388e7a Daily bump.
From-SVN: r263043
2018-07-28 00:16:23 +00:00
GCC Administrator 06584b89fa Daily bump.
From-SVN: r263025
2018-07-27 00:16:10 +00:00
GCC Administrator a123db486e Daily bump.
From-SVN: r262986
2018-07-26 00:16:20 +00:00
GCC Administrator 46c356f48d Daily bump.
From-SVN: r262955
2018-07-25 00:16:26 +00:00
GCC Administrator 278a1bf20e Daily bump.
From-SVN: r262938
2018-07-24 00:16:24 +00:00
GCC Administrator 264033661a Daily bump.
From-SVN: r262925
2018-07-23 00:16:10 +00:00
GCC Administrator c87d87f727 Daily bump.
From-SVN: r262919
2018-07-22 00:16:09 +00:00
GCC Administrator bb2043717e Daily bump.
From-SVN: r262915
2018-07-21 00:16:10 +00:00
GCC Administrator 95df7580da Daily bump.
From-SVN: r262895
2018-07-20 00:16:08 +00:00
GCC Administrator 3e30d31a91 Daily bump.
From-SVN: r262868
2018-07-19 00:16:09 +00:00
GCC Administrator 589d2de35d Daily bump.
From-SVN: r262844
2018-07-18 00:16:21 +00:00
Kyrylo Tkachov 5d09bc2689 Avoid assembler warnings from AArch64 constructor/destructor priorities
2018-07-17  Kyrylo Tkachov  <kyrylo.tkachov@arm.com>

	Backport from mainline
	PR target/84168
	2017-09-28  Joseph Myers  <joseph@codesourcery.com>

	* config/aarch64/aarch64.c (aarch64_elf_asm_constructor)
	(aarch64_elf_asm_destructor): Pass SECTION_NOTYPE to get_section
	when creating .init_array and .fini_array sections with priority
	specified.

From-SVN: r262821
2018-07-17 12:43:43 +00:00
Eric Botcazou 6044cc4858 decl.c (choices_to_gnu): Rename parameters.
* gcc-interface/decl.c (choices_to_gnu): Rename parameters.  Deal with
	an operand of Character type.  Factor out range generation to the end.
	Check that the bounds are literals and convert them to the type of the
	operand before building the ranges.
	* gcc-interface/utils.c (make_dummy_type): Minor tweak.
	(make_packable_type): Propagate TYPE_DEBUG_TYPE.
	(maybe_pad_type): Likewise.

From-SVN: r262814
2018-07-17 10:12:02 +00:00
Eric Botcazou 56dbe683db decl.c (gnat_to_gnu_entity): Deal with more rvalues in the expression of a renaming.
* gcc-interface/decl.c (gnat_to_gnu_entity) <E_Variable>: Deal with
	more rvalues in the expression of a renaming.

From-SVN: r262809
2018-07-17 09:23:31 +00:00
GCC Administrator 05da005673 Daily bump.
From-SVN: r262762
2018-07-17 00:16:23 +00:00
Fritz Reese 564ce8deb7 re PR fortran/83184 (Out of memory or ICE with option -fdec)
2018-07-16  Fritz Reese  <fritzoreese@gmail.com>

    gcc/testsuite/ChangeLog:

	PR fortran/83184
	Backport from trunk.
	* gfortran.dg/assumed_rank_14.f90: New testcase.
	* gfortran.dg/assumed_rank_15.f90: New testcase.
	* gfortran.dg/dec_structure_8.f90: Update error messages.
	* gfortran.dg/dec_structure_23.f90: Update error messages.

    gcc/fortran/ChangeLog:

	PR fortran/83184
	Backport from trunk.
	* decl.c (match_old_style_init): Initialize locus of variable expr when
	creating a data variable.
	(match_clist_expr): Verify array is explicit shape/size before
	attempting to allocate constant array constructor.

From-SVN: r262759
2018-07-16 23:35:39 +00:00
Fritz Reese 3283fd0f6c backport: re PR fortran/83183 (Out of memory with option -finit-derived)
2018-07-16  Fritz Reese  <fritzoreese@gmail.com>

    gcc/testsuite/ChangeLog:

	Backport from trunk:

	PR fortran/83183
	PR fortran/86325
	* gfortran.dg/init_flag_18.f90: New testcase.
	* gfortran.dg/init_flag_19.f03: New testcase.

    gcc/fortran/ChangeLog:

	Backport from trunk:

	PR fortran/86417
	* module.c (mio_component): Set component->loc when loading from module.

	PR fortran/83183
	PR fortran/86325
	* expr.c (class_allocatable, class_pointer, comp_allocatable,
	comp_pointer): New helpers.
	(component_initializer): Generate EXPR_NULL for allocatable or pointer
	components. Do not generate initializers for components within BT_CLASS.
	Do not assign to comp->initializer.
	(gfc_generate_initializer): Use new helpers; move code to generate
	EXPR_NULL for class allocatable components into component_initializer().

From-SVN: r262751
2018-07-16 22:25:54 +00:00
GCC Administrator ca0cf1b80c Daily bump.
From-SVN: r262673
2018-07-16 00:16:25 +00:00
GCC Administrator bead010332 Daily bump.
From-SVN: r262663
2018-07-15 00:16:10 +00:00
GCC Administrator 1881e37eed Daily bump.
From-SVN: r262656
2018-07-14 00:16:20 +00:00
GCC Administrator 6accf86988 Daily bump.
From-SVN: r262618
2018-07-13 00:16:22 +00:00
Richard Biener 83bb92f095 re PR target/84829 (-mieee-fp causes to link with -lieee but that is no longer available)
2018-07-12  Richard Biener  <rguenther@suse.de>

	PR target/84829
	* config/gnu-user.h (GNU_USER_TARGET_NO_PTHREADS_LIB_SPEC):
	Remove -mieee-fp handling.

	* gcc.target/i386/pr84829.c: New testcase.

From-SVN: r262597
2018-07-12 16:29:50 +00:00
GCC Administrator 89e91324ad Daily bump.
From-SVN: r262569
2018-07-12 00:16:11 +00:00
GCC Administrator 476b60f4a8 Daily bump.
From-SVN: r262547
2018-07-11 00:16:48 +00:00
Carl Love 3e661b0636 backport: vsx.md (define_insn "*stxvl"): Add missing argument to the sldi instruction.
2018-07-10  Carl Love  <cel@us.ibm.com>

	Backport from mainline
	2017-09-07  Carl Love  <cel@us.ibm.com>

	* config/rs6000/vsx.md (define_insn "*stxvl"): Add missing argument to
	the sldi instruction.

From-SVN: r262541
2018-07-10 17:33:40 +00:00
GCC Administrator 514452079e Daily bump.
From-SVN: r262530
2018-07-10 00:16:37 +00:00
GCC Administrator 23063d8a47 Daily bump.
From-SVN: r262507
2018-07-09 00:16:24 +00:00
GCC Administrator b35463f6d7 Daily bump.
From-SVN: r262503
2018-07-08 00:16:40 +00:00
GCC Administrator 27631caf1b Daily bump.
From-SVN: r262490
2018-07-07 00:16:10 +00:00
GCC Administrator 4f661d6d9b Daily bump.
From-SVN: r262460
2018-07-06 00:16:28 +00:00
François Dumont 04ab81013d backport: re PR libstdc++/86272 (__gnu_debug::string uses undefined __glibcxx_check_insert_range2)
2018-07-05  François Dumont  <fdumont@gcc.gnu.org>

	Backport from mainline
	2018-07-04  François Dumont  <fdumont@gcc.gnu.org>

	PR libstdc++/86272
	* include/debug/string
	(__gnu_debug::basic_string<>::insert<_Ite>(const_iterator, _Ite, _Ite)):
	Use __glibcxx_check_insert_range.

From-SVN: r262454
2018-07-05 20:48:02 +00:00
GCC Administrator 31a594c057 Daily bump.
From-SVN: r262426
2018-07-05 00:16:41 +00:00
Jonathan Wakely 65215e08d3 Use non-throwing is_directory in filesystem::create_directory
The create_dir helper was calling the throwing form of
filesystem::is_directory instead of passing the error_code argument.
Since std::filesystem::create_directory(const path&, error_code&) is
noexcept, it would call std::terminate if an error occurred in
is_directory.

Passing the error_code also takes care of clearing it in the case where
is_directory returns true.

Backport from mainline
2018-03-09  Jonathan Wakely  <jwakely@redhat.com>

	src/filesystem/ops.cc (create_dir): Pass error_code to is_directory.

From-SVN: r262413
2018-07-04 14:59:57 +01:00
Jonathan Wakely 0ee55982e1 LWG 3050 Fix cv-qualification of convertibility constraints
Backport from mainline
2018-06-18  Jonathan Wakely  <jwakely@redhat.com>

	* include/std/chrono (duration, operator*, operator/, operator%): Use
	const-qualified type as source type in is_convertible constraints.
	* testsuite/20_util/duration/arithmetic/dr3050.cc: New.
	* testsuite/20_util/duration/cons/dr3050.cc: New.
	* testsuite/20_util/duration/literals/range.cc: Rename to...
	* testsuite/20_util/duration/literals/range_neg.cc: Here. Adjust
	dg-error lineno.

From-SVN: r262412
2018-07-04 14:59:51 +01:00
Jonathan Wakely 822af00440 PR libstdc++/86127 avoid unnecessary allocator conversions
There is no need to use an allocator of the correct value_type when
calling allocator_traits::construct and allocator_traits::destroy. The
existing node allocator can be used, instead of constructing a new
allocator object every time.

There's also no benefit to using __gnu_cxx::__alloc_traits instead of
std::allocator_traits to get the pointer and const_pointer types.
std::forward_list is only available for C++11 and later, when
std::allocator_traits is available too.

Backport from mainline
2018-06-13  Jonathan Wakely  <jwakely@redhat.com>

	PR libstdc++/86127
	* include/bits/forward_list.h (_Fwd_list_base::_Tp_alloc_type): Remove
	unused typedef.
	(_Fwd_list_base::_M_create_node, _Fwd_list_base::_M_erase_after):
	Use node allocator to create and destroy elements.
	(forward_list::_Tp_alloc_type): Remove unused typedef.
	(forward_list::_Alloc_traits): Use allocator_traits instead of
	__gnu_cxx::__alloc_traits.
        * include/bits/forward_list.tcc (_Fwd_list_base::_M_erase_after):
	Use node allocator to create and destroy elements.

From-SVN: r262411
2018-07-04 14:59:42 +01:00
Jonathan Wakely d55126cdd6 Qualify another call in <variant>
Backport from mainline
2018-05-29  Jonathan Wakely  <jwakely@redhat.com>

	* include/std/variant (__erased_dtor): Qualify call to __get.

From-SVN: r262410
2018-07-04 14:59:37 +01:00
Jonathan Wakely ade0ce8b51 Qualify std::__invoke in <variant> to prevent ADL
Backport from mainline
2018-05-15  Jonathan Wakely  <jwakely@redhat.com>

	* include/std/variant (__gen_vtable_impl::__visit_invoke): Qualify
	__invoke to prevent ADL.

From-SVN: r262409
2018-07-04 14:59:32 +01:00
Jonathan Wakely 576e157ac7 Add another workaround to std::variant for Clang bug 31852
Backport from mainline
2018-04-05  Jonathan Wakely  <jwakely@redhat.com>

	* include/std/variant (_VARIANT_RELATION_FUNCTION_TEMPLATE): Qualify
	__get calls to avoid ADL and avoid ambiguity due to Clang bug.

From-SVN: r262408
2018-07-04 14:59:28 +01:00
Jonathan Wakely c6c090cd5f Add workaround to std::variant for Clang bug 31852
Backport from mainline
2018-03-26  Jonathan Wakely  <jwakely@redhat.com>

	* include/std/variant (__get): Qualify calls to avoid ADL.
	(__select_index): Adjust whitespace.
	(variant): Add using-declaration to workaround Clang bug.

From-SVN: r262407
2018-07-04 14:59:21 +01:00
Jonathan Wakely c7618a293a PR target/85904 check for aligned_alloc on netbsd cross-compilation
Backport from mainline
2018-05-24  Maya Rashish  <coypu@sdf.org>

	PR target/85904
	* crossconfig.m4: Test for aligned_alloc on netbsd.
	* configure: Regenerate.

From-SVN: r262406
2018-07-04 14:59:17 +01:00
Jonathan Wakely e9dae68f9f PR libstdc++/85098 add missing definitions for static constants
In C++11 and C++14 any odr-use of these constants requires a definition
at namespace-scope.  In C++17 they are implicitly inline and so the
namespace-scope redeclarations are redundant (and allowing them is
deprecated).

Backport from mainline
2018-05-18  Jonathan Wakely  <jwakely@redhat.com>

	PR libstdc++/85098
	* include/bits/regex.h [__cplusplus < 201703L] (basic_regex::icase)
	(basic_regex::nosubs, basic_regex::optimize, basic_regex::collate)
	(basic_regex::ECMAScript, basic_regex::basic, basic_regex::extended)
	(basic_regex::awk, basic_regex::grep, basic_regex::egrep): Add
	definitions.
	* include/bits/regex_automaton.h (_NFA::_M_insert_state): Adjust
	whitespace.
	* testsuite/28_regex/basic_regex/85098.cc: New

From-SVN: r262405
2018-07-04 14:59:13 +01:00
Jonathan Wakely c8fbe55810 PR libstdc++/85671 allow copy elision in path concatenation
By performing the /= operation on a named local variable instead of a
temporary the copy made for the return value can be elided.

Backport from mainline
2018-05-07  Jonathan Wakely  <jwakely@redhat.com>

	PR libstdc++/85671
	* include/experimental/bits/fs_path.h (operator/): Likewise.

From-SVN: r262404
2018-07-04 14:59:06 +01:00
Jonathan Wakely b207860d8e PR libstdc++/83982 fix exception-safety guarantee of std::vector::resize
Construct new elements before moving existing ones, so that if a default
constructor throws, the existing elements are not left in a moved-from
state.

Backport from mainline
2018-06-14  Daniel Trebbien <dtrebbien@gmail.com>
	    Jonathan Wakely  <jwakely@redhat.com>

	PR libstdc++/83982
	* include/bits/vector.tcc (vector::_M_default_append(size_type)):
	Default-construct new elements before moving existing ones.
	* testsuite/23_containers/vector/capacity/resize/strong_guarantee.cc:
	New.

From-SVN: r262403
2018-07-04 14:59:01 +01:00
Jonathan Wakely e919c9ef06 PR libstdc++/84087 add default arguments to basic_string members (LWG 2268)
This change was a DR against C++11 and so should have been implemented
years ago.

Backport from mainline
2018-05-03  Jonathan Wakely  <jwakely@redhat.com>

	PR libstdc++/84087 LWG DR 2268 basic_string default arguments
	* include/bits/basic_string.h [_GLIBCXX_USE_CXX11_ABI=1]
	(append(const basic_string&, size_type, size_type)
	(assign(const basic_string&, size_type, size_type)
	(insert(size_type, const basic_string&, size_type, size_type)
	(replace(size_type,size_type,const basic_string&,size_type,size_type)
	(compare(size_type,size_type,constbasic_string&,size_type,size_type)):
	Add default arguments (LWG 2268).
	[_GLIBCXX_USE_CXX11_ABI=0]
	(append(const basic_string&, size_type, size_type)
	(assign(const basic_string&, size_type, size_type)
	(insert(size_type, const basic_string&, size_type, size_type)
	(replace(size_type,size_type,const basic_string&,size_type,size_type)
	(compare(size_type,size_type,constbasic_string&,size_type,size_type)):
	Likewise.
	* testsuite/21_strings/basic_string/dr2268.cc: New test.

From-SVN: r262402
2018-07-04 14:58:50 +01:00
Martin Jambor 7f55444200 Remove spurious $HOME include from BRIG FE Makefile
2018-07-04  Martin Jambor  <mjambor@suse.cz>

	PR hsa/86371
	* Make-lang.in (BRIGINCLUDES): Remove erroneous include path in $HOME.

From-SVN: r262400
2018-07-04 14:22:29 +02:00
GCC Administrator 66c92f33e0 Daily bump.
From-SVN: r262362
2018-07-04 00:16:51 +00:00
Jason Merrill 480d58a2a8 PR c++/86378 - functional cast in noexcept-specifier.
* tree.c (strip_typedefs_expr) [TREE_LIST]: Fix iteration.

From-SVN: r262352
2018-07-03 12:27:04 -04:00
Paul Thomas b2c9f2a382 re PR fortran/82969 (ICE in gfc_class_vptr_get, at fortran/trans-expr.c:211)
2018-07-03  Paul Thomas  <pault@gcc.gnu.org>

	PR fortran/82969
	PR fortran/86242
	* trans-array.c (structure_alloc_comps): Do not explicitly copy
	procedure pointer components.

2018-07-03  Paul Thomas  <pault@gcc.gnu.org>

	PR fortran/82969
	PR fortran/86242
	* gfortran.dg/proc_ptr_50.f90: New test.

From-SVN: r262331
2018-07-03 09:46:31 +00:00
GCC Administrator 6ba60bf88c Daily bump.
From-SVN: r262324
2018-07-03 00:16:31 +00:00
Ian Lance Taylor efa8f2afd2 re PR go/86331 (the gccgo's "go" tool looks like failing to invoke any sub go command)
PR go/86331
    os: check return value as well as error from waitid
    
    https://gcc.gnu.org/PR86331 indicates that if a signal handler runs it
    is possible for syscall.Syscall6 to return a non-zero errno value even
    if no error occurs. That is a problem in general, but this fix will
    let us work around the general problem for the specific case of
    calling waitid.
    
    Reviewed-on: https://go-review.googlesource.com/121595

From-SVN: r262315
2018-07-02 16:29:24 +00:00
Martin Liska d5ef75541c Clean up gcc/ChangeLog file.
From-SVN: r262310
2018-07-02 14:51:14 +00:00
GCC Administrator a239d7e82f Daily bump.
From-SVN: r262292
2018-07-02 00:16:16 +00:00
GCC Administrator 8f35947827 Daily bump.
From-SVN: r262280
2018-07-01 00:16:09 +00:00
GCC Administrator a9ba67bd14 Daily bump.
From-SVN: r262264
2018-06-30 00:16:25 +00:00
Fritz Reese 6eb2ae214d Revert r262224 (backport of r262221) as PDTs are not supported in 7-branch.
gcc/fortran/ChangeLog:
-2018-06-28  Fritz Reese  <fritzoreese@gmail.com>
-
-	PR fortran/82865
-	Backport from trunk.
-	* decl.c (gfc_match_type): Refactor and check for PDT declarations.
-

gcc/testsuite/ChangeLog:
-2018-06-28  Fritz Reese  <fritzoreese@gmail.com>
-
-	PR fortran/82865
-	Backport from trunk.
-	* gfortran.dg/dec_type_print_2.f03: New testcase.
-

From-SVN: r262260
2018-06-29 20:29:34 +00:00
Martin Liska f34342aa43 Partial backport r256656
2018-06-29  Martin Liska  <mliska@suse.cz>

	Backport from mainline
	2018-01-10  Kelvin Nilsen  <kelvin@gcc.gnu.org>

	* lex.c (search_line_fast): Remove illegal coercion of an
	unaligned pointer value to vector pointer type and replace with
	use of __builtin_vec_vsx_ld () built-in function, which operates
	on unaligned pointer values.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/gcc-6-branch@261621 138bc75d-0d04-0410-961f-82ee72b054a4

From-SVN: r262243
2018-06-29 09:31:30 +00:00
GCC Administrator 4e830dbbcb Daily bump.
From-SVN: r262238
2018-06-29 00:16:24 +00:00
Fritz Reese a7fe62df62 re PR fortran/82865 (Option -fdec collides with PDT)
2018-06-28  Fritz Reese  <fritzoreese@gmail.com>

    gcc/testsuite/ChangeLog:

	PR fortran/82865
	Backport from trunk.
	* gfortran.dg/dec_type_print_2.f03: New testcase.

    gcc/fortran/ChangeLog:

	PR fortran/82865
	Backport from trunk.
	* decl.c (gfc_match_type): Refactor and check for PDT declarations.

From-SVN: r262224
2018-06-28 16:51:23 +00:00
Jason Merrill ef5850f13b PR c++/80290 - memory-hog with std::pair.
* pt.c (type_unification_real): Skip non-dependent conversion
	check for a nested list argument.
	(braced_init_depth): New.

From-SVN: r262204
2018-06-27 20:25:21 -04:00
GCC Administrator 9fbd05fc97 Daily bump.
From-SVN: r262201
2018-06-28 00:16:20 +00:00
David Edelsohn 566011d3ec [multiple changes]
2018-06-27  David Edelsohn  <dje.gcc@gmail.com>

        2018-06-19  Tony Reix  <tony.reix@atos.com>
            Damien Bergamini  <damien.bergamini@atos.com>
            David Edelsohn  <dje.gcc@gmail.com>

        * collect2.c (static_obj): New variable.
        (static_libs): New variable.
        (is_in_list): Uncomment declaration.
        (main): Track AIX libraries linked statically.
        (is_in_list): Uncomment definition.
        (scan_prog_file): Don't add AIX shared libraries initializer
        to constructor list if linking statically.

From-SVN: r262193
2018-06-27 16:08:21 -04:00
GCC Administrator 2a67f97518 Daily bump.
From-SVN: r262169
2018-06-27 00:16:42 +00:00
Kelvin Nilsen c4d61a5b46 backport: rs6000-c.c (altivec_overloaded_builtins): Change behavior of vec_packsu (vector unsigned long long...
gcc/ChangeLog:

2018-06-26  Kelvin Nilsen  <kelvin@gcc.gnu.org>

	Backported from mainline
	2018-06-20  Kelvin Nilsen  <kelvin@gcc.gnu.org>

	* config/rs6000/rs6000-c.c (altivec_overloaded_builtins): Change
	behavior of vec_packsu (vector unsigned long long, vector unsigned
	long long) to match behavior of vec_packs with same signature.

gcc/testsuite/ChangeLog:

2018-06-26  Kelvin Nilsen  <kelvin@gcc.gnu.org>

	Backported from mainline
	2018-06-20  Kelvin Nilsen  <kelvin@gcc.gnu.org>

	* gcc.target/powerpc/builtins-1.c: Add dg directives to scan
	for vpkudus.

From-SVN: r262164
2018-06-26 19:45:01 +00:00
Robin Dapp 8e24e825f5 S/390: Fix mtune default.
When building with --with-tune=zEC12 and calling the resulting gcc
with --march=z13 (no extra -mtune), the binary would unexpectedly be compiled
with -march=z13 -mtune=zEC12.  This patch avoids using the default tune
parameter if -march is specified as argument but the user can still
explicitly state -march=z13 -mtune=zEC12.

gcc/ChangeLog:

2018-06-26  Robin Dapp  <rdapp@linux.ibm.com>

        * config/s390/s390.h (enum processor_flags): Do not use
        default tune parameter when -march was specified.

From-SVN: r262145
2018-06-26 12:23:02 +00:00
Jakub Jelinek a8b7129f6a re PR target/86314 (GCC 7.x and 8.x zero out "eax" before using "rax" in "lock bts")
PR target/86314
	* config/i386/i386.md (setcc + movzbl to xor + setcc peephole2s):
	Check reg_overlap_mentioned_p in addition to reg_set_p with the same
	operands.

	* gcc.dg/pr86314.c: New test.

From-SVN: r262144
2018-06-26 13:54:29 +02:00
Jakub Jelinek b99c613252 re PR c++/86291 (OpenMP incorrect for-loop collapsing with iterators and at least 5 nested loops)
PR c++/86291
	* parser.c (cp_parser_omp_for_loop_init): Change for_block argument
	type from vec<tree, va_gc> * to vec<tree, va_gc> *&.

	* testsuite/libgomp.c++/pr86291.C: New test.

From-SVN: r262139
2018-06-26 13:16:10 +02:00
GCC Administrator 967d9cf14d Daily bump.
From-SVN: r262125
2018-06-26 00:16:36 +00:00
Michael Meissner efd36869c5 backport: re PR target/85424 (The __builtin_packlongdouble function might have issues with the output overlapping the inputs)
2018-06-25  Michael Meissner  <meissner@linux.vnet.ibm.com>

	Back port from trunk
	2018-04-17  Michael Meissner  <meissner@linux.vnet.ibm.com>

	PR target/85424
	* config/rs6000/rs6000.md (pack<mode>): Do not try handle a pack
	where the inputs overlap with the output.

From-SVN: r262122
2018-06-25 23:28:27 +00:00
Fritz Reese e96d538fd6 re PR fortran/82972 (ICE with -finit-derived in gfc_conv_structure, at fortran/trans-expr.c:7733 (and others))
2018-06-25  Fritz Reese  <fritzoreese@gmail.com>

	PR fortran/82972
	PR fortran/83088
	PR fortran/85851
	Backport from trunk.
	* expr.c (component_initializer): Assign init expr to c->initializer.
	(generate_isocbinding_initializer): New.
	(gfc_generate_initializer): Call generate_isocbinding_initializer to
	generate initializers for c_ptr and c_funptr with -finit-derived.

2018-06-25  Fritz Reese  <fritzoreese@gmail.com>

	PR fortran/82972
	PR fortran/83088
	PR fortran/85851
	Backport from trunk.
	* gfortran.dg/init_flag_17.f90: New testcase.

From-SVN: r262106
2018-06-25 19:07:03 +00:00
Jakub Jelinek c7fdef1d61 re PR target/84786 ([miscompilation] vunpcklpd accessing xmm16-22 targeting KNL)
PR target/84786
	* config/i386/sse.md (vshift_count): New mode attr.
	(<shift_insn><mode>3<mask_name>): Use <vshift_count>N instead of vN
	as last operand's constraint for VI2_AVX2_AVX512BW shifts.  Use YvN
	instead of vN as last operand's constraint for VI48_AVX2 shifts.

	* gcc.target/i386/avx512f-pr84786-3.c: New test.

From-SVN: r262014
2018-06-25 14:48:29 +02:00
Paul Thomas 167dfcfc46 re PR fortran/83118 (Bad intrinsic assignment of class(*) array component of derived type)
2018-06-25  Paul Thomas  <pault@gcc.gnu.org>

	PR fortran/83118
	Back port from trunk
	* resolve.c (resolve_ordinary_assign): Force the creation of a
	vtable for assignment of non-polymorphic expressions to an
	unlimited polymorphic object.
	* trans-array.c (gfc_alloc_allocatable_for_assignment): Use the
	size of the rhs type for such assignments. Set the dtype, _len
	and vptrs appropriately.
	* trans-expr.c (gfc_trans_assignment): Force the use of the
	_copy function for these assignments.

2018-06-25  Paul Thomas  <pault@gcc.gnu.org>

	PR fortran/83118
	Back port from trunk
	* gfortran.dg/unlimited_polymorphic_30.f03: New test.

From-SVN: r262005
2018-06-25 07:52:09 +00:00
GCC Administrator 02d5a81c8d Daily bump.
From-SVN: r262000
2018-06-25 00:16:48 +00:00
GCC Administrator d7449417f2 Daily bump.
From-SVN: r261990
2018-06-24 00:16:25 +00:00
Richard Sandiford e9d21f6975 Fix phi backedge detection in backprop (PR85989)
Backport trunk r261064.

2018-06-23  Richard Sandiford  <richard.sandiford@linaro.org>

gcc/
	PR tree-optimization/85989
	* gimple-ssa-backprop.c (backprop::m_visited_phis): New member
	variable.
	(backprop::intersect_uses): Check it when deciding whether this
	is a backedge reference.
	(backprop::process_block): Add each phi to m_visited_phis
	after visiting it, then clear it at the end.

gcc/testsuite/
	PR tree-optimization/85989
	* gcc.dg/torture/pr85989.c: New test.

From-SVN: r261984
2018-06-23 12:21:18 +00:00
GCC Administrator a9c04be619 Daily bump.
From-SVN: r261977
2018-06-23 00:16:47 +00:00
Jakub Jelinek 616196a7bd backport: re PR c++/86210 (Missing -Wnonnull warning for function defined in the same TU)
Backported from mainline
	2018-06-20  Jakub Jelinek  <jakub@redhat.com>

	PR c++/86210
	* c-common.c (check_nonnull_arg): Use fold_for_warn.  Adjust obsolete
	comment.

	* g++.dg/warn/Wnonnull4.C: New test.

From-SVN: r261970
2018-06-22 23:33:58 +02:00
Jakub Jelinek b1173d7d5c backport: re PR tree-optimization/86231 (vrp_meet causes wrong-code)
Backported from mainline
	2018-06-20  Jakub Jelinek  <jakub@redhat.com>

	PR tree-optimization/86231
	* tree-vrp.c (union_ranges): For (  [  )  ] or (   )[   ] range and
	anti-range don't overwrite *vr0min before using it to compute *vr0max.

	* gcc.dg/tree-ssa/vrp119.c: New test.
	* gcc.c-torture/execute/pr86231.c: New test.

From-SVN: r261969
2018-06-22 23:33:07 +02:00
Jakub Jelinek 3765c86f5c backport: re PR middle-end/85878 (ICE in convert_mode_scalar, at expr.c:287)
Backported from mainline
	2018-06-15  Jakub Jelinek  <jakub@redhat.com>

	PR middle-end/85878
	* expr.c (expand_assignment): Only call store_expr for halves if the
	mode is the same.

	* gfortran.fortran-torture/compile/pr85878.f90: New test.

From-SVN: r261968
2018-06-22 23:30:06 +02:00
Jakub Jelinek eb989a7c14 backport: re PR target/85945 (ICE in resolve_subreg_use, at lower-subreg.c:751)
Backported from mainline
	2018-06-14  Jakub Jelinek  <jakub@redhat.com>

	PR target/85945
	* lower-subreg.c (find_decomposable_subregs): Don't decompose float
	subregs of multi-word pseudos unless the float mode has word size.

	* gcc.c-torture/compile/pr85945.c: New test.

From-SVN: r261967
2018-06-22 23:29:24 +02:00
Jakub Jelinek bcb3e32d2c backport: re PR c++/86025 (ICE with -Wduplicated-branches and OpenMP critical)
Backported from mainline
	2018-06-04  Jakub Jelinek  <jakub@redhat.com>

	PR c++/86025
	* tree.c (inchash::add_expr): Handle IDENTIFIER_NODE.

	* c-c++-common/gomp/pr86025.c: New test.

From-SVN: r261966
2018-06-22 23:28:36 +02:00
Jakub Jelinek 8d500ed580 backport: re PR c++/85952 (Bogus -Wunused-but-set-variable warning with array structured binding)
Backported from mainline
	2018-05-29  Jakub Jelinek  <jakub@redhat.com>

	PR c++/85952
	* init.c (build_aggr_init): For structured binding initialized from
	array call mark_rvalue_use on the initializer.

	* g++.dg/warn/Wunused-var-33.C: New test.

From-SVN: r261965
2018-06-22 23:27:41 +02:00
Jakub Jelinek 9ab3937b28 backport: re PR c/85696 (OpenMP with variably modified and default(none) won't compile)
Backported from mainline
	2018-05-11  Jakub Jelinek  <jakub@redhat.com>

	PR c/85696
	* c-omp.c (c_omp_predetermined_sharing): Return
	OMP_CLAUSE_DEFAULT_SHARED for artificial vars with integral type.

	* c-typeck.c (c_finish_omp_clauses): Don't use
	c_omp_predetermined_sharing, instead just check TREE_READONLY.

	* cp-tree.h (cxx_omp_predetermined_sharing_1): New prototype.
	* cp-gimplify.c (cxx_omp_predetermined_sharing): New wrapper around
	cxx_omp_predetermined_sharing_1.  Rename old function to ...
	(cxx_omp_predetermined_sharing_1): ... this.
	* semantics.c (finish_omp_clauses): Use cxx_omp_predetermined_sharing_1
	instead of cxx_omp_predetermined_sharing.

	* c-c++-common/gomp/pr85696.c: New test.

From-SVN: r261964
2018-06-22 23:27:25 +02:00
Jakub Jelinek f492b27c91 backport: re PR c/85696 (OpenMP with variably modified and default(none) won't compile)
Backported from mainline
	2018-05-11  Jakub Jelinek  <jakub@redhat.com>

	PR c/85696
	* c-omp.c (c_omp_predetermined_sharing): Return
	OMP_CLAUSE_DEFAULT_SHARED for artificial vars with integral type.

	* c-typeck.c (c_finish_omp_clauses): Don't use
	c_omp_predetermined_sharing, instead just check TREE_READONLY.

	* cp-tree.h (cxx_omp_predetermined_sharing_1): New prototype.
	* cp-gimplify.c (cxx_omp_predetermined_sharing): New wrapper around
	cxx_omp_predetermined_sharing_1.  Rename old function to ...
	(cxx_omp_predetermined_sharing_1): ... this.
	* semantics.c (finish_omp_clauses): Use cxx_omp_predetermined_sharing_1
	instead of cxx_omp_predetermined_sharing.

	* c-c++-common/gomp/pr85696.c: New test.

From-SVN: r261963
2018-06-22 23:25:04 +02:00
Jakub Jelinek 3056ef4bff backport: re PR c++/85662 ("error: non-constant condition for static assertion" from __builtin_offsetof in C++)
Backported from mainline
	2018-06-22  Jakub Jelinek  <jakub@redhat.com>

	PR c++/85662
	* g++.dg/ext/offsetof3.C: New test.

	2018-05-10  Jakub Jelinek  <jakub@redhat.com>

	PR c++/85662
	* c-common.h (fold_offsetof_1): Removed.
	(fold_offsetof): Add TYPE argument defaulted to size_type_node and
	CTX argument defaulted to ERROR_MARK.
	* c-common.c (fold_offsetof_1): Renamed to ...
	(fold_offsetof): ... this.  Remove wrapper function.  Add TYPE
	argument, convert the pointer constant to TYPE and use size_binop
	with PLUS_EXPR instead of fold_build_pointer_plus if type is not
	a pointer type.  Adjust recursive calls.

	* c-fold.c (c_fully_fold_internal): Use fold_offsetof rather than
	fold_offsetof_1, pass TREE_TYPE (expr) as TYPE to it and drop the
	fold_convert_loc.
	* c-typeck.c (build_unary_op): Use fold_offsetof rather than
	fold_offsetof_1, pass argtype as TYPE to it and drop the
	fold_convert_loc.

	* cp-gimplify.c (cp_fold): Use fold_offsetof rather than
	fold_offsetof_1, pass TREE_TYPE (x) as TYPE to it and drop the
	fold_convert.

	* g++.dg/ext/offsetof2.C: New test.

From-SVN: r261962
2018-06-22 23:23:03 +02:00
Jakub Jelinek 7329a73260 backport: re PR c++/85659 (ICE with inline assembly inside virtual function)
Backported from mainline
	2018-05-06  Jakub Jelinek  <jakub@redhat.com>

	PR c++/85659
	* cfgexpand.c (expand_asm_stmt): Don't create a temporary if
	the type is addressable.  Don't force op into register if it has
	BLKmode.

	* g++.dg/ext/asm14.C: New test.
	* g++.dg/ext/asm15.C: New test.
	* g++.dg/ext/asm16.C: New test.

From-SVN: r261961
2018-06-22 23:20:53 +02:00
Jakub Jelinek 5ce295a033 backport: re PR web/85578 (broken links in gcc-8.0.1-RC-20180427/INSTALL/specific.html, and out of date prerequisites.html)
Backported from mainline
	2018-05-01  Jakub Jelinek  <jakub@redhat.com>

	PR web/85578
	* doc/install.texi2html: Replace _002d with - and _002a with * in
	generated html files using sed.

From-SVN: r261960
2018-06-22 23:20:02 +02:00
Jakub Jelinek 2e752352eb backport: re PR tree-optimization/85529 (wrong code at -O2 and -O3 on x86_64-linux-gnu)
Backported from mainline
	2018-04-27  Jakub Jelinek  <jakub@redhat.com>

	PR tree-optimization/85529
	* tree-ssa-reassoc.c (optimize_range_tests_var_bound): Add FIRST_BB
	argument.  Don't call get_nonzero_bits if opcode is ERROR_MARK_NODE,
	rhs2 def stmt's bb is dominated by first_bb and it isn't an obvious
	zero extension or masking of the MSB bit.
	(optimize_range_tests): Add FIRST_BB argument, pass it through
	to optimize_range_tests_var_bound.
	(maybe_optimize_range_tests, reassociate_bb): Adjust
	optimize_range_tests callers.

	* gcc.c-torture/execute/pr85529-1.c: New test.
	* gcc.c-torture/execute/pr85529-2.c: New test.
	* gcc.dg/pr85529.c: New test.

From-SVN: r261959
2018-06-22 23:19:32 +02:00
Jakub Jelinek fd64a8a1e0 backport: re PR tree-optimization/85446 (wrong-code on riscv64)
Backported from mainline
	2018-04-19  Jakub Jelinek  <jakub@redhat.com>

	PR tree-optimization/85446
	* match.pd ((intptr_t) x eq/ne CST to x eq/ne (typeof x) cst): Require
	the integral and pointer types to have the same precision.

From-SVN: r261958
2018-06-22 23:18:32 +02:00
Jakub Jelinek 940e9f392d backport: re PR jit/85384 (libgccjit does not work if --with-gcc-major-version is used)
2018-06-22  Jakub Jelinek  <jakub@redhat.com>

	Backported from mainline
	2018-04-18  David Malcolm  <dmalcolm@redhat.com>

	PR jit/85384
	* acx.m4 (GCC_BASE_VER): Remove \$\$ from sed expression.

	* configure.ac (gcc-driver-name.h): Honor --with-gcc-major-version
	by using gcc_base_ver to generate a gcc_driver_version, and use
	it when generating GCC_DRIVER_NAME.
	* configure: Regenerate.

	* configure: Regenerate.

From-SVN: r261957
2018-06-22 23:16:41 +02:00
Jakub Jelinek 102ea0d5f1 backport: re PR c++/84463 (Supposedly-incompliant "error: '* key0' is not a constant expression")
Backported from mainline
	2018-04-18  Jakub Jelinek  <jakub@redhat.com>

	PR c++/84463
	* typeck.c (cp_build_addr_expr_1): Move handling of offsetof-like
	tricks from here to ...
	* cp-gimplify.c (cp_fold) <case ADDR_EXPR>: ... here.  Only use it
	if INDIRECT_REF's operand is INTEGER_CST cast to pointer type.

	* g++.dg/cpp0x/constexpr-nullptr-1.C: Add -O1 to dg-options.
	* g++.dg/cpp0x/constexpr-nullptr-2.C: Expect different diagnostics
	in two cases.  Uncomment two other tests and add expected dg-error for
	them.
	* g++.dg/init/struct2.C: Cast to int rather than long to avoid
	-Wnarrowing diagnostics on some targets for c++11.
	* g++.dg/parse/array-size2.C: Remove xfail.
	* g++.dg/cpp0x/constexpr-84463.C: New test.

From-SVN: r261956
2018-06-22 23:12:32 +02:00
Jakub Jelinek 50f8ab99c8 backport: re PR rtl-optimization/85431 (UBSAN: ../../gcc/dse.c:303:15: runtime error: shift exponent 64 is too large for 64-bit type 'long unsigned int')
Backported from mainline
	2018-04-17  Jakub Jelinek  <jakub@redhat.com>

	PR rtl-optimization/85431
	* dse.c (record_store): Ignore zero width stores.

From-SVN: r261955
2018-06-22 23:11:28 +02:00
Jakub Jelinek 837e188b6b backport: re PR target/85430 (ICE: SIGSEGV in memory_operand at recog.c:1358/9 with -O2 -fno-tree-ccp -fno-tree-fre)
Backported from mainline
	2018-04-17  Jakub Jelinek  <jakub@redhat.com>

	PR target/85430
	* config/i386/i386.md (*ashlqi3_1_slp): Use alu1 type instead of alu.

	* gcc.dg/pr85430.c: New test.

From-SVN: r261954
2018-06-22 23:10:59 +02:00
Jakub Jelinek bbca820400 backport: re PR rtl-optimization/85300 (ICE in exact_int_to_float_conversion_p, at simplify-rtx.c:895)
Backported from mainline
	2018-04-10  Jakub Jelinek  <jakub@redhat.com>

	PR rtl-optimization/85300
	* combine.c (subst): Handle subst of CONST_SCALAR_INT_P new_rtx also
	into FLOAT and UNSIGNED_FLOAT like ZERO_EXTEND, return a CLOBBER if
	simplify_unary_operation fails.

	* gcc.dg/pr85300.c: New test.

From-SVN: r261953
2018-06-22 23:10:17 +02:00
Jakub Jelinek fd6def3e86 backport: re PR fortran/85313 (gcc/fortran/openmp.c: 2 * confused logic ?)
Backported from mainline
	2018-04-10  Jakub Jelinek  <jakub@redhat.com>

	PR fortran/85313
	* openmp.c (resolve_omp_do): Remove bogus if (j < i) break;.
	(resolve_oacc_nested_loops): Likewise.  Formatting fix.

	* gfortran.dg/gomp/pr85313.f90: New test.

From-SVN: r261952
2018-06-22 23:09:32 +02:00
Jakub Jelinek b8e47758b5 backport: re PR tree-optimization/85257 (wrong code with -O -fno-tree-ccp and reading zeroed vector member)
Backported from mainline
	2018-04-07  Jakub Jelinek  <jakub@redhat.com>

	PR tree-optimization/85257
	* fold-const.c (native_encode_vector): If not all elts could fit
	and off is -1, return 0 rather than offset.
	* tree-ssa-sccvn.c (vn_reference_lookup_3): Pass
	(offset - offset2) / BITS_PER_UNIT as 4th argument to
	native_encode_expr.  Verify len * BITS_PER_UNIT >= maxsizei.  Don't
	adjust buffer in native_interpret_expr call.

	* gcc.dg/pr85257.c: New test.

From-SVN: r261951
2018-06-22 23:08:47 +02:00
Jakub Jelinek 7b42eb87dc backport: re PR debug/85252 (ICE with -g for static zero-length array initialization)
Backported from mainline
	2018-04-06  Jakub Jelinek  <jakub@redhat.com>

	PR debug/85252
	* dwarf2out.c (rtl_for_decl_init): For STRING_CST initializer only
	build CONST_STRING if TYPE_MAX_VALUE is non-NULL and is INTEGER_CST.

	* gcc.dg/debug/pr85252.c: New test.

From-SVN: r261950
2018-06-22 23:08:00 +02:00
Jakub Jelinek 0099aeaa3a backport: re PR c++/85210 (ICE with broken structured binding in template)
Backported from mainline
	2018-04-06  Jakub Jelinek  <jakub@redhat.com>

	PR c++/85210
	* pt.c (tsubst_decomp_names): Return error_mark_node and assert
	errorcount is set if tsubst doesn't return a VAR_DECL.

	* g++.dg/cpp1z/decomp42.C: New test.

From-SVN: r261949
2018-06-22 23:07:16 +02:00
Jakub Jelinek 75bcfc00e5 backport: re PR c++/85208 (ICE with #pragma weak and structured binding)
Backported from mainline
	2018-04-05  Jakub Jelinek  <jakub@redhat.com>

	PR c++/85208
	* decl.c (start_decl): For DECL_DECOMPOSITION_P decls, don't call
	maybe_apply_pragma_weak here...
	(cp_maybe_mangle_decomp): ... but call it here instead.

	* g++.dg/cpp1z/decomp41.C: New test.

From-SVN: r261948
2018-06-22 23:06:41 +02:00
Jakub Jelinek de680082be backport: re PR inline-asm/85172 (internal compiler error: unexpected expression '<statement>' of kind asm_expr)
Backported from mainline
	2018-04-04  Jakub Jelinek  <jakub@redhat.com>

	PR inline-asm/85172
	* constexpr.c (cxx_eval_builtin_function_call): For calls to
	builtin_valid_in_constant_expr_p functions, don't call
	cxx_eval_constant_expression if argument is not
	potential_constant_expression.

	* g++.dg/ext/builtin13.C: New test.
	* g++.dg/ext/atomic-4.C: New test.

From-SVN: r261947
2018-06-22 23:05:52 +02:00
Jakub Jelinek 47eddf9eed backport: re PR rtl-optimization/85167 (shrink-wrap.c:333:15: runtime error with UBSAN)
Backported from mainline
	2018-04-03  Jakub Jelinek  <jakub@redhat.com>

	PR rtl-optimization/85167
	* shrink-wrap.c (move_insn_for_shrink_wrap): Don't set bb_uses and
	bb_defs if *split_p, instead preinitialize it to NULL.

	* gcc.dg/pr85167.c: New test.

From-SVN: r261946
2018-06-22 23:05:08 +02:00
Jakub Jelinek 379d4cf940 backport: re PR c++/85147 (ICE with invalid variadic template-template parameter)
Backported from mainline
	2018-04-03  Jakub Jelinek  <jakub@redhat.com>

	PR c++/85147
	* pt.c (fixed_parameter_pack_p_1): Punt if parm is error_mark_node.

	* g++.dg/cpp0x/pr85147.C: New test.

From-SVN: r261945
2018-06-22 23:04:25 +02:00
Jakub Jelinek 8452d757ac backport: re PR c++/85140 (ICE with invalid use of alignas)
Backported from mainline
	2018-04-03  Jakub Jelinek  <jakub@redhat.com>

	PR c++/85140
	* name-lookup.c (handle_namespace_attrs): Return early if attributes
	is error_mark_node.

	* g++.dg/cpp0x/gen-attrs-64.C: New test.

From-SVN: r261944
2018-06-22 23:03:38 +02:00
Jakub Jelinek 870c4f81ad backport: re PR c++/84791 (ICE with broken OpenMP reduction clause)
Backported from mainline
	2018-03-30  Jakub Jelinek  <jakub@redhat.com>

	PR c++/84791
	* semantics.c (finish_omp_reduction_clause): If
	OMP_CLAUSE_REDUCTION_PLACEHOLDER is error_mark_node, return true
	even if processing_template_decl.

	* g++.dg/gomp/pr84791.C: New test.

From-SVN: r261943
2018-06-22 23:02:52 +02:00
Jakub Jelinek 01230f3857 backport: re PR target/85095 (worse code generated)
Backported from mainline
	2018-03-28  Jakub Jelinek  <jakub@redhat.com>

	PR target/85095
	* config/i386/i386.md (*add<mode>3_carry_0, *addsi3_carry_zext_0,
	*sub<mode>3_carry_0, *subsi3_carry_zext_0): New patterns.

	* gcc.target/i386/pr85095-1.c: New test.
	* gcc.target/i386/pr85095-2.c: New test.
	* gcc.c-torture/execute/pr85095.c: New test.

From-SVN: r261942
2018-06-22 23:02:07 +02:00
Jakub Jelinek 78b745b680 backport: re PR c++/85076 (ICE with invalid template used as lambda argument)
Backported from mainline
	2018-03-27  Jakub Jelinek  <jakub@redhat.com>

	PR c++/85076
	* tree.c (cp_build_reference_type): If to_type is error_mark_node,
	return it right away.

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

From-SVN: r261941
2018-06-22 23:01:00 +02:00
Jakub Jelinek b60dbb9e61 backport: re PR c++/85068 (ICE with invalid covariant return type hierarchy)
Backported from mainline
	2018-03-27  Jakub Jelinek  <jakub@redhat.com>

	PR c++/85068
	* class.c (update_vtable_entry_for_fn): Don't ICE if base_binfo
	is NULL.  Assert if thunk_binfo is NULL then errorcount is non-zero.

	* g++.dg/inherit/covariant22.C: New test.

From-SVN: r261940
2018-06-22 22:59:31 +02:00
Jakub Jelinek 49b60684bf backport: re PR inline-asm/85022 (internal compiler error: in write_dependence_p, at alias.c:3003)
Backported from mainline
	2018-03-23  Jakub Jelinek  <jakub@redhat.com>

	PR inline-asm/85022
	* emit-rtl.c (init_emit_regs): Indicate that VOIDmode MEMs don't have
	known size by default.

From-SVN: r261939
2018-06-22 22:58:44 +02:00
Jakub Jelinek 3224e3e062 backport: re PR inline-asm/85034 (-O1 internal compiler error: in elimination_costs_in_insn, at reload1.c:3633)
Backported from mainline
	2018-03-23  Jakub Jelinek  <jakub@redhat.com>

	PR inline-asm/85034
	* function.c (match_asm_constraints_1): Don't optimize if input
	doesn't satisfy general_operand predicate for output's mode.

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

From-SVN: r261938
2018-06-22 22:58:02 +02:00
Jakub Jelinek 7de2abafba backport: re PR inline-asm/85022 (internal compiler error: in write_dependence_p, at alias.c:3003)
Backported from mainline
	2018-03-23  Jakub Jelinek  <jakub@redhat.com>

	PR inline-asm/85022
	* alias.c (write_dependence_p): Don't require for x_canonicalized
	non-VOIDmode if x has VOIDmode.

	* c-c++-common/torture/pr85022.c: New test.

From-SVN: r261937
2018-06-22 22:57:15 +02:00
Jakub Jelinek 5832c163cf backport: re PR inline-asm/84941 (internal compiler error: in reg_overlap_mentioned_p, at rtlanal.c:1870 (reg_overlap_mentioned_p()/match_asm_constraints_1()))
Backported from mainline
	2018-03-22  Jakub Jelinek  <jakub@redhat.com>

	PR inline-asm/84941
	* function.c (match_asm_constraints_1): Don't do the optimization
	if input isn't a REG, SUBREG, MEM or constant.

	* gcc.dg/pr84941.c: New test.

From-SVN: r261936
2018-06-22 22:56:25 +02:00
Jakub Jelinek b6abb1374d backport: re PR c/84999 (ICE in make_vector_type, at tree.c:9561)
Backported from mainline
	2018-03-21  Jakub Jelinek  <jakub@redhat.com>

	PR c/84999
	* c-typeck.c (build_binary_op): If c_common_type_for_size fails when
	building vector comparison, diagnose it and return error_mark_node.

	* c-c++-common/pr84999.c: New test.

From-SVN: r261934
2018-06-22 22:55:40 +02:00
Jakub Jelinek 5a986e0b8b backport: re PR c++/84961 (ICE error: SSA_NAME_DEF_STMT is wrong)
Backported from mainline
	2018-03-21  Jakub Jelinek  <jakub@redhat.com>

	PR c++/84961
	* cp-tree.h (genericize_compound_lvalue): Declare.
	* typeck.c (genericize_compound_lvalue): New function.
	(unary_complex_lvalue, cp_build_modify_expr): Use it.
	* semantics.c (finish_asm_stmt): Replace MODIFY_EXPR, PREINCREMENT_EXPR
	and PREDECREMENT_EXPR in output and "m" constrained input operands with
	COMPOUND_EXPR.  Call cxx_mark_addressable on the rightmost
	COMPOUND_EXPR operand.

	* c-c++-common/pr43690.c: Don't expect errors on "m" (--x) and
	"m" (++x) in C++.
	* g++.dg/torture/pr84961-1.C: New test.
	* g++.dg/torture/pr84961-2.C: New test.

From-SVN: r261933
2018-06-22 22:54:44 +02:00
Jakub Jelinek 672ec745f9 backport: re PR debug/84875 (ICE in maybe_record_trace_start, at dwarf2cfi.c:2348 on s390x)
Backported from mainline
	2018-03-20  Jakub Jelinek  <jakub@redhat.com>

	PR debug/84875
	* dce.c (delete_unmarked_insns): Don't remove frame related noop moves
	holding REG_CFA_RESTORE notes, instead turn them into a USE.

	* gcc.dg/pr84875.c: New test.

From-SVN: r261932
2018-06-22 22:53:41 +02:00
Jakub Jelinek aeab2a0872 backport: re PR c/84953 (misleading warning from strpbrk(x,""))
Backported from mainline
	2018-03-20  Jakub Jelinek  <jakub@redhat.com>

	PR c/84953
	* builtins.c (fold_builtin_strpbrk): For strpbrk(x, "") use type
	instead of TREE_TYPE (s1) for the return value.

	* gcc.dg/pr84953.c: New test.

From-SVN: r261931
2018-06-22 22:52:44 +02:00
Jakub Jelinek 9d7e44b006 backport: re PR sanitizer/85018 (Many sanitizer tests ICE since r258681)
Backported from mainline
	2018-03-22  Jakub Jelinek  <jakub@redhat.com>

	PR sanitizer/85018
	* dwarf2asm.c (dw2_output_indirect_constant_1): Set
	DECL_INITIAL (decl) to decl at the end.
	* varasm.c (use_blocks_for_decl_p): Revert the 2018-03-20 change,
	adjust the comment.

	2018-03-20  Jakub Jelinek  <jakub@redhat.com>

	PR target/84990
	* dwarf2asm.c (dw2_output_indirect_constant_1): Temporarily turn off
	flag_section_anchors.
	* varasm.c (use_blocks_for_decl_p): Remove hack for
	dw2_force_const_mem.

	2018-03-19  Jakub Jelinek  <jakub@redhat.com>

	PR sanitizer/78651
	* dwarf2asm.c: Include fold-const.c.
	(dw2_output_indirect_constant_1): Set DECL_INITIAL (decl) to ADDR_EXPR
	of decl rather than decl itself.

	2018-03-19  Maxim Ostapenko  <m.ostapenko@samsung.com>

	PR sanitizer/78651
	* dwarf2asm.c (dw2_output_indirect_constant_1): Disable ASan before
	calling assemble_variable.

	* g++.dg/asan/pr78651.C: New test.

From-SVN: r261930
2018-06-22 22:51:42 +02:00
Jakub Jelinek 6a1e018fa4 backport: re PR target/84899 (ICE: in final_scan_insn_1, at final.c:3139 (error: could not split insn))
Backported from mainline
	2018-03-16  Jakub Jelinek  <jakub@redhat.com>

	PR target/84899
	* postreload.c (reload_combine_recognize_pattern): Perform
	INTVAL addition in unsigned HOST_WIDE_INT type to avoid UB and
	truncate_int_for_mode the result for the destination's mode.

	* gcc.dg/pr84899.c: New test.

From-SVN: r261929
2018-06-22 22:48:57 +02:00
Jakub Jelinek 1d5f72d6aa backport: re PR c++/84874 (internal compiler error: in reshape_init_class, at cp/decl.c:5800)
Backported from mainline
	2018-03-16  Jakub Jelinek  <jakub@redhat.com>

	PR c++/84874
	* g++.dg/cpp1z/desig8.C: New test.

From-SVN: r261928
2018-06-22 22:47:57 +02:00
Jakub Jelinek 9892faf5e6 backport: re PR tree-optimization/84841 (ICE: tree check: expected ssa_name, have real_cst in rewrite_expr_tree_parallel, at tree-ssa-reassoc.c:4624)
Backported from mainline
	2018-03-16  Jakub Jelinek  <jakub@redhat.com>

	PR tree-optimization/84841
	* tree-ssa-reassoc.c (INTEGER_CONST_TYPE): Change to 1 << 4 from
	1 << 3.
	(FLOAT_ONE_CONST_TYPE): Define.
	(constant_type): Return FLOAT_ONE_CONST_TYPE for -1.0 and 1.0.
	(sort_by_operand_rank): Put entries with higher constant_type last
	rather than first to match comments.

	* gcc.dg/pr84841.c: New test.

From-SVN: r261927
2018-06-22 22:46:37 +02:00
Jakub Jelinek 349fde3dad backport: re PR c++/84874 (internal compiler error: in reshape_init_class, at cp/decl.c:5800)
Backported from mainline
	2018-03-16  Jakub Jelinek  <jakub@redhat.com>

	PR c++/84874
	* decl.c (reshape_init_class): Don't assert d->cur->index == field
	if d->cur->index is a FIELD_DECL, instead set field to d->cur->index.

	* g++.dg/cpp1z/desig7.C: New test.

From-SVN: r261926
2018-06-22 22:44:39 +02:00
Jakub Jelinek 9074761258 backport: re PR c++/79085 (ICE with placement new to unaligned location)
Backported from mainline
	2018-03-15  Jakub Jelinek  <jakub@redhat.com>

	PR c++/79085
	* calls.c (expand_call): For TREE_ADDRESSABLE rettype ignore alignment
	check and use address of target always.

	* g++.dg/opt/pr79085.C: New test.

From-SVN: r261925
2018-06-22 22:43:53 +02:00
Jakub Jelinek 14203e0390 backport: re PR c++/84222 ([[deprecated]] class complains about internal class usage)
Backported from mainline
	2018-03-15  Jakub Jelinek  <jakub@redhat.com>

	PR c++/84222
	* cp-tree.h (cp_warn_deprecated_use): Declare.
	* tree.c (cp_warn_deprecated_use): New function.
	* typeck2.c (build_functional_cast): Use it.
	* decl.c (grokparms): Likewise.
	(grokdeclarator): Likewise.  Temporarily push nested class scope
	around grokparms call for out of class member definitions.

	* g++.dg/warn/deprecated.C (T::member3): Change dg-warning to dg-bogus.
	* g++.dg/warn/deprecated-6.C (T::member3): Likewise.
	* g++.dg/warn/deprecated-13.C: New test.

From-SVN: r261924
2018-06-22 22:43:09 +02:00
Jakub Jelinek 42e4700c95 backport: re PR target/84860 (ICE in emit_move_insn, at expr.c:3717)
Backported from mainline
	2018-03-15  Jakub Jelinek  <jakub@redhat.com>

	PR target/84860
	* optabs.c (emit_conditional_move): Pass address of cmode's copy
	rather than address of cmode as last argument to prepare_cmp_insn.

	* gcc.c-torture/compile/pr84860.c: New test.

From-SVN: r261923
2018-06-22 22:41:55 +02:00
Jakub Jelinek e915c604c1 backport: re PR c/84853 (ICE: verify_gimple failed (expand_shift_1))
Backported from mainline
	2018-03-15  Jakub Jelinek  <jakub@redhat.com>

	PR c/84853
	* c-typeck.c (build_binary_op) <case RSHIFT_EXPR, case LSHIFT_EXPR>:
	If code1 is INTEGER_TYPE, only allow code0 VECTOR_TYPE if it has
	INTEGER_TYPE element type.

	* gcc.dg/pr84853.c: New test.

From-SVN: r261922
2018-06-22 22:40:45 +02:00
Jakub Jelinek 256768d447 backport: re PR middle-end/84834 (ICE: tree check: expected integer_cst, have complex_cst in to_wide, at tree.h:5527)
Backported from mainline
	2018-03-13  Jakub Jelinek  <jakub@redhat.com>

	PR middle-end/84834
	* match.pd ((A & C) != 0 ? D : 0): Use INTEGER_CST@2 instead of
	integer_pow2p@2 and test integer_pow2p in condition.
	(A < 0 ? C : 0): Similarly for @1.

	* gcc.dg/pr84834.c: New test.

From-SVN: r261921
2018-06-22 22:38:25 +02:00
Jakub Jelinek 5d34c11fe0 backport: re PR target/84827 (ICE in extract_insn, at recog.c:2311)
Backported from mainline
	2018-03-13  Jakub Jelinek  <jakub@redhat.com>

	PR target/84827
	* config/i386/i386.md (round<mode>2): For 387 fancy math, disable
	pattern if -ftrapping-math -fno-fp-int-builtin-inexact.

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

From-SVN: r261920
2018-06-22 22:37:40 +02:00
Jakub Jelinek ffa78b61cc backport: re PR target/84786 ([miscompilation] vunpcklpd accessing xmm16-22 targeting KNL)
Backported from mainline
	2018-03-13  Jakub Jelinek  <jakub@redhat.com>

	PR target/84786
	* config/i386/sse.md (sse2_loadhpd): Use Yv constraint rather than v
	on the last operand.

	* gcc.target/i386/avx512f-pr84786-1.c: New test.
	* gcc.target/i386/avx512f-pr84786-2.c: New test.

From-SVN: r261919
2018-06-22 22:36:31 +02:00
Jakub Jelinek 656cc9e091 backport: re PR target/84772 (powerpc-spe: Spurious "is used uninitialized" warning, or possibly incorrect codegen for va_arg(long double))
Backported from mainline
	2018-03-09  Jakub Jelinek  <jakub@redhat.com>

	PR target/84772
	* config/rs6000/rs6000.c (rs6000_gimplify_va_arg): Mark va_arg_tmp
	temporary TREE_ADDRESSABLE before gimplification of BUILT_IN_MEMCPY.

	* gcc.dg/pr84772.c: New test.

From-SVN: r261918
2018-06-22 22:35:29 +02:00
Jakub Jelinek 4dbb5fc70e backport: re PR c++/84076 (Warning about objects through POD mistakenly claims the object is a pointer)
Backported from mainline
	2018-03-09  Jason Merrill  <jason@redhat.com>
		    Jakub Jelinek  <jakub@redhat.com>

	PR c++/84076
	* call.c (convert_arg_to_ellipsis): Instead of cp_build_addr_expr
	build ADDR_EXPR with REFERENCE_TYPE.
	(build_over_call): For purposes of check_function_arguments, if
	argarray[j] is ADDR_EXPR with REFERENCE_TYPE created above, use
	its operand rather than the argument itself.

	* g++.dg/warn/Wformat-2.C: New test.

From-SVN: r261917
2018-06-22 22:34:33 +02:00
Jakub Jelinek d339e220ed backport: re PR c++/84767 (ICE with pointer to VLA)
Backported from mainline
	2018-03-09  Jakub Jelinek  <jakub@redhat.com>

	PR c++/84767
	* tree-inline.c (copy_tree_body_r): For INDIRECT_REF of a remapped
	decl, use remap_type if we want to use the type.

	* g++.dg/ext/vla18.C: New test.

From-SVN: r261916
2018-06-22 22:33:38 +02:00
Jakub Jelinek 36c1b85a67 backport: re PR c++/80598 (-Wunused triggers for functions used in uninstantiated templates)
Backported from mainline
	2018-03-08  Jason Merrill  <jason@redhat.com>
		    Jakub Jelinek  <jakub@redhat.com>

	PR c++/80598
	* call.c (build_over_call): In templates set TREE_USED (first_fn) when
	not calling mark_used for the benefit of -Wunused-function warning.

	* g++.dg/warn/Wunused-function4.C: New test.

From-SVN: r261915
2018-06-22 22:32:15 +02:00
Jakub Jelinek 6935710dbd backport: re PR tree-optimization/84739 (ICE in get_value_for_expr, at tree-ssa-ccp.c:649)
Backported from mainline
	2018-03-08  Jakub Jelinek  <jakub@redhat.com>

	PR tree-optimization/84739
	* tree-tailcall.c (find_tail_calls): Check call arguments against
	DECL_ARGUMENTS (current_function_decl) rather than
	DECL_ARGUMENTS (func) when checking for tail recursion.

	* gcc.dg/pr84739.c: New test.

From-SVN: r261914
2018-06-22 22:31:10 +02:00
Jakub Jelinek 8ae01fd0b7 backport: re PR target/84700 (ICE on 32-bit BE powerpc targets w/ -misel -O1)
Backported from mainline
	2018-03-05  Jakub Jelinek  <jakub@redhat.com>

	PR target/84700
	* combine.c (combine_simplify_rtx): Don't try to simplify if
	if_then_else_cond returned non-NULL, but either true_rtx or false_rtx
	are equal to x.

	* gcc.target/powerpc/pr84700.c: New test.

From-SVN: r261913
2018-06-22 22:29:34 +02:00
Jakub Jelinek deea4ea79b backport: re PR c++/84662 (internal compiler error: tree check: expected class 'type', have 'exceptional' (error_mark) in is_bitfield_expr_with_lowered_type, at cp/typeck.c:1944)
Backported from mainline
	2018-03-02  Jakub Jelinek  <jakub@redhat.com>

	PR c++/84662
	* pt.c (tsubst_copy_and_build) <case TEMPLATE_ID_EXPR>: Use
	RETURN instead of return.
	<case POINTER_PLUS_EXPR>: Likewise.
	<case CONVERT_EXPR>: If op0 is error_mark_node, just return
	it instead of wrapping it into CONVERT_EXPR.

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

From-SVN: r261912
2018-06-22 22:28:04 +02:00
Jonathan Wakely 4a57c3b49c PR libstdc++/86138 prevent implicit instantiation of COW empty rep
The explicit instantiation declarations for std::basic_string are
disabled for C++17 (and later) so that basic_string symbols get
implicitly instantiated in every translation unit that needs them.  On
targets that don't support STB_GNU_UNIQUE this leads to multiple copies
of the empty rep symbol for COW strings. In order to detect whether a
COW string needs to deallocate its storage it compares the address with
the empty rep.  When there are multiple copies of the empty rep object
the address is not unique, and so string destructors try to delete the
empty rep, which crashes.

In order to guarantee uniqueness of the _S_empty_rep_storage symbol this
patch adds an explicit instantiation declaration for just that symbol.
This means the other symbols are still implicitly instantiated in C++17
code, but for the empty rep the definition in the library gets used.

Separately, there is no need for C++17 code to implicitly instantiate
the I/O functions for strings, so this also restores the explicit
instantiation declarations for those functions.

Backport from mainline
2018-06-22  Jonathan Wakely  <jwakely@redhat.com>

	PR libstdc++/86138
	* include/bits/basic_string.tcc:
	[__cplusplus > 201402 && !_GLIBCXX_USE_CXX11_ABI]
	(basic_string<char>::_Rep::_S_empty_rep_storage)
	(basic_string<wchar_t>::_Rep::_S_empty_rep_storage): Add explicit
	instantiation declarations.
	[__cplusplus > 201402] (operator>>, operator<<, getline): Re-enable
	explicit instantiation declarations.
	* testsuite/21_strings/basic_string/cons/char/86138.cc: New.
	* testsuite/21_strings/basic_string/cons/wchar_t/86138.cc: New.

From-SVN: r261907
2018-06-22 16:58:38 +01:00
Andre Vieira 6f9798bf98 backport: arm_cmse.h (cmse_nsfptr_create): Change typeof to __typeof__.
gcc/
2018-06-22  Andre Vieira  <andre.simoesdiasvieira@arm.com>

	Backport from mainline
	2018-06-05  Andre Vieira  <andre.simoesdiasvieira@arm.com>

	* config/arm/arm_cmse.h (cmse_nsfptr_create): Change typeof to
	__typeof__.
	(cmse_check_pointed_object): Likewise.

gcc/testsuite/
2018-06-22  Andre Vieira  <andre.simoesdiasvieira@arm.com>

	Backport from mainline
	2018-06-05  Andre Vieira  <andre.simoesdiasvieira@arm.com>

	* gcc.target/arm/cmse/cmse-1c99.c: New test.

From-SVN: r261900
2018-06-22 14:38:34 +00:00
Andre Vieira 3884929658 backport: arm_cmse.h (cmse_nsfptr_create, [...]): Remove #include <stdint.h>.
gcc/
2018-06-22  Andre Vieira  <andre.simoesdiasvieira@arm.com>

	Backport from mainline
	2018-05-17  Jerome Lambourg  <lambourg@adacore.com>

	* config/arm/arm_cmse.h (cmse_nsfptr_create, cmse_is_nsfptr): Remove
	#include <stdint.h>.  Replace intptr_t with __INTPTR_TYPE__.

libgcc/
2018-06-22  Andre Vieira  <andre.simoesdiasvieira@arm.com>

	Backport from mainline
	2018-05-17  Jerome Lambourg  <lambourg@adacore.com>

	* config/arm/cmse.c (cmse_check_address_range): Replace
	UINTPTR_MAX with __UINTPTR_MAX__ and uintptr_t with __UINTPTR_TYPE__.

From-SVN: r261898
2018-06-22 14:35:24 +00:00
Ian Lance Taylor 29989221e5 syscall: remove Ustat
glibc 2.28 removes ustat.h and the ustat function entirely, which
    breaks syscall.Ustat.
    
    Updates golang/go#25990
    
    Reviewed-on: https://go-review.googlesource.com/120535

From-SVN: r261894
2018-06-22 14:25:18 +00:00
GCC Administrator 39dce2a693 Daily bump.
From-SVN: r261875
2018-06-22 00:16:34 +00:00
Jonathan Wakely 4ae5b426ff * config/abi/post/x86_64-linux-gnu/baseline_symbols.txt: Update.
From-SVN: r261864
2018-06-21 21:51:51 +01:00
Sebastian Huber 1534996ff5 RISC-V: Add custom RTEMS multilibs
Add multilib variants for -march=rv64imafd, e.g. to support the BOOMv2 core.

Add -mcmodel=medany as a variant of the 64-bit multilibs for RTEMS.  The
rationale for this change is that several existing RISC-V chips map the
RAM at 0x80000000.  In RTEMS, we do not use virtual memory, so
applications will run at this location which is outside the +-2GiB range
in a 64-bit configuration.

gcc/
	* config.gcc (riscv*-*-elf* | riscv*-*-rtems*): Use custom
	multilibs for *-*-rtems*.
	* config/riscv/t-rtems: New file.

From-SVN: r261838
2018-06-21 09:36:40 +00:00
GCC Administrator bc95e9eb0e Daily bump.
From-SVN: r261828
2018-06-21 00:16:37 +00:00
GCC Administrator 102073d298 Daily bump.
From-SVN: r261777
2018-06-20 00:16:49 +00:00
Max Filippov bdaa9e551f xtensa: fix PR target/65416
The issue is caused by reordering of stack pointer update after stack
space allocation with instructions that write to the allocated stack
space. In windowed ABI register spill area for the previous call frame
is located just below the stack pointer and may be reloaded back into
the register file on movsp.
Implement allocate_stack pattern for windowed ABI configuration and
insert an instruction that prevents reordering of frame memory access
and stack pointer update.

gcc/
2018-06-19  Max Filippov  <jcmvbkbc@gmail.com>

	Backport from mainline
	2018-06-19  Max Filippov  <jcmvbkbc@gmail.com>

	* config/xtensa/xtensa.md (UNSPEC_FRAME_BLOCKAGE): New unspec
	constant.
	(allocate_stack, frame_blockage, *frame_blockage): New patterns.

From-SVN: r261764
2018-06-19 21:01:22 +00:00
Jonathan Wakely 22e89a8f22 Remove unused <exception> header from <utility>
This header was needed for the declaration of std::terminate but the
calls to it were removed in r242401.

	* include/std/utility: Remove unused <exception> header.

From-SVN: r261752
2018-06-19 18:32:50 +01:00
Eric Botcazou 23413cf4e5 gimplify.c (gimplify_init_constructor): Really never clear for an incomplete constructor if CONSTRUCTOR_NO_CLEARING is set.
* gimplify.c (gimplify_init_constructor): Really never clear for an
	incomplete constructor if CONSTRUCTOR_NO_CLEARING is set.

From-SVN: r261737
2018-06-19 09:46:40 +00:00
GCC Administrator 9996652407 Daily bump.
From-SVN: r261722
2018-06-19 00:16:32 +00:00
Martin Sebor 0ccda1eae5 PR middle-end/82063 - issues with arguments enabled by -Wall
gcc/ChangeLog:
        PR middle-end/82063
        * calls.c (alloc_max_size): Correct a logic error/typo.
        Treat excessive arguments as infinite.  Warn for invalid arguments.
        * doc/invoke.texi (-Walloc-size-larger-than): Update.

gcc/testsuite/ChangeLog:
        PR middle-end/82063
        * gcc.dg/Walloc-size-larger-than-1.c: New test.
        * gcc.dg/Walloc-size-larger-than-10.c: New test.
        * gcc.dg/Walloc-size-larger-than-11.c: New test.
        * gcc.dg/Walloc-size-larger-than-12.c: New test.
        * gcc.dg/Walloc-size-larger-than-13.c: New test.
        * gcc.dg/Walloc-size-larger-than-14.c: New test.
        * gcc.dg/Walloc-size-larger-than-15.c: New test.
        * gcc.dg/Walloc-size-larger-than-16.c: New test.
        * gcc.dg/Walloc-size-larger-than-2.c: New test.
        * gcc.dg/Walloc-size-larger-than-3.c: New test.
        * gcc.dg/Walloc-size-larger-than-4.c: New test.
        * gcc.dg/Walloc-size-larger-than-5.c: New test.
        * gcc.dg/Walloc-size-larger-than-6.c: New test.
        * gcc.dg/Walloc-size-larger-than-7.c: New test.
        * gcc.dg/Walloc-size-larger-than-8.c: New test.
        * gcc.dg/Walloc-size-larger-than-9.c: New test.
        * gcc.dg/Walloc-size-larger-than.c: New test.

From-SVN: r261720
2018-06-18 18:02:30 -06:00
GCC Administrator 204f4cdbe1 Daily bump.
From-SVN: r261693
2018-06-18 00:16:21 +00:00
GCC Administrator a0c97cbe4b Daily bump.
From-SVN: r261684
2018-06-17 00:16:15 +00:00
GCC Administrator 672684bb31 Daily bump.
From-SVN: r261672
2018-06-16 00:16:29 +00:00
Jonathan Wakely 06ccfdfa91 PR libstdc++/86169 unshare COW string when non-const data() called
PR libstdc++/86169
	* include/bits/basic_string.h [!_GLIBCXX_USE_CXX11_ABI]
	(basic_string::data()): Unshare string.
	* testsuite/21_strings/basic_string/operations/data/char/86169.cc:
	New.

From-SVN: r261646
2018-06-15 20:19:04 +01:00
Jonathan Wakely 0c9294db39 Only define __cpp_lib_constexpr_char_traits for C++17
* include/bits/char_traits.h (__cpp_lib_constexpr_char_traits): Only
	define for C++17 and above.

From-SVN: r261637
2018-06-15 17:42:57 +01:00
GCC Administrator 24245a3cfd Daily bump.
From-SVN: r261615
2018-06-15 00:16:31 +00:00
Sebastian Huber 5972b62341 RTEMS: Prefer int for int32_t
Common systems like glibc and FreeBSD define int32_t to int.  This means
a lot of third party code works well in these cases:

  #include <stdint.h>

  void f(int32_t);

  void f(int);

  void g(int32_t *);

  void h(void)
  {
    int i;
    g(&i);
  }

On RTEMS you got however in C

  test.c:5:6: error: conflicting types for 'f'
    void f(int);
        ^
  test.c:3:6: note: previous declaration of 'f' was here
    void f(int32_t);
        ^
  test.c: In function 'h':
  test.c:12:4: warning: passing argument 1 of 'g' from incompatible
  pointer type [-Wincompatible-pointer-types]
    g(&i);
      ^
  test.c:7:6: note: expected 'int32_t * {aka long int *}' but argument
  is of type 'int *' void g(int32_t *);

and C++

  test.c: In function 'void h()':
  test.c:12:4: error: invalid conversion from 'int*' to 'int32_t* {aka
  long int*}' [-fpermissive]
    g(&i);
      ^~
  test.c:7:6: note:   initializing argument 1 of 'void g(int32_t*)'
    void g(int32_t *);
      ^

This was due to a Newlib speciality which uses long for int32_t if long
is a 32-bit type.  To ease the use of third party software in RTEMS we
override this Newlib option now and use int for int32_t if int is a
32-bit type.

gcc/
	* config/rtems.h (STDINT_LONG32): Define.

From-SVN: r261584
2018-06-14 05:19:35 +00:00
GCC Administrator 3841c00125 Daily bump.
From-SVN: r261578
2018-06-14 00:16:10 +00:00
Steven G. Kargl 5d0316627e re PR fortran/86110 (ICE in gfc_resolve_character_array_constructor, at fortran/array.c:2044)
2018-06-13  Steven G. Kargl  <kargl@gcc.gnu.org>

	PR fortran/86110
	* array.c (gfc_resolve_character_array_constructor): Avoid NULL 
	pointer dereference.

2018-06-13  Steven G. Kargl  <kargl@gcc.gnu.org>

	PR fortran/86110
	* gfortran.dg/pr86110.f90: New test.

From-SVN: r261575
2018-06-13 22:40:46 +00:00
GCC Administrator bc13aa945c Daily bump.
From-SVN: r261533
2018-06-13 00:16:38 +00:00
Jason Merrill 71f5847e74 PR c++/85815 - reference to member of enclosing template.
* parser.c (cp_parser_postfix_dot_deref_expression): Check
	currently_open_class.

From-SVN: r261524
2018-06-12 15:53:10 -04:00
Jason Merrill d525c67f13 PR c++/86060 - ICE on range for with -std=c++98.
* parser.c (cp_parser_init_statement): Don't clobber *decl after
	pedwarn.

From-SVN: r261523
2018-06-12 15:53:02 -04:00
Steven G. Kargl 7e5b05f19f re PR fortran/44491 (Diagnostic just shows "<During initialization>" instead of a locus)
2018-06-12  Steven G. Kargl  <kargl@gcc.gnu.org>

	PR fortran/44491
	* expr.c (gfc_check_assign): Select non-NULL locus.

2018-06-12  Steven G. Kargl  <kargl@gcc.gnu.org>

	PR fortran/44491
	* gfortran.dg/pr44491.f90: New testcase

From-SVN: r261520
2018-06-12 18:28:25 +00:00
Eric Botcazou 3960a3b98f ada-tree.h (TYPE_RETURN_BY_DIRECT_REF_P): Change from using TYPE_LANG_FLAG_4 to using TYPE_LANG_FLAG_0.
* gcc-interface/ada-tree.h (TYPE_RETURN_BY_DIRECT_REF_P): Change from
	using TYPE_LANG_FLAG_4 to using TYPE_LANG_FLAG_0.
	(TYPE_ALIGN_OK): Move around.
	(TYPE_PADDING_FOR_COMPONENT): Remove superfluous parentheses.
	* gcc-interface/decl.c (change_qualified_type): Move to...
	(gnat_to_gnu_entity): Adjust comment.
	* gcc-interface/gigi.h (change_qualified_type): ...here; make inline.
	(ceil_pow2): Use ceil_log2.
	* gcc-interface/utils.c (finish_subprog_decl): Add couple of comments
	and do not set TREE_SIDE_EFFECTS.
	(handle_noreturn_attribute): Use change_qualified_type.

From-SVN: r261488
2018-06-12 10:35:05 +00:00
Eric Botcazou ed457510e1 decl.c (gnat_to_gnu_entity): Do not get the expression of a dispatch table that is not being defined.
* gcc-interface/decl.c (gnat_to_gnu_entity) <E_Constant>: Do not get
	the expression of a dispatch table that is not being defined.
	<E_Record_Subtype>: Remove obsolete kludge.

From-SVN: r261485
2018-06-12 10:20:02 +00:00
Eric Botcazou 92e047e775 Backpor from mainline
2018-06-02  Eric Botcazou  <ebotcazou@adacore.com>

	* gcc-interface/decl.c (gnat_to_gnu_entity) <E_Constant>: If this is
	not a definition, retrieve the expression only if it's a compile-time
	known value if we are just annotating types.

	* gcc-interface/utils.c (convert): Do not try to upcast properly for a
	conversion between tagged types in type_annotate_only mode.

From-SVN: r261482
2018-06-12 10:09:20 +00:00
Eric Botcazou 99c7270971 backport: decl.c (gnat_to_gnu_entity): Reuse the existing fields of a dummy fat pointer type, if any.
Backport from mainline
	2018-06-11  Eric Botcazou  <ebotcazou@adacore.com>

	* gcc-interface/decl.c (gnat_to_gnu_entity) <E_Array_Type>: Reuse the
	existing fields of a dummy fat pointer type, if any.  Clear the
	TYPE_DECL_SUPPRESS_DEBUG on the fat pointer type after completing it.

From-SVN: r261478
2018-06-12 09:31:48 +00:00
GCC Administrator 1ba4d2fe37 Daily bump.
From-SVN: r261470
2018-06-12 00:16:09 +00:00
Peter Bergner 4e719bb239 backport: re PR target/85755 (PowerPC Gcc's -mupdate produces inefficient code on power8/power9 machines)
gcc/
	Backport from mainline
	2018-06-08  Peter Bergner  <bergner@vnet.ibm.com>

	PR target/85755
	* config/rs6000/rs6000.c (mem_operand_gpr): Enable PRE_INC and PRE_DEC
	addresses.

gcc/testsuite/
	Backport from mainline
	2018-06-08  Peter Bergner  <bergner@vnet.ibm.com>

	PR target/85755
	* gcc.target/powerpc/pr85755.c: New test.

From-SVN: r261442
2018-06-11 13:25:37 -05:00
GCC Administrator be4ab57111 Daily bump.
From-SVN: r261391
2018-06-11 00:16:11 +00:00
Jerry DeLisle 4627d4046d Add ChangeLog entry
From-SVN: r261385
2018-06-10 03:10:09 +00:00
Jerry DeLisle e8d0215ca2 backport: re PR libfortran/86070 (gfortran.dg/fmt_zero_digits.f90 segmentation fault starting with r261077)
2018-06-09  Jerry DeLisle  <jvdelisle@gcc.gnu.org>

	Backport from trunk.
	PR libgfortran/86070
	* io/write_float.def (build_float_string): Initialize *len.

From-SVN: r261384
2018-06-10 03:10:00 +00:00
GCC Administrator 29bb1c248a Daily bump.
From-SVN: r261379
2018-06-10 00:17:03 +00:00
Steven G. Kargl 216b8050e7 re PR fortran/38351 (Poor error message for rank mismatch in operator args)
2018-06-09  Steven G. Kargl  <kargl@gcc.gnu.org>

	PR fortran/38351
	* resolve.c (resolve_operator): Provide better error message for
	derived type entity used in an binary intrinsic numeric operator.

2018-06-09  Steven G. Kargl  <kargl@gcc.gnu.org>

	PR fortran/38351
	* gfortran.dg/pr38351.f90: New test.
	* gfortran.dg/typebound_operator_4.f03: Adjust for new error message.

From-SVN: r261376
2018-06-09 21:54:45 +00:00
Steven G. Kargl 68dc6e7380 re PR fortran/63514 (functions containing volatile are considered pure)
2018-06-09  Steven G. Kargl  <kargl@gcc.gnu.org>

	PR fortran/63514
	* symbol.c (gfc_add_volatile): Enforce F2008:C1282 and F2018:C1588.


2018-06-09  Steven G. Kargl  <kargl@gcc.gnu.org>

	PR fortran/63514
	* gfortran.dg/pr63514.f90: New test.

From-SVN: r261375
2018-06-09 20:10:34 +00:00
Steven G. Kargl 707a031d31 re PR fortran/78278 (ICE in gfc_wide_memset, at fortran/scanner.c:153)
2018-06-09  Steven G. Kargl  <kargl@gcc.gnu.org>

	PR fortran/78278
	* data.c (gfc_assign_data_value): Re-arrange code to allow for
	an error for double initialization of CHARACTER entities.

2018-06-09  Steven G. Kargl  <kargl@gcc.gnu.org>

	PR fortran/78278
	* gfortran.dg/data_bounds_1.f90: Add -std=gnu option.
	* gfortran.dg/data_char_1.f90: Ditto.
	* gfortran.dg/pr78571.f90: Ditto.
	* gfortran.dg/pr78278.f90: New test.

From-SVN: r261374
2018-06-09 19:57:29 +00:00
Steven G. Kargl 4dc4a78e90 re PR fortran/86059 (ICE in reduce_binary_ac, at fortran/arith.c:1308 (and others))
2018-06-09  Steven G. Kargl  <kargl@gcc.gnu.org>

	PR fortran/86059
	* array.c (match_array_cons_element): NULL() cannot be in an
	array constructor.

2018-06-09  Steven G. Kargl  <kargl@gcc.gnu.org>

	PR fortran/86059
	* gfortran.dg/associate_30.f90: Remove code tested ...
	* gfortran.dg/pr67803.f90: Ditto.
	* gfortran.dg/pr67805.f90: Ditto.
	* gfortran.dg/pr86059.f90: ... here.  New test.

From-SVN: r261373
2018-06-09 18:54:56 +00:00
Steven G. Kargl cb7a7d9139 re PR fortran/85138 (ICE with generic function)
2018-06-09  Steven G. Kargl  <kargl@gcc.gnu.org>

	PR fortran/85138
	PR fortran/85996
	PR fortran/86051
	* decl.c (gfc_match_char_spec): Use private namespace in attempt to
	reduce a charlen to a constant.

2018-06-09  Steven G. Kargl  <kargl@gcc.gnu.org>

	PR fortran/85138
	PR fortran/85996
	PR fortran/86051
	* gfortran.dg/pr85138_1.f90: New test.
	* gfortran.dg/pr85138_2.f90: Ditto.
	* gfortran.dg/pr85996.f90: Ditto.

From-SVN: r261371
2018-06-09 18:29:40 +00:00
GCC Administrator e42913ed9c Daily bump.
From-SVN: r261355
2018-06-09 00:16:23 +00:00
GCC Administrator da871cfe69 Daily bump.
From-SVN: r261301
2018-06-08 00:16:19 +00:00
Steven G. Kargl 0ce75deef3 re PR fortran/86045 (ICE in reduce_binary_ac, at fortran/arith.c:1308)
2018-06-07  Steven G. Kargl  <kargl@gcc.gnu.org>

	PR fortran/86045
	Backport from trunk.
	* simplify.c (gfc_simplify_mod): Re-arrange code to test whether
	'P' is zero and issue an error if it is.

2018-06-07  Steven G. Kargl  <kargl@gcc.gnu.org>

	PR fortran/86045
	Backport from trunk.
	* gfortran.dg/pr86045.f90: New test.

From-SVN: r261291
2018-06-07 18:39:30 +00:00
Thomas Koenig 07b2e04ccd re PR fortran/85641 (ICE with string concatenate)
2018-06-07  Thomas Koenig  <tkoenig@gcc.gnu.org>

	PR fortran/85641
	Backport from trunk.
	* frontend-passes.c (is_fe_temp): Add prototype.
	(realloc_string_callback): Early return for frontend-generated
	temporary.

2018-06-07  Thomas Koenig  <tkoenig@gcc.gnu.org>

	PR fortran/85641
	Backport from trunk.
	* gfortran.dg/realloc_on_assign_30.f90: New test.

From-SVN: r261289
2018-06-07 18:13:33 +00:00
Peter Bergner 167ce20782 backport: re PR target/63177 (Powerpc no-vfa-vect-depend-2.c and no-vfa-vect-depend-3.c failures)
Backport from mainline
	2018-06-06  Peter Bergner  <bergner@vnet.ibm.com>

	PR target/63177
	* /config/rs6000/rs6000.h (ASM_CPU_SPEC): Add support for -mpower9.
	Don't handle -mcpu=power8 if -mpower9-vector is also used.

From-SVN: r261276
2018-06-07 09:01:57 -05:00
Richard Biener 33570df178 backport: re PR sanitizer/84761 (AddressSanitizer is not compatible with glibc 2.27 on x86)
2018-06-07  Richard Biener  <rguenther@suse.de>

	Backport from mainline
	2018-03-19  Jakub Jelinek  <jakub@redhat.com>

	PR sanitizer/84761
	* sanitizer_common/sanitizer_linux_libcdep.cc (__GLIBC_PREREQ):
	Define if not defined.
	(DL_INTERNAL_FUNCTION): Don't define.
	(InitTlsSize): For __i386__ if not compiled against glibc 2.27+
	determine at runtime whether to use regparm(3), stdcall calling
	convention for older glibcs or normal calling convention for
	newer glibcs for call to _dl_get_tls_static_info.

From-SVN: r261272
2018-06-07 11:56:25 +00:00
Richard Biener 4aad21e2c0 backport: [multiple changes]
2018-06-07  Richard Biener  <rguenther@suse.de>

	Backport from mainline
	2018-05-04  Richard Biener  <rguenther@suse.de>

	PR middle-end/85588
	* fold-const.c (negate_expr_p): Restrict negation of operand
	zero of a division to when we know that can happen without
	overflow.
	(fold_negate_expr_1): Likewise.

	* gcc.dg/torture/pr85588.c: New testcase.
	* gcc.dg/torture/pr57656.c: Use dg-additional-options.

	2018-05-02  Richard Biener  <rguenther@suse.de>

	PR middle-end/85567
	* gimplify.c (gimplify_save_expr): When in SSA form allow
	SAVE_EXPRs to compute to SSA vars.

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

	2018-05-02  Richard Biener  <rguenther@suse.de>

	PR tree-optimization/85597
	* tree-vect-stmts.c (vectorizable_operation): For ternary SLP
	do not use split vect_get_vec_defs call but call vect_get_slp_defs
	directly.

	* gcc.dg/vect/pr85597.c: New testcase.

From-SVN: r261269
2018-06-07 10:10:00 +00:00
GCC Administrator 5a4e789a3a Daily bump.
From-SVN: r261257
2018-06-07 00:16:11 +00:00
GCC Administrator 8c2f7d080a Daily bump.
From-SVN: r261224
2018-06-06 00:16:23 +00:00
Andreas Krebbel d36e0ed9e3 S/390: Fix __builtin_tbeginc signature
The builtin was accidentally defined to have an integer return value.
Fixed with the attached patch.

gcc/ChangeLog:

2018-06-05  Andreas Krebbel  <krebbel@linux.ibm.com>

	Backport from mainline
	2018-06-05  Andreas Krebbel  <krebbel@linux.ibm.com>

	* config/s390/s390-builtin-types.def: Add void function type.
	* config/s390/s390-builtins.def: Use the function type for the
	tbeginc builtin.

gcc/testsuite/ChangeLog:

2018-06-05  Andreas Krebbel  <krebbel@linux.ibm.com>

	Backport from mainline
	2018-06-05  Andreas Krebbel  <krebbel@linux.ibm.com>

	* gcc.target/s390/htm-builtins-compile-4.c: New test.

From-SVN: r261190
2018-06-05 08:21:57 +00:00
GCC Administrator 2e74544cea Daily bump.
From-SVN: r261178
2018-06-05 00:16:10 +00:00
Steven G. Kargl e6a090b2d0 re PR fortran/85981 (ICE in gfc_trans_string_copy, at fortran/trans-expr.c:6539)
2018-06-04  Steven G. Kargl  <kargl@gcc.gnu.org>

	PR fortran/85981
	* resolve.c (resolve_allocate_deallocate): Check errmsg is default
	character kind.

2018-06-04  Steven G. Kargl  <kargl@gcc.gnu.org>

	PR fortran/85981
	* gfortran.dg/allocate_alloc_opt_14.f90: New test.
	* gfortran.dg/allocate_alloc_opt_1.f90: Update error string.
	* gfortran.dg/allocate_stat_2.f90: Ditto.
	* gfortran.dg/deallocate_alloc_opt_1.f90: Ditto.

From-SVN: r261162
2018-06-04 17:09:01 +00:00
GCC Administrator 54a80d7fed Daily bump.
From-SVN: r261134
2018-06-04 00:16:33 +00:00
GCC Administrator a50cac41f7 Daily bump.
From-SVN: r261118
2018-06-03 00:16:09 +00:00
Eric Botcazou 39ad29a981 Add missing directive
From-SVN: r261111
2018-06-02 10:58:13 +00:00
Eric Botcazou 7f6c002cdf ada-tree.h (TYPE_PADDING_FOR_COMPONENT): New macro.
* gcc-interface/ada-tree.h (TYPE_PADDING_FOR_COMPONENT): New macro.
	* gcc-interface/decl.c (gnat_to_gnu_component_type): Cache the padding
	type built for an aliased component with variable size.

From-SVN: r261108
2018-06-02 10:52:39 +00:00
Eric Botcazou 63cf89107c backport: trans.c (Call_to_gnu): If this is a function call and there is no target...
Backport from mainline
	2018-05-31  Eric Botcazou  <ebotcazou@adacore.com>

	* gcc-interface/trans.c (Call_to_gnu): If this is a function call and
	there is no target, also create a temporary for the return value for
	an allocator if the type is an unconstrained record type with default
	discriminant.

From-SVN: r261104
2018-06-02 09:52:57 +00:00
GCC Administrator f5c1953fa8 Daily bump.
From-SVN: r261094
2018-06-02 00:16:21 +00:00
Jerry DeLisle cffcc89ac3 backport: re PR fortran/85840 (Memory leak in write.c)
2018-06-01  Jerry DeLisle  <jvdelisle@gcc.gnu.org>

	Backport from trunk.
	PR libgfortran/85840
	* io/write.c (write_float_0, write_real, write_real_g0,
	write_complex): Use separate local variables for the float
	string length.

From-SVN: r261077
2018-06-01 18:34:09 +00:00
Bill Schmidt ada08cc201 backport: [multiple changes]
2018-06-01  Bill Schmidt  <wschmidt@linux.ibm.com>

	PR tree-optimization/85712
	Backport from mainline:
	2018-05-23  Bill Schmidt  <wschmidt@linux.ibm.com>

	PR tree-optimization/85712
	* gimple-ssa-strength-reduction.c (struct slsr_cand_d): Add
	first_interp field.
	(alloc_cand_and_find_basis): Initialize first_interp field.
	(slsr_process_mul): Modify first_interp field.
	(slsr_process_add): Likewise.
	(slsr_process_cast): Modify first_interp field for each new
	interpretation.
	(slsr_process_copy): Likewise.
	(dump_candidate): Dump first_interp field.
	(replace_mult_candidate): Process all interpretations, not just
	subsequent ones.
	(replace_rhs_if_not_dup): Likewise.
	(replace_one_candidate): Likewise.

	Backport from mainline:
	2018-05-25  Bill Schmidt  <wschmidt@linux.ibm.com>

	PR tree-optimization/85712
	* gimple-ssa-strength-reduction.c (replace_one_candidate): Skip if
	this candidate has already been replaced in-situ by a copy.

From-SVN: r261066
2018-06-01 12:57:16 +00:00
GCC Administrator 70dd0dcefd Daily bump.
From-SVN: r261048
2018-06-01 00:16:10 +00:00
Matthias Klose 1d568b9e43 re PR sanitizer/86012 (libsanitizer build failure on sparc64-linux-gnu)
2018-05-31  Matthias Klose  <doko@ubuntu.com>

        PR sanitizer/86012
        * sanitizer_common/sanitizer_platform_limits_posix.cc: Define
        SIZEOF_STRUCT_USTAT for 32bit sparc.

From-SVN: r260992
2018-05-31 09:59:35 +00:00
GCC Administrator 352bc46a46 Daily bump.
From-SVN: r260986
2018-05-31 00:16:36 +00:00
GCC Administrator 04f6a9f902 Daily bump.
From-SVN: r260910
2018-05-30 00:16:10 +00:00
GCC Administrator e092478145 Daily bump.
From-SVN: r260854
2018-05-29 00:16:30 +00:00
GCC Administrator c91b6a11d4 Daily bump.
From-SVN: r260812
2018-05-28 00:16:25 +00:00
GCC Administrator c2b9b97ce2 Daily bump.
From-SVN: r260799
2018-05-27 00:16:17 +00:00
GCC Administrator 5c12b9deb7 Daily bump.
From-SVN: r260787
2018-05-26 00:16:40 +00:00
Steven G. Kargl 56351a7aab re PR fortran/85543 (ICE in update_current_proc_array_outer_dependency, at fortran/resolve.c:3060)
2018-05-25  Steven G. Kargl  <kargl@gcc.gnu.org>

	PR fortran/85543
	Backport from trunk
	* resolve.c (update_current_proc_array_outer_dependency): Avoid NULL
	pointer dereference.


2018-05-25  Steven G. Kargl  <kargl@gcc.gnu.org>

	PR fortran/85543
	Backport from trunk
	* gfortran.dg/pr85543.f90: New test.

From-SVN: r260774
2018-05-25 19:24:06 +00:00
Steven G. Kargl 926913758b re PR fortran/85779 (ICE in gfc_typename, at fortran/misc.c:156)
2018-05-25  Steven G. Kargl  <kargl@gcc.gnu.org>

	PR fortran/85779
	Backport from trunk
	* decl.c (gfc_match_derived_decl): Fix NULL point dereference.

2018-05-25  Steven G. Kargl  <kargl@gcc.gnu.org>

	PR fortran/85779
	Backport from trunk
	* gfortran.dg/pr85779_1.f90: New test.
	* gfortran.dg/pr85779_2.f90: Ditto.
	* gfortran.dg/pr85779_3.f90: Ditto.

From-SVN: r260773
2018-05-25 19:13:50 +00:00
Steven G. Kargl 88097476b2 re PR fortran/85780 (ICE in resolve_fl_procedure, at fortran/resolve.c:12504)
2018-05-25  Steven G. Kargl  <kargl@gcc.gnu.org>

	PR fortran/85780
	Backport from trunk
	* resolve.c (resolve_fl_procedure): Avoid NULL dereference.

2018-05-25  Steven G. Kargl  <kargl@gcc.gnu.org>

	PR fortran/85780
	Backport from trunk
	* gfortran.dg/pr85780.f90: New test.

From-SVN: r260771
2018-05-25 19:05:52 +00:00
Steven G. Kargl c554c37a26 re PR fortran/85895 (ICE in gfc_conv_array_ref, at fortran/trans-array.c:3518)
2018-05-25  Steven G. Kargl  <kargl@gcc.gnu.org>

	PR fortran/85895
	Backport from trunk
	* resolve.c (resolve_sync): Resolve expression before checking for
	an error.

2018-05-25  Steven G. Kargl  <kargl@gcc.gnu.org>

	PR fortran/85895
	Backport from trunk
	* gfortran.dg/coarray_3.f90: Fix invalid testcase.
	* gfortran.dg/pr85895.f90: New test.

From-SVN: r260770
2018-05-25 18:57:04 +00:00
Uros Bizjak af0e20c869 re PR target/85903 (FAIL: gcc.target/i386/avx512dq-vcvtuqq2pd-2.c)
* config/i386/sse.md (cvtusi2<ssescalarmodesuffix>64<round_name>):
	Add {q} suffix to insn mnemonic.

	PR target/85903
	* config/i386/sse.md (movdi_to_sse): Do not generate pseudo
	when memory input operand is handled.

testsuite/ChangeLog:

	* gcc.target/i386/avx512f-vcvtusi2sd64-1.c: Update scan string.
	* gcc.target/i386/avx512f-vcvtusi2ss64-1.c: Ditto.

From-SVN: r260758
2018-05-25 15:38:13 +02:00
GCC Administrator fb3d063722 Daily bump.
From-SVN: r260701
2018-05-25 00:16:19 +00:00
H.J. Lu f38743e936 libsanitizer: Use pre-computed size of struct ustat for Linux
Cherry-pick compiler-rt revision 333213:

<sys/ustat.h> has been removed from glibc 2.28 by:

commit cf2478d53ad7071e84c724a986b56fe17f4f4ca7
Author: Adhemerval Zanella <adhemerval.zanella@linaro.org>
Date:   Sun Mar 18 11:28:59 2018 +0800

    Deprecate ustat syscall interface

This patch uses pre-computed size of struct ustat for Linux.

	PR sanitizer/85835
	* sanitizer_common/sanitizer_platform_limits_posix.cc: Don't
	include <sys/ustat.h> for Linux.
	(SIZEOF_STRUCT_USTAT): New.
	(struct_ustat_sz): Use SIZEOF_STRUCT_USTAT for Linux.

From-SVN: r260688
2018-05-24 13:21:54 -07:00
GCC Administrator 9572599d64 Daily bump.
From-SVN: r260631
2018-05-24 00:16:33 +00:00
GCC Administrator f719aa16ab Daily bump.
From-SVN: r260559
2018-05-23 00:16:10 +00:00
GCC Administrator 6784bc35d2 Daily bump.
From-SVN: r260495
2018-05-22 00:16:29 +00:00
Pat Haugen 17b7d3edfb re PR tree-optimization/85698 (CPU2017 525.x264_r fails starting with r257581)
PR target/85698
	* config/rs6000/rs6000.c (rs6000_output_move_128bit): Check dest operand.

	* gcc.target/powerpc/pr85698.c: New test.

From-SVN: r260476
2018-05-21 16:34:44 +00:00
GCC Administrator 2cbde98030 Daily bump.
From-SVN: r260429
2018-05-21 00:16:28 +00:00
Paul Thomas e62bd7cfb8 re PR fortran/80657 (Loop in character function declaration)
2018-05-20  Paul Thomas  <pault@gcc.gnu.org>

	PR fortran/80657
	Backport from trunk
	* resolve.c (flag_fn_result_spec): Use the 'sym' argument to
	test for self refs to the function result in the character len
	expression. If a self reference is found, emit an error and
	return true.
	(resolve_fntype): Use the function symbol in the calls to the
	above.

2018-05-20  Paul Thomas  <pault@gcc.gnu.org>

	PR fortran/80657
	Backport from trunk
	* gfortran.dg/char_result_18.f90: New test.

From-SVN: r260424
2018-05-20 18:08:04 +00:00
Paul Thomas 1af98493eb re PR fortran/82275 (gfortran rejects valid & accepts invalid reference to dimension-remapped type SELECT TYPE selector)
2018-05-20  Paul Thomas  <pault@gcc.gnu.org>

	PR fortran/82275
	Backport from trunk
	* match.c (gfc_match_type_spec): Go through the array ref and
	decrement 'rank' for every dimension that is an element.

2018-05-20  Paul Thomas  <pault@gcc.gnu.org>

	PR fortran/82275
	Backport from trunk
	* gfortran.dg/select_type_42.f90: New test.

From-SVN: r260423
2018-05-20 17:16:09 +00:00
GCC Administrator 6831d6045d Daily bump.
From-SVN: r260406
2018-05-20 00:16:28 +00:00
Paul Thomas 34aac30d2d re PR fortran/82923 (Automatic allocation of deferred length character using function result)
2018-05-19  Paul Thomas  <pault@gcc.gnu.org>

	PR fortran/82923
	PR fortran/66694
	PR fortran/82617
	* trans-array.c (gfc_alloc_allocatable_for_assignment): Set the
	charlen backend_decl of the rhs expr to ss->info->string_length
	so that the value in the current scope is used.

2018-05-19  Paul Thomas  <pault@gcc.gnu.org>

	PR fortran/82923
	* gfortran.dg/allocate_assumed_charlen_4.f90: New test. Note
	that the patch fixes PR66694 & PR82617, although the testcases
	are not explicitly included.

From-SVN: r260399
2018-05-19 14:53:58 +00:00
GCC Administrator 8c55577cec Daily bump.
From-SVN: r260386
2018-05-19 00:16:38 +00:00
GCC Administrator 923ed8dc1c Daily bump.
From-SVN: r260345
2018-05-18 00:16:10 +00:00
Jonathan Wakely 19620f85c7 PR libstdc++/85812 fix memory leak in std::make_exception_ptr
PR libstdc++/85812
	* libsupc++/cxxabi_init_exception.h (__cxa_free_exception): Declare.
	* libsupc++/exception_ptr.h (make_exception_ptr) [__cpp_exceptions]:
	Refactor to separate non-throwing and throwing implementations.
	[__cpp_rtti && !_GLIBCXX_HAVE_CDTOR_CALLABI]: Deallocate the memory
	if constructing the object throws.

From-SVN: r260331
2018-05-17 18:26:44 +01:00
Paul Thomas 0ecc8d6fd1 re PR fortran/82814 (ICE from submodule character function)
2017-05-17  Paul Thomas  <pault@gcc.gnu.org>

	PR fortran/82814
	* gfortran.dg/submodule_31.f08: New test.

From-SVN: r260324
2018-05-17 15:17:43 +00:00
Martin Jambor 5026bf985a Check is_single_const in intersect_with_plats
2018-05-17  Martin Jambor  <mjambor@suse.cz>

	Backport from mainline
	2018-05-11  Martin Jambor  <mjambor@suse.cz>

	PR ipa/85655
	* ipa-cp.c (intersect_with_plats): Check that the lattice contains
	single const.

From-SVN: r260320
2018-05-17 14:23:34 +02:00
GCC Administrator 8b024b9ad3 Daily bump.
From-SVN: r260302
2018-05-17 00:16:09 +00:00
Paul Thomas 5b26bda1c6 re PR fortran/83149 ([6- and 7-branches] Missing test for sym->ns->proc_name: crash_signal in toplev.c:325)
2018-05-16  Paul Thomas  <pault@gcc.gnu.org>

	PR fortran/83149
	Backport from trunk
	* trans-decl.c (gfc_finish_var_decl): Test sym->ns->proc_name
	before accessing its components.
	* trans-types.c (gfc_sym_type): If a character result has null
	backend_decl, try the procedure symbol..

2018-05-16  Paul Thomas  <pault@gcc.gnu.org>

	PR fortran/83149
	Backport from trunk
	* gfortran.dg/pr83149_1.f90: New test.
	* gfortran.dg/pr83149.f90: Additional source for previous.
	* gfortran.dg/pr83149_b.f90: New test.
	* gfortran.dg/pr83149_a.f90: Additional source for previous.

From-SVN: r260285
2018-05-16 11:17:10 +00:00
Paul Thomas 0c09cb7ae8 re PR fortran/83898 (ICE in gfc_conv_expr_descriptor, at fortran/trans-array.c:7181)
2018-16-05  Paul Thomas  <pault@gcc.gnu.org>

	PR fortran/83898
	Backport from trunk
	* trans-stmt.c (trans_associate_var): Do not set cst_array_ctor
	for characters.

2018-16-05  Paul Thomas  <pault@gcc.gnu.org>

	PR fortran/83898
	Backport from trunk
	* gfortran.dg/associate_33.f03 : New test.

From-SVN: r260282
2018-05-16 10:18:20 +00:00
Paul Thomas e777974703 re PR fortran/84546 (Bad sourced allocation of CLASS(*) with source with CLASS(*) component)
2018-05-16  Paul Thomas  <pault@gcc.gnu.org>

	PR fortran/84546
	Backport from trunk
	* trans-array.c (structure_alloc_comps): Make sure that the
	vptr is copied and that the unlimited polymorphic _len is used
	to compute the size to be allocated.
	(build_array_ref): Set the 'unlimited' argument false in the
	call to gfc_get_class_array_ref.
	* trans-expr.c (gfc_get_class_array_ref): If unlimited, use the
	unlimited polymorphic _len for the offset to the element.
	(gfc_copy_class_to_class): Set the new 'unlimited' argument.
	* trans.h : Add the boolean 'unlimited' to the prototype.

2018-05-16  Paul Thomas  <pault@gcc.gnu.org>

	PR fortran/84546
	Backport from trunk
	* gfortran.dg/unlimited_polymorphic_29.f90 : New test.

From-SVN: r260281
2018-05-16 09:35:19 +00:00
GCC Administrator ee1f682ad5 Daily bump.
From-SVN: r260275
2018-05-16 00:16:17 +00:00
GCC Administrator 1e0a4617de Daily bump.
From-SVN: r260246
2018-05-15 00:16:17 +00:00
Jonathan Wakely cb4a4643bc PR libstdc++/67554 Do not pass null pointers to memcpy
PR libstdc++/67554
	* include/bits/valarray_array.h (_Array_copy_ctor<_Tp, true>)
	(_Array_copier<_Tp, true>): Do not pass null pointers to memcpy.

From-SVN: r260243
2018-05-14 23:22:27 +01:00
Jonathan Wakely a49fa6a084 PR libstdc++/82966 fix swapping of node handles
PR libstdc++/82966
	* include/bits/node_handle.h (_Node_handle_common::_M_swap): Use value
	instead of type.
	* testsuite/23_containers/set/modifiers/node_swap.cc: New.

From-SVN: r260242
2018-05-14 23:22:23 +01:00
GCC Administrator b2cf667044 Daily bump.
From-SVN: r260219
2018-05-14 00:16:10 +00:00
GCC Administrator f304423213 Daily bump.
From-SVN: r260203
2018-05-13 00:16:39 +00:00
Steven G. Kargl 0db767d911 re PR fortran/85542 (ICE in check_inquiry, at fortran/expr.c:2426)
2018-05-12  Steven G. Kargl  <kargl@gcc.gnu.org>

	PR fortran/85542
	Backport from trunk
	* expr.c (check_inquiry): Avoid NULL pointer dereference.
 
2018-05-12  Steven G. Kargl  <kargl@gcc.gnu.org>

	PR fortran/85542
	Backport from trunk
	* gfortran.dg/pr85542.f90: New test.

From-SVN: r260197
2018-05-12 16:57:28 +00:00
Paul Thomas 1889a748b4 re PR fortran/68846 (Pointer function as LValue doesn't work when the assignment regards a dummy argument.)
2018-05-12  Paul Thomas  <pault@gcc.gnu.org>

	PR fortran/68846
	PR fortran/70864
	Backport from trunk
	* resolve.c (get_temp_from_expr): The temporary must not have
	dummy or intent attributes.

2018-05-12  Paul Thomas  <pault@gcc.gnu.org>

	PR fortran/68846
	Backport from trunk
	* gfortran.dg/temporary_3.f90 : New test.

	PR fortran/70864
	Backport from trunk
	* gfortran.dg/temporary_2.f90 : New test.

From-SVN: r260195
2018-05-12 15:33:24 +00:00
GCC Administrator 707c9c8f23 Daily bump.
From-SVN: r260192
2018-05-12 00:16:21 +00:00
Steven G. Kargl 32da09c4c6 re PR fortran/70870 (Segmentation violation in gfc_assign_data_value)
2018-05-11  Steven G. Kargl  <kargl@gcc.gnu.org>

	PR fortran/70870
	Backport from trunk
	* data.c (gfc_assign_data_value): Check that a data object does
	not also have default initialization.

2018-05-11  Steven G. Kargl  <kargl@gcc.gnu.org>

	PR fortran/70870
	Backport from trunk
	* gfortran.dg/pr70870_1.f90: New test.

From-SVN: r260176
2018-05-11 18:00:41 +00:00
Steven G. Kargl 59a3192bc3 re PR fortran/85521 (ICE in gfc_resolve_character_array_constructor, at fortran/array.c:2049)
2018-05-11  Steven G. Kargl  <kargl@gcc.gnu.org>

	PR fortran/85521
	Backport from trunk
	* array.c (gfc_resolve_character_array_constructor): Substrings
	with upper bound smaller than lower bound are zero length strings.

2018-05-11  Steven G. Kargl  <kargl@gcc.gnu.org>

	PR fortran/85521
	Backport from trunk
	* gfortran.dg/pr85521_1.f90: New test.
	* gfortran.dg/pr85521_2.f90: New test.

From-SVN: r260175
2018-05-11 17:59:05 +00:00
Steven G. Kargl eb9c2ee54a re PR fortran/85687 (ICE in gfc_sym_identifier, at fortran/trans-decl.c:351)
2018-05-11  Steven G. Kargl  <kargl@gcc.gnu.org>

	PR fortran/85687
	Backport from trunk
	* check.c (gfc_check_rank): Check that the argument is a data object.

2018-05-11  Steven G. Kargl  <kargl@gcc.gnu.org>

	PR fortran/85687
	Backport from trunk
	* gfortran.dg/pr85687.f90: new test.

From-SVN: r260174
2018-05-11 17:58:03 +00:00
GCC Administrator 92faf9aa8c Daily bump.
From-SVN: r260145
2018-05-11 00:16:11 +00:00
Jonathan Wakely b5fd4a4f06 Document Dual ABI for std::ios_base::failure
* doc/xml/faq.xml: Link to C++17 status. Add note to outdated answer.
	* doc/xml/manual/debug_mode.xml: Add array and forward_list to list
	of C++11 containers with Debug Mode support.
	* doc/xml/manual/using.xml: Document Dual ABI for ios_base::failure.
	* doc/html/*: Regenerate.

From-SVN: r260131
2018-05-10 20:23:33 +01:00
GCC Administrator 040019f459 Daily bump.
From-SVN: r260102
2018-05-10 00:16:12 +00:00
Jason Merrill 82ad3a67e4 PR c++/85646 - lambda visibility.
* decl2.c (determine_visibility): Don't mess with template arguments
	from the containing scope.
	(vague_linkage_p): Check DECL_ABSTRACT_P before looking at a 'tor
	thunk.

From-SVN: r260069
2018-05-08 22:34:03 -04:00
GCC Administrator 1c786cb901 Daily bump.
From-SVN: r260061
2018-05-09 00:16:13 +00:00
GCC Administrator 86b05b9908 Daily bump.
From-SVN: r260019
2018-05-08 00:16:28 +00:00
Edward Smith-Rowland 12eb60f827 backport: re PR libstdc++/80506 (Wrong magic number in std::gamma_distribution)
2018-05-07  Edward Smith-Rowland  <3dw4rd@verizon.net>
	    Jonathan Wakely  <jwakely@redhat.com>

	Backport from mainline
	2018-05-07  Edward Smith-Rowland  <3dw4rd@verizon.net>

	PR libstdc++/80506
	* include/bits/random.tcc (gamma_distribution::operator()): Fix magic
	number used in loop condition.
	(gamma_distribution::__generate_impl()): Ditto.


Co-Authored-By: Jonathan Wakely <jwakely@redhat.com>

From-SVN: r260006
2018-05-07 16:23:29 +00:00
GCC Administrator 27933d2bcb Daily bump.
From-SVN: r259984
2018-05-07 00:16:09 +00:00
Andre Vehreschild 235a7f0e13 re PR fortran/85507 (ICE in gfc_dep_resolver, at fortran/dependency.c:2258)
gcc/fortran/ChangeLog:

2018-05-06  Andre Vehreschild  <vehre@gcc.gnu.org>

	PR fortran/85507
	Backport from trunk.
	* dependency.c (gfc_dep_resolver): Revert looking at coarray dimension
	introduced by r259385.
	* trans-intrinsic.c (conv_caf_send): Always report a dependency for
	same variables in coarray assignments.

gcc/testsuite/ChangeLog:

2018-05-06  Andre Vehreschild  <vehre@gcc.gnu.org>

	PR fortran/85507
	Backport from trunk
	* gfortran.dg/coarray_dependency_1.f90: New test.
	* gfortran.dg/coarray_lib_comm_1.f90: Fix counting caf-expressions.

From-SVN: r259977
2018-05-06 13:52:46 +02:00
GCC Administrator 1180649026 Daily bump.
From-SVN: r259971
2018-05-06 00:16:12 +00:00
GCC Administrator ad2890019d Daily bump.
From-SVN: r259963
2018-05-05 00:16:15 +00:00
GCC Administrator afe3349556 Daily bump.
From-SVN: r259915
2018-05-04 00:16:12 +00:00
Jonathan Wakely f7526fc9cf PR libstdc++/84769 qualify call to std::get<0>
PR libstdc++/84769
	* include/std/variant (visit): Qualify std::get call.

From-SVN: r259910
2018-05-03 21:16:34 +01:00
Jonathan Wakely 86c77995da PR libstdc++/85632 fix wraparound in filesystem::space
On 32-bit targets any values over 4GB would wrap and produce the wrong
result.

	PR libstdc++/85632 use uintmax_t for arithmetic
	* src/filesystem/ops.cc (experimental::filesystem::space): Perform
	arithmetic in result type.
	* testsuite/experimental/filesystem/operations/space.cc: New.

From-SVN: r259909
2018-05-03 21:16:29 +01:00
GCC Administrator d22e1cbc77 Daily bump.
From-SVN: r259872
2018-05-03 00:16:11 +00:00
GCC Administrator b6fe618ca7 Daily bump.
From-SVN: r259816
2018-05-02 00:16:24 +00:00
Tom de Vries d557a55ea9 backport "[openacc] Fix ICE when compiling tile loop containing infinite loop"
2018-05-01  Tom de Vries  <tom@codesourcery.com>

	backport from trunk:
	2018-04-16  Cesar Philippidis  <cesar@codesourcery.com>
		    Tom de Vries  <tom@codesourcery.com>

	PR middle-end/84955
	* omp-expand.c (expand_oacc_for): Add dummy false branch for
	tiled basic blocks without omp continue statements.

	* testsuite/libgomp.oacc-c-c++-common/pr84955.c: New test.
	* testsuite/libgomp.oacc-fortran/pr84955.f90: New test.

From-SVN: r259795
2018-05-01 13:21:19 +00:00
Kyrylo Tkachov 34cd4a0502 [arm] PR target/82518: Return false in ARRAY_MODE_SUPPORTED_P for BYTES_BIG_ENDIAN pt2
Backport from trunk
	2018-04-27  Kyrylo Tkachov  <kyrylo.tkachov@arm.com>

	PR target/82518
	* lib/target-supports.exp (check_effective_target_vect_load_lanes):
	Use check_effective_target_arm_little_endian.

From-SVN: r259790
2018-05-01 09:00:39 +00:00
GCC Administrator c3fab8c51c Daily bump.
From-SVN: r259785
2018-05-01 00:16:11 +00:00
Edward Smith-Rowland a6aef355ce PR libstdc++/pr66689 - comp_ellint_3 and ellint_3 return garbage values
2018-04-30  Edward Smith-Rowland  <3dw4rd@verizon.net>

	PR libstdc++/pr66689 - comp_ellint_3 and ellint_3 return garbage values
	* include/tr1/ell_integral.tcc: Correct the nu sign convention
	in ellint_3 and comp_ellint_3.
	* testsuite/tr1/5_numerical_facilities/special_functions/
	06_comp_ellint_3/check_value.cc: Regen with correct values.
	* testsuite/tr1/5_numerical_facilities/special_functions/
	14_ellint_3/check_value.cc: Ditto.
	* testsuite/special_functions/06_comp_ellint_3/check_value.cc: Ditto.
	* testsuite/special_functions/13_ellint_3/check_value.cc: Ditto.
	* testsuite/special_functions/06_comp_ellint_3/pr66689.cc: New.
	* testsuite/special_functions/13_ellint_3/pr66689.cc: New.
	* testsuite/tr1/5_numerical_facilities/special_functions/
	06_comp_ellint_3/pr66689.cc: New.
	* testsuite/tr1/5_numerical_facilities/special_functions/
	14_ellint_3/pr66689.cc: New.

2018-04-30  Edward Smith-Rowland  <3dw4rd@verizon.net>

	PR libstdc++/68397 std::tr1::expint fails ... long double arguments.
	* include/tr1/exp_integral.tcc: Increase iteration limits.
	* testsuite/tr1/5_numerical_facilities/special_functions/15_expint/
	pr68397.cc: New test.
	* testsuite/special_functions/14_expint/pr68397.cc: New test.

svn commit \ --This line, and those below, will be ignored--
  ChangeLog \ M ChangeLog M include/tr1/ell_integral.tcc A testsuite/special_functions/06_comp_ellint_3/pr66689.cc A 
testsuite/special_functions/13_ellint_3/pr66689.cc A testsuite/tr1/5_numerical_facilities/special_functions/06_comp_ellint_3/pr66689.cc A 
testsuite/tr1/5_numerical_facilities/special_functions/14_ellint_3/pr66689.cc M testsuite/special_functions/06_comp_ellint_3/check_value.cc M 
testsuite/special_functions/13_ellint_3/check_value.cc M testsuite/tr1/5_numerical_facilities/special_functions/06_comp_ellint_3/check_value.cc M 
testsuite/tr1/5_numerical_facilities/special_functions/14_ellint_3/check_value.cc M include/tr1/exp_integral.tcc A 
testsuite/special_functions/14_expint/pr68397.cc A testsuite/tr1/5_numerical_facilities/special_functions/15_expint/pr68397.cc
  include/tr1/ell_integral.tcc \
  testsuite/special_functions/06_comp_ellint_3/pr66689.cc \
  testsuite/special_functions/13_ellint_3/pr66689.cc \
  testsuite/tr1/5_numerical_facilities/special_functions/06_comp_ellint_3/pr66689.cc \
  testsuite/tr1/5_numerical_facilities/special_functions/14_ellint_3/pr66689.cc \
  testsuite/special_functions/06_comp_ellint_3/check_value.cc \
  testsuite/special_functions/13_ellint_3/check_value.cc \
  testsuite/tr1/5_numerical_facilities/special_functions/06_comp_ellint_3/check_value.cc \
  testsuite/tr1/5_numerical_facilities/special_functio

From-SVN: r259777
2018-04-30 19:51:13 +00:00
GCC Administrator 8856bf7521 Daily bump.
From-SVN: r259751
2018-04-30 00:16:11 +00:00
GCC Administrator 95115f56d3 Daily bump.
From-SVN: r259745
2018-04-29 00:16:13 +00:00
Andre Vehreschild da5d5f1610 re PR fortran/81773 ([Coarray] Get with vector index on lhs leads to incorrect caf_get_by_ref() call.)
gcc/fortran/ChangeLog:

2018-04-28  Andre Vehreschild  <vehre@gcc.gnu.org>

	PR fortran/81773
	PR fortran/83606
	Backport from trunk
	* dependency.c (gfc_dep_resolver): Coarray indexes are to be ignored
	during dependency computation.  They define no data dependency.
	* trans-array.c (conv_array_index_offset): The stride can not be set
	here, prevent fail.
	* trans-intrinsic.c (conv_caf_send): Add creation of temporary array
	for caf_get's result and copying to the array with vectorial
	indexing.

gcc/testsuite/ChangeLog:

2018-04-28  Andre Vehreschild  <vehre@gcc.gnu.org>

	PR fortran/81773
	PR fortran/83606
	Backport from trunk
	* gfortran.dg/coarray/get_to_indexed_array_1.f90: New test.
	* gfortran.dg/coarray/get_to_indirect_array.f90: New test.

From-SVN: r259742
2018-04-28 16:54:20 +02:00
GCC Administrator 77922dcd01 Daily bump.
From-SVN: r259735
2018-04-28 00:16:14 +00:00
GCC Administrator 8759f23f62 Daily bump.
From-SVN: r259693
2018-04-27 00:16:13 +00:00
Richard Biener 8e8eb5c602 Backport PRs 84873, 85168, 85244, 85284
2018-04-26  Richard Biener  <rguenther@suse.de>

	Backport from mainline
	2018-04-09  Richard Biener  <rguenther@suse.de>

	PR tree-optimization/85284
	* tree-ssa-loop-niter.c (number_of_iterations_exit_assumptions):
	Only use the niter constraining form of simple_iv when the exit
	is always executed.

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

	2018-04-06  Richard Biener  <rguenther@suse.de>

	PR middle-end/85244
	* tree-dfa.c (get_ref_base_and_extent): Reset seen_variable_array_ref
	after seeing a component reference with an adjacent field.  Treat
	refs to arrays at struct end of external decls similar to
	refs to unconstrained commons.

	* gcc.dg/torture/pr85244-1.c: New testcase.
	* gcc.dg/torture/pr85244-2.c: Likewise.

	2018-04-04  Richard Biener  <rguenther@suse.de>

	PR tree-optimization/85168
	* tree-ssa-sccvn.c (vn_reference_maybe_forwprop_address): Avoid
	propagating abnormals.

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

	2018-03-16  Richard Biener  <rguenther@suse.de>

	PR c/84873
	* c-gimplify.c (c_gimplify_expr): Revert previous change.  Instead
	unshare the possibly folded expression.

	2018-03-15  Richard Biener  <rguenther@suse.de>

	PR c/84873
	* c-gimplify.c (c_gimplify_expr): Do not fold expressions.

	* c-c++-common/pr84873.c: New testcase.

From-SVN: r259670
2018-04-26 10:00:24 +00:00
GCC Administrator cbbf5e7cd4 Daily bump.
From-SVN: r259660
2018-04-26 00:16:26 +00:00
GCC Administrator 8d9340dd5a Daily bump.
From-SVN: r259627
2018-04-25 00:16:30 +00:00
Steven G. Kargl c535ec76b5 re PR fortran/85520 (Out of memory when declaring a character with len << 0)
2018-04-24  Steven G. Kargl  <kargl@gcc.gnu.org>

	PR fortran/85520
	* decl.c (gfc_match_char_spec): Check for negative length and set to 0.

2018-04-24  Steven G. Kargl  <kargl@gcc.gnu.org>

	PR fortran/85520
	* gfortran.dg/pr85520.f90: New test.

From-SVN: r259624
2018-04-25 00:00:47 +00:00
Martin Liska eb300da42a Backport r259490
2018-04-24  Martin Liska  <mliska@suse.cz>

	Backport from mainline
	2018-04-19  Martin Liska  <mliska@suse.cz>

	* lto-symtab.c (lto_symtab_resolve_symbols): Do not bail out
	for multiple PREVAILING_DEF_IRONLY for common symbols.

From-SVN: r259605
2018-04-24 15:19:46 +00:00
Martin Liska 01cd8ab79c Backport r259459
2018-04-24  Martin Liska  <mliska@suse.cz>

	Backport from mainline
	2018-04-18  Bill Seurer  <seurer@linux.vnet.ibm.com>

	PR sanitizer/85389
	* asan/asan_allocator.h (kAllocatorSpace): For __powerpc64__ change
	from 0xa0000000000ULL to ~(uptr)0.

From-SVN: r259604
2018-04-24 15:19:32 +00:00
Martin Liska 670a229a23 Backport r259431
2018-04-24  Martin Liska  <mliska@suse.cz>

	Backport from mainline
	2018-04-17  Martin Liska  <mliska@suse.cz>

	PR lto/85405
	* ipa-devirt.c (odr_types_equivalent_p): Remove trailing
	in message, remote space in between '_G' and '('.

From-SVN: r259603
2018-04-24 15:19:11 +00:00
Martin Liska ac4cb6fae7 Backport r259429
2018-04-24  Martin Liska  <mliska@suse.cz>

	Backport from mainline
	2018-04-17  Jan Hubicka  <jh@suse.cz>

	PR lto/85405
	* ipa-devirt.c (odr_types_equivalent_p): Handle bit fields.

From-SVN: r259602
2018-04-24 15:18:57 +00:00
Martin Liska 16b3803b21 Backport r259274
2018-04-24  Martin Liska  <mliska@suse.cz>

	Backport from mainline
	2018-04-10  Martin Liska  <mliska@suse.cz>

	PR lto/85248
	* lto-symtab.c (lto_symtab_merge_p): Do not check for
	TREE_VALUES of error attributes.

From-SVN: r259601
2018-04-24 15:18:42 +00:00
Martin Liska 1e38c2c902 Backport r259265
2018-04-24  Martin Liska  <mliska@suse.cz>

	Backport from mainline
	2018-04-10  Richard Biener  <rguenther@suse.de>
		    Martin Liska  <mliska@suse.cz>

	PR lto/85248
	* lto-symtab.c (lto_symtab_merge_p): Handle noreturn attribute.
2018-04-24  Martin Liska  <mliska@suse.cz>

	Backport from mainline
	2018-04-10  Jakub Jelinek  <jakub@redhat.com>

	PR lto/85248
	* gcc.dg/lto/pr85248_0.c: New test.
	* gcc.dg/lto/pr85248_1.c: New test.

From-SVN: r259600
2018-04-24 15:18:25 +00:00
Martin Liska e7b57280cc Backport r258924
2018-04-24  Martin Liska  <mliska@suse.cz>

	Backport from mainline
	2018-03-28  Jakub Jelinek  <jakub@redhat.com>
		    Martin Liska  <mliska@suse.cz>

	PR sanitizer/85081
	* gimplify.c (asan_poison_variable): Don't do the check for
	gimplify_omp_ctxp here.
	(gimplify_decl_expr): Do it here.
	(gimplify_target_expr): Likewise.
2018-04-24  Martin Liska  <mliska@suse.cz>

	Backport from mainline
	2018-03-28  Jakub Jelinek  <jakub@redhat.com>
		    Martin Liska  <mliska@suse.cz>

	PR sanitizer/85081
	* g++.dg/asan/pr85081.C: New test.

From-SVN: r259599
2018-04-24 15:17:48 +00:00
Martin Liska f53ce58761 Backport r258705
2018-04-24  Martin Liska  <mliska@suse.cz>

	Backport from mainline
	2018-03-21  Martin Liska  <mliska@suse.cz>

	PR ipa/84963
	* ipa-icf.c (sem_item_optimizer::fixup_points_to_sets): Remove
	not intended return statement.
2018-04-24  Martin Liska  <mliska@suse.cz>

	Backport from mainline
	2018-03-21  Martin Liska  <mliska@suse.cz>

	PR ipa/84963
	* gfortran.dg/goacc/pr84963.f90: New test.

From-SVN: r259598
2018-04-24 15:17:19 +00:00
Martin Liska 6bacc8813f Backport r258480
2018-04-24  Martin Liska  <mliska@suse.cz>

	Backport from mainline
	2018-03-13  Martin Liska  <mliska@suse.cz>

	PR ipa/84658.
	* (sem_item_optimizer::sem_item_optimizer): Initialize new
	vector.
	(sem_item_optimizer::~sem_item_optimizer): Release it.
	(sem_item_optimizer::merge_classes): Register variable aliases.
	(sem_item_optimizer::fixup_pt_set): New function.
	(sem_item_optimizer::fixup_points_to_sets): Likewise.
	* ipa-icf.h: Declare new variables and functions.
2018-04-24  Martin Liska  <mliska@suse.cz>

	Backport from mainline
	2018-03-13  Martin Liska  <mliska@suse.cz>

	PR ipa/84658.
	* g++.dg/ipa/pr84658.C: New test.

From-SVN: r259597
2018-04-24 15:17:00 +00:00
Aaron Sawdey 9f286fb0f8 backport: re PR target/83660 (ICE with vec_extract inside expression statement)
2018-04-23  Aaron Sawdey  <acsawdey@linux.ibm.com>

	Backport from mainline
	2018-04-16  Aaron Sawdey  <acsawdey@linux.ibm.com>

	PR target/83660
	* config/rs6000/rs6000-c.c (altivec_resolve_overloaded_builtin): Mark
	vec_extract expression as having side effects to make sure it gets
	a cleanup point.

2018-04-23  Aaron Sawdey  <acsawdey@linux.ibm.com>

	Backport from mainline
	2018-04-16  Aaron Sawdey  <acsawdey@linux.ibm.com>

	PR target/83660
	* gcc.target/powerpc/pr83660.C: New test.

From-SVN: r259590
2018-04-23 19:19:43 -05:00
GCC Administrator d970ea3321 Daily bump.
From-SVN: r259588
2018-04-24 00:16:23 +00:00
Ville Voutilainen 137924df24 Implement P0969
Backport from mainline

2018-04-05  Ville Voutilainen  <ville.voutilainen@gmail.com>

	Implement P0969
	* decl.c (find_decomp_class_base): Check accessibility instead
	of declared access, adjust diagnostic.

From-SVN: r259579
2018-04-23 23:52:47 +03:00
Eric Botcazou 038b3ea9de re PR middle-end/85496 (internal compiler error: in emit_move_insn, at expr.c:3722)
PR middle-end/85496
	* expr.c (store_field): In the bitfield case, if the value comes from
	a function call and is returned in registers by means of a PARALLEL,
	do not change the mode of the temporary unless BLKmode and VOIDmode.

From-SVN: r259576
2018-04-23 20:29:22 +00:00
Jakub Jelinek 9e515759f0 PR c++/85470 - wrong error with static data member.
* decl.c (check_initializer): Check DECL_INITIALIZED_IN_CLASS_P.
	* typeck2.c (store_init_value): Likewise.

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

From-SVN: r259572
2018-04-23 15:58:57 -04:00
Ville Voutilainen 6fe4e5f3f1 Implement P0961
Backport from mainline

2018-04-05  Ville Voutilainen  <ville.voutilainen@gmail.com>

	Implement P0961
	* decl.c (get_tuple_decomp_init): Check the templatedness
	of a member get.

From-SVN: r259561
2018-04-23 17:22:58 +03:00
GCC Administrator a9a1a8b742 Daily bump.
From-SVN: r259555
2018-04-23 00:16:10 +00:00
GCC Administrator 657efff657 Daily bump.
From-SVN: r259543
2018-04-22 00:16:20 +00:00
GCC Administrator 88f1443437 Daily bump.
From-SVN: r259538
2018-04-21 00:16:10 +00:00
Peter Bergner 4462004c6e backport: re PR target/83969 (ICE in final_scan_insn, at final.c:2997 (error: could not split insn) for powerpc targets)
gcc/
	Backport from mainline
	2018-03-09  Peter Bergner  <bergner@vnet.ibm.com>

	PR target/83969
	* config/rs6000/rs6000.c (rs6000_offsettable_memref_p): New prototype.
	Add strict argument and use it.
	(rs6000_split_multireg_move): Update for new strict argument.
	(mem_operand_gpr): Disallow all non-offsettable addresses.
	* config/rs6000/rs6000.md (*movdi_internal64): Use YZ constraint.

gcc/testsuite/
	PR target/85436
	* go.dg/pr85436.go: New test.

	Backport from mainline
	2018-03-09  Peter Bergner  <bergner@vnet.ibm.com>

	PR target/83969
	* gcc.target/powerpc/pr83969.c: New test.

From-SVN: r259520
2018-04-20 07:19:10 -05:00
GCC Administrator b47ba21e7b Daily bump.
From-SVN: r259514
2018-04-20 00:16:21 +00:00
Jonathan Wakely 450096bc3f PR c++/85464 - missing location for -Wignored-qualifiers diagnostic
The fix for PR c++/69733 caused a regression for conversion operators
with redundant cv-qualifiers, changing an incorrect location to an
unknown location. This restores it to the incorrect location (as was
already done on trunk by the fix for PR c++/65775).

gcc/cp:

	PR c++/85464 - missing location for -Wignored-qualifiers diagnostic
	* decl.c (grokdeclarator): If declspecs->locations[ds_type_spec]
	is UNKNOWN_LOCATION fall back to input_location.

gcc/testsuite:

	PR c++/85464 - missing location for -Wignored-qualifiers diagnostic
	* g++.dg/diagnostic/pr85464.C: New.

From-SVN: r259499
2018-04-19 16:29:03 +01:00
GCC Administrator 44d20480c1 Daily bump.
From-SVN: r259482
2018-04-19 00:16:20 +00:00
Jonathan Wakely e18af2cac1 PR libstdc++/85442 fix duplicate debuginfo for cxx11-ios_failure.cc
2018-04-18  Jonathan Wakely  <jwakely@redhat.com>
	    Jakub Jelinek  <jakub@redhat.com>

	PR libstdc++/85442
	* src/c++11/Makefile.am: Don't generate debuginfo again for
	cxx11-ios_failure-lt.s and cxx11-ios_failure.s files.
	* src/c++11/Makefile.in: Regenerate.

Co-Authored-By: Jakub Jelinek <jakub@redhat.com>

From-SVN: r259468
2018-04-18 14:13:29 +01:00
Thomas Preud'homme 0cf68da8b4 [ARM] Fix PR85261: ICE with FPSCR setter builtin
Instruction pattern for setting the FPSCR expects the input value to be
in a register. However, __builtin_arm_set_fpscr expander does not ensure
that this is the case and as a result GCC ICEs when the builtin is
called with a constant literal.

This commit fixes the builtin to force the input value into a register.
It also remove the unneeded volatile in the existing fpscr test and
fixes the function prototype.

2018-04-18  Thomas Preud'homme  <thomas.preudhomme@arm.com>

    Backport from mainline
    2018-04-11  Thomas Preud'homme  <thomas.preudhomme@arm.com>

    gcc/
    PR target/85261
    * config/arm/arm-builtins.c (arm_expand_builtin): Force input operand
    into register.

    gcc/testsuite/
    PR target/85261
    * gcc.target/arm/fpscr.c: Add call to __builtin_arm_set_fpscr with
    literal value.  Expect 2 MCR instruction.  Fix function prototype.
    Remove volatile keyword.

From-SVN: r259465
2018-04-18 11:42:10 +00:00
GCC Administrator a3d9aa9ad3 Daily bump.
From-SVN: r259454
2018-04-18 00:16:18 +00:00
GCC Administrator f6fc2738b7 Daily bump.
From-SVN: r259425
2018-04-17 00:16:09 +00:00
GCC Administrator 30948e0913 Daily bump.
From-SVN: r259391
2018-04-16 00:16:10 +00:00
GCC Administrator 5f3c1d19b3 Daily bump.
From-SVN: r259388
2018-04-15 00:16:10 +00:00
GCC Administrator d5bfdbf17d Daily bump.
From-SVN: r259382
2018-04-14 00:16:19 +00:00
Jonathan Wakely dc70c3122e Fix broken sed command from previous commit
* src/c++11/Makefile.am: Fix sed command.
	* src/c++11/Makefile.in: Regenerate.

From-SVN: r259375
2018-04-13 11:55:37 +01:00
Jonathan Wakely c46c4b5ccc Fix __iosfail_type_info hack to work on darwin
* src/c++11/Makefile.am: Rewrite sed rule to be less fragile and to
	handle mangled names starting with double underscores on darwin.
	* src/c++11/Makefile.in: Regenerate.

From-SVN: r259372
2018-04-13 11:19:30 +01:00
GCC Administrator e9d8c7dbe7 Daily bump.
From-SVN: r259362
2018-04-13 00:16:11 +00:00
Jonathan Wakely 0ab1752fae Fix comments that misspell names of files and classes
* src/c++11/Makefile.am: Fix comment.
	* src/c++11/Makefile.in: Regenerate.
	* src/c++11/cxx11-ios_failure.cc: Fix comment.
	* src/c++98/ios_failure.cc: Likewise.

From-SVN: r259358
2018-04-12 21:55:25 +01:00
Jonathan Wakely 07026d8924 PR libstdc++/85222 allow catching iostream errors as gcc4-compatible ios::failure
Define a new exception type derived from std::ios::failure[abi:cxx11]
which also aggregates an object of the gcc4-compatible ios::failure
type. Make __throw_ios_failure throw this new type for iostream errors
that raise exceptions. Provide custom type info for the new type so that
it can be caught by handlers for the gcc4-compatible ios::failure type
as well as handlers for ios::failure[abi:cxx11] and its bases.

Backport from mainline
2018-04-10  Jonathan Wakely  <jwakely@redhat.com>

	PR libstdc++/85222
	* src/c++11/Makefile.am [ENABLE_DUAL_ABI]: Add special rules for
	cxx11-ios_failure.cc to rewrite type info for __ios_failure.
	* src/c++11/Makefile.in: Regenerate.
	* src/c++11/cxx11-ios_failure.cc (__ios_failure, __iosfail_type_info):
	New types.
	[_GLIBCXX_USE_DUAL_ABI] (__throw_ios_failure): Define here.
	* src/c++11/ios.cc (__throw_ios_failure): Remove definition.
	(_GLIBCXX_USE_CXX11_ABI): Don't define here.
	* src/c++98/ios_failure.cc (__construct_ios_failure)
	(__destroy_ios_failure, is_ios_failure_handler): New functions.
	[!_GLIBCXX_USE_DUAL_ABI] (__throw_ios_failure): Define here.
	* testsuite/27_io/ios_base/failure/dual_abi.cc: New.
	* testsuite/27_io/basic_ios/copyfmt/char/1.cc: Revert changes to
	handler types, to always catch std::ios_base::failure.
	* testsuite/27_io/basic_ios/exceptions/char/1.cc: Likewise.
	* testsuite/27_io/basic_istream/extractors_arithmetic/char/
	exceptions_failbit.cc: Likewise.
	* testsuite/27_io/basic_istream/extractors_arithmetic/wchar_t/
	exceptions_failbit.cc: Likewise.
	* testsuite/27_io/basic_istream/extractors_other/char/
	exceptions_null.cc: Likewise.
	* testsuite/27_io/basic_istream/extractors_other/wchar_t/
	exceptions_null.cc: Likewise.
	* testsuite/27_io/basic_istream/sentry/char/12297.cc: Likewise.
	* testsuite/27_io/basic_istream/sentry/wchar_t/12297.cc: Likewise.
	* testsuite/27_io/basic_ostream/inserters_other/char/
	exceptions_null.cc: Likewise.
	* testsuite/27_io/basic_ostream/inserters_other/wchar_t/
	exceptions_null.cc: Likewise.
	* testsuite/27_io/ios_base/storage/2.cc: Likewise.

From-SVN: r259352
2018-04-12 20:06:50 +01:00
Sebastian Huber 8b6c3882d1 Ada: Fix s-oscons.ads generation
The $(GNATLIBCFLAGS) are already included in $(GNATLIBCFLAGS_FOR_C).

We must call the C compiler with the right machine flags.  So, add
$(GNATLIBCFLAGS_FOR_C) to $(OSCONS_EXTRACT).  For example, on a bi-arch
compiler supporting 32-bit and 64-bit instruction sets we pick otherwise
only one variant due to a missing -m32 or -m64 flag.

gcc/ada
	* gcc-interface/Makefile.in (OSCONS_CPP): Remove redundant
	$(GNATLIBCFLAGS).
	(OSCONS_EXTRACT): Add $(GNATLIBCFLAGS_FOR_C).

From-SVN: r259343
2018-04-12 11:08:35 +00:00
Andreas Krebbel 7f4f7c91fb IBM Z: Spectre: Prevent thunk cfi to be emitted with -fno-dwarf2-cfi-asm
The CFI magic we emit as part of the indirect branch thunks in order to
have somewhat sane unwind information must not be emitted with
-fno-dwarf2-cfi-asm.

gcc/ChangeLog:

2018-04-12  Andreas Krebbel  <krebbel@linux.vnet.ibm.com>

	Backport from mainline
	2018-04-12  Andreas Krebbel  <krebbel@linux.vnet.ibm.com>

	* config/s390/s390.c (s390_output_indirect_thunk_function): Check
	also for flag_dwarf2_cfi_asm.

gcc/testsuite/ChangeLog:

2018-04-12  Andreas Krebbel  <krebbel@linux.vnet.ibm.com>

	Backport from mainline
	2018-04-12  Andreas Krebbel  <krebbel@linux.vnet.ibm.com>

	* gcc.target/s390/nobp-no-dwarf2-cfi.c: New test.

From-SVN: r259341
2018-04-12 10:20:11 +00:00
GCC Administrator 21082ba981 Daily bump.
From-SVN: r259335
2018-04-12 00:16:10 +00:00
Uros Bizjak de4394a73c alpha.md (stack_probe_internal): Rename from "probe_stack".
* config/alpha/alpha.md (stack_probe_internal): Rename
	from "probe_stack".  Update all callers.

From-SVN: r259329
2018-04-11 20:36:37 +02:00
Thomas Preud'homme 6736006840 [ARM] Fix PR85203: cmse_nonsecure_caller returns wrong result
__builtin_cmse_nonsecure_caller implementation returns true in almost
all cases due to 2 separate bugs:

* gen_addsi is used instead of gen_andsi to retrieve the lsb
* the lsb boolean value is not negated but the specification [1] says
  the intrinsic should return true for a nonsecure caller and a
  nonsecure caller is characterized with LR's lsb being 0

This was not caught due to (1) lack of runtime test and (2) the existing
RTL scan not taking into account that '.' matches newline in Tcl regular
expressions.

This commit fixes the implementation issues and improves testing of
cmse_nonsecure_caller by (1) adding a runtime test for the secure caller
case and (2) looking for an SET insn of an AND expression in the right
function. This leaves the nonsecure caller case only partly tested
since the exact value being AND and the negation are not covered by the
scan and the existing test infrastructure does not allow 2 separate
compilation and link to be performed. It is enough though to catch the
current incorrect behavior.

The commit also reorganize the scan directives in cmse-1.c to more
easily identify what function they are intended to test in the file.

2018-04-11  Thomas Preud'homme  <thomas.preudhomme@arm.com>

    Backport from mainline
    2018-04-04  Thomas Preud'homme  <thomas.preudhomme@arm.com>

    gcc/
    PR target/85203
    * config/arm/arm-builtins.c (arm_expand_builtin): Change
    expansion to perform a bitwise AND of the argument followed by a
    boolean negation of the result.

    gcc/testsuite/
    PR target/85203
    * gcc.target/arm/cmse/cmse-1.c: Tighten cmse_nonsecure_caller RTL scan
    to match a single insn of the baz function.  Move scan directives at
    the end of the file below the functions they are trying to test for
    better readability.
    * gcc.target/arm/cmse/cmse-16.c: New testcase.

From-SVN: r259309
2018-04-11 09:47:21 +00:00
GCC Administrator 7b8cb2f232 Daily bump.
From-SVN: r259306
2018-04-11 00:16:09 +00:00
Thomas Schwinge c51ea89a49 [PR target/85056] Address -Wmaybe-uninitialized diagnostic
gcc/testsuite/
	* gcc.target/nvptx/pr85056.c (main): Initialize "sum".

trunk r259288

From-SVN: r259289
2018-04-10 18:55:43 +02:00
Jason Merrill 6d90490ddb PR c++/85279 - dump_expr doesn't understand decltype.
* error.c (dump_expr): Handle DECLTYPE_TYPE.

From-SVN: r259280
2018-04-10 10:29:52 -04:00
Kyrylo Tkachov f3f1033ca2 [AArch64] PR target/84748: Mark *compare_cstore<mode>_insn as clobbering CC reg
Backport from mainline
	2018-03-08  Kyrylo Tkachov  <kyrylo.tkachov@arm.com>

	PR target/84748
	* config/aarch64/aarch64.md (*compare_cstore<mode>_insn): Mark pattern
	as clobbering CC_REGNUM.

	* gcc.c-torture/execute/pr84748.c: New test.

From-SVN: r259270
2018-04-10 12:59:08 +00:00
GCC Administrator 0b35ecda19 Daily bump.
From-SVN: r259262
2018-04-10 00:16:17 +00:00
GCC Administrator 643f5d1cf9 Daily bump.
From-SVN: r259226
2018-04-09 00:16:23 +00:00
GCC Administrator ee104097e9 Daily bump.
From-SVN: r259214
2018-04-08 00:16:20 +00:00
GCC Administrator 4d6a0466b7 Daily bump.
From-SVN: r259199
2018-04-07 00:16:09 +00:00
Eric Botcazou 13a9fe0d3c re PR middle-end/85196 (ICE in extract_insn, at recog.c:2311: unrecognizable insn)
PR target/85196
	* config/sparc/sparc.c (sparc_expand_move): Deal with symbolic operands
	based on LABEL_REF.  Remove useless assertion.
	(pic_address_needs_scratch): Fix formatting.
	(sparc_legitimize_pic_address): Minor tweaks.
	(sparc_delegitimize_address): Adjust assertion accordingly.
	* config/sparc/sparc.md (movsi_pic_label_ref): Change label_ref_operand
	into symbolic_operand.
	(movsi_high_pic_label_ref): Likewise.
	(movsi_lo_sum_pic_label_ref): Likewise.
	(movdi_pic_label_ref): Likewise.
	(movdi_high_pic_label_ref): Likewise.
	(movdi_lo_sum_pic_label_ref): Likewise.

From-SVN: r259195
2018-04-06 22:32:39 +00:00
Amaan Cheval 54b3f89076 config.gcc (x86_64-*-rtems*): Add rtems.h to tm_file for custom LIB_SPEC setup.
2018-04-06  Amaan Cheval  <amaan.cheval@gmail.com>

	* config.gcc (x86_64-*-rtems*): Add rtems.h to tm_file for
	custom LIB_SPEC setup.

From-SVN: r259191
2018-04-06 20:59:51 +00:00
GCC Administrator 5cf1db4252 Daily bump.
From-SVN: r259158
2018-04-06 00:16:09 +00:00
Uros Bizjak e142425033 re PR target/85193 (ICE: SIGSEGV in memory_operand at recog.c:1361 with -O2 -fno-tree-ccp -fno-tree-fre -mno-sse)
PR target/85193
	* config/i386/i386.md (define_attr "memory"): Handle rotate1 type.

testsuite/ChangeLog:

	PR target/85193
	* gcc.target/i386/pr85193.c: New test.

From-SVN: r259150
2018-04-05 20:43:26 +02:00
Jason Merrill e0f9fc21c0 PR c++/82152 - ICE with class deduction and inherited ctor.
* pt.c (do_class_deduction): Ignore inherited ctors.

From-SVN: r259147
2018-04-05 14:27:49 -04:00
Jason Merrill 754ce5996e PR c++/84665 - ICE with array of empty class.
* decl2.c (cp_check_const_attributes): Use fold_non_dependent_expr.

From-SVN: r259146
2018-04-05 14:27:43 -04:00
Jason Merrill b06634744d PR c++/85006 - -fconcepts ICE with A<auto...> return type
* pt.c (tsubst_pack_expansion): Allow unsubstituted auto pack.

From-SVN: r259145
2018-04-05 14:27:37 -04:00
GCC Administrator f8862cf4dd Daily bump.
From-SVN: r259110
2018-04-05 00:16:09 +00:00
Peter Bergner b65f99bc93 backport: re PR rtl-optimization/84878 (ICE: Segmentation fault (in add_cross_iteration_register_deps))
gcc/
	Backport from mainline
	2018-04-04  Peter Bergner  <bergner@vnet.ibm.com>

	PR rtl-optimization/84878
	* ddg.c (add_cross_iteration_register_deps): Use DF_REF_BB to determine
	the basic block.  Assert the use reference is not artificial and that
	it has an associated insn.

gcc/testsuite/
	Backport from mainline
	2018-04-04  Peter Bergner  <bergner@vnet.ibm.com>

	PR rtl-optimization/84878
	* gcc.target/powerpc/pr84878.c: New test.

From-SVN: r259103
2018-04-04 14:51:32 -05:00
Jason Merrill fdbeab6d5f PR c++/85118 - wrong error with generic lambda and std::bind.
* call.c (add_template_conv_candidate): Disable if there are any
	call operators.

From-SVN: r259094
2018-04-04 12:46:00 -04:00
Jason Merrill dcc462f562 PR c++/85148 - ICE with 'this' in array NSDMI.
* tree.c (replace_placeholders_r): Use handled_component_p.

From-SVN: r259093
2018-04-04 12:45:53 -04:00
GCC Administrator aa84038834 Daily bump.
From-SVN: r259063
2018-04-04 00:16:15 +00:00
Uros Bizjak 3f24bbf3eb i386.c (emit_i387_cw_initialization): Always use logic instructions when changing rounding bits to preserve precision...
* config/i386/i386.c (emit_i387_cw_initialization): Always use logic
	instructions when changing rounding bits to preserve precision bits
	in the x87 control word.

From-SVN: r259055
2018-04-03 22:41:37 +02:00
Jason Merrill 59cd75da14 PR c++/85113 - ICE with constexpr and __builtin_constant_p.
* constexpr.c (cxx_eval_builtin_function_call): Only defer
	__builtin_constant_p if ctx->quiet.

From-SVN: r259053
2018-04-03 15:14:03 -04:00
Jason Merrill cd94b4d825 Fix noexcept merging with system headers.
* typeck.c (merge_types): Limit matching attribute shortcut to
	the default case.

From-SVN: r259048
2018-04-03 13:46:41 -04:00
Jason Merrill 2db525f059 PR c++/64095 - auto... parameter pack.
* parser.c (cp_parser_parameter_declaration): Handle turning autos
	into packs here.
	(cp_parser_parameter_declaration_list): Not here.

From-SVN: r259047
2018-04-03 13:46:35 -04:00
Jason Merrill 487f89d84b PR c++/85060 - wrong-code with call to base member in template.
* search.c (any_dependent_bases_p): Check uses_template_parms
	rather than processing_template_decl.

From-SVN: r259046
2018-04-03 13:46:30 -04:00
Cesar Philippidis 6471d76801 re PR target/85056 ([nvptx] wrong declaration of external arrays)
PR target/85056

	Backport from mainline
	2018-03-27  Cesar Philippidis  <cesar@codesourcery.com>

	PR target/85056

	gcc/
	* config/nvptx/nvptx.c (nvptx_assemble_decl_begin): Add '[]' to
	extern array declarations.

	gcc/testsuite/
	* testsuite/gcc.target/nvptx/pr85056.c: New test.
	* testsuite/gcc.target/nvptx/pr85056a.c: New test.

From-SVN: r259032
2018-04-03 07:04:22 -07:00
GCC Administrator 4ccb16405e Daily bump.
From-SVN: r259023
2018-04-03 00:16:21 +00:00
Peter Bergner dc60246a1b backport: re PR target/84912 (__builtin_divde* produce Internal Compiler Error when compiled -m32)
gcc/
	Backport from mainline
	2018-03-28  Peter Bergner  <bergner@vnet.ibm.com>

	PR target/84912
	* config/rs6000/rs6000.h: Update copyright date.
	(RS6000_BTM_POWERPC64): New define.
	(RS6000_BTM_COMMON): Add RS6000_BTM_POWERPC64.
	* config/rs6000/rs6000.c: Update copyright date.
	(rs6000_builtin_mask_calculate): Add support for RS6000_BTM_POWERPC64.
	(rs6000_invalid_builtin): Add handling for RS6000_BTM_POWERPC64
	(rs6000_builtin_mask_names): Add RS6000_BTM_POWERPC64.
	* config/rs6000/rs6000-builtin.def: Update copyright date.
	(BU_P7_POWERPC64_MISC_2): New macro definition.
	(DIVDE): Use it.
	(DIVDEU): Likewise.

	Backport from mainline
	2018-03-28  Peter Bergner  <bergner@vnet.ibm.com>

	PR target/84912
	* config/rs6000/rs6000-builtin.def (DIVWEO): Delete macro expansion.
	(DIVWEUO): Likewise.
	(DIVDEO): Likewise.
	(DIVDEUO): Likewise.
	* config/rs6000/rs6000.c (builtin_function_type): Remove support for
	DIVWEUO and DIVDEUO.
	* config/rs6000/rs6000.md: Update copyright date.
	(UNSPEC_DIVEO, UNSPEC_DIVEUO): Delete unspecs.
	(UNSPEC_DIV_EXTEND): Remove deleted unspecs.
	(div_extend): Likewise.
	* doc/extend.texi: Update copyright date.
	(__builtin_divweo): Remove documentation for deleted builtin function.
	(__builtin_divweuo): Likewise.
	(__builtin_divdeo): Likewise.
	(__builtin_divdeuo): Likewise.

gcc/testsuite/
	Backport from mainline
	2018-03-28  Peter Bergner  <bergner@vnet.ibm.com>

	PR target/84912
	* gcc.target/powerpc/extend-divide-1.c (div_weo): Remove test for
	deleted builtin function.
	(div_weuo): Likewise.
	* gcc.target/powerpc/extend-divide-2.c (div_deo): Likewise.
	(div_deuo): Likewise.

From-SVN: r259016
2018-04-02 14:19:37 -05:00
Peter Bergner a86a5cadd8 backport: re PR target/81143 (New test case gcc.target/powerpc/pr79799-2.c fails on powerpc BE)
Backport from mainline
	2018-02-08  Peter Bergner  <bergner@vnet.ibm.com>

	PR target/81143
	* gcc.target/powerpc/pr79799-2.c: Use __LITTLE_ENDIAN__.

From-SVN: r259011
2018-04-02 10:24:01 -05:00
Peter Bergner f1cc69541f backport: re PR testsuite/80546 (FAIL: gcc.target/powerpc/bool3-p[78].c scan-assembler-not)
Backport from mainline
	2018-03-30  Peter Bergner  <bergner@vnet.ibm.com>

	PR target/80546
	* config/rs6000/vsx.md (??r): New mode attribute.
	(*vsx_mov<mode>_64bit): Use it.
	(*vsx_mov<mode>_32bit): Likewise.

From-SVN: r259009
2018-04-02 09:35:07 -05:00
H.J. Lu f5508e7126 i386: Enable AVX/AVX512 features only if supported by OSXSAVE
Enable AVX and AVX512 features only if their states are supported by
OSXSAVE.

	Backport from mainline
	PR target/85100
	* config/i386/cpuinfo.c (XCR_XFEATURE_ENABLED_MASK): New.
	(XSTATE_FP): Likewise.
	(XSTATE_SSE): Likewise.
	(XSTATE_YMM): Likewise.
	(XSTATE_OPMASK): Likewise.
	(XSTATE_ZMM): Likewise.
	(XSTATE_HI_ZMM): Likewise.
	(XCR_AVX_ENABLED_MASK): Likewise.
	(XCR_AVX512F_ENABLED_MASK): Likewise.
	(get_available_features): Enable AVX and AVX512 features only
	if their states are supported by OSXSAVE.

From-SVN: r259006
2018-04-02 05:03:16 -07:00
GCC Administrator eef06f4f93 Daily bump.
From-SVN: r259001
2018-04-02 00:16:19 +00:00
GCC Administrator 7e28c873af Daily bump.
From-SVN: r258992
2018-04-01 00:16:09 +00:00
GCC Administrator cbd411033c Daily bump.
From-SVN: r258985
2018-03-31 00:16:10 +00:00
GCC Administrator c053e53d96 Daily bump.
From-SVN: r258969
2018-03-30 00:16:20 +00:00
Sebastian Peryt f98fc31944 re PR c++/84783 (Missing _mm256_permutexvar_epi64() intrinsic for AVX512VL)
2018-03-29  Sebastian Peryt  <sebastian.peryt@intel.com>

	gcc/ChangeLog:
	PR c++/84783
	* config/i386/avx512vlintrin.h (_mm256_permutexvar_epi64)
	(_mm256_permutexvar_epi32, _mm256_permutex_epi64): New intrinsics.

	gcc/testsuite/ChangeLog:
	PR c++/84783

	* gcc.target/i386/avx512vl-vpermd-1.c (_mm256_permutexvar_epi32):
	Test new intrinsic.
	* gcc.target/i386/avx512vl-vpermq-imm-1.c (_mm256_permutex_epi64):
	Ditto.
	* gcc.target/i386/avx512vl-vpermq-var-1.c (_mm256_permutexvar_epi64):
	Ditto.
	* gcc.target/i386/avx512f-vpermd-2.c: Do not check for AVX512F_LEN.
	* gcc.target/i386/avx512f-vpermq-imm-2.c: Ditto.
	* gcc.target/i386/avx512f-vpermq-var-2.c: Ditto.

From-SVN: r258958
2018-03-29 16:51:03 +02:00
Ville Voutilainen 789da6ef2c Implement P0962
Backport from mainline
2018-03-23  Ville Voutilainen  <ville.voutilainen@gmail.com>

	Implement P0962
	* parser.c (cp_parser_perform_range_for_lookup): Change
	the condition for deciding whether to use members.

From-SVN: r258955
2018-03-29 17:07:42 +03:00
Sudakshina Das 1587a6644a [ARM][PR target/84826] Fix ICE in extract_insn, at recog.c:2304 on
arm-linux-gnueabihf

This patch backports r258777 and r258805 to gcc-7-branch
and gcc-6-branch. The same ICE occurs in both the branches with
-fstack-check. Thus the test case directive has been changed.

The discussion on the patch that went into trunk is:
https://gcc.gnu.org/ml/gcc-patches/2018-03/msg01120.html

ChangeLog entries:
    
*** gcc/ChangeLog ***
    
2018-03-29  Sudakshina Das  <sudi.das@arm.com>

	Backport from mainline
	2018-03-22  Sudakshina Das  <sudi.das@arm.com>

	PR target/84826
	* config/arm/arm.h (machine_function): Add static_chain_stack_bytes.
	* config/arm/arm.c (arm_compute_static_chain_stack_bytes): Avoid
	re-computing once computed.
	(arm_expand_prologue): Compute machine->static_chain_stack_bytes.
	(arm_init_machine_status): Initialize
	machine->static_chain_stack_bytes.
    
*** gcc/testsuite/ChangeLog ***
    
2018-03-29  Sudakshina Das  <sudi.das@arm.com>

	* gcc.target/arm/pr84826.c: Change dg-option to -fstack-check.

	Backport from mainline
	2018-03-23  Sudakshina Das  <sudi.das@arm.com>

	PR target/84826
	* gcc.target/arm/pr84826.c: Add dg directive.

	Backport from mainline
	2018-03-22  Sudakshina Das  <sudi.das@arm.com>

	PR target/84826
	* gcc.target/arm/pr84826.c: New test.

From-SVN: r258948
2018-03-29 09:19:45 +00:00
GCC Administrator 60b17aa843 Daily bump.
From-SVN: r258945
2018-03-29 00:16:10 +00:00
Carl Love 2ebdf90a96 crypto-builtin-1-runnable: Add p8vector_hw to dg-do run.
gcc/testsuite/ChangeLog:

2018-03-28  Carl Love  <cel@us.ibm.com>

	* gcc.target/powerpc/crypto-builtin-1-runnable:  Add
	p8vector_hw to dg-do run.

From-SVN: r258937
2018-03-28 20:53:59 +00:00
Thomas Koenig 186778f45f re PR fortran/85084 (ICE: out of memory allocating 18446744073709551600 bytes ...)
2018-03-28  Thomas Koenig  <tkoenig@gcc.gnu.org>

	PR fortran/85084
	Backport from trunk.
	* frontend-passes.c (gfc_run_passes): Do not run front-end
	optimizations if a previous error occurred.

2018-03-28  Thomas Koenig  <tkoenig@gcc.gnu.org>

	PR fortran/85084
	Backport from trunk.
	* gfortran.dg/matmul_rank_1.f90: New test.

From-SVN: r258926
2018-03-28 17:34:08 +00:00
Kyrylo Tkachov 58cde6d46d Fix up ChangeLog date from my previous commit
From-SVN: r258919
2018-03-28 10:40:12 +00:00
Sudakshina Das 661a8af800 [PR81647][AARCH64] Fix handling of Unordered Comparisons in aarch64-simd.md
This is a backport of r258653 and r258672.

ChangeLog Entries:

*** gcc/ChangeLog ***

2018-03-28  Sudakshina Das  <sudi.das@arm.com>

	2018-03-19  Sudakshina Das  <sudi.das@arm.com>
	PR target/81647

	* config/aarch64/aarch64-simd.md (vec_cmp<mode><v_cmp_result>): Modify
	instructions for UNLT, UNLE, UNGT, UNGE, UNEQ, UNORDERED and ORDERED.

*** gcc/testsuite/ChangeLog ***

2018-03-28  Sudakshina Das  <sudi.das@arm.com>
	    Christophe Lyon  <christophe.lyon@linaro.org>

	2018-03-20  Christophe Lyon  <christophe.lyon@linaro.org>

	PR target/81647
	* gcc.target/aarch64/pr81647.c: Require fenv_exceptions.

	2018-03-19  Sudakshina Das  <sudi.das@arm.com>

	PR target/81647
	* gcc.target/aarch64/pr81647.c: New.

Co-Authored-By: Christophe Lyon <christophe.lyon@linaro.org>

From-SVN: r258917
2018-03-28 10:15:47 +00:00
Kyrylo Tkachov f00bed0e60 [arm] PR target/85026: Fix ldrsh length estimate in Thumb state
Backport from mainline
	2018-03-23  Kyrylo Tkachov  <kyrylo.tkachov@arm.com>

	PR target/85026
	* config/arm/arm.md (unaligned_loadhis): Remove first alternative.
	Clean up attributes.

	* g++.dg/pr85026.C: New test.

From-SVN: r258916
2018-03-28 09:20:22 +00:00
GCC Administrator 5c3427ecbe Daily bump.
From-SVN: r258911
2018-03-28 00:16:09 +00:00
Segher Boessenkool e6708d874e rs6000: -mreadonly-in-sdata (PR82411)
This adds a new option -mreadonly-in-sdata (on by default) that
controls whether readonly data can be put in sdata.  (For EABI this
does nothing, readonly data is put in sdata2 as usual).


	Backport from mainline
	2018-03-08  Segher Boessenkool  <segher@kernel.crashing.org>

	PR target/82411
	* config/rs6000/rs6000.c (rs6000_elf_in_small_data_p): Don't put
	readonly data in sdata, if that is disabled.
	* config/rs6000/sysv4.opt (mreadonly-in-sdata): New option.
	* doc/invoke.texi (RS/6000 and PowerPC Options): Document
	-mreadonly-in-sdata option.


	Backport from mainline
	2018-03-08  Segher Boessenkool  <segher@kernel.crashing.org>

	PR target/82411
	* gcc.target/powerpc/ppc-sdata-2.c: Skip if -mno-readonly-in-sdata.

From-SVN: r258907
2018-03-28 01:13:02 +02:00
Sudakshina Das 404879f218 [ARM][PR82989] Fix unexpected use of NEON instructions for shifts
This is a backport of r258677 and r258723 of trunk.

*** gcc/ChangeLog ***

2018-03-27  Sudakshina Das  <sudi.das@arm.com>

	Backport from mainline:
	2018-03-20  Sudakshina Das  <sudi.das@arm.com>

	PR target/82989
	* config/arm/neon.md (ashldi3_neon): Update ?s for constraints
	to favor GPR over NEON registers.
	(<shift>di3_neon): Likewise.

*** gcc/testsuite/ChangeLog ***

2018-03-27  Sudakshina Das  <sudi.das@arm.com>

	Backport from mainline:
	2018-03-20  Sudakshina Das  <sudi.das@arm.com>

	PR target/82989
	* gcc.target/arm/pr82989.c: New test.

	Backport from mainline:
	2018-03-21  Sudakshina Das  <sudi.das@arm.com>

	PR target/82989
	* gcc.target/arm/pr82989.c: Change dg scan-assembly directives.

From-SVN: r258883
2018-03-27 13:26:56 +00:00
Kyrylo Tkachov 308aa0e25a [arm] PR target/82518: Return false in ARRAY_MODE_SUPPORTED_P for BYTES_BIG_ENDIAN
Backport from mainline
	2018-03-20  Kyrylo Tkachov  <kyrylo.tkachov@arm.com>

	PR target/82518
	* config/arm/arm.c (arm_array_mode_supported_p): Return false for
	BYTES_BIG_ENDIAN.

	* lib/target-supports.exp (check_effective_target_vect_load_lanes):
	Disable for armeb targets.
	* gcc.target/arm/pr82518.c: New test.

From-SVN: r258874
2018-03-27 11:19:55 +00:00
GCC Administrator 38c2c4ecb8 Daily bump.
From-SVN: r258868
2018-03-27 00:16:12 +00:00
GCC Administrator da0a8eefd3 Daily bump.
From-SVN: r258848
2018-03-26 00:16:09 +00:00
GCC Administrator 6cf78ba794 Daily bump.
From-SVN: r258837
2018-03-25 00:16:18 +00:00
GCC Administrator 6465f2597b Daily bump.
From-SVN: r258830
2018-03-24 00:16:13 +00:00
Peter Bergner 90d813a415 backport: re PR target/83789 (__builtin_altivec_lvx fails for powerpc for altivec-4.c)
Backport from mainline
	2018-03-20  Peter Bergner  <bergner@vnet.ibm.com>

	PR target/83789
	* config/rs6000/altivec.md (altivec_lvx_<mode>_2op): Delete define_insn.
	(altivec_lvx_<mode>_1op): Likewise.
	(altivec_stvx_<mode>_2op): Likewise.
	(altivec_stvx_<mode>_1op): Likewise.
	(altivec_lvx_<VM2:mode>): New define_expand.
	(altivec_stvx_<VM2:mode>): Likewise.
	(altivec_lvx_<VM2:mode>_2op_<P:mptrsize>): New define_insn.
	(altivec_lvx_<VM2:mode>_1op_<P:mptrsize>): Likewise.
	(altivec_stvx_<VM2:mode>_2op_<P:mptrsize>): Likewise.
	(altivec_stvx_<VM2:mode>_1op_<P:mptrsize>): Likewise.
	* config/rs6000/rs6000.c (altivec_expand_lv_builtin): Likewise.
	(altivec_expand_stv_builtin): Likewise.
	(altivec_expand_builtin): Likewise.
	* config/rs6000/vector.md: Likewise.

From-SVN: r258819
2018-03-23 12:48:58 -05:00
Carl Love beb3bcf419 backport: r6000.c (rtx_is_swappable_p): Add case UNSPEC_VPERMXOR.
gcc/ChangeLog:

2018-03-23  Carl Love  <cel@us.ibm.com>

	Backport from mainline:
	2018-03-14  Carl Love  <cel@us.ibm.com>

	* config/rs6000/r6000.c (rtx_is_swappable_p): Add case UNSPEC_VPERMXOR.

gcc/testsuite/ChangeLog:

2018-03-23  Carl Love  <cel@us.ibm.com>

	* gcc.target/powerpc/crypto-builtin-1-runnable.c: New test file.

From-SVN: r258815
2018-03-23 15:08:28 +00:00
Jason Merrill ece0cfbf67 PR c++/78489 - Substitution in wrong order
PR c++/84489
	* pt.c (type_unification_real): Revert last two changes.

From-SVN: r258814
2018-03-23 10:40:06 -04:00
Jason Merrill ccc923e125 PR c++/71834 - template-id with too few arguments.
* pt.c (coerce_template_parms): Make sure we gave an error.

From-SVN: r258813
2018-03-23 10:40:00 -04:00
Jason Merrill 7301f1f718 PR c++/84937 - ICE with class deduction and auto.
* pt.c (rewrite_template_parm): Fix auto handling.

From-SVN: r258812
2018-03-23 10:39:54 -04:00
Jason Merrill 508d86930b PR c++/80227 - SFINAE and negative array size.
* decl.c (compute_array_index_type): Convert to signed for negative
	check.

From-SVN: r258811
2018-03-23 10:39:47 -04:00
Jason Merrill 8f9c5cac9e PR c++/84839 - ICE with decltype of parameter pack.
* pt.c (tsubst_pack_expansion): Set cp_unevaluated_operand while
	instantiating dummy parms.

From-SVN: r258810
2018-03-23 10:39:36 -04:00
Jason Merrill 9862e7a296 PR c++/84798 - ICE with auto in abstract function declarator.
* parser.c (cp_parser_parameter_declaration_clause): Check
	parser->default_arg_ok_p.

From-SVN: r258809
2018-03-23 10:39:30 -04:00
Jason Merrill d00ef60fb5 PR c++/84355 - ICE with deduction for member class template.
* pt.c (tsubst) [TEMPLATE_TYPE_PARM]: Always substitute into
	CLASS_PLACEHOLDER_TEMPLATE.

From-SVN: r258808
2018-03-23 10:39:25 -04:00
Paolo Carlini ce29952af4 PR c++/82336 - link error with list-init default argument.
* decl.c (check_default_argument): Unshare an initializer list.

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

From-SVN: r258807
2018-03-23 10:39:19 -04:00
GCC Administrator cf066fe583 Daily bump.
From-SVN: r258788
2018-03-23 00:16:15 +00:00
Rainer Orth c8ea68cd43 xfail experimental/memory_resource/resource_adaptor.cc on 32-bit Solaris/x86 (PR libstdc++/77691)
PR libstdc++/77691
	* testsuite/experimental/memory_resource/resource_adaptor.cc:
	xfail execution on 32-bit Solaris/x86.

From-SVN: r258778
2018-03-22 17:42:32 +00:00
Marek Polacek 49f957ecdd PR c++/71638, ICE with NSDMI and reference.
* constexpr.c (cxx_eval_bare_aggregate): Update constructor's flags
	even when we replace an element.

	* g++.dg/cpp0x/nsdmi14.C: New test.
	* g++.dg/cpp1y/nsdmi-aggr10.C: New test.

From-SVN: r258772
2018-03-22 14:18:17 +00:00
Marek Polacek c66866e50f re PR c++/84927 (ICE with NSDMI and reference)
PR c++/84927
	* constexpr.c (cxx_eval_bare_aggregate): Update constructor's flags
	as we evaluate the elements.
	(cxx_eval_constant_expression): Verify constructor's flags
	unconditionally.

From-SVN: r258771
2018-03-22 14:17:03 +00:00
Marek Polacek 3ad015a1b7 re PR c++/84854 (ICE: unexpected expression in cxx_eval_constant_expression, at cp/constexpr.c:4774)
PR c++/84854
	* semantics.c (finish_if_stmt_cond): Check if the type of the condition
	is boolean.

	* g++.dg/cpp1z/constexpr-if13.C: New test.

From-SVN: r258770
2018-03-22 14:14:06 +00:00
Tom de Vries eaf27fcd8f backport "[tail-merge] Don't merge bbs with bb_has_abnormal_pred"
2018-03-22  Tom de Vries  <tom@codesourcery.com>

	backport from trunk:
	2018-03-22  Tom de Vries  <tom@codesourcery.com>

	PR tree-optimization/84956
	* tree-ssa-tail-merge.c (find_clusters_1): Skip bbs with
	bb_has_abnormal_pred.

	* gcc.dg/pr84956.c: New test.

From-SVN: r258759
2018-03-22 10:39:43 +00:00
GCC Administrator 9645746829 Daily bump.
From-SVN: r258753
2018-03-22 00:16:12 +00:00
Steven G. Kargl 7be869fa28 re PR fortran/85001 (ICE in gfc_build_array_type, at fortran/trans-types.c:1420)
2018-03-20  Steven G. Kargl  <kargl@gcc.gnu.org>

	PR fortran/85001
	* interface.c (symbol_rank): Remove bogus null pointer check that
	crept in when translating a ternary operator into an if-else 
	constructor.

2018-03-20  Steven G. Kargl  <kargl@gcc.gnu.org>

	PR fortran/85001
	* gfortran.dg/interface_41.f90: New test.

From-SVN: r258699
2018-03-21 01:26:25 +00:00
GCC Administrator e4a6dfa0eb Daily bump.
From-SVN: r258696
2018-03-21 00:16:10 +00:00
GCC Administrator e4d0d50065 Daily bump.
From-SVN: r258669
2018-03-20 00:16:10 +00:00
Thomas Koenig f95875cc2a re PR fortran/84931 (Expansion of array constructor with constant implied-do-object goes sideways)
2018-03-19  Thomas Koenig  <tkoenig@gcc.gnu.org>

	PR fortran/84931
	Backport from trunk
	* simplify.c (gfc_convert_constant): Correctly handle iterators
	for type conversion.

2018-03-19  Thomas Koenig  <tkoenig@gcc.gnu.org>

	PR fortran/84931
	Backport from trunk
	* gfortran.dg/array_constructor_52.f90: New test.

From-SVN: r258666
2018-03-19 22:03:01 +00:00
Steven G. Kargl 18df884dbf re PR fortran/77414 (ICE in create_function_arglist, at fortran/trans-decl.c:2410)
2018-03-19  Steven G. Kargl  <kargl@gcc.gnu.org>

	PR fortran/77414
	* decl.c (get_proc_name):  Check for a subroutine re-defined in
	the contain portion of a subroutine.  Change language of existing
	error message to better describe the issue. While here fix whitespace
	issues.

2018-03-19  Steven G. Kargl  <kargl@gcc.gnu.org>

	PR fortran/77414
	* gfortran.dg/pr77414.f90: New test.
	* gfortran.dg/internal_references_1.f90: Adjust error message.

From-SVN: r258654
2018-03-19 18:54:29 +00:00
Steven G. Kargl 945ac36cf9 re PR fortran/65453 (ICE in build_function_decl, at fortran/trans-decl.c:2001)
2018-03-19  Steven G. Kargl  <kargl@gcc.gnu.org>

	PR fortran/65453
	* decl.c (get_proc_name): Catch clash between a procedure statement
	and a contained subprogram

2018-03-19  Steven G. Kargl  <kargl@gcc.gnu.org>

	PR fortran/65453
	* gfortran.dg/pr65453.f90: New test.

From-SVN: r258652
2018-03-19 18:36:29 +00:00
H.J. Lu a5d048aefc i386: Don't generate alias for function return thunk
Function return thunks shouldn't be aliased to indirect branch thunks
since indirect branch thunks are placed in COMDAT section and a COMDAT
section with indirect branch may not have function return thunk.  This
patch generates function return thunks directly.

gcc/

	Backport from mainline
	2018-03-15  H.J. Lu  <hongjiu.lu@intel.com>

	PR target/84574
	* config/i386/i386.c (indirect_thunk_needed): Update comments.
	(indirect_thunk_bnd_needed): Likewise.
	(indirect_thunks_used): Likewise.
	(indirect_thunks_bnd_used): Likewise.
	(indirect_return_needed): New.
	(indirect_return_bnd_needed): Likewise.
	(output_indirect_thunk_function): Add a bool argument for
	function return.
	(output_indirect_thunk_function): Don't generate alias for
	function return thunk.
	(ix86_code_end): Call output_indirect_thunk_function to generate
	function return thunks.
	(ix86_output_function_return): Set indirect_return_bnd_needed
	and indirect_return_needed instead of indirect_thunk_bnd_needed
	and indirect_thunk_needed.

gcc/testsuite/

	Backport from mainline
	2018-03-15  H.J. Lu  <hongjiu.lu@intel.com>

	PR target/84574
	* gcc.target/i386/ret-thunk-9.c: Expect __x86_return_thunk
	label instead of __x86_indirect_thunk label.

From-SVN: r258647
2018-03-19 09:52:13 -07:00
GCC Administrator 6390d8ad77 Daily bump.
From-SVN: r258639
2018-03-19 00:16:15 +00:00
GCC Administrator 2faddee74f Daily bump.
From-SVN: r258625
2018-03-18 00:16:11 +00:00
GCC Administrator c867bccb02 Daily bump.
From-SVN: r258616
2018-03-17 00:16:09 +00:00
Steven G. Kargl 16168e8919 Commit ChangeLog entries for revision 258582.
2018-03-15  Steven G. Kargl  <kargl@gcc.gnu.org>

	PR fortran/78741
	* decl.c (get_proc_name):  Check for clash of entry name with
	subroutine name.

2018-03-15  Steven G. Kargl  <kargl@gcc.gnu.org>

	PR fortran/78741
	* gfortran.dg/pr78741.f90: New test.

From-SVN: r258583
2018-03-16 03:30:06 +00:00
Steven G. Kargl 9114a81b8e re PR fortran/78741 (ICE in gfc_get_symbol_decl, at fortran/trans-decl.c:1534)
2018-03-15  Steven G. Kargl  <kargl@gcc.gnu.org>

	PR fortran/78741
	* decl.c (get_proc_name):  Check for clash of entry name with
	subroutine name.

2018-03-15  Steven G. Kargl  <kargl@gcc.gnu.org>

	PR fortran/78741
	* gfortran.dg/pr78741.f90: New test.

From-SVN: r258582
2018-03-16 03:28:08 +00:00
GCC Administrator 8c52c39dd9 Daily bump.
From-SVN: r258578
2018-03-16 00:16:09 +00:00
GCC Administrator a6d4eb1721 Daily bump.
From-SVN: r258545
2018-03-15 00:16:09 +00:00
John David Anglin 5363506db6 re PR target/83451 (FAIL: gfortran.dg/matmul_10.f90 -O3 -fomit-frame-pointer -funroll-loops -fpeel-loops -ftracer -finline-functions (ICE))
PR target/83451
	* config/pa/pa.c (pa_emit_move_sequence):  Always emit secondary reload
	insn for floating-point loads and stores.

From-SVN: r258542
2018-03-14 23:51:06 +00:00
GCC Administrator 7ebfd2ee5b Daily bump.
From-SVN: r258507
2018-03-14 00:16:23 +00:00
Jonathan Wakely 237ee2f8fa PR libstdc++/84769 qualify std::get and std::get_if to avoid ADL
Backport from mainline
2018-03-09  Jonathan Wakely  <jwakely@redhat.com>

	PR libstdc++/84769
	* include/std/variant (get<_Tp, _Types...>, get_if<_Tp, _Types...>):
	Qualify calls to get<_Np, Types...> and get_if<_Np, _Types...>.

From-SVN: r258482
2018-03-13 13:24:36 +00:00
GCC Administrator f0658cde30 Daily bump.
From-SVN: r258473
2018-03-13 00:16:20 +00:00
Jonathan Wakely be7d8f2f9e PR libstdc++/84773 use aligned alloc functions for FreeBSD and MinGW cross-compilers
PR libstdc++/84773
	PR libstdc++/83662
	* crossconfig.m4: Check for aligned_alloc etc. on freebsd and mingw32.
	* configure: Regenerate.
	* include/c_global/cstdlib [_GLIBCXX_HAVE_ALIGNED_ALLOC]
	(aligned_alloc): Add using-declaration.
	* testsuite/18_support/aligned_alloc/aligned_alloc.cc: New test.

From-SVN: r258469
2018-03-12 23:32:30 +00:00
Eric Botcazou 992ce42ee9 re PR ada/82813 (warning: '.builtin_memcpy' writing between 2 and 6 bytes into a region of size 0 overflows the destination [-Wstringop-overflow=])
PR ada/82813
	* gcc-interface/misc.c (gnat_post_options): Disable string overflow
	warnings.

From-SVN: r258467
2018-03-12 22:40:19 +00:00
Jonathan Wakely 158f05a9bd Fix spelling of -mclflushopt in manual
* doc/invoke.texi (-mclflushopt): Fix spelling of option.

From-SVN: r258464
2018-03-12 22:34:08 +00:00
Steven G. Kargl 2f0406b846 re PR fortran/83939 (Constraint C1290 (elemental function cannot be allocatable) not enforced)
2018-03-12  Steven G. Kargl  <kargl@gcc.gnu.org>

	PR fortran/83939
	* resolve.c (resolve_fl_procedure): Enforce F2018:C15100.

2018-03-12  Steven G. Kargl  <kargl@gcc.gnu.org>

	PR fortran/83939
	* gfortran.dg/pr83939.f90

From-SVN: r258456
2018-03-12 18:15:42 +00:00
Richard Sandiford 358f48bfac Don't vectorise zero-step rmw operations (PR 84485)
GCC 6 and 7 would vectorise:

void
f (unsigned long incx, unsigned long incy,
   float *restrict dx, float *restrict dy)
{
  unsigned long ix = 0, iy = 0;
  for (unsigned long i = 0; i < 512; ++i)
    {
      dy[iy] += dx[ix];
      ix += incx;
      iy += incy;
    }
}

without first proving that incy is nonzero.  This is a regression from
GCC 5.  It was fixed on trunk in r256644, which versioned the loop based
on whether incy is zero, but that's obviously too invasive to backport.
This patch instead bails out for possibly-zero steps in the place that
trunk would try a check for zeroness.

Also, the patch makes vect_analyze_data_ref_access check safelen
as well as force_vectorize.

2018-03-12  Richard Sandiford  <richard.sandiford@linaro.org>

gcc/
	PR tree-optimization/84485
	* tree-vect-data-refs.c (vect_analyze_data_ref_dependence): Return
	true for zero dependence distances if the step might be zero,
	and if there is no metadata that guarantees correctness.
	(vect_analyze_data_ref_access): Check safelen as well as
	force_vectorize.

gcc/testsuite/
	PR tree-optimization/84485
	* gcc.dg/vect/pr84485.c: New test.

From-SVN: r258450
2018-03-12 13:50:52 +00:00
GCC Administrator 55cb6a5b1b Daily bump.
From-SVN: r258440
2018-03-12 00:16:10 +00:00
John David Anglin 39341f7793 backport: re PR target/83984 (ld: The value 0x8000000000005 does not fit when applying the relocation DIR21L)
Backport from mainline
	2018-02-14  John David Anglin  <danglin@gcc.gnu.org>

	PR target/83984
	* config/pa/pa.md: Load address of PIC label using the linkage table
	if the label is nonlocal.

From-SVN: r258432
2018-03-11 14:43:39 +00:00
John David Anglin d2b8cea8d7 backport: fptr.c (_dl_read_access_allowed): New.
Backport from mainline
	2018-03-06  John David Anglin  <danglin@gcc.gnu.org>

	* config/pa/fptr.c (_dl_read_access_allowed): New.
	(__canonicalize_funcptr_for_compare): Use it.

From-SVN: r258430
2018-03-11 14:37:40 +00:00
John David Anglin da43f14da3 backport: pa.h (ASM_GENERATE_INTERNAL_LABEL): Revise to use sprint_ul.
Backport from mainline
	2018-03-06  John David Anglin  <danglin@gcc.gnu.org>

	* config/pa/pa.h (ASM_GENERATE_INTERNAL_LABEL): Revise to use
	sprint_ul.
	(ASM_OUTPUT_ADDR_VEC_ELT): Revise for above change.
	(ASM_OUTPUT_ADDR_DIFF_ELT): Likewise.
	* config/pa/pa64-hpux.h (ASM_GENERATE_INTERNAL_LABEL): Revise as above.

From-SVN: r258428
2018-03-11 14:32:16 +00:00
GCC Administrator 6cf7691a62 Daily bump.
From-SVN: r258422
2018-03-11 00:16:14 +00:00
Steven G. Kargl fe1e1848c3 re PR fortran/84734 (Compiling codes with insane array dimensions gives an ICE after r257971)
2018-03-10  Steven G. Kargl  <kargl@gcc.gnu.org>

	PR fortran/84734
	* arith.c (check_result, eval_intrinsic):  If result overflows, pass
	the expression up the chain instead of a NULL pointer.

2018-03-10  Steven G. Kargl  <kargl@gcc.gnu.org>

	PR fortran/84734
	* gfortran.dg/pr84734.f90: New test.

From-SVN: r258417
2018-03-10 18:44:25 +00:00
Eric Botcazou faaab12a7b trans.c (node_has_volatile_full_access): Consider only entities for objects.
* gcc-interface/trans.c (node_has_volatile_full_access) <N_Identifier>:
	Consider only entities for objects.

From-SVN: r258413
2018-03-10 10:15:01 +00:00
Jason Merrill 041bc6e332 PR c++/84785 - ICE with alias template and default targs.
* pt.c (type_unification_real): Set processing_template_decl if
	saw_undeduced == 1.

From-SVN: r258409
2018-03-09 22:35:17 -05:00
GCC Administrator 5dd9a6b9d0 Daily bump.
From-SVN: r258404
2018-03-10 00:16:09 +00:00
Andreas Krebbel 1427e626a8 S/390: libatomic: Fix 16 byte atomic exchange
The compiler builtin will use the hardware instruction cdsg if the
memory operand is properly aligned and will fall back to the
library call otherwise.
In case the compiler for one part is able to detect that the
location is aligned and fails to do so for another usage of the hw
instruction and the sw fall back would be mixed on the same memory
location.  To avoid this the library fall back also has to use the
hardware instruction if possible.

libatomic/ChangeLog:

2018-03-09  Andreas Krebbel  <krebbel@linux.vnet.ibm.com>

	Backport from mainline
	2018-03-09  Andreas Krebbel  <krebbel@linux.vnet.ibm.com>

	* config/s390/exch_n.c: New file.
	* configure.tgt: Add the config directory for s390.

From-SVN: r258385
2018-03-09 12:35:17 +00:00
Kugan Vivekanandarajah 5d90168c8a backport: pr63304_1.c: Remove-mno-fix-cortex-a53-843419.
gcc/testsuite/ChangeLog:

2018-03-09  Kugan Vivekanandarajah  <kuganv@linaro.org>

	Backport from mainline
	2017-09-13  Kugan Vivekanandarajah  <kuganv@linaro.org>

        * gcc.target/aarch64/pr63304_1.c: Remove-mno-fix-cortex-a53-843419.

gcc/ChangeLog:

2018-03-09  Kugan Vivekanandarajah  <kuganv@linaro.org>

	Backport from mainline
	2017-09-13  Kugan Vivekanandarajah  <kuganv@linaro.org>
        * config/aarch64/aarch64.c (aarch64_override_options_after_change_1):
        Disable pc relative literal load irrespective of TARGET_FIX_ERR_A53_84341
        for default.

From-SVN: r258378
2018-03-09 01:55:44 +00:00
GCC Administrator 79a2b5f6c0 Daily bump.
From-SVN: r258373
2018-03-09 00:16:09 +00:00
Steven G. Kargl ed297ea93e re PR fortran/64124 ([F95] Valid constant expr rejected)
2018-03-08  Steven G. Kargl  <kargl@gcc.gnu.org>

	PR fortran/64124
	PR fortran/70409
	* decl.c (gfc_match_char_spec): Try to reduce a charlen to a constant.

2018-03-08  Steven G. Kargl  <kargl@gcc.gnu.org>

	PR fortran/64124
	PR fortran/70409
	* gfortran.dg/pr64124.f90: New tests.
	* gfortran.dg/pr70409.f90: New tests.

From-SVN: r258367
2018-03-08 19:01:23 +00:00
GCC Administrator 672a905ad2 Daily bump.
From-SVN: r258344
2018-03-08 00:16:10 +00:00
Denis Chertykov 24742e9ef9 backport: re PR target/84209 ([avr] Don't split SP in split2)
Backport from mainline
	2018-02-07  Georg-Johann Lay  <avr@gjlay.de>

	PR target/84209
	* config/avr/avr.h (GENERAL_REGNO_P, GENERAL_REG_P): New macros.
	* config/avr/avr.md: Only post-reload split REG-REG moves if
	either register is GENERAL_REG_P.

From-SVN: r258315
2018-03-07 12:13:12 +03:00
Marek Polacek 8526b00e7d re PR c++/84684 (inserting random code / flags produces wrong code)
PR c++/84684
	* constexpr.c (cxx_bind_parameters_in_call): Unshare evaluated
	arguments.

	* g++.dg/cpp1z/constexpr-84684.C: New test.

From-SVN: r258313
2018-03-07 07:50:57 +00:00
GCC Administrator 2042f0c773 Daily bump.
From-SVN: r258308
2018-03-07 00:16:20 +00:00
Carl Love 8641f24ec5 backport: 2/16/18 commit 257748 Carl Love <cel@us.ibm.com>
gcc/ChangeLog
2018-03-06  Carl Love  <cel@us.ibm.com>

	Backport from mainline
	2/16/18  commit 257748  Carl Love  <cel@us.ibm.com>
	 
	* config/rs6000/altivec.h: Remove vec_vextract4b and vec_vinsert4b.
	* config/rs6000/rs6000-builtin.def: Remove macro expansion for
	VINSERT4B_DI and VINSERT4B.
	* config/rs6000/rs6000.c: Remove case statements for
	P9V_BUILTIN_VINSERT4B, P9V_BUILTIN_VINSERT4B_DI,
	and P9V_BUILTIN_VEC_VINSERT4B.
	* config/rs6000/rs6000-c.c (altivec_expand_builtin): Remove entries for
	P9V_BUILTIN_VEC_VEXTRACT4B and P9V_BUILTIN_VEC_VINSERT4B.
	* config/rs6000/vsx.md:  Remove define_expand vinsert4b,
	define_insn *vinsert4b_internal, define_insn "*vinsert4b_di_internal.
	* doc/extend.texi: Remove vec_vextract4b, non ABI definitions for
	vec_insert4b.

gcc/testsuite/ChangeLog
2018-03-06  Carl Love  <cel@us.ibm.com>

	Backport from mainline
	2/16/18  commit 257748  Carl Love  <cel@us.ibm.com>

	* gcc.target/powerpc/p9-vinsert4b-1.c: Remove test file for non-ABI
	tests.
	* gcc.target/powerpc/p9-vinsert4b-2.c: Remove test file for non-ABI
	tests.

From-SVN: r258306
2018-03-06 23:52:59 +00:00
Martin Liska 2f329d15d4 Backport r257932
2018-03-06  Martin Liska  <mliska@suse.cz>

	Backport from mainline
	2018-02-23  Segher Boessenkool  <segher@kernel.crashing.org>

	PR testsuite/80551
	* c-c++-common/tsan/race_on_mutex.c: Change regexp to allow
	__GI___pthread_mutex_init as well.

From-SVN: r258300
2018-03-06 20:07:49 +00:00
Martin Liska 6b8712da43 Backport r257842
2018-03-06  Martin Liska  <mliska@suse.cz>

	Backport from mainline
	2018-02-20  Martin Liska  <mliska@suse.cz>

	PR c/84310
	PR target/79747
	* final.c (shorten_branches): Build align_tab array with one
	more element.
	* opts.c (finish_options): Add alignment option limit check.
	(MAX_CODE_ALIGN): Likewise.
	(MAX_CODE_ALIGN_VALUE): Likewise.
	* doc/invoke.texi: Document maximum allowed option value for
	all -falign-* options.
2018-03-06  Martin Liska  <mliska@suse.cz>

	Backport from mainline
	2018-02-20  Martin Liska  <mliska@suse.cz>

	PR c/84310
	PR target/79747
	* gcc.target/i386/pr84310.c: New test.
	* gcc.target/i386/pr84310-2.c: Likewise.

From-SVN: r258299
2018-03-06 20:07:38 +00:00
Martin Liska abf755ad77 Backport r257803
2018-03-06  Martin Liska  <mliska@suse.cz>

	Backport from mainline
	2018-02-19  Martin Liska  <mliska@suse.cz>

	PR other/80589
	* doc/invoke.texi: Fix typo.
	* params.def (PARAM_MAX_LOOP_HEADER_INSNS): Likewise.

From-SVN: r258298
2018-03-06 20:07:18 +00:00
Martin Liska e97e8a7209 Backport r257384
2018-03-06  Martin Liska  <mliska@suse.cz>

	Backport from mainline
	2018-02-05  Martin Liska  <mliska@suse.cz>

	PR gcov-profile/84137
	* doc/gcov.texi: Fix typo in documentation.

From-SVN: r258297
2018-03-06 20:06:56 +00:00
Martin Liska 2e9ea2795c Backport r257383
2018-03-06  Martin Liska  <mliska@suse.cz>

	Backport from mainline
	2018-02-05  Martin Liska  <mliska@suse.cz>

	PR gcov-profile/83879
	* doc/gcov.texi: Document necessity of --dynamic-list-data when
	using dlopen functionality.

From-SVN: r258296
2018-03-06 20:06:45 +00:00
Martin Liska 71d5ffd3e4 Backport r256989
2018-03-06  Martin Liska  <mliska@suse.cz>

	Backport from mainline
	2018-01-23  Martin Liska  <mliska@suse.cz>

	PR lto/81440
	* lto-symtab.c (lto_symtab_merge): Handle and do not warn about
	trailing arrays at the end of a struct.
2018-03-06  Martin Liska  <mliska@suse.cz>

	Backport from mainline
	2018-01-23  Martin Liska  <mliska@suse.cz>

	PR lto/81440
	* gcc.dg/lto/pr81440.h: New test.
	* gcc.dg/lto/pr81440_0.c: New test.
	* gcc.dg/lto/pr81440_1.c: New test.

From-SVN: r258295
2018-03-06 20:06:29 +00:00
Martin Liska c28d61c1b3 Backport r255818
2018-03-06  Martin Liska  <mliska@suse.cz>

	Backport from mainline
	2017-12-19  Martin Liska  <mliska@suse.cz>

	PR rtl-optimization/82675
	* loop-unroll.c (unroll_loop_constant_iterations): Allocate one
	more element in sbitmap.

From-SVN: r258294
2018-03-06 20:06:10 +00:00
Martin Liska 481a9a3267 Backport r247342
2018-03-06  Martin Liska  <mliska@suse.cz>

	Backport from mainline
	2017-04-27  Martin Liska  <mliska@suse.cz>

	PR testsuite/79455
	* c-c++-common/tsan/race_on_mutex.c: Make the scanned pattern
	more generic.

From-SVN: r258293
2018-03-06 20:05:52 +00:00
Martin Liska c17f25542d Fix IPA profile merging, fixed in trunk with r253910.
2018-03-06  Martin Liska  <mliska@suse.cz>

	Backport from mainline
	2018-03-05  Martin Liska  <mliska@suse.cz>

	* ipa-utils.c (ipa_merge_profiles): Do not merge alias or
	a function without profile.

From-SVN: r258292
2018-03-06 20:05:36 +00:00
Martin Liska 4377de0a9e Backport r257939
2018-03-06  Martin Liska  <mliska@suse.cz>

	Backport from mainline
	2018-02-08  Jan Hubicka  <hubicka@ucw.cz>

	* lto-partition.c (lto_balanced_map): Watch overflow.

From-SVN: r258291
2018-03-06 20:05:06 +00:00
Martin Liska c67174f46a Backport r257877
2018-03-06  Martin Liska  <mliska@suse.cz>

	Backport from mainline
	2018-02-21  Jan Hubicka  <hubicka@ucw.cz>

	PR c/84229
	* ipa-cp.c (determine_versionability): Do not version functions caling
	va_arg_pack.

From-SVN: r258290
2018-03-06 20:04:36 +00:00
Martin Liska 200c8f6535 Backport r257490
2018-03-06  Martin Liska  <mliska@suse.cz>

	Backport from mainline
	2018-02-08  Jan Hubicka  <hubicka@ucw.cz>

	PR ipa/81360
	* cgraph.h (symtab_node::output_to_lto_symbol_table_p): Declare
	* symtab.c: Include builtins.h
	(symtab_node::output_to_lto_symbol_table_p): Move here
	from lto-streamer-out.c:output_symbol_p.
	* lto-streamer-out.c (write_symbol): Turn early exit to assert.
	(output_symbol_p): Move all logic to symtab.c
	(produce_symtab): Update.
2018-03-06  Martin Liska  <mliska@suse.cz>

	Backport from mainline
	2018-02-08  Jan Hubicka  <hubicka@ucw.cz>

	PR ipa/81360
	* lto.c (unify_scc): Register prevailing trees, not trees to be freed.
	(read_cgraph_and_symbols): Use
	symtab_node::output_to_lto_symbol_table_p.

From-SVN: r258289
2018-03-06 20:04:20 +00:00
Martin Liska 89050a7496 Backport r257442
2018-03-06  Martin Liska  <mliska@suse.cz>

	Backport from mainline
	2018-01-30  Jan Hubicka  <hubicka@ucw.cz>

	* lto.c (register_resolution): Remove forgotten sanity check.

From-SVN: r258288
2018-03-06 20:02:46 +00:00
Martin Liska 072663b146 Backport r257412
2018-03-06  Martin Liska  <mliska@suse.cz>

	Backport from mainline
	2018-01-30  Jan Hubicka  <hubicka@ucw.cz>

	PR lto/81004
	* lto.c: Include builtins.h
	(register_resolution): Merge resolutions in case trees was
	merged across units.
	(lto_maybe_register_decl): Break out from ...
	(lto_read_decls): ... here.
	(unify_scc): Also register decls here.
	(read_cgraph_and_symbols): Sanity check that all resolutions was
	read.

From-SVN: r258287
2018-03-06 20:02:22 +00:00
Martin Liska 0d3d9bfd05 Backport r257343
2018-03-06  Martin Liska  <mliska@suse.cz>

	Backport from mainline
	2018-02-02  Eric Botcazou  <ebotcazou@adacore.com>

	PR lto/83954
	* lto-symtab.c (warn_type_compatibility_p): Do not recurse into the
	component type of array types with non-aliased component.

From-SVN: r258286
2018-03-06 20:02:03 +00:00
Martin Liska e86ed8ec44 Backport r257183
2018-03-06  Martin Liska  <mliska@suse.cz>

	Backport from mainline
	2018-01-30  Jan Hubicka  <hubicka@ucw.cz>

	PR lto/83954
	* lto-symtab.c (warn_type_compatibility_p): Silence false positive
	for type match warning on arrays of pointers.
2018-03-06  Martin Liska  <mliska@suse.cz>

	Backport from mainline
	2018-01-30  Jan Hubicka  <hubicka@ucw.cz>

	PR lto/83954
	* gcc.dg/lto/pr83954.h: New testcase.
	* gcc.dg/lto/pr83954_0.c: New testcase.
	* gcc.dg/lto/pr83954_1.c: New testcase.

From-SVN: r258285
2018-03-06 20:01:44 +00:00
Martin Liska cbac8410bc Backport r253729
2018-03-06  Martin Liska  <mliska@suse.cz>

	Backport from mainline
	2017-10-13  Jan Hubicka  <hubicka@ucw.cz>

	* lto-lang.c (lto_post_options): Clean shlib flag when not doing PIC.

From-SVN: r258284
2018-03-06 20:00:48 +00:00
Steven G. Kargl ac3f35daf8 re PR fortran/56667 (Syntax error causes misleading message: "Expected PARAMETER symbol in complex constant")
2018-03-06  Steven G. Kargl  <kargl@gcc.gnu.org>

	PR fortran/56667
	* primary.c (match_sym_complex_part): Give the matcher for an implied
	do-loop a chance to run.

2018-03-06  Steven G. Kargl  <kargl@gcc.gnu.org>

	PR fortran/56667
	* gfortran.dg/implied_do_2.f90: New test.
	* gfortran.dg/coarray_8.f90: Update for new error message.

From-SVN: r258282
2018-03-06 19:27:48 +00:00
Peter Bergner 936b7b3e22 backport: re PR target/81572 (gcc-7 regression: unnecessary vector regmove on compare)
gcc/
	Backport from mainline
	2018-02-22  Vladimir Makarov  <vmakarov@redhat.com>

	PR target/81572
	* lra-int.h (LRA_UNKNOWN_ALT, LRA_NON_CLOBBERED_ALT): New macros.
	* lra.c (lra_set_insn_recog_data, lra_update_insn_recog_data): Use
	LRA_UNKNOWN_ALT.
	* lra-constraints.c (curr_insn_transform): Set up
	LRA_NON_CLOBBERED_ALT for moves processed on the fast path.  Use
	LRA_UNKNOWN_ALT.
	(remove_inheritance_pseudos): Use LRA_UNKNOWN_ALT.
	* lra-eliminations.c (spill_pseudos): Ditto.
	(process_insn_for_elimination): Ditto.
	* lra-lives.c (reg_early_clobber_p): Use the new macros.
	* lra-spills.c (spill_pseudos): Use LRA_UNKNOWN_ALT and
	LRA_NON_CLOBBERED_ALT.

gcc/testsuite/
	Backport from mainline
	2018-02-22  Vladimir Makarov  <vmakarov@redhat.com>

	PR target/81572
	* gcc.target/powerpc/pr81572.c: New.

From-SVN: r258280
2018-03-06 09:54:30 -06:00
Eric Botcazou 3be21a8619 trans.c (convert_with_check): Fix typo in the condition guarding the overflow check emitted for the upper...
* gcc-interface/trans.c (convert_with_check): Fix typo in the condition
	guarding the overflow check emitted for the upper bound of a floating-
	point conversion.

From-SVN: r258278
2018-03-06 12:21:41 +00:00
Richard Biener 945732c434 backport: [multiple changes]
2018-03-06  Richard Biener  <rguenther@suse.de>

	Backport from mainline
	2018-03-05  Richard Biener  <rguenther@suse.de>

	PR tree-optimization/84486
	* tree-ssa-pre.c (create_expression_by_pieces): Remove dead code.
	When inserting a __builtin_assume_aligned call set the LHS
	SSA name alignment info accordingly.

	2018-02-28  Richard Biener  <rguenther@suse.de>

	PR middle-end/84607
	* genmatch.c (capture_info::walk_match): Do not mark
	captured expressions without operands as expr_p given
	they act more like predicates and should be subject to
	"lost tail" side-effect preserving.

	* gcc.dg/pr84607.c: New testcase.

From-SVN: r258274
2018-03-06 10:01:52 +00:00
GCC Administrator 88f1a5c3e6 Daily bump.
From-SVN: r258266
2018-03-06 00:16:19 +00:00
Will Schmidt 6d70521e76 backport: re PR target/84371 (test case gcc.target/powerpc/builtins-3.c fails on power9)
2018-03-05  Will Schmidt  <will_schmidt@vnet.ibm.com>

	Backport from trunk.

	2018-02-16  Will Schmidt  <will_schmidt@vnet.ibm.com>

	PR target/84371
	* gcc.target/powerpc/builtins-3.c: Update dg-options and dg-skip-if
	stanzas.
	* gcc.target/powerpc/builtins-3.p8.c: Add dg-skip-if stanza.
	* gcc.target/powerpc/builtins-3.p9.c: Add dg-skip-if stanza.

From-SVN: r258257
2018-03-05 17:11:16 +00:00
Jakub Jelinek 2465bbe214 re PR target/84524 (-O3 causes behavior change)
PR target/84524
	* config/i386/sse.md (*<code><mode>3): Replace <mask_prefix3> with
	orig,vex.
	(*<plusminus_insn><mode>3): Likewise.  Remove <mask_operand3> uses.

	* gcc.c-torture/execute/pr84524.c: New test.
	* gcc.target/i386/avx512bw-pr84524.c: New test.

From-SVN: r258253
2018-03-05 17:09:49 +01:00
Jason Merrill f2d6e2b42d PR c++/84686 - missing volatile loads.
* cvt.c (convert_to_void): Call maybe_undo_parenthesized_ref.

From-SVN: r258245
2018-03-05 09:28:07 -05:00
GCC Administrator 09bac2abc5 Daily bump.
From-SVN: r258237
2018-03-05 00:16:09 +00:00
Paul Thomas 8bc0bee23a re PR fortran/83076 (ICE in gfc_deallocate_scalar_with_status, at fortran/trans.c:1598)
2018-03-04  Paul Thomas  <pault@gcc.gnu.org>

	PR fortran/83076
	* resolve.c (resolve_fl_derived0): Add caf_token fields for
	allocatable and pointer scalars, when -fcoarray selected.
	* trans-types.c (gfc_copy_dt_decls_ifequal): Copy the token
	field as well as the backend_decl.
	(gfc_get_derived_type): Flag GFC_FCOARRAY_LIB for module
	derived types that are not vtypes. Components with caf_token
	attribute are pvoid types. For a component requiring it, find
	the caf_token field and have the component token field point to
	its backend_decl.

	PR fortran/83319
	*trans-types.c (gfc_get_array_descriptor_base): Add the token
	field to the descriptor even when codimen not set.


2018-03-04  Paul Thomas  <pault@gcc.gnu.org>

	PR fortran/83076
	* gfortran.dg/coarray_45.f90 : New test.

	PR fortran/83319
	* gfortran.dg/coarray_46.f90 : New test.

From-SVN: r258233
2018-03-04 13:56:09 +00:00
Harald Anlauf 46a0e42a7d re PR fortran/71085 (ICE with some intrinsic functions specifying array function result dimension)
2018-03-03  Harald Anlauf  <anlauf@gmx.de>

	PR fortran/71085
	* trans-expr.c (gfc_apply_interface_mapping_to_expr): Do not
	dereference NULL pointer.


2018-03-03  Harald Anlauf  <anlauf@gmx.de>

	PR fortran/71085
	* gfortran.dg/pr71085.f90: New test.

From-SVN: r258229
2018-03-04 01:52:24 +00:00
GCC Administrator 48560a9dfe Daily bump.
From-SVN: r258226
2018-03-04 00:16:10 +00:00
Steven G. Kargl a563d19561 re PR fortran/51434 (ICE with scalar init of an array parameter, used in DT default init with transfer)
2018-03-03  Steven G. Kargl  <kargl@gcc.gnu.org>

	PR fortran/51434
	* simplify.c (gfc_simplify_transfer): Resolve mold.

2018-03-03  Steven G. Kargl  <kargl@gcc.gnu.org>

	PR fortran/51434
	* gfortran.dg/pr51434.f90: New test.

From-SVN: r258222
2018-03-03 19:02:28 +00:00
Paul Thomas 791881a329 re PR fortran/80965 (ICE with class argument and -O2 optimization)
2018-03-03  Paul Thomas  <pault@gcc.gnu.org>

	PR fortran/80965
	* resolve.c (build_loc_call): Change symtree name from 'loc' to
	'_loc'.

2018-03-03  Paul Thomas  <pault@gcc.gnu.org>

	PR fortran/80965
	* gfortran.dg/select_type_41.f90: New test.

From-SVN: r258213
2018-03-03 16:33:17 +00:00
Paul Thomas e45fa8dd0e re PR fortran/78990 (ICE when assigning polymorphic array function result)
2018-03-03  Paul Thomas  <pault@gcc.gnu.org>

	PR fortran/78990
	* expr.c (gfc_is_class_array_function): Renamed from
	'gfc_is_alloc_class_array_function' and modified to return true
	for pointers as well as allocatable results.
	* gfortran.h : Change of name for prototype of above function.
	* trans-array.c (gfc_add_loop_ss_code): Force finalization of
	class array results.
	(build_class_array_ref): Change assertion into a condition.
	(build_class_array_ref): Set the se class_vptr for class array
	function results.
	(gfc_walk_function_expr): Reference gfc_is_class_array_function
	as above.
	* trans-decl.c (get_proc_result): Move it up before
	gfc_trans_deferred_vars.
	(gfc_trans_deferred_vars): Nullify explicit return class arrays
	on entry.
	* trans-expr.c (gfc_conv_class_to_class): Allow conversion of
	class array functions that have an se class_vptr and use it
	for the result vptr.
	(gfc_conv_subref_array_arg): Rename reference to the above
	function.
	(gfc_conv_procedure_call): Ditto. Add the se pre block to the
	loop pre block before the function is evaluated. Do not
	finalize class pointer results.
	(arrayfunc_assign_needs_temporary, gfc_trans_assignment_1) More
	renamed references.
	* trans-intrinsic.c (gfc_conv_intrinsic_size): Ditto.

2018-03-03  Paul Thomas  <pault@gcc.gnu.org>

	PR fortran/78990
	* gfortran.dg/class_67.f90: New test.

From-SVN: r258212
2018-03-03 16:26:49 +00:00
Jakub Jelinek a903e07c1f backport: re PR ipa/84628 (attribute(warning/error) functions should not be merged together)
Backported from mainline
	2018-03-02  Jakub Jelinek  <jakub@redhat.com>
		    Richard Biener  <rguenther@suse.de>

	PR ipa/84628
	* expr.c (expand_expr_real_1) <case CALL_EXPR>: Don't emit diagnostics
	for error or warning attributes if CALL_FROM_THUNK_P is set.
	Formatting fixes.

	* gcc.dg/pr84628.c: New test.

From-SVN: r258208
2018-03-03 14:43:30 +01:00
Jakub Jelinek cd421ffd10 backport: re PR inline-asm/84625 (ICE with empty constraint and vector constant)
Backported from mainline
	2018-03-02  Jakub Jelinek  <jakub@redhat.com>

	PR inline-asm/84625
	* config/i386/i386.c (ix86_print_operand): Use conditional
	output_operand_lossage instead of gcc_assert if CONST_VECTOR is not
	zero vector.

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

From-SVN: r258207
2018-03-03 14:42:40 +01:00
Jakub Jelinek 01cb1e60a5 backport: re PR sanitizer/70875 (ICE in get_ubsan_type_info_for_type with -fsanitize=undefined)
Backported from mainline
	2018-03-02  Jakub Jelinek  <jakub@redhat.com>

	PR sanitizer/70875
	* gcc.dg/ubsan/bounds-3.c: Add -fno-sanitize-recover=bounds to
	dg-options and dg-shouldfail "ubsan" directive.

From-SVN: r258206
2018-03-03 14:41:52 +01:00
Jakub Jelinek 22e23fdda7 backport: re PR c++/84558 (ICE with invalid constexpr constructor)
Backported from mainline
	2018-02-26  Jakub Jelinek  <jakub@redhat.com>

	PR c++/84558
	* constexpr.c (cxx_eval_vec_init_1): For reuse, treat NULL eltinit like
	a valid constant initializer.  Formatting fixes.

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

From-SVN: r258205
2018-03-03 14:41:20 +01:00
Jakub Jelinek 68f2615df8 backport: re PR c++/84557 (ICE with invalid firstprivate variable)
Backported from mainline
	2018-02-26  Jakub Jelinek  <jakub@redhat.com>

	PR c++/84557
	* parser.c (cp_parser_omp_var_list_no_open): Only call
	cp_parser_lookup_name_simple on names satisfying identifier_p.
	(cp_parser_oacc_routine): Likewise.

	* g++.dg/gomp/pr84557.C: New test.

From-SVN: r258204
2018-03-03 14:40:39 +01:00
Jakub Jelinek 13a90dc4b9 backport: re PR c++/84556 (C++17, lambda, OpenMP simd: sorry, unimplemented: unexpected AST)
Backported from mainline
	2018-02-26  Jakub Jelinek  <jakub@redhat.com>

	PR c++/84556
	* g++.dg/gomp/pr84556.C: New test.
	* g++.dg/vect/pr84556.cc: New test.

From-SVN: r258203
2018-03-03 14:39:52 +01:00
Jakub Jelinek abf608a6cc backport: ipa-prop.c (ipa_vr_ggc_hash_traits::hash): Hash p->min and p->max as pointers rather than using iterative_hash_expr.
Backported from mainline
	2018-02-23  Jakub Jelinek  <jakub@redhat.com>

	* ipa-prop.c (ipa_vr_ggc_hash_traits::hash): Hash p->min and
	p->max as pointers rather than using iterative_hash_expr.

From-SVN: r258202
2018-03-03 14:39:18 +01:00
Jakub Jelinek 9196e777ac backport: re PR tree-optimization/84503 (store-merging miscompilation on powerpc64 with -O3 since r241789)
Backported from mainline
	2018-02-22  Jakub Jelinek  <jakub@redhat.com>

	PR tree-optimization/84503
	* gcc.dg/pr84503-1.c: New test.
	* gcc.dg/pr84503-2.c: New test.

	2017-11-10  Jakub Jelinek  <jakub@redhat.com>

	PR bootstrap/82916
	* gimple-ssa-store-merging.c
	(pass_store_merging::terminate_all_aliasing_chains): For
	gimple_store_p stmts also call refs_output_dependent_p.

	* gcc.dg/pr82916.c: New test.

From-SVN: r258201
2018-03-03 14:38:48 +01:00
Jakub Jelinek 1a9f6a3756 backport: re PR c++/84445 (ICE with __builtin_launder and virtual function)
Backported from mainline
	2018-02-20  Jakub Jelinek  <jakub@redhat.com>

	PR c++/84445
	* class.c (fixed_type_or_null) <case CALL_EXPR>: Only test
	TREE_HAS_CONSTRUCTOR if instance is not an internal function call.

	* g++.dg/cpp1z/launder7.C: New test.

From-SVN: r258200
2018-03-03 14:37:47 +01:00
Jakub Jelinek 1f6acb1861 backport: re PR c++/84449 (ICE with constexpr and deleted destructor)
Backported from mainline
	2018-02-20  Jakub Jelinek  <jakub@redhat.com>

	PR c++/84449
	* tree.c (bot_manip): If build_cplus_new or break_out_target_exprs
	returns error_mark_node, return it immediately.
	(break_out_target_exprs): If cp_walk_tree with bot_manip returns
	error_mark_node, return error_mark_node.

	* g++.dg/cpp0x/constexpr-84449.C: New test.

From-SVN: r258199
2018-03-03 14:37:05 +01:00
Jakub Jelinek 8043a9baa1 backport: re PR c++/84444 (ICE with __builtin_launder and cast)
Backported from mainline
	2018-02-19  Jakub Jelinek  <jakub@redhat.com>

	PR c++/84444
	* builtins.c (builtin_mathfn_code): Don't check if CALL_EXPR_FN (t)
	is ADDR_EXPR.

	* g++.dg/cpp1z/launder8.C: New test.

From-SVN: r258198
2018-03-03 14:36:20 +01:00
Jakub Jelinek fb24b1a32e backport: re PR c++/84448 (ICE with broken condition in parallel for loop)
Backported from mainline
	2018-02-19  Jakub Jelinek  <jakub@redhat.com>

	PR c++/84448
	* parser.c (cp_parser_binary_expression): For no_toplevel_fold_p, if
	either operand is error_mark_node, set current.lhs to that instead of
	creating a binary op with error_mark_node operands.

	* g++.dg/gomp/pr84448.C: New test.

From-SVN: r258197
2018-03-03 14:35:37 +01:00
Jakub Jelinek d3422478e5 backport: re PR c++/84430 (ICE with #pragma omp simd in lambda)
Backported from mainline
	2018-02-19  Jakub Jelinek  <jakub@redhat.com>

	PR c++/84430
	* constexpr.c (potential_constant_expression_1): Handle OMP_SIMD.

	* g++.dg/gomp/pr84430.C: New test.

From-SVN: r258196
2018-03-03 14:34:48 +01:00
Jakub Jelinek 718b8a4c89 backport: re PR ipa/84425 (Hang in ipa-inline.c starting with r250048)
Backported from mainline
	2018-02-16  Jakub Jelinek  <jakub@redhat.com>

	PR ipa/84425
	* ipa-inline.c (inline_small_functions): Fix a typo.

	* gcc.c-torture/compile/pr84425.c: New test.

From-SVN: r258194
2018-03-03 14:34:07 +01:00
Jakub Jelinek aa2bcdb761 backport: re PR fortran/84418 (ICE with fortran OpenMP linear (ref ()) clause)
Backported from mainline
	2018-02-16  Jakub Jelinek  <jakub@redhat.com>

	PR fortran/84418
	* trans-openmp.c (gfc_trans_omp_clauses): For OMP_CLAUSE_LINEAR_REF
	kind set OMP_CLAUSE_LINEAR_STEP to TYPE_SIZE_UNIT times last_step.

	* libgomp.fortran/pr84418-1.f90: New test.
	* libgomp.fortran/pr84418-2.f90: New test.

From-SVN: r258193
2018-03-03 14:33:26 +01:00
Jakub Jelinek f2fc871ec1 backport: re PR c++/84192 (ICE with statement expression)
Backported from mainline
	2018-02-16  Marek Polacek  <polacek@redhat.com>
		    Jakub Jelinek  <jakub@redhat.com>

	PR c++/84192
	* constexpr.c (cxx_eval_constant_expression) <case RETURN_EXPR>: Don't
	set *jump_target to anything if jump_target is NULL.

	* g++.dg/cpp1y/constexpr-84192.C: New test.

From-SVN: r258192
2018-03-03 14:32:26 +01:00
Jakub Jelinek d5c2f74410 backport: re PR c/82210 (Having _Alignas in a struct with VLAs causes writing to one array to overwrite another)
Backported from mainline
	2018-02-13  Jakub Jelinek  <jakub@redhat.com>

	PR c/82210
	* stor-layout.c (place_field): For variable length fields, adjust
	offset_align afterwards not just based on the field's alignment,
	but also on the size.

	* gcc.c-torture/execute/pr82210.c: New test.

From-SVN: r258191
2018-03-03 14:31:38 +01:00
Jakub Jelinek 9a1a9fe88b backport: re PR c++/84341 (ICE with #pragma omp atomic)
Backported from mainline
	2018-02-12  Jakub Jelinek  <jakub@redhat.com>

	PR c++/84341
	* parser.c (cp_parser_binary_expression): Use build_min instead of
	build2_loc to build the no_toplevel_fold_p toplevel binary expression.

	* c-c++-common/gomp/pr84341.c: New test.

From-SVN: r258190
2018-03-03 14:30:57 +01:00
Jakub Jelinek 123fadd720 backport: re PR sanitizer/83987 (ICE with OpenMP, sanitizer and virtual bases)
Backported from mainline
	2018-02-10  Jakub Jelinek  <jakub@redhat.com>

	PR sanitizer/83987
	* omp-low.c (maybe_remove_omp_member_access_dummy_vars,
	remove_member_access_dummy_vars): New functions.
	(lower_omp_for, lower_omp_taskreg, lower_omp_target,
	lower_omp_1, execute_lower_omp): Use them.

	* tree.c (cp_free_lang_data): Revert 2018-01-23 change.

	* g++.dg/ubsan/pr83987-2.C: New test.

From-SVN: r258189
2018-03-03 14:29:52 +01:00
Jakub Jelinek 3f7dace1eb backport: re PR rtl-optimization/84308 (Memory leak in spread_components)
Backported from mainline
	2018-02-10  Jakub Jelinek  <jakub@redhat.com>

	PR rtl-optimization/84308
	* shrink-wrap.c (spread_components): Release todo vector.

From-SVN: r258188
2018-03-03 14:28:43 +01:00
Jakub Jelinek ec35c867d9 backport: re PR sanitizer/84285 (Fail to statically link with -fsanitize=undefined)
Backported from mainline
	2018-02-09  Jakub Jelinek  <jakub@redhat.com>

	PR sanitizer/84285
	* gcc.c (STATIC_LIBASAN_LIBS, STATIC_LIBTSAN_LIBS,
	STATIC_LIBLSAN_LIBS, STATIC_LIBUBSAN_LIBS): Handle -static like
	-static-lib*san.

From-SVN: r258187
2018-03-03 14:28:15 +01:00
Jakub Jelinek 9ee0e809cd backport: re PR c++/83659 (ICE on compilable C++ code: in tree_to_shwi, at tree.c:6821)
Backported from mainline
	2018-02-09  Marek Polacek  <polacek@redhat.com>
		    Jakub Jelinek  <jakub@redhat.com>

	PR c++/83659
	* fold-const.c (fold_indirect_ref_1): Use VECTOR_TYPE_P macro.
	Formatting fixes.  Verify first that tree_fits_shwi_p (op01).
	Sync some changes from cxx_fold_indirect_ref.

	* constexpr.c (cxx_fold_indirect_ref): Sync some changes from
	fold_indirect_ref_1.  Verify first that tree_fits_shwi_p (op01).
	Formatting fixes.

	* g++.dg/torture/pr83659.C: New test.

From-SVN: r258186
2018-03-03 14:27:47 +01:00
Jakub Jelinek 09d82b553c backport: re PR c++/84082 (ICE with broken template function definition)
Backported from mainline
	2018-02-07  Jakub Jelinek  <jakub@redhat.com>

	PR c++/84082
	* parser.c (cp_parser_dot_deref_incomplete): New function.
	(cp_parser_postfix_dot_deref_expression): Use it.

	* g++.dg/template/incomplete11.C: New test.
	* g++.dg/parse/crash67.C: Expect an incomplete type diagnostics too.

From-SVN: r258185
2018-03-03 14:26:52 +01:00
Jakub Jelinek b372012e11 backport: tree-eh.c (operation_could_trap_helper_p): Ignore honor_trapv for *DIV_EXPR and *MOD_EXPR.
Backported from mainline
	2018-02-07  Jakub Jelinek  <jakub@redhat.com>

	* tree-eh.c (operation_could_trap_helper_p): Ignore honor_trapv for
	*DIV_EXPR and *MOD_EXPR.

From-SVN: r258184
2018-03-03 14:25:59 +01:00
Jakub Jelinek 9575487b6c backport: re PR tree-optimization/81661 (ICE in gimplify_modify_expr, at gimplify.c:5638)
Backported from mainline
	2018-02-01  Jakub Jelinek  <jakub@redhat.com>

	PR tree-optimization/81661
	PR tree-optimization/84117
	* tree-eh.h (rewrite_to_non_trapping_overflow): Declare.
	* tree-eh.c: Include gimplify.h.
	(find_trapping_overflow, replace_trapping_overflow,
	rewrite_to_non_trapping_overflow): New functions.
	* tree-vect-loop.c: Include tree-eh.h.
	(vect_get_loop_niters): Use rewrite_to_non_trapping_overflow.

	* gcc.dg/pr81661.c: New test.
	* gfortran.dg/pr84117.f90: New test.

From-SVN: r258183
2018-03-03 14:25:27 +01:00
Jakub Jelinek e91f3c250e backport: re PR fortran/84116 (ICE in gfc_match_omp_clauses, at fortran/openmp.c:1354)
Backported from mainline
	2018-01-31  Jakub Jelinek  <jakub@redhat.com>

	PR fortran/84116
	* openmp.c (gfc_match_omp_clauses): If all the linear
	gfc_match_omp_variable_list calls failed, don't gfc_free_omp_namelist
	nor set *head = NULL.  Formatting fixes.

	* gfortran.dg/gomp/pr84116.f90: New test.

From-SVN: r258182
2018-03-03 14:24:36 +01:00
Jakub Jelinek fd681b4e04 backport: re PR c++/83993 (ICE: constant not recomputed when ADDR_EXPR changed)
Backported from mainline
	2018-01-31  Jason Merrill  <jason@redhat.com>
		    Jakub Jelinek  <jakub@redhat.com>

	PR c++/83993
	* constexpr.c (cxx_eval_outermost_constant_expr): Build NOP_EXPR
	around non-constant ADDR_EXPRs rather than clearing TREE_CONSTANT
	on ADDR_EXPR.

	* g++.dg/init/pr83993-2.C: New test.

From-SVN: r258181
2018-03-03 14:23:43 +01:00
Jakub Jelinek fb50692f4e backport: re PR preprocessor/69869 (internal compiler error: Segmentation fault in call to skip_macro_block_comment when using '-traditional-cpp')
Backported from mainline
	2018-01-31  Jakub Jelinek  <jakub@redhat.com>

	PR preprocessor/69869
	* traditional.c (skip_macro_block_comment): Return bool, true if
	the macro block comment is unterminated.
	(copy_comment): Use return value from skip_macro_block_comment instead
	of always false.

	* gcc.dg/cpp/trad/pr69869.c: New test.

From-SVN: r258180
2018-03-03 14:22:45 +01:00
Jakub Jelinek defdca27d5 backport: re PR target/83986 (ICE in maybe_record_trace_start, at dwarf2cfi.c:2348)
Backported from mainline
	2018-01-30  Jakub Jelinek  <jakub@redhat.com>

	PR rtl-optimization/83986
	* sched-deps.c (sched_analyze_insn): For frame related insns, add anti
	dependence against last_pending_memory_flush in addition to
	pending_jump_insns.

	* gcc.dg/pr83986.c: New test.

From-SVN: r258179
2018-03-03 14:21:58 +01:00
Jakub Jelinek 1997793639 backport: re PR libgomp/84096 (Wrong prototype for omp_init_nest_lock_with_hint() in "omp.h.in")
Backported from mainline
	2018-01-29  Christoph Spiel  <cspiel@freenet.de>
		    Jakub Jelinek  <jakub@redhat.com>

	PR libgomp/84096
	* omp.h.in (omp_init_nest_lock_with_hint): Use omp_nest_lock_t
	instead of omp_lock_t.

From-SVN: r258178
2018-03-03 14:21:10 +01:00
Jakub Jelinek 6f4f0d1f60 backport: re PR middle-end/84040 (compilation time of gcc.c-torture/compile/limits-blockid.c is 50x slower)
Backported from mainline
	2018-01-27  Jakub Jelinek  <jakub@redhat.com>

	PR middle-end/84040
	* sched-deps.c (sched_macro_fuse_insns): Return immediately if
	!insn_set.

From-SVN: r258177
2018-03-03 14:20:42 +01:00
Jakub Jelinek b22f1568ea backport: c-cppbuiltin.c (c_cpp_builtins): Use ggc_strdup for the fp_suffix argument.
Backported from mainline
	2018-01-27  Jakub Jelinek  <jakub@redhat.com>

	* c-cppbuiltin.c (c_cpp_builtins): Use ggc_strdup for the fp_suffix
	argument.
	(LAZY_HEX_FP_VALUES_CNT): Define.
	(lazy_hex_fp_values): Allow up to LAZY_HEX_FP_VALUES_CNT lazy hex fp
	values rather than just 12.
	(builtin_define_with_hex_fp_value): Likewise.

	* include/cpplib.h (enum cpp_builtin_type): Change BT_LAST_USER from
	BT_FIRST_USER + 31 to BT_FIRST_USER + 63.

From-SVN: r258176
2018-03-03 14:20:13 +01:00
Jakub Jelinek 17fed8c505 backport: re PR c++/84031 (structured binding unpacks nameless padding bitfields)
Backported from mainline
	2018-01-25  Jakub Jelinek  <jakub@redhat.com>

	PR c++/84031
	* decl.c (find_decomp_class_base): Ignore unnamed bitfields.  Ignore
	recursive calls that return ret.
	(cp_finish_decomp): Ignore unnamed bitfields.

	* g++.dg/cpp1z/decomp36.C: New test.

From-SVN: r258175
2018-03-03 14:19:00 +01:00
Jakub Jelinek 8cf4c7029b backport: re PR middle-end/83977 (ICE in simd_clone_clauses_extract, at omp-simd-clone.c:184)
Backported from mainline
	2018-01-24  Jakub Jelinek  <jakub@redhat.com>

	PR middle-end/83977
	* tree-inline.c (tree_function_versioning): Remove "omp declare simd"
	attributes from DECL_ATTRIBUTES (new_decl) without affecting
	DECL_ATTRIBUTES (old_decl).

	* c-c++-common/gomp/pr83977-1.c: New test.
	* c-c++-common/gomp/pr83977-2.c: New test.
	* c-c++-common/gomp/pr83977-3.c: New test.
	* gfortran.dg/gomp/pr83977.f90: New test.

From-SVN: r258174
2018-03-03 14:18:15 +01:00
Jakub Jelinek d828fc3a4b backport: re PR sanitizer/83987 (ICE with OpenMP, sanitizer and virtual bases)
Backported from mainline
	2018-01-23  Jakub Jelinek  <jakub@redhat.com>

	PR sanitizer/83987
	* tree.c (cp_free_lang_data): Change DECL_VALUE_EXPR of
	DECL_OMP_PRIVATIZED_MEMBER vars to error_mark_node.

	* g++.dg/ubsan/pr83987.C: New test.

From-SVN: r258173
2018-03-03 14:17:11 +01:00
Jakub Jelinek 4128f4b1ce backport: re PR c++/83958 (ICE: Segmentation fault (in find_decomp_class_base))
Backported from mainline
	2018-01-23  Jakub Jelinek  <jakub@redhat.com>

	PR c++/83958
	* decl.c (cp_finish_decomp): Diagnose if reference structure binding
	refers to incomplete type.

	* g++.dg/cpp1z/decomp35.C: New test.

From-SVN: r258172
2018-03-03 14:16:27 +01:00
Jakub Jelinek 3fbbba5960 backport: re PR middle-end/83945 (internal compiler error: Segmentation fault with -O -fcode-hoisting)
Backported from mainline
	2018-01-20  Jakub Jelinek  <jakub@redhat.com>

	PR middle-end/83945
	* tree-emutls.c: Include gimplify.h.
	(lower_emutls_2): New function.
	(lower_emutls_1): If ADDR_EXPR is a gimple invariant and walk_tree
	with lower_emutls_2 callback finds some TLS decl in it, unshare_expr
	it before further processing.

	* gcc.dg/tls/pr83945.c: New test.

From-SVN: r258171
2018-03-03 14:15:49 +01:00
Jakub Jelinek 8ef9da3d06 backport: re PR target/83930 (ICE: RTL check: expected code 'const_int', have 'mem' in simplify_binary_operation_1, at simplify-rtx.c:3302)
Backported from mainline
	2018-01-20  Jakub Jelinek  <jakub@redhat.com>

	PR target/83930
	* simplify-rtx.c (simplify_binary_operation_1) <case UMOD>: Use
	UINTVAL (trueop1) instead of INTVAL (op1).

	* gcc.dg/pr83930.c: New test.

From-SVN: r258170
2018-03-03 14:14:58 +01:00
Jakub Jelinek 4c0b33f532 backport: re PR c++/83824 (ICE on invalid C++ code with alignas: in chainon, at tree.c:3037)
Backported from mainline
	2018-01-18  Jakub Jelinek  <jakub@redhat.com>

	PR c++/83824
	* parser.c (attr_chainon): New function.
	(cp_parser_label_for_labeled_statement, cp_parser_decl_specifier_seq,
	cp_parser_namespace_definition, cp_parser_init_declarator,
	cp_parser_type_specifier_seq, cp_parser_parameter_declaration,
	cp_parser_gnu_attributes_opt): Use it.
	(cp_parser_member_declaration, cp_parser_objc_class_ivars,
	cp_parser_objc_struct_declaration): Likewise.  Don't reset
	prefix_attributes if attributes is error_mark_node.

	* g++.dg/cpp0x/pr83824.C: New test.

From-SVN: r258169
2018-03-03 14:14:11 +01:00
Jakub Jelinek 9c18f8cd36 backport: re PR c++/83817 (internal compiler error: tree check: expected call_expr, have aggr_init_expr in tsubst_copy_and_build, at cp/pt.c:17822)
Backported from mainline
	2018-01-16  Jakub Jelinek  <jakub@redhat.com>

	PR c++/83817
	* pt.c (tsubst_copy_and_build) <case CALL_EXPR>: If function
	is AGGR_INIT_EXPR rather than CALL_EXPR, set AGGR_INIT_FROM_THUNK_P
	instead of CALL_FROM_THUNK_P.

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

From-SVN: r258168
2018-03-03 14:13:28 +01:00
Jakub Jelinek 89aa33708f backport: re PR preprocessor/83722 (the ICE dumper doesn't comment-out some error messages)
Backported from mainline
	2018-01-09  Jakub Jelinek  <jakub@redhat.com>

	PR preprocessor/83722
	* gcc.c (try_generate_repro): Pass
	&temp_stderr_files[RETRY_ICE_ATTEMPTS - 1] rather than
	&temp_stdout_files[RETRY_ICE_ATTEMPTS - 1] as last argument to
	do_report_bug.

From-SVN: r258167
2018-03-03 14:12:39 +01:00
Jakub Jelinek 7f95ef4f30 backport: re PR tree-optimization/83605 (ICE: verify_gimple failed (error: dead STMT in EH table))
Backported from mainline
	2018-01-05  Jakub Jelinek  <jakub@redhat.com>

	PR tree-optimization/83605
	* gimple-ssa-strength-reduction.c: Include tree-eh.h.
	(find_candidates_dom_walker::before_dom_children): Ignore stmts that
	can throw.

	* gcc.dg/pr83605.c: New test.

From-SVN: r258166
2018-03-03 14:12:10 +01:00
Jonathan Wakely ccfcb97e57 PR libstdc++/84671 handle digit separators in duration literals
Backport from mainline
2018-03-02  Jonathan Wakely  <jwakely@redhat.com>

	PR libstdc++/84671
	* include/bits/parse_numbers.h (_Number_help): Add partial
	specialization to handle digit separators. Adjust partial
	specialization for recursion temrination to require _Pow == 1ULL.
	* testsuite/20_util/duration/literals/84671.cc: New

From-SVN: r258164
2018-03-03 00:17:03 +00:00
GCC Administrator a900dfdf6d Daily bump.
From-SVN: r258162
2018-03-03 00:16:12 +00:00
Jason Merrill ef12f9dcf7 Fix MIPS16 ICE.
* pt.c (type_dependent_expression_p): Check DECL_LANG_SPECIFIC.

From-SVN: r258145
2018-03-02 11:55:55 -05:00
Jason Merrill db6fe41ff5 PR c++/84489 - dependent default template argument
* pt.c (type_unification_real): Handle early substitution failure.

From-SVN: r258144
2018-03-02 11:55:49 -05:00
H.J. Lu 99364c275c i386: Add TARGET_INDIRECT_BRANCH_REGISTER
For

---
struct C {
  virtual ~C();
  virtual void f();
};

void
f (C *p)
{
  p->f();
  p->f();
}
---

-mindirect-branch=thunk-extern -O2 on x86-64 GNU/Linux generates:

_Z1fP1C:
.LFB0:
        .cfi_startproc
        pushq   %rbx
        .cfi_def_cfa_offset 16
        .cfi_offset 3, -16
        movq    (%rdi), %rax
        movq    %rdi, %rbx
        jmp     .LIND1
.LIND0:
        pushq   16(%rax)
        jmp     __x86_indirect_thunk
.LIND1:
        call    .LIND0
        movq    (%rbx), %rax
        movq    %rbx, %rdi
        popq    %rbx
        .cfi_def_cfa_offset 8
        movq    16(%rax), %rax
        jmp     __x86_indirect_thunk_rax
        .cfi_endproc

x86-64 is supposed to have asynchronous unwind tables by default, but
there is nothing that reflects the change in the (relative) frame
address after .LIND0.  That region really has to be moved outside of
the .cfi_startproc/.cfi_endproc bracket.

This patch adds TARGET_INDIRECT_BRANCH_REGISTER to force indirect
branch via register whenever -mindirect-branch= is used.  Now,
-mindirect-branch=thunk-extern -O2 on x86-64 GNU/Linux generates:

_Z1fP1C:
.LFB0:
	.cfi_startproc
	pushq	%rbx
	.cfi_def_cfa_offset 16
	.cfi_offset 3, -16
	movq	(%rdi), %rax
	movq	%rdi, %rbx
	movq	16(%rax), %rax
	call	__x86_indirect_thunk_rax
	movq	(%rbx), %rax
	movq	%rbx, %rdi
	popq	%rbx
	.cfi_def_cfa_offset 8
	movq	16(%rax), %rax
	jmp	__x86_indirect_thunk_rax
	.cfi_endproc

so that "-mindirect-branch=thunk-extern" is equivalent to
"-mindirect-branch=thunk-extern -mindirect-branch-register", which is
used by Linux kernel.

gcc/

	Backport from mainline
	PR target/84039
	2018-02-26  H.J. Lu  <hongjiu.lu@intel.com>

	* config/i386/constraints.md (Bs): Replace
	ix86_indirect_branch_register with
	TARGET_INDIRECT_BRANCH_REGISTER.
	(Bw): Likewise.
	* config/i386/i386.md (indirect_jump): Likewise.
	(tablejump): Likewise.
	(*sibcall_memory): Likewise.
	(*sibcall_value_memory): Likewise.
	Peepholes of indirect call and jump via memory: Likewise.
	(*sibcall_GOT_32): Disallowed for TARGET_INDIRECT_BRANCH_REGISTER.
	(*sibcall_value_GOT_32): Likewise.
	* config/i386/predicates.md (indirect_branch_operand): Likewise.
	(GOT_memory_operand): Likewise.
	(call_insn_operand): Likewise.
	(sibcall_insn_operand): Likewise.
	(GOT32_symbol_operand): Likewise.
	* config/i386/i386.h (TARGET_INDIRECT_BRANCH_REGISTER): New.

gcc/testsuite/

	Backport from mainline
	2018-02-26  H.J. Lu  <hongjiu.lu@intel.com>

	PR target/84039
	* gcc.target/i386/indirect-thunk-1.c: Updated.
	* 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-5.c: Likewise.
	* gcc.target/i386/indirect-thunk-6.c: Likewise.
	* gcc.target/i386/indirect-thunk-7.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-attr-7.c: Likewise.
	* gcc.target/i386/indirect-thunk-bnd-1.c: Likewise.
	* gcc.target/i386/indirect-thunk-bnd-2.c: Likewise.
	* gcc.target/i386/indirect-thunk-bnd-3.c: Likewise.
	* gcc.target/i386/indirect-thunk-bnd-4.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-extern-5.c: Likewise.
	* gcc.target/i386/indirect-thunk-extern-6.c: Likewise.
	* gcc.target/i386/indirect-thunk-extern-7.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/indirect-thunk-inline-5.c: Likewise.
	* gcc.target/i386/indirect-thunk-inline-6.c: Likewise.
	* gcc.target/i386/indirect-thunk-inline-7.c: Likewise.
	* gcc.target/i386/ret-thunk-9.c: Likewise.
	* gcc.target/i386/ret-thunk-10.c: Likewise.
	* gcc.target/i386/ret-thunk-11.c: Likewise.
	* gcc.target/i386/ret-thunk-12.c: Likewise.
	* gcc.target/i386/ret-thunk-13.c: Likewise.
	* gcc.target/i386/ret-thunk-14.c: Likewise.
	* gcc.target/i386/ret-thunk-15.c: Likewise.

From-SVN: r258135
2018-03-02 05:09:55 -08:00
H.J. Lu b5286ee60a i386: Update -mfunction-return= for return with pop
When -mfunction-return= is used, simple_return_pop_internal should pop
return address into ECX register, adjust stack by bytes to pop from stack
and jump to the return thunk via ECX register.

Revision 257992 removed the bool argument from ix86_output_indirect_jmp.
Update comments to reflect it.

Tested on i686 and x86-64.

gcc/

	Backport from mainline
	2018-02-26  H.J. Lu  <hongjiu.lu@intel.com>

	* config/i386/i386.c (ix86_output_indirect_jmp): Update comments.

	2018-02-26  H.J. Lu  <hongjiu.lu@intel.com>

	PR target/84530
	* config/i386/i386-protos.h (ix86_output_indirect_jmp): Remove
	the bool argument.
	(ix86_output_indirect_function_return): New prototype.
	(ix86_split_simple_return_pop_internal): Likewise.
	* config/i386/i386.c (indirect_return_via_cx): New.
	(indirect_return_via_cx_bnd): Likewise.
	(indirect_thunk_name): Handle return va CX_REG.
	(output_indirect_thunk_function): Create alias for
	__x86_return_thunk_[re]cx and __x86_return_thunk_[re]cx_bnd.
	(ix86_output_indirect_jmp): Remove the bool argument.
	(ix86_output_indirect_function_return): New function.
	(ix86_split_simple_return_pop_internal): Likewise.
	* config/i386/i386.md (*indirect_jump): Don't pass false
	to ix86_output_indirect_jmp.
	(*tablejump_1): Likewise.
	(simple_return_pop_internal): Change it to define_insn_and_split.
	Call ix86_split_simple_return_pop_internal to split it for
	-mfunction-return=.
	(simple_return_indirect_internal): Call
	ix86_output_indirect_function_return instead of
	ix86_output_indirect_jmp.

gcc/testsuite/

	Backport from mainline
	2018-02-26  H.J. Lu  <hongjiu.lu@intel.com>

	PR target/84530
	* gcc.target/i386/ret-thunk-22.c: New test.
	* gcc.target/i386/ret-thunk-23.c: Likewise.
	* gcc.target/i386/ret-thunk-24.c: Likewise.
	* gcc.target/i386/ret-thunk-25.c: Likewise.
	* gcc.target/i386/ret-thunk-26.c: Likewise.

From-SVN: r258134
2018-03-02 05:05:18 -08:00
Thomas Schwinge d2d907c4d1 [nvptx] Add support for CUDA 9
Backport trunk r256891:

	gcc/
	2018-01-19  Cesar Philippidis  <cesar@codesourcery.com>

	PR target/83790
	* config/nvptx/nvptx.c (output_init_frag): Don't use generic address
	spaces for function labels.

	gcc/testsuite/
	2018-01-19  Cesar Philippidis  <cesar@codesourcery.com>

	PR target/83790
	* gcc.target/nvptx/indirect_call.c: New test.

From-SVN: r258126
2018-03-02 09:39:31 +01:00
GCC Administrator 593fcf51cd Daily bump.
From-SVN: r258119
2018-03-02 00:16:20 +00:00
Jason Merrill d6f0e7af52 PR c++/71569 - decltype of template.
* parser.c (cp_parser_decltype_expr): Handle missing template args.

From-SVN: r258111
2018-03-01 14:47:18 -05:00
Thomas Preud'homme 276e3f24d6 backport: with follow-up r255433 commit.
2017-03-01  Thomas Preud'homme  <thomas.preudhomme@arm.com>

    Backport from mainline
    2017-12-05  Matthew Gretton-Dann  <matthew.gretton-dann@arm.com>
    with follow-up r255433 commit.

    gcc/testsuite/
    * gcc.c-torture/unsorted/dump-noaddr.x: Generate dump files in
    tmpdir.

From-SVN: r258105
2018-03-01 16:41:11 +00:00
Jason Merrill d38532e5c4 PR c++/71569 - ICE with redundant args on member variable template.
* decl.c (start_decl): Handle partial specialization of member
	variable template.
	* pt.c (determine_specialization): Allow partial specialization
	of member variable template without specializing enclosing class.
	(process_partial_specialization): Improve error message.

Co-Authored-By: Alexandre Oliva <aoliva@redhat.com>

From-SVN: r258103
2018-03-01 11:12:26 -05:00
GCC Administrator fc41aa95f8 Daily bump.
From-SVN: r258091
2018-03-01 00:16:17 +00:00
Jason Merrill 5088df49e6 PR c++/71784 - ICE with ref-qualifier and explicit specialization.
* pt.c (determine_specialization): Check ref-qualifier.

From-SVN: r258086
2018-02-28 16:34:31 -05:00
Alan Modra d47385a744 gcc testsuite changes for new linker messages
GNU ld error messages have changed to comply with the GNU coding
standards.

	* lib/prune.exp (prune_gcc_output): Match lower case "in function"
	GNU ld message.
	* g++.dg/other/anon5.C: Match lower case "bad value" GNU ld message.

From-SVN: r258055
2018-02-28 18:35:46 +10:30
GCC Administrator 8f95db14c6 Daily bump.
From-SVN: r258049
2018-02-28 00:16:09 +00:00
Jason Merrill b64aa28307 PR c++/84496 - ICE with generic lambda in lambda.
* pt.c (type_dependent_expression_p): Fix dependency checking of
	functions without DECL_TEMPLATE_INFO.

From-SVN: r258037
2018-02-27 10:31:29 -05:00
Jason Merrill b841e78ad7 PR c++/84441 - ICE with base initialized from ?:
* call.c (unsafe_copy_elision_p): Handle COND_EXPR.

From-SVN: r258025
2018-02-26 21:47:31 -05:00
Jason Merrill eff4c8eb71 PR c++/84520 - ICE with generic lambda in NSDMI.
* lambda.c (lambda_expr_this_capture): Don't look for fake NSDMI
	'this' in a generic lambda instantiation.

From-SVN: r258024
2018-02-26 21:47:25 -05:00
GCC Administrator a68f6eae3e Daily bump.
From-SVN: r258019
2018-02-27 00:16:19 +00:00
Carl Love 695604a9fa backport: altivec.h: Add builtin names vec_extract4b vec_insert4b.
gcc/ChangeLog

2018-02-26  Carl Love  <cel@us.ibm.com>

	Backport from mainline: commit 257747 on 2018-02-16.

	* config/rs6000/altivec.h: Add builtin names vec_extract4b
	vec_insert4b.
	* config/rs6000/rs6000-builtin.def: Add INSERT4B and EXTRACT4B
	definitions.
	* config/rs6000/rs6000-c.c: Add the definitions for
	P9V_BUILTIN_VEC_EXTRACT4B and P9V_BUILTIN_VEC_INSERT4B.
	* config/rs6000/rs6000.c (altivec_expand_builtin): Add
	P9V_BUILTIN_EXTRACT4B and P9V_BUILTIN_INSERT4B case statements.
	* config/rs6000/vsx.md: Add define_insn extract4b.  Add define_expand
	definition for insert4b and define insn *insert3b_internal.
	* doc/extend.texi: Add documentation for vec_extract4b.

gcc/testsuite/ChangeLog

2018-02-26  Carl Love  <cel@us.ibm.com>

	Backport from mainline: commit 257747 on 2018-02-16.

	* gcc.target/powerpc/builtins-7-p9-runnable.c: New runnable test file
	for the ABI definitions for vec_extract4b and vec_insert4b.

From-SVN: r258007
2018-02-26 18:37:27 +00:00
Jonathan Wakely 8d21a3144a PR libstdc++/84532 prevent unwrapping of reference_wrapper arguments
Backport from mainline
2018-02-23  Jonathan Wakely  <jwakely@redhat.com>

	PR libstdc++/84532
	* include/std/thread (thread::__make_invoker): Construct tuple
	directly instead of using make_tuple.
	* testsuite/30_threads/async/84532.cc: New.
	* testsuite/30_threads/thread/84532.cc: New.

From-SVN: r258004
2018-02-26 17:09:34 +00:00
Eric Botcazou ce0cdf7168 re PR rtl-optimization/83496 (wrong code generated with -Os -mbranch-cost=1)
PR rtl-optimization/83496
	* reorg.c (steal_delay_list_from_target): Change REDUNDANT array from
	booleans to RTXes.  Call fix_reg_dead_note on every non-null element.
	(steal_delay_list_from_fallthrough): Call fix_reg_dead_note on a
	redundant insn, if any.
	(relax_delay_slots): Likewise.
	(update_reg_unused_notes): Rename REDUNDANT_INSN to OTHER_INSN.

From-SVN: r258000
2018-02-26 16:39:41 +00:00
Jason Merrill b2cc5bc076 PR c++/81589 - error with is_trivially_constructible.
* method.c (constructible_expr): Set cp_unevaluated.

Co-Authored-By: Ville Voutilainen <ville.voutilainen@gmail.com>

From-SVN: r257981
2018-02-26 01:09:07 -05:00
Jason Merrill adff9ac1be PR c++/84015 - ICE with class deduction and auto template parm.
* pt.c (rewrite_template_parm): Use tf_partial in first tsubst.

From-SVN: r257980
2018-02-26 01:09:01 -05:00
GCC Administrator e65b9c0a1a Daily bump.
From-SVN: r257977
2018-02-26 00:16:27 +00:00
Steven G. Kargl 65f84ebdca 2018-02-25 Steven G. Kargl <kargl@gcc.gnu.org>
Commit ChangeLog entries for r257972, wcich were forgotten.

From-SVN: r257973
2018-02-25 17:16:09 +00:00
Steven G. Kargl b5ffe43e31 re PR fortran/83633 (gfortran internal compiler error for explicit-shape array with non-constant bounds)
2018-02-25  Steven G. Kargl  <kargl@gcc.gnu.org>

	PR fortran/83633
	* decl.c (variable_decl): Check that an explicit-shape-array with
	nonconstant bounds is allowed.

2018-02-25  Steven G. Kargl  <kargl@gcc.gnu.org>

	PR fortran/83633
	* gfortran.dg/explicit_shape_1.f90: New test.
	* gfortran.dg/automatic_module_variable.f90: Update regex.
	* gfortran.dg/bad_automatic_objects_1.f90: Ditto.
	* gfortran.dg/constant_shape.f90: Ditto.

From-SVN: r257972
2018-02-25 17:08:51 +00:00
Thomas Koenig 2fcedd1479 re PR fortran/78238 ([OOP] ICE: verify_gimple failed, with -fdefault-integer-8)
2018-02-25  Thomas Koenig  <tkoenig@gcc.gnu.org>

	PR fortran/78238
	Backport from trunk
	* gfortran.h (gfc_integer_4_kind): Define.
	* resolve.c (resolve_select_type): Make sure that the
	kind of c->high is gfc_integer_4_kind.

2018-02-25  Thomas Koenig  <tkoenig@gcc.gnu.org>

	PR fortran/78238
	Backport from trunk
	* gfortran.dg/select_type_40.f90: New test.

From-SVN: r257969
2018-02-25 09:30:04 +00:00
GCC Administrator eb0050ebb0 Daily bump.
From-SVN: r257966
2018-02-25 00:16:19 +00:00
Steven G. Kargl 1742491dab re PR fortran/30792 (DATA implied-do substring allowed with -std=f95/f2003)
2018-02-24  Steven G. Kargl <kargl@gcc.gnu.org>

	PR fortran/30792
	* decl.c (gfc_match_data): Check for invalid substring in
	data-implied-do

2018-02-24  Steven G. Kargl <kargl@gcc.gnu.org>

	PR fortran/30792
	* gfortran.dg/data_substring.f90: New test.

From-SVN: r257963
2018-02-24 17:51:09 +00:00
GCC Administrator f8307ec686 Daily bump.
From-SVN: r257959
2018-02-24 00:16:10 +00:00
Steven G. Kargl d5c8c847da re PR fortran/84511 (Internal compiler error from directly printing return of C_LOC)
2018-02-23  Steven G. Kargl  <kargl@gcc.gnu.org>

	PR fortran/84511
	* trans-io.c (transfer_expr): Deal with C_LOC in transfer statement.

From-SVN: r257948
2018-02-23 19:37:57 +00:00
Steven G. Kargl 3a2e1e322b re PR fortran/84346 (Statement functions should not accept keywords)
2018-02-23  Steven G. Kargl  <kargl@gcc.gnu.org>

	PR fortran/84346
	* interface.c (compare_actual_formal): Issue error if keyword is
	used in a statement function.

2018-02-23  Steven G. Kargl  <kargl@gcc.gnu.org>

	PR fortran/84346
	* gfortran.dg/statement_function_1.f90: Update test.

From-SVN: r257946
2018-02-23 19:35:51 +00:00
Jerry DeLisle e6edd7f791 backport: re PR fortran/84506 (INQUIRE(pos=) always sets pos=0 with -fdefault-integer-8)
2018-02-23  Jerry DeLisle  <jvdelisle@gcc.gnu.org>

	Backport from trunk
	PR fortran/84506
	* trans-io.c (set_parameter_value_inquire): Adjust range check of
	negative unit values for kind=8 units to the kind=4 negative limit.

	* gfortran.dg/inquire_19.f90: New test.

From-SVN: r257945
2018-02-23 19:16:00 +00:00
GCC Administrator 7f6385a170 Daily bump.
From-SVN: r257926
2018-02-23 00:16:10 +00:00
Thomas Koenig 4b3dc9496c re PR fortran/81116 (Last character of allocatable-length string reset to blank in an assigment)
2018-02-22  Thomas Koenig  <tkoenig@gcc.gnu.org>

	PR fortran/81116
	PR fortran/84495
	Backport from trunk
	* frontend-passes.c (realloc_string_callback): If expression is a
	concatenation, also check for dependency.
	(constant_string_length): Check for presence of symtree.

2018-02-22  Thomas Koenig  <tkoenig@gcc.gnu.org>

	PR fortran/81116
	PR fortran/84495
	* gfortran.dg/realloc_on_assignment_29.f90:  New test.

From-SVN: r257912
2018-02-22 18:52:21 +00:00
Sudakshina Das b1214cd3b9 Adding the missing LTGT to plug the ICE in PR81228.
This is a backport of r255625 of trunk.

*** gcc/ChangeLog ***

2018-02-22  Sudakshina Das  <sudi.das@arm.com>
	    Bin Cheng  <bin.cheng@arm.com>

	Backport from mainline:
	2017-12-14  Sudakshina Das  <sudi.das@arm.com>
		    Bin Cheng  <bin.cheng@arm.com>

	PR target/81228
	* config/aarch64/aarch64.c (aarch64_select_cc_mode): Move LTGT to
	CCFPEmode.
	* config/aarch64/aarch64-simd.md (vec_cmp<mode><v_cmp_result>): Add
	LTGT.

*** gcc/testsuite/ChangeLog ***

2017-02-22  Sudakshina Das  <sudi.das@arm.com>

	Backport from mainline:
	2017-12-14  Sudakshina Das  <sudi.das@arm.com>

	PR target/81228
	* gcc.dg/pr81228.c: New.

Co-Authored-By: Bin Cheng <bin.cheng@arm.com>

From-SVN: r257901
2018-02-22 15:01:05 +00:00
GCC Administrator 446d0c490b Daily bump.
From-SVN: r257886
2018-02-22 00:16:09 +00:00
GCC Administrator 0961a18f23 Daily bump.
From-SVN: r257867
2018-02-21 00:16:20 +00:00
Max Filippov e9d3cf703b libgcc: xtensa: fix build with -mtext-section-literals
libgcc/
2018-02-20  Max Filippov  <jcmvbkbc@gmail.com>

	Backport from mainline
	2018-02-20  Max Filippov  <jcmvbkbc@gmail.com>

	* config/xtensa/ieee754-df.S (__adddf3_aux): Add
	.literal_position directive.
	* config/xtensa/ieee754-sf.S (__addsf3_aux): Likewise.

From-SVN: r257863
2018-02-20 21:08:38 +00:00
Jerry DeLisle fa07ca91a0 backport: re PR fortran/82007 (DTIO write format stored in a string leads to severe errors)
2018-02-19  Jerry DeLisle  <jvdelisle@gcc.gnu.org>

	Backport from trunk
	PR fortran/82007
	* resolve.c (resolve_transfer): Delete code looking for 'DT'
	format specifiers in format strings. Set formatted to true if a
	format string or format label is present.
	* trans-io.c (get_dtio_proc): Likewise. (transfer_expr): Fix
	whitespace.

From-SVN: r257837
2018-02-20 04:05:38 +00:00
GCC Administrator 32057ae18b Daily bump.
From-SVN: r257834
2018-02-20 00:16:09 +00:00
Jonathan Wakely fa61ad2d11 PR libstdc++/81797 Add .NOTPARALLEL to include/Makefile for darwin
Backport from mainline
2018-02-15  Jonathan Wakely  <jwakely@redhat.com>

	PR libstdc++/81797
	* configure.ac (INCLUDE_DIR_NOTPARALLEL): Define.
	* configure: Regenerate.
	* include/Makefile.am (INCLUDE_DIR_NOTPARALLEL): Add .NOTPARALLEL when
	defined.
	* include/Makefile.in: Regenerate.

From-SVN: r257808
2018-02-19 16:02:38 +00:00
Jonathan Wakely 89bad1c163 Fix lambdas in template default argument of inherited ctor.
gcc/cp:

Backport from mainline
2017-08-29  Jason Merrill  <jason@redhat.com>

	Fix lambdas in template default argument of inherited ctor.
	* method.c (synthesized_method_base_walk): Replace an inherited
	template with its specialization.
	(synthesized_method_walk): Make inheriting_ctor a pointer.
	(maybe_explain_implicit_delete, explain_implicit_non_constexpr)
	(deduce_inheriting_ctor, implicitly_declare_fn): Adjust.

gcc/testsuite:

Backport from mainline
2018-01-02  Marek Polacek  <polacek@redhat.com>

	PR c++/81860
	* g++.dg/cpp0x/inh-ctor30.C: New test.

From-SVN: r257806
2018-02-19 14:53:36 +00:00
GCC Administrator 72a5e46198 Daily bump.
From-SVN: r257799
2018-02-19 00:16:09 +00:00
Jerry DeLisle 5286b8c296 backport: re PR fortran/84412 (Erroneous "Inquire statement identifies an internal file" error)
2018-02-18  Jerry DeLisle  <jvdelisle@gcc.gnu.org>

	Backport from trunk
	PR libgfortran/84412
	* io/transfer.c (finalize_transfer): After completng an internal unit
	I/O operation, clear internal_unit_kind.

	* gfortran.dg/inquire_18.f90: New test.

From-SVN: r257793
2018-02-18 16:30:42 +00:00
GCC Administrator f9b6d86c4a Daily bump.
From-SVN: r257786
2018-02-18 00:16:09 +00:00
Thomas Koenig 1643fb2bca backport: re PR fortran/84270 (optimization bug with assumed size array argument)
2018-02-17  Thomas Koenig  <tkoenig@gcc.gnu.org>

	Backport from trunk
	PR fortran/84270
	* frontend-passes (scalarized_expr):  If the expression
	is an assumed size array, leave in the last reference
	and pass AR_SECTION instead of AR_FULL to gfc_resolve
	in order to avoid an error.

2018-02-17  Thomas Koenig  <tkoenig@gcc.gnu.org>

	Backport from trunk
	PR fortran/84270
	* gfortran.dg/inline_matmul_22.f90: New test.

From-SVN: r257784
2018-02-17 16:01:50 +00:00
Jozef Lawrynowicz 3abece18b2 re PR target/79242 (ICE in simplify_subreg, at simplify-rtx.c:6029)
2018-02-16  Jozef Lawrynowicz <jozefl.gcc@gmail.com>

	PR target/79242
	* machmode.def: Define a complex mode for PARTIAL_INT.
	* genmodes.c (complex_class): Return MODE_COMPLEX_INT for
	MODE_PARTIAL_INT.
	* doc/rtl.texi: Document CSPImode.
	* config/msp430/msp430.c (msp430_hard_regno_nregs): Add CPSImode
	handling.
	(msp430_hard_regno_nregs_with_padding): Likewise.

	PR target/79242
	gcc.target/msp430/pr79242.c: New test.

From-SVN: r257779
2018-02-16 17:25:15 -07:00
GCC Administrator f61af34fbe Daily bump.
From-SVN: r257777
2018-02-17 00:16:16 +00:00
Eric Botcazou 1be4d64652 re PR target/84277 (A lot of new acats testsuite failures)
PR ada/84277
	* gnat.dg/array11.adb (Array11): Tweak index and remove warning.
	* gnat.dg/dispatch1.adb: Rename into...
	* gnat.dg/disp1.adb: ...this.
	* gnat.dg/dispatch1_p.ads: Rename into...
	* gnat.dg/disp1_pkg.ads: ...this.
	* gnat.dg/disp2.adb: Rename into...
	* gnat.dg/dispatch2.adb: ...this.
	* gnat.dg/dispatch2_p.ads: Rename into...
	* gnat.dg/disp2_pkg.ads: ...this.
	* gnat.dg/dispatch2_p.adb: Rename into...
	* gnat.dg/disp2_pkg.adb: this.
	* gnat.dg/generic_dispatch.adb: Rename into...
	* gnat.dg/generic_disp.adb: this.
	* gnat.dg/generic_dispatch_p.ads: Rename into...
	* gnat.dg/generic_disp_pkg.ads: ...this.
	* gnat.dg/generic_dispatch_p.adb: Rename into...
	* gnat.dg/generic_disp_pkg.adb: ...this.
	* gnat.dg/null_pointer_deref1.adb (Null_Pointer_Deref1): Robustify.
	* gnat.dg/null_pointer_deref2.adb (Null_Pointer_Deref2): Likewise.
	* gnat.dg/object_overflow1.adb: Tweak index.
	* gnat.dg/object_overflow2.adb: Likewise.
	* gnat.dg/object_overflow3.adb: Likewise.
	* gnat.dg/object_overflow4.adb: Likewise.
	* gnat.dg/object_overflow5.adb: Likewise.

From-SVN: r257774
2018-02-16 23:26:49 +00:00
Jason Merrill 850cdd0cd7 PR c++/84151 - unnecessary volatile load with static member.
* call.c (build_new_method_call_1): Avoid loading from a volatile
	lvalue used as the object argument for a static member function.

From-SVN: r257767
2018-02-16 16:06:56 -05:00
Jason Merrill 72123b4306 PR c++/81853 - using-directive and constexpr.
* constexpr.c (cxx_eval_constant_expression): Handle USING_STMT.

From-SVN: r257766
2018-02-16 16:06:50 -05:00
Jason Merrill 755f523693 PR c++/84420 - ICE with structured binding in lambda.
* lambda.c (is_capture_proxy): Check DECL_DECOMPOSITION_P.

From-SVN: r257765
2018-02-16 16:06:45 -05:00
Jason Merrill 54c2127a38 PR c++/83835 - C++17 error with constructor ctors.
* call.c (build_special_member_call): Set TARGET_EXPR_DIRECT_INIT_P.

From-SVN: r257764
2018-02-16 16:06:39 -05:00
Jason Merrill bb6ee7116e PR c++/82664 - ICE with reference to function template parm.
* pt.c (convert_nontype_argument_function): Avoid obfuscationg
	NOP_EXPRs.

From-SVN: r257754
2018-02-16 14:06:59 -05:00
Jason Merrill 73ffff9633 PR c++/82764 - C++17 ICE with empty base
* class.c (build_base_field_1): Set DECL_SIZE to zero for empty
	base.

From-SVN: r257746
2018-02-16 11:45:49 -05:00
Sudakshina Das 45a1860e42 Fix emit_store_flag_force () function to fix ICE in int_mode_for_mode,
at stor-layout.c:403 with arm-linux-gnueabi.

*** gcc/ChangeLog ***

2018-02-16  Sudakshina Das  <sudi.das@arm.com>

	Backport from trunk
	2018-01-10  Sudakshina Das  <sudi.das@arm.com>

	PR target/82096
	* expmed.c (emit_store_flag_force): Swap if const op0
	and change VOIDmode to mode of op0.

*** gcc/testsuite/ChangeLog ***

2018-02-16  Sudakshina Das  <sudi.das@arm.com>

	Backport from trunk
	2018-01-12  Sudakshina Das  <sudi.das@arm.com>

	* gcc.c-torture/compile/pr82096.c: Add dg-skip-if
	directive.

	Backport from trunk
	2018-01-10  Sudakshina Das  <sudi.das@arm.com>

	PR target/82096
	* gcc.c-torture/compile/pr82096.c: New test.

From-SVN: r257741
2018-02-16 15:37:35 +00:00
Jason Merrill 40f10e4bde PR c++/83227 - C++17 ICE with init-list derived-to-base conversion.
* call.c (convert_like_real): Don't use the copy-list-initialization
	shortcut for ck_base.

From-SVN: r257738
2018-02-16 09:12:48 -05:00
Jason Merrill e46c575b58 PR c++/84045 - ICE with typedef and noexcept.
* except.c (build_noexcept_spec): Use strip_typedefs_expr.

From-SVN: r257737
2018-02-16 09:12:42 -05:00
Richard Biener a263579fc5 re PR c/84190 (double arithmetic on x86 no longer rounds to nearest)
2018-02-16  Richard Biener  <rguenther@suse.de>

	PR tree-optimization/84190
	* tree-ssa.c (non_rewritable_mem_ref_base): Do not touch
	volatile accesses if the decl isn't volatile.

	* g++.dg/torture/pr84190.C: New testcase.

From-SVN: r257722
2018-02-16 07:57:56 +00:00
GCC Administrator 04024315b4 Daily bump.
From-SVN: r257717
2018-02-16 00:16:32 +00:00
Michael Meissner c6d64f05c1 backport: re PR target/84154 (PowerPC GCC 7 and 8 have regression in converting fp to short/char and returning it)
[gcc]
2018-02-15  Michael Meissner  <meissner@linux.vnet.ibm.com>

	Back port from trunk
	2018-02-07  Michael Meissner  <meissner@linux.vnet.ibm.com>

	PR target/84154
	* config/rs6000/rs6000.md (fix_trunc<SFDF:mode><QHI:mode>2):
	Convert from define_expand to be define_insn_and_split.  Rework
	float/double/_Float128 conversions to QI/HI/SImode to work with
	both ISA 2.07 (power8) or ISA 3.0 (power9).  Fix regression where
	conversions to QI/HImode types did a store and then a load to
	truncate the value.  For conversions to VSX registers, don't split
	the insn, instead emit the code directly.  Use the code iterator
	any_fix to combine signed and unsigned conversions.
	(fix<uns>_trunc<SFDF:mode>si2_p8): Likewise.
	(fixuns_trunc<SFDF:mode><QHI:mode>2): Likewise.
	(fix_trunc<IEEE128:mode><QHI:mode>2): Likewise.
	(fix<uns>_trunc<SFDF:mode><QHI:mode>2): Likewise.
	(fix_<mode>di2_hw): Likewise.
	(fixuns_<mode>di2_hw): Likewise.
	(fix_<mode>si2_hw): Likewise.
	(fixuns_<mode>si2_hw): Likewise.
	(fix<uns>_<IEEE128:mode><SDI:mode>2_hw): Likewise.
	(fix<uns>_trunc<IEEE128:mode><QHI:mode>2): Likewise.
	(fctiw<u>z_<mode>_smallint): Rename fctiw<u>z_<mode>_smallint to
	fix<uns>_trunc<SFDF:mode>si2_p8.
	(fix_trunc<SFDF:mode><QHI:mode>2_internal): Delete, no longer
	used.
	(fixuns_trunc<SFDF:mode><QHI:mode>2_internal): Likewise.
	(fix<uns>_<mode>_mem): Likewise.
	(fctiw<u>z_<mode>_mem): Likewise.
	(fix<uns>_<mode>_mem): Likewise.
	(fix<uns>_trunc<SFDF:mode><QHSI:mode>2_mem): On ISA 3.0, prevent
	the register allocator from doing a direct move to the GPRs to do
	a store, and instead use the ISA 3.0 store byte/half-word from
	vector register instruction.  For IEEE 128-bit floating point,
	also optimize stores of 32-bit ints.
	(fix<uns>_trunc<IEEE128:mode><QHSI:mode>2_mem): Likewise.

[gcc/testsuite]
2018-02-15  Michael Meissner  <meissner@linux.vnet.ibm.com>

	Back port from trunk
	2018-02-07  Michael Meissner  <meissner@linux.vnet.ibm.com>

	PR target/84154
	* gcc.target/powerpc/pr84154-1.c: New tests.
	* gcc.target/powerpc/pr84154-2.c: Likewise.
	* gcc.target/powerpc/pr84154-3.c: Likewise.

From-SVN: r257697
2018-02-15 17:54:41 +00:00
Will Schmidt 401444beff re PR testsuite/84388 (test case gcc/testsuite/gcc.target/powerpc/fold-vec-mult-int128-p9.c fails for gcc 7 on power9)
[testsuite]

2018-02-15  Will Schmidt  <will_schmidt@vnet.ibm.com>

	PR target/84388
	* gcc.target/powerpc/fold-vec-mult-int128-p8.c: Update dg-options
	and scan-assembler stanzas.
	* gcc.target/powerpc/fold-vec-mult-int128-p9.c: Same.

From-SVN: r257692
2018-02-15 14:50:15 +00:00
Aaron Sawdey b90fb39d27 backport: re PR debug/83758 (ICE building gccgo on powerpc64le --with-cpu=power8)
2018-02-15  Aaron Sawdey  <acsawdey@linux.vnet.ibm.com>

	Back port from mainline
	2018-01-30  Aaron Sawdey  <acsawdey@linux.vnet.ibm.com>

	PR target/83758
	* config/rs6000/rs6000.c (rs6000_internal_arg_pointer): Only return
	a reg rtx.

From-SVN: r257691
2018-02-15 08:48:15 -06:00
GCC Administrator caf5565402 Daily bump.
From-SVN: r257678
2018-02-15 00:16:21 +00:00
Peter Bergner 04d3ad5d3f re PR target/84390 (test case gcc.target/powerpc/vsxcopy.c fails for gcc 7 and gcc 6 on power9)
PR target/84390
	* gcc.target/powerpc/vsxcopy.c: Also match lxv when compiling
	with -mcpu=power9.

From-SVN: r257670
2018-02-14 13:56:25 -06:00
Peter Bergner 6f2750187d backport: re PR target/84372 (test case gcc.target/powerpc/lvsl-lvsr.c fails on power9)
Back port from mainline
	2018-02-13  Peter Bergner  <bergner@vnet.ibm.com>

	PR target/84372
	* gcc.target/powerpc/lvsl-lvsr.c: Also match lxv when compiling
	with -mcpu=power9.

From-SVN: r257667
2018-02-14 12:48:53 -06:00
Peter Bergner a1cd383520 backport: re PR target/84279 (powerpc64le ICE on cvc4)
gcc/
	Back port from mainline
	2018-02-13  Peter Bergner  <bergner@vnet.ibm.com>

	PR target/84279
	* config/rs6000/rs6000.c (mem_operand_gpr): Disallow altivec addresses.

gcc/testsuite/
	Back port from mainline
	2018-02-13  Peter Bergner  <bergner@vnet.ibm.com>

	PR target/84279
	* g++.dg/pr84279.C: New test.

From-SVN: r257661
2018-02-14 09:17:04 -06:00
Martin Jambor f58f535f35 Fix location handling in ipa_modify_call_arguments
2018-02-14  Martin Jambor  <mjambor@suse.cz>

        PR c++/83990
        * ipa-prop.c (ipa_modify_call_arguments): Use location of call
        statements, also set location of a load to a temporary.

From-SVN: r257656
2018-02-14 13:55:47 +01:00
GCC Administrator 0097d9582a Daily bump.
From-SVN: r257650
2018-02-14 00:16:09 +00:00
Alastair McKinstry 5aba19fadf Make module files reproducible
Using lbasename ensures that the build path does not end up in the
module file.

Regtested on x86_64-pc-linux-gnu. Backport from trunk.

2018-02-13  Alastair McKinstry  <alastair.mckinstry@sceal.ie>
	    Janne Blomqvist  <jb@gcc.gnu.org>

	* module.c (dump_module): Use lbasename to ensure that module
	files are reproducible.

Co-Authored-By: Janne Blomqvist <jb@gcc.gnu.org>

From-SVN: r257614
2018-02-13 10:03:04 +02:00
GCC Administrator 07f8a7f6b0 Daily bump.
From-SVN: r257609
2018-02-13 00:16:15 +00:00
Thomas Koenig 727bcd82f2 re PR fortran/68560 (The test gfortran.dg/shape_8.f90 now fails when compiled with -flto)
2018-02-12  Thomas Koenig  <tkoenig@gcc.gnu.org>

	PR fortran/68560
	* gfortran.dg/shape_9.f90: New test.

2018-02-12  Thomas Koenig  <tkoenig@gcc.gnu.org>

	PR fortran/68560
	* gfortran.dg/shape_9.f90: New test.

From-SVN: r257602
2018-02-12 20:13:30 +00:00
Steven G. Kargl 97b3a91f9c re PR fortran/35299 (scope of variables in statement function do not acquire rank from host)
2018-02-12  Francois-Xavier Coudert  <fxcoudert@gcc.gnu.org>

	PR fortran/35299
	ChangeLog for r257566
	* gfortran.dg/statement_function_3.f: New test.

2018-02-12  Francois-Xavier Coudert  <fxcoudert@gcc.gnu.org>

	PR fortran/35299
	ChangeLog for r257566
	* resolve.c (resolve_formal_arglist): Update error message.

From-SVN: r257594
2018-02-12 18:08:02 +00:00
Steven G. Kargl 2b99dac472 re PR fortran/54223 (Statement function statement with dummy arguments that are also OPTIONAL may crash in wrong calls)
2018-02-12  Steven G. Kargl  <kargl@gcc.gnu.org>

	PR fortran/54223
	PR fortran/84276
	* interface.c (compare_actual_formal): Add in_statement_function
	bool parameter.  Skip check of INTENT attribute for statement
	functions.  Arguments to a statement function cannot be optional,
	issue error for missing argument.
	(gfc_procedure_use, gfc_ppc_use, gfc_arglist_matches_symbol): Use
	in_statement_function.

2018-02-12  Steven G. Kargl  <kargl@gcc.gnu.org>

	PR fortran/54223
	PR fortran/84276
	* gfortran.dg/statement_function_1.f90: New test.
	* gfortran.dg/statement_function_2.f90: New test.

From-SVN: r257593
2018-02-12 18:04:33 +00:00
GCC Administrator 4644b5209d Daily bump.
From-SVN: r257573
2018-02-12 00:16:10 +00:00
GCC Administrator 90c79d7a86 Daily bump.
From-SVN: r257558
2018-02-11 00:16:09 +00:00
John David Anglin caeda217ca pa.c (hppa_profile_hook): Mark SYMBOL_REF for _mcount as function label.
* config/pa/pa.c (hppa_profile_hook): Mark SYMBOL_REF for _mcount as
	function label.

From-SVN: r257555
2018-02-10 23:35:00 +00:00
John David Anglin 3c2b0b5a38 backport: re PR middle-end/84089 (FAIL: g++.dg/cpp1y/lambda-generic-x.C -std=gnu++14 (internal compiler error))
Backport from mainline
	2018-02-01  Aldy Hernandez  <aldyh@redhat.com>

	PR target/84089
	* config/pa/predicates.md (base14_operand): Handle VOIDmode.

From-SVN: r257552
2018-02-10 19:55:06 +00:00
GCC Administrator 2ad5291358 Daily bump.
From-SVN: r257547
2018-02-10 00:16:08 +00:00
Martin Jambor 380d364374 [hsa] Set program allocation for static local variables
2018-02-09  Martin Jambor  <mjambor@suse.cz>

	* hsa-gen.c (get_symbol_for_decl): Set program allocation for
	static local variables.

libgomp/
	* testsuite/libgomp.hsa.c/staticvar.c: New test.

From-SVN: r257528
2018-02-09 16:49:20 +01:00
Andreas Krebbel d4841529d0 S/390: Fix PR84295
gcc/ChangeLog:

2018-02-09  Andreas Krebbel  <krebbel@linux.vnet.ibm.com>

	Backport from mainline
	2018-02-09  Andreas Krebbel  <krebbel@linux.vnet.ibm.com>

	PR target/PR84295
	* config/s390/s390.c (s390_set_current_function): Invoke
	s390_indirect_branch_settings also if fndecl didn't change.

gcc/testsuite/ChangeLog:

2018-02-09  Andreas Krebbel  <krebbel@linux.vnet.ibm.com>

	Backport from mainline
	2018-02-09  Andreas Krebbel  <krebbel@linux.vnet.ibm.com>

	PR target/PR84295
	* gcc.target/s390/pr84295.c: New test.

From-SVN: r257523
2018-02-09 11:45:49 +00:00
GCC Administrator ed3783d6f4 Daily bump.
From-SVN: r257507
2018-02-09 00:16:10 +00:00
Iain Sandoe 45bb1b8e46 re PR target/84113 (libgcc/unwind.inc:136:1: unrecognizable insn: internal compiler error on Darwin)
2018-02-08  Iain Sandoe  <iain@codesourcery.com>

	PR target/84113
	* config/rs6000/altivec.md (*restore_world): Remove LR use.
	* config/rs6000/predicates.md (restore_world_operation): Adjust op
	count, remove one USE.

From-SVN: r257501
2018-02-08 18:48:37 +00:00
Andreas Krebbel 9bdc290ecc S/390: Disable branch prediction for indirect branches
gcc/ChangeLog:

2018-02-08  Andreas Krebbel  <krebbel@linux.vnet.ibm.com>

	Backport from mainline
	2018-02-08  Andreas Krebbel  <krebbel@linux.vnet.ibm.com>

	* config/s390/s390-opts.h (enum indirect_branch): Define.
	* config/s390/s390-protos.h (s390_return_addr_from_memory)
	(s390_indirect_branch_via_thunk)
	(s390_indirect_branch_via_inline_thunk): Add function prototypes.
	(enum s390_indirect_branch_type): Define.
	* config/s390/s390.c (struct s390_frame_layout, struct
	machine_function): Remove.
	(indirect_branch_prez10thunk_mask, indirect_branch_z10thunk_mask)
	(indirect_branch_table_label_no, indirect_branch_table_name):
	Define variables.
	(INDIRECT_BRANCH_NUM_OPTIONS): Define macro.
	(enum s390_indirect_branch_option): Define.
	(s390_return_addr_from_memory): New function.
	(s390_handle_string_attribute): New function.
	(s390_attribute_table): Add new attribute handler.
	(s390_execute_label): Handle UNSPEC_EXECUTE_JUMP patterns.
	(s390_indirect_branch_via_thunk): New function.
	(s390_indirect_branch_via_inline_thunk): New function.
	(s390_function_ok_for_sibcall): When jumping via thunk disallow
	sibling call optimization for non z10 compiles.
	(s390_emit_call): Force indirect branch target to be a single
	register.  Add r1 clobber for non-z10 compiles.
	(s390_emit_epilogue): Emit return jump via return_use expander.
	(s390_reorg): Handle JUMP_INSNs as execute targets.
	(s390_option_override_internal): Perform validity checks for the
	new command line options.
	(s390_indirect_branch_attrvalue): New function.
	(s390_indirect_branch_settings): New function.
	(s390_set_current_function): Invoke s390_indirect_branch_settings.
	(s390_output_indirect_thunk_function):  New function.
	(s390_code_end): Implement target hook.
	(s390_case_values_threshold): Implement target hook.
	(TARGET_ASM_CODE_END, TARGET_CASE_VALUES_THRESHOLD): Define target
	macros.
	* config/s390/s390.h (struct s390_frame_layout)
	(struct	machine_function): Move here from s390.c.
	(TARGET_INDIRECT_BRANCH_NOBP_RET)
	(TARGET_INDIRECT_BRANCH_NOBP_JUMP)
	(TARGET_INDIRECT_BRANCH_NOBP_JUMP_THUNK)
	(TARGET_INDIRECT_BRANCH_NOBP_JUMP_INLINE_THUNK)
	(TARGET_INDIRECT_BRANCH_NOBP_CALL)
	(TARGET_DEFAULT_INDIRECT_BRANCH_TABLE)
	(TARGET_INDIRECT_BRANCH_THUNK_NAME_EXRL)
	(TARGET_INDIRECT_BRANCH_THUNK_NAME_EX)
	(TARGET_INDIRECT_BRANCH_TABLE): Define macros.
	* config/s390/s390.md (UNSPEC_EXECUTE_JUMP)
	(INDIRECT_BRANCH_THUNK_REGNUM): Define constants.
	(mnemonic attribute): Add values which aren't recognized
	automatically.
	("*cjump_long", "*icjump_long", "*basr", "*basr_r"): Disable
	pattern for branch conversion.  Fix mnemonic attribute.
	("*c<code>", "*sibcall_br", "*sibcall_value_br", "*return"): Emit
	indirect branch via thunk if requested.
	("indirect_jump", "<code>"): Expand patterns for branch conversion.
	("*indirect_jump"): Disable for branch conversion using out of
	line thunks.
	("indirect_jump_via_thunk<mode>_z10")
	("indirect_jump_via_thunk<mode>")
	("indirect_jump_via_inlinethunk<mode>_z10")
	("indirect_jump_via_inlinethunk<mode>", "*casesi_jump")
	("casesi_jump_via_thunk<mode>_z10", "casesi_jump_via_thunk<mode>")
	("casesi_jump_via_inlinethunk<mode>_z10")
	("casesi_jump_via_inlinethunk<mode>", "*basr_via_thunk<mode>_z10")
	("*basr_via_thunk<mode>", "*basr_r_via_thunk_z10")
	("*basr_r_via_thunk", "return<mode>_prez10"): New pattern.
	("*indirect2_jump"): Disable for branch conversion.
	("casesi_jump"): Turn into expander and expand patterns for branch
	conversion.
	("return_use"): New expander.
	("*return"): Emit return via thunk and rename it to ...
	("*return<mode>"): ... this one.
	* config/s390/s390.opt: Add new options and and enum for the
	option values.

gcc/testsuite/ChangeLog:

2018-02-08  Andreas Krebbel  <krebbel@linux.vnet.ibm.com>

	Backport from mainline
	2018-02-08  Andreas Krebbel  <krebbel@linux.vnet.ibm.com>

	* gcc.target/s390/nobp-function-pointer-attr.c: New test.
	* gcc.target/s390/nobp-function-pointer-nothunk.c: New test.
	* gcc.target/s390/nobp-function-pointer-z10.c: New test.
	* gcc.target/s390/nobp-function-pointer-z900.c: New test.
	* gcc.target/s390/nobp-indirect-jump-attr.c: New test.
	* gcc.target/s390/nobp-indirect-jump-inline-attr.c: New test.
	* gcc.target/s390/nobp-indirect-jump-inline-z10.c: New test.
	* gcc.target/s390/nobp-indirect-jump-inline-z900.c: New test.
	* gcc.target/s390/nobp-indirect-jump-nothunk.c: New test.
	* gcc.target/s390/nobp-indirect-jump-z10.c: New test.
	* gcc.target/s390/nobp-indirect-jump-z900.c: New test.
	* gcc.target/s390/nobp-return-attr-all.c: New test.
	* gcc.target/s390/nobp-return-attr-neg.c: New test.
	* gcc.target/s390/nobp-return-mem-attr.c: New test.
	* gcc.target/s390/nobp-return-mem-nothunk.c: New test.
	* gcc.target/s390/nobp-return-mem-z10.c: New test.
	* gcc.target/s390/nobp-return-mem-z900.c: New test.
	* gcc.target/s390/nobp-return-reg-attr.c: New test.
	* gcc.target/s390/nobp-return-reg-mixed.c: New test.
	* gcc.target/s390/nobp-return-reg-nothunk.c: New test.
	* gcc.target/s390/nobp-return-reg-z10.c: New test.
	* gcc.target/s390/nobp-return-reg-z900.c: New test.
	* gcc.target/s390/nobp-table-jump-inline-z10.c: New test.
	* gcc.target/s390/nobp-table-jump-inline-z900.c: New test.
	* gcc.target/s390/nobp-table-jump-z10.c: New test.
	* gcc.target/s390/nobp-table-jump-z900.c: New test.

From-SVN: r257498
2018-02-08 17:00:48 +00:00
Richard Biener 784c86ebd6 re PR middle-end/84233 (ICE (segfault) in gimple_assign_rhs_code)
2018-02-08  Richard Biener  <rguenther@suse.de>

	PR tree-optimization/84233
	* tree-ssa-phiprop.c (propagate_with_phi): Use separate
	changed flag instead of boguously re-using phi_inserted.

	* g++.dg/torture/pr84233.C: New testcase.

From-SVN: r257487
2018-02-08 13:30:49 +00:00
GCC Administrator 9ca2653483 Daily bump.
From-SVN: r257476
2018-02-08 00:16:15 +00:00
Steven G. Kargl acdd508a97 re PR fortran/82994 (ICE in gfc_match_deallocate, at fortran/match.c:4478)
2018-02-07  Steven G. Kargl  <kargl@gcc.gnu.org>

	PR fortran/82994
	* match.c (gfc_match_deallocate): Check for NULL pointer.

2018-02-07  Steven G. Kargl  <kargl@gcc.gnu.org>

	PR fortran/82994
	* gfortran.dg/deallocate_error_3.f90: New test.
	* gfortran.dg/deallocate_error_4.f90: New test.

From-SVN: r257467
2018-02-07 22:36:24 +00:00
Steven G. Kargl 1c96aa8b47 re PR fortran/82049 (ICE with character(*),parameter array constructor)
2018-02-07  Steven G. Kargl  <kargl@gcc.gnu.org>

	PR fortran/82049
	* match.c (gfc_match_type_spec): If the charlen is non-NULL, then
	try to resolve it.  While here return early if possible.

2018-02-07  Steven G. Kargl  <kargl@gcc.gnu.org>

	PR fortran/82049
	* gfortran.dg/assumed_charlen_parameter.f90: New test.

From-SVN: r257460
2018-02-07 20:45:40 +00:00
Bill Schmidt d6e5fa72eb backport: rs6000.c (rs6000_option_override_internal): Display warning message for -mno-speculate-indirect-jumps.
[gcc]

2018-02-07  Bill Schmidt  <wschmidt@linux.vnet.ibm.com>

	Backport from mainline
	2018-02-06  Bill Schmidt  <wschmidt@linux.vnet.ibm.com>

	* config/rs6000/rs6000.c (rs6000_option_override_internal):
	Display warning message for -mno-speculate-indirect-jumps.

[gcc/testsuite]

2018-02-07  Bill Schmidt  <wschmidt@linux.vnet.ibm.com>

	Backport from mainline
	2018-02-06  Bill Schmidt  <wschmidt@linux.vnet.ibm.com>

	* gcc.target/powerpc/safe-indirect-jump-1.c: Detect deprecation
	warning for -mno-speculate-indirect-jumps.
	* gcc.target/powerpc/safe-indirect-jump-2.c: Likewise.
	* gcc.target/powerpc/safe-indirect-jump-3.c: Likewise.
	* gcc.target/powerpc/safe-indirect-jump-4.c: Likewise.
	* gcc.target/powerpc/safe-indirect-jump-5.c: Likewise.
	* gcc.target/powerpc/safe-indirect-jump-6.c: Likewise.
	* gcc.target/powerpc/safe-indirect-jump-7.c: Likewise.

From-SVN: r257458
2018-02-07 20:04:39 +00:00
GCC Administrator 701609214f Daily bump.
From-SVN: r257434
2018-02-07 00:16:23 +00:00
Rainer Orth 5facf7ac76 Avoid cc1 SEGV in gcc.dg/rtl/x86_64/final.c (PR target/79975)
PR target/79975
	* gcc.dg/rtl/x86_64/final.c: Add -fdwarf2-cfi-asm to dg-options.

From-SVN: r257409
2018-02-06 10:30:49 +00:00
GCC Administrator bb1279f136 Daily bump.
From-SVN: r257403
2018-02-06 00:16:09 +00:00
Rainer Orth 7d28399ad6 Disable SHF_MERGE on Solaris 10/x86 (PR bootstrap/84017)
Backport from mainline
	2018-01-30  Rainer Orth  <ro@CeBiTec.Uni-Bielefeld.DE>

	PR bootstrap/84017
	* configure.ac (gcc_cv_as_shf_merge): Disable on Solaris 10/x86.
	* configure: Regenerate.

From-SVN: r257398
2018-02-05 22:35:08 +00:00
Peter Bergner 8ee9f27913 backport: re PR target/56010 (Powerpc, -mcpu=native and -mtune=native use the wrong name for target 7450)
Back port from mainline
	2018-02-01  Peter Bergner  <bergner@vnet.ibm.com>

	PR target/56010
	PR target/83743
	* config/rs6000/driver-rs6000.c: #include "diagnostic.h".
	#include "opts.h".
	(rs6000_supported_cpu_names): New static variable.
	(linux_cpu_translation_table): Likewise.
	(elf_platform) <cpu>: Define new static variable and use it.
	Translate kernel AT_PLATFORM name to canonical name if needed.
	Error if platform name is unknown.

From-SVN: r257392
2018-02-05 13:17:37 -06:00
GCC Administrator 6ba0afd970 Daily bump.
From-SVN: r257371
2018-02-05 00:16:08 +00:00
GCC Administrator 9ec67122e6 Daily bump.
From-SVN: r257361
2018-02-04 00:16:19 +00:00
GCC Administrator a280be2ab2 Daily bump.
From-SVN: r257354
2018-02-03 00:16:09 +00:00
H.J. Lu f11eef4c5a i386: Pass INVALID_REGNUM as invalid register number
Backport from mainline
	* config/i386/i386.c (ix86_output_function_return): Pass
	INVALID_REGNUM, instead of -1, as invalid register number to
	indirect_thunk_name and output_indirect_thunk.

From-SVN: r257341
2018-02-02 08:47:02 -08:00
Uros Bizjak fc8922bb92 dec_parameter_1.f (sub1): Remove statement with no effect.
* gfortran.dg/dec_parameter_1.f (sub1): Remove statement with no effect.
	* gfortran.dg/dec_parameter_2.f90 (sub1): Ditto.

From-SVN: r257338
2018-02-02 17:05:27 +01:00
GCC Administrator 5fb556ce38 Daily bump.
From-SVN: r257321
2018-02-02 00:16:23 +00:00
Uros Bizjak e569fc9aac re PR rtl-optimization/84123 (internal compiler error: in gen_rtx_SUBREG, at emit-rtl.c:908, alpha linux.)
PR rtl-optimization/84123
	* combine.c (change_zero_ext): Check if hard register satisfies
	can_change_dest_mode before calling gen_lowpart_SUBREG.

From-SVN: r257318
2018-02-01 23:22:03 +01:00
Renlin Li d94c2790e0 [PR83370][AARCH64]Use tighter register constraint for sibcall patterns.
gcc/

	backport from mainline
	2018-02-01  Renlin Li  <renlin.li@arm.com>

	PR target/83370
	* config/aarch64/aarch64.c (aarch64_class_max_nregs): Handle
	TAILCALL_ADDR_REGS.
	(aarch64_register_move_cost): Likewise.
	* config/aarch64/aarch64.h (reg_class): Rename CALLER_SAVE_REGS to
	TAILCALL_ADDR_REGS.
	(REG_CLASS_NAMES): Likewise.
	(REG_CLASS_CONTENTS): Rename CALLER_SAVE_REGS to
	TAILCALL_ADDR_REGS. Remove IP registers.
	* config/aarch64/aarch64.md (Ucs): Update register constraint.

gcc/testsuite/

	backport from mainline
	2018-02-01  Richard Sandiford  <richard.sandiford@linaro.org>

	PR target/83370
	* gcc.target/aarch64/pr83370.c: New.

From-SVN: r257314
2018-02-01 21:09:06 +00:00
Richard Biener 8ee604e008 backport: re PR target/82795 (ICE in predicate_mem_writes, at tree-if-conv.c:2251)
2018-02-01  Richard Biener  <rguenther@suse.de>

	Backport from mainline
	2017-11-02  Richard Biener  <rguenther@suse.de>

	PR tree-optimization/82795
	* tree-if-conv.c (predicate_mem_writes): Remove bogus assert.

	* gcc.target/i386/pr82795.c: New testcase.

From-SVN: r257292
2018-02-01 12:07:46 +00:00
Rainer Orth c6bd500eca Guard against incomplete AVX512F support in Solaris as
Backport from mainline
	2018-01-12  Rainer Orth  <ro@CeBiTec.Uni-Bielefeld.DE>

	* lib/target-supports.exp (check_effective_target_avx512f): Also
	check for __builtin_ia32_addsd_round,
	__builtin_ia32_getmantsd_round.
	* gcc.target/i386/i386.exp (check_effective_target_avx512f):
	Remove.

From-SVN: r257282
2018-02-01 08:07:12 +00:00
GCC Administrator 1d1418bd61 Daily bump.
From-SVN: r257278
2018-02-01 00:16:21 +00:00
Richard Biener 12ee89961a backport: re PR bootstrap/80867 (gnat bootstrap broken on powerpc64le-linux-gnu with -O3)
gcc/ChangeLog:

2018-01-31  Richard Biener <rguenther@suse.de>
	    Kelvin Nilsen  <kelvin@gcc.gnu.org>

	Backport from mainline
	2018-01-29  Richard Biener <rguenther@suse.de>
		    Kelvin Nilsen  <kelvin@gcc.gnu.org>

	PR bootstrap/80867
	* tree-vect-stmts.c (vectorizable_call): Don't call
	targetm.vectorize_builtin_md_vectorized_function if callee is
	NULL.


Co-Authored-By: Kelvin Nilsen <kelvin@gcc.gnu.org>

From-SVN: r257248
2018-01-31 18:22:19 +00:00
Eric Botcazou 9f734f6bec re PR rtl-optimization/84071 (wrong elimination of zero-extension after sign-extended load)
PR rtl-optimization/84071
	* doc/tm.texi.in (WORD_REGISTER_OPERATIONS): Add explicit case.
	* doc/tm.texi: Regenerate.

From-SVN: r257238
2018-01-31 15:01:53 +00:00
Eric Botcazou fa2faf84b1 re PR rtl-optimization/84071 (wrong elimination of zero-extension after sign-extended load)
PR rtl-optimization/84071
	* combine.c (record_dead_and_set_regs_1): Record the source unmodified
	for a paradoxical SUBREG on a WORD_REGISTER_OPERATIONS target.

From-SVN: r257226
2018-01-31 10:08:08 +00:00
GCC Administrator 930e0d77a4 Daily bump.
From-SVN: r257214
2018-01-31 00:16:22 +00:00
GCC Administrator 52d413c621 Daily bump.
From-SVN: r257169
2018-01-30 00:16:16 +00:00
Joseph Myers fe72e7ff68 Fix m68k-linux-gnu libgcc build for ColdFire (PR target/68467).
PR target/68467 is libgcc failing to build for m68k-linux-gnu
configured for ColdFire.

Jeff has an analysis in the PR identifying the problem as resulting
from the callers of libcalls with 1-byte or 2-byte arguments wanting
to push just 1 or 2 bytes on the stack, while the libcall
implementations have the normal C ABI and expect 4-byte arguments.
For normal C functions, I believe the TARGET_PROMOTE_PROTOTYPES
definition would ensure such arguments get passed as 4-byte, but that
does not apply for libcalls.

This patch fixes the issue by defining TARGET_PROMOTE_FUNCTION_MODE
for m68k.  The definition is conservative, only applying promotions in
the case of arguments to libcalls; otherwise it returns the unpromoted
type, which I believe matches what the default implementation of the
hook would have done on m68k.

I have tested that this fixes the libgcc build for ColdFire, and, in
conjunction with one glibc patch, this enables glibc to build cleanly
for ColdFire and to pass the compilation parts of the glibc testsuite
except for one test unrelated to this patch (while glibc and the
compilation parts of the testsuite continue to build OK for
non-ColdFire m68k, as expected).  I have *not* run any GCC tests for
this patch, or any execution tests for m68k.

	Backport from mainline
	2018-01-24  Joseph Myers  <joseph@codesourcery.com>

	PR target/68467
	* config/m68k/m68k.c (m68k_promote_function_mode): New function.
	(TARGET_PROMOTE_FUNCTION_MODE): New macro.

From-SVN: r257165
2018-01-29 21:00:52 +00:00
Jason Merrill fceecb5f37 PR c++/82461 - constexpr list-initialized member
* constexpr.c (potential_constant_expression_1): Check
	TARGET_EXPR_DIRECT_INIT_P.

From-SVN: r257164
2018-01-29 15:58:36 -05:00
Uros Bizjak 1f82453a8d backport: re PR target/81763 (Issues with BMI on 32bit x86 apps on GCC 7.1+)
Backport from mainline
	2018-01-26  Uros Bizjak  <ubizjak@gmail.com>

	PR target/81763
	* config/i386/i386.md (*andndi3_doubleword): Add earlyclobber
	to (=&r,r,rm) alternative. Add (=r,0,rm) and (=r,r,0) alternatives.

From-SVN: r257154
2018-01-29 17:03:17 +01:00
Jonathan Wakely 9a5343f711 PR libstdc++/83833 fix failing test on ia32
PR libstdc++/83833
	* testsuite/26_numerics/random/chi_squared_distribution/83833.cc:
	Add -ffloat-store to options for m68k and ia32.

From-SVN: r257150
2018-01-29 14:45:00 +00:00
Jonathan Wakely 0396ba8a88 PR libstdc++/83658 fix exception-safety in std::any::emplace
PR libstdc++/83658
	* include/std/any (any::__do_emplace): Only set _M_manager after
	constructing the contained object.
	* testsuite/20_util/any/misc/any_cast_neg.cc: Adjust dg-error line.
	* testsuite/20_util/any/modifiers/83658.cc: New test.

From-SVN: r257145
2018-01-29 13:58:54 +00:00
Jonathan Wakely feb2be45d4 PR libstdc++/83833 fix chi_squared_distribution::param(const param&)
Backport from mainline
2018-01-15  Jonathan Wakely  <jwakely@redhat.com>

	PR libstdc++/83833
	* include/bits/random.h (chi_squared_distribution::param): Update
	gamma distribution parameter.
	* testsuite/26_numerics/random/chi_squared_distribution/83833.cc: New
	test.

From-SVN: r257144
2018-01-29 13:58:49 +00:00
Alan Modra 1bb3a7a3af fix changelog typo
From-SVN: r257136
2018-01-29 14:58:41 +10:30
Alan Modra 07d298bf39 PR84033, powerpc64le -moptimize-swaps bad code with vec_vbpermq
vbpermq produces its output in bits 48..63 of the target vector reg,
so the output cannot be lane swapped.

gcc/
	PR target/84033
	* config/rs6000/rs6000.c (rtx_is_swappable_p): Exclude
	UNSPEC_VBPERMQ.
gcc/testsuite/
	PR target/84033
	* gcc.target/powerpc/swaps-p8-46.c: New.

Backport svn r257070

From-SVN: r257135
2018-01-29 14:53:00 +10:30
GCC Administrator bbb41b17fe Daily bump.
From-SVN: r257133
2018-01-29 00:16:10 +00:00
GCC Administrator 08fce90c27 Daily bump.
From-SVN: r257129
2018-01-28 00:16:08 +00:00
H.J. Lu 6631266e40 Replace -mfunction-return== with -mfunction-return=
Fix a typo in doc/invoke.texi.

	Backport from mainline
	* doc/invoke.texi: Replace -mfunction-return==@var{choice} with
	-mfunction-return=@var{choice}.

From-SVN: r257125
2018-01-27 06:07:29 -08:00
H.J. Lu 8d5cf96064 i386: Use const reference of struct ix86_frame to avoid copy
We can use const reference of struct ix86_frame to avoid making a local
copy of ix86_frame.  ix86_expand_epilogue makes a local copy of struct
ix86_frame and uses the reg_save_offset field as a local variable.  This
patch uses a separate local variable for reg_save_offset.

Tested on x86-64 with ada.

	Backport from mainline
	PR target/83905
	* config/i386/i386.c (ix86_expand_prologue): Use cost reference
	of struct ix86_frame.
	(ix86_expand_epilogue): Likewise.  Add a local variable for
	the reg_save_offset field in struct ix86_frame.

From-SVN: r257123
2018-01-27 05:10:24 -08:00
GCC Administrator a949926b75 Daily bump.
From-SVN: r257116
2018-01-27 00:16:10 +00:00
Segher Boessenkool 4a5b2fc906 rs6000: Fix safe-indirect-jump-[18].c
Thist patch merges the safe-indirect-jump-1.c and -8.c testcases,
since they do the same thing.  On the 64-bit and AIX ABIs the indirect
call is not a sibcall, since there is code generated after the call
(the restore of r2).  On the 32-bit non-AIX ABIs it is a sibcall.


	Backport from trunk
	2018-01-26  Segher Boessenkool  <segher@kernel.crashing.org>

	* gcc.target/powerpc/safe-indirect-jump-1.c: Build on all targets.
	Make expected output depend on whether we expect sibcalls or not.
	* gcc.target/powerpc/safe-indirect-jump-8.c: Delete (merged into
	safe-indirect-jump-1.c).

	Backport from trunk
	2018-01-21  Bill Schmidt  <wschmidt@linux.vnet.ibm.com>

	PR target/83946
	* gcc.target/powerpc/safe-indirect-jump-8.c: Skip for AIX.

From-SVN: r257110
2018-01-26 22:31:37 +01:00
Nathan Sidwell bfddeb89ee [C++/82878] backport fix
https://gcc.gnu.org/ml/gcc-patches/2018-01/msg02170.html
	PR c++/82878
	PR c++/78495
	* call.c (build_call_a): Don't set CALL_FROM_THUNK_P for inherited
	ctor.
	* cp-gimplify.c	(cp_genericize_r): Restore THUNK dereference
	inhibibition check removed in previous c++/78495 change.

	PR c++/82878
	* g++.dg/cpp0x/pr82878.C: New.
	* g++.dg/cpp1z/inh-ctor38.C: Check moves too.

From-SVN: r257089
2018-01-26 13:48:37 +00:00
Jakub Jelinek 534d53db5f re PR rtl-optimization/83985 (Compile time hog for 32-bit BE powerpc targets)
PR rtl-optimization/83985
	* dce.c (deletable_insn_p): Return false for separate shrink wrapping
	REG_CFA_RESTORE insns.
	(delete_unmarked_insns): Don't ignore separate shrink wrapping
	REG_CFA_RESTORE insns here.

	* gcc.dg/pr83985.c: New test.

From-SVN: r257088
2018-01-26 13:24:53 +01:00
GCC Administrator 76ae1eec43 Daily bump.
From-SVN: r257072
2018-01-26 00:16:11 +00:00
Uros Bizjak fd526ae1ce backport: i386.c (indirect_thunk_name): Declare regno as unsigned int.
Backport from mainline
	2018-01-17  Uros Bizjak  <ubizjak@gmail.com>

	* config/i386/i386.c (indirect_thunk_name): Declare regno
	as unsigned int.  Compare regno with INVALID_REGNUM.
	(output_indirect_thunk): Ditto.
	(output_indirect_thunk_function): Ditto.
	(ix86_code_end): Declare regno as unsigned int.  Use INVALID_REGNUM
	in the call to output_indirect_thunk_function.

From-SVN: r257067
2018-01-25 20:39:01 +01:00
Michael Meissner 8c92f46a25 backport: re PR target/83862 (powerpc: ICE in signbit testcase)
[gcc]
2018-01-25  Michael Meissner  <meissner@linux.vnet.ibm.com>

	Back port from trunk
	2018-01-22  Michael Meissner  <meissner@linux.vnet.ibm.com>

	PR target/83862
	* config/rs6000/rs6000-protos.h (rs6000_split_signbit): Delete,
	no longer used.
	* config/rs6000/rs6000.c (rs6000_split_signbit): Likewise.
	* config/rs6000/rs6000.md (signbit<mode>2): Change code for IEEE
	128-bit to produce an UNSPEC move to get the double word with the
	signbit and then a shift directly to do signbit.
	(signbit<mode>2_dm): Replace old IEEE 128-bit signbit
	implementation with a new version that just does either a direct
	move or a regular move.  Move memory interface to separate insns.
	Move insns so they are next to the expander.
	(signbit<mode>2_dm_mem_be): New combiner insns to combine load
	with signbit move.  Split big and little endian case.
	(signbit<mode>2_dm_mem_le): Likewise.
	(signbit<mode>2_dm_<su>ext): Delete, no longer used.
	(signbit<mode>2_dm2): Likewise.

[gcc/testsuite]
2018-01-25  Michael Meissner  <meissner@linux.vnet.ibm.com>

	Back port from trunk
	2018-01-22  Michael Meissner  <meissner@linux.vnet.ibm.com>

	PR target/83862
	* gcc.target/powerpc/pr83862.c: New test.

From-SVN: r257060
2018-01-25 17:36:47 +00:00
Peter Bergner 24f63f147e backport: re PR target/83399 (Power8 ICE During LRA with 2-op rtl pattern for lvx instruction)
gcc/
	Back port from mainline
	2018-01-10  Peter Bergner  <bergner@vnet.ibm.com>

	PR target/83399
	* config/rs6000/rs6000.c (print_operand) <'y'>: Use
	VECTOR_MEM_ALTIVEC_OR_VSX_P.
	* config/rs6000/vsx.md (*vsx_le_perm_load_<mode> for VSX_D): Use
	indexed_or_indirect_operand predicate.
	(*vsx_le_perm_load_<mode> for VSX_W): Likewise.
	(*vsx_le_perm_load_v8hi): Likewise.
	(*vsx_le_perm_load_v16qi): Likewise.
	(*vsx_le_perm_store_<mode> for VSX_D): Likewise.
	(*vsx_le_perm_store_<mode> for VSX_W): Likewise.
	(*vsx_le_perm_store_v8hi): Likewise.
	(*vsx_le_perm_store_v16qi): Likewise.
	(eight unnamed splitters): Likewise.

gcc/testsuite/
	Back port from mainline
	2018-01-10  Peter Bergner  <bergner@vnet.ibm.com>

	PR target/83399
	* gcc.target/powerpc/pr83399.c: New test.

From-SVN: r257058
2018-01-25 10:50:08 -06:00
Bill Schmidt 9120a85da4 backport: rs6000-p8swap.c (swap_feeds_both_load_and_store): New function.
2018-01-25  Bill Schmidt  <wschmidt@linux.vnet.ibm.com>

	Backport from mainline
	2018-01-02  Bill Schmidt  <wschmidt@linux.vnet.ibm.com>

	* config/rs6000/rs6000-p8swap.c (swap_feeds_both_load_and_store):
	New function.
	(rs6000_analyze_swaps): Mark a web unoptimizable if it contains a
	swap associated with both a load and a store.

From-SVN: r257056
2018-01-25 16:23:21 +00:00
Jonathan Wakely ae5df2bb8d PR libstdc++/81076 make __byte_operand SFINAE-friendly
PR libstdc++/81076
	* include/c_global/cstddef (__byte_operand): Define primary template.
	* testsuite/18_support/byte/81076.cc: New test.

From-SVN: r257055
2018-01-25 15:46:46 +00:00
Jonathan Wakely 94bb0f5985 PR libstdc++/83830 Define std::has_unique_object_representations_v
PR libstdc++/83830
	* include/std/type_traits (has_unique_object_representations_v): Add
	variable template.
	* testsuite/20_util/has_unique_object_representations/value.cc: Check
	variable template.

From-SVN: r257054
2018-01-25 15:46:41 +00:00
Richard Biener 40394b23e9 BASE-VER: Increment to 7.3.1.
2018-01-25  Richard Biener  <rguenther@suse.de>

	* BASE-VER: Increment to 7.3.1.

From-SVN: r257043
2018-01-25 09:25:01 +00:00
1863 changed files with 79869 additions and 20734 deletions

View File

@ -1,3 +1,19 @@
2019-11-14 Release Manager
* GCC 7.5.0 released.
2018-12-06 Release Manager
* GCC 7.4.0 released.
2018-06-22 Jakub Jelinek <jakub@redhat.com>
Backported from mainline
2018-04-18 David Malcolm <dmalcolm@redhat.com>
PR jit/85384
* configure: Regenerate.
2018-01-25 Release Manager
* GCC 7.3.0 released.

View File

@ -1,3 +1,19 @@
2019-11-14 Release Manager
* GCC 7.5.0 released.
2018-12-06 Release Manager
* GCC 7.4.0 released.
2018-06-22 Jakub Jelinek <jakub@redhat.com>
Backported from mainline
2018-04-18 David Malcolm <dmalcolm@redhat.com>
PR jit/85384
* acx.m4 (GCC_BASE_VER): Remove \$\$ from sed expression.
2018-01-25 Release Manager
* GCC 7.3.0 released.

View File

@ -246,7 +246,7 @@ AC_DEFUN([GCC_BASE_VER],
[AS_HELP_STRING([--with-gcc-major-version-only], [use only GCC major number in filesystem paths])],
[if test x$with_gcc_major_version_only = xyes ; then
changequote(,)dnl
get_gcc_base_ver="sed -e 's/^\([0-9]*\).*\$\$/\1/'"
get_gcc_base_ver="sed -e 's/^\([0-9]*\).*/\1/'"
changequote([,])dnl
fi
])

2
configure vendored
View File

@ -6620,7 +6620,7 @@ fi
# Check whether --with-gcc-major-version-only was given.
if test "${with_gcc_major_version_only+set}" = set; then :
withval=$with_gcc_major_version_only; if test x$with_gcc_major_version_only = xyes ; then
get_gcc_base_ver="sed -e 's/^\([0-9]*\).*\$\$/\1/'"
get_gcc_base_ver="sed -e 's/^\([0-9]*\).*/\1/'"
fi
fi

View File

@ -1,3 +1,15 @@
2019-11-14 Release Manager
* GCC 7.5.0 released.
2019-08-16 Uros Bizjak <ubizjak@gmail.com>
* test_summary: Do not escape "=".
2018-12-06 Release Manager
* GCC 7.4.0 released.
2018-01-25 Release Manager
* GCC 7.3.0 released.

View File

@ -1,3 +1,11 @@
2019-11-14 Release Manager
* GCC 7.5.0 released.
2018-12-06 Release Manager
* GCC 7.4.0 released.
2018-01-25 Release Manager
* GCC 7.3.0 released.

View File

@ -1,3 +1,11 @@
2019-11-14 Release Manager
* GCC 7.5.0 released.
2018-12-06 Release Manager
* GCC 7.4.0 released.
2018-01-25 Release Manager
* GCC 7.3.0 released.

View File

@ -1,3 +1,11 @@
2019-11-14 Release Manager
* GCC 7.5.0 released.
2018-12-06 Release Manager
* GCC 7.4.0 released.
2018-01-25 Release Manager
* GCC 7.3.0 released.

View File

@ -126,7 +126,7 @@ NR == 1 {
if (lang == "") lang = " "$2" "; else lang = " ";
}
$2 == "version" { save = $0; $1 = ""; $2 = ""; version = $0; gsub(/^ */, "", version); gsub(/\r$/, "", version); $0 = save; }
/\===.*Summary/ { print ""; print; blanks=1; }
/===.*Summary/ { print ""; print; blanks=1; }
/tests ===/ || /^(Target|Host|Native)/ || $2 == "version" { print; blanks=1; }
/^(XPASS|FAIL|UNRESOLVED|WARNING|ERROR|# of )/ { sub ("\r", ""); print; }
/^using:/ { print ""; print; print ""; }

View File

@ -1,3 +1,76 @@
2019-11-14 Release Manager
* GCC 7.5.0 released.
2019-09-04 Iain Sandoe <iain@sandoe.co.uk>
Backport from mainline.
2019-08-18 C.G. Dogan <gcc+cgdogan.00@gmail.com>
Iain Sandoe <iain@sandoe.co.uk>
PR target/83531
* inclhack.def (darwin_api_availability): New; strip leading
underscores from API_XXXX defines.
* fixincl.x: Regenerate.
* tests/base/os/availability.h: New file.
2019-09-04 Iain Sandoe <iain@sandoe.co.uk>
Backport from mainline.
2019-06-21 Iain Sandoe <iain@sandoe.co.uk>
* inclhack.def: Replace the complex test using __STRICT_ANSI__ and
__STDC_VERSION__ with a test using __DARWIN_NO_LONG_LONG.
Ensure that the top level math.h uses <> to wrap included headers
rather than "".
* fixincl.x: Regenerated.
* tests/base/architecture/ppc/math.h: Update test to include the
__DARWIN_NO_LONG_LONG case.
2019-09-04 Iain Sandoe <iain@sandoe.co.uk>
Backport from mainline.
2019-06-21 Iain Sandoe <iain@sandoe.co.uk>
* inclhack.def: Guard __has_attribute and __has_extension in
os/base.h.
Guard Apple blocks syntax in dispatch/object.h.
* fixincl.x: Regenerate.
* tests/base/dispatch/object.h: New file.
* tests/base/os/base.h: New file.
2019-06-03 Iain Sandoe <iain@sandoe.co.uk>
Backport from mainline.
2019-05-11 Iain Sandoe <iain@sandoe.co.uk>
PR bootstrap/89864
* inclhack.def (darwin_ucred__Atomic): Do not supply test_text
for wrap fixes.
* fixincl.x: Regenerated.
Backport from mainline.
2019-04-18 Erik Schnetter <schnetter@gmail.com>
Jakub Jelinek <jakub@redhat.com>
Iain Sandoe <iain@sandoe.co.uk>
PR bootstrap/89864
* inclhack.def (darwin_ucred__Atomic): New, work around _Atomic keyword
use in headers included by C++.
* fixincl.x: Regenerated.
2018-12-06 Release Manager
* GCC 7.4.0 released.
2018-06-22 Jakub Jelinek <jakub@redhat.com>
Backported from mainline
2018-04-18 David Malcolm <dmalcolm@redhat.com>
PR jit/85384
* configure: Regenerate.
2018-01-25 Release Manager
* GCC 7.3.0 released.

View File

@ -5401,7 +5401,7 @@ _ACEOF
# Check whether --with-gcc-major-version-only was given.
if test "${with_gcc_major_version_only+set}" = set; then :
withval=$with_gcc_major_version_only; if test x$with_gcc_major_version_only = xyes ; then
get_gcc_base_ver="sed -e 's/^\([0-9]*\).*\$\$/\1/'"
get_gcc_base_ver="sed -e 's/^\([0-9]*\).*/\1/'"
fi
fi

View File

@ -1,12 +1,12 @@
/* -*- buffer-read-only: t -*- vi: set ro:
*
*
* DO NOT EDIT THIS FILE (fixincl.x)
*
* It has been AutoGen-ed Saturday February 25, 2017 at 03:25:44 PM EST
*
* It has been AutoGen-ed August 29, 2019 at 12:25:44 AM by AutoGen 5.17.4
* From the definitions inclhack.def
* and the template file fixincl
*/
/* DO NOT SVN-MERGE THIS FILE, EITHER Sat 25 Feb 2017 15:25:44 EST
/* DO NOT SVN-MERGE THIS FILE, EITHER Thu Aug 29 00:25:44 BST 2019
*
* You must regenerate it. Use the ./genfixes script.
*
@ -15,7 +15,7 @@
* certain ANSI-incompatible system header files which are fixed to work
* correctly with ANSI C and placed in a directory that GNU C will search.
*
* This file contains 248 fixup descriptions.
* This file contains 253 fixup descriptions.
*
* See README for more information.
*
@ -267,6 +267,56 @@ static const char* apzAab_Darwin7_9_Long_Double_FuncsPatch[] = {
#endif /* __MATH__ */",
(char*)NULL };
/* * * * * * * * * * * * * * * * * * * * * * * * * *
*
* Description of Darwin_Api_Availability fix
*/
tSCC zDarwin_Api_AvailabilityName[] =
"darwin_api_availability";
/*
* File name selection pattern
*/
tSCC zDarwin_Api_AvailabilityList[] =
"os/availability.h\0";
/*
* Machine/OS name selection pattern
*/
tSCC* apzDarwin_Api_AvailabilityMachs[] = {
"*-*-darwin*",
(const char*)NULL };
/*
* content selection pattern - do fix if pattern found
*/
tSCC zDarwin_Api_AvailabilitySelect0[] =
" *#define __API_AVAILABLE.*\n\
*#define __API_DEPRECATED.*\n\
*#define __API_DEPRECATED_WITH_REPLACEMENT.*\n\
*#define __API_UNAVAILABLE.*\n";
/*
* content bypass pattern - skip fix if pattern found
*/
tSCC zDarwin_Api_AvailabilityBypass0[] =
"__IPHONE_OS_VERSION_MIN_REQUIRED";
#define DARWIN_API_AVAILABILITY_TEST_CT 2
static tTestDesc aDarwin_Api_AvailabilityTests[] = {
{ TT_NEGREP, zDarwin_Api_AvailabilityBypass0, (regex_t*)NULL },
{ TT_EGREP, zDarwin_Api_AvailabilitySelect0, (regex_t*)NULL }, };
/*
* Fix Command Arguments for Darwin_Api_Availability
*/
static const char* apzDarwin_Api_AvailabilityPatch[] = {
"format",
" #define API_AVAILABLE(...)\n\
#define API_DEPRECATED(...)\n\
#define API_DEPRECATED_WITH_REPLACEMENT(...)\n\
#define API_UNAVAILABLE(...)\n",
(char*)NULL };
/* * * * * * * * * * * * * * * * * * * * * * * * * *
*
* Description of Aab_Fd_Zero_Asm_Posix_Types_H fix
@ -2638,7 +2688,7 @@ tSCC zDarwin_9_Long_Double_Funcs_2List[] =
* Machine/OS name selection pattern
*/
tSCC* apzDarwin_9_Long_Double_Funcs_2Machs[] = {
"*-*-darwin7.9*",
"*-*-darwin*",
(const char*)NULL };
/*
@ -2742,6 +2792,42 @@ static const char* apzDarwin_Gcc4_BreakagePatch[] = {
"((__GNUC__ >= 4) || (__GNUC__ == 3 && __GNUC_MINOR__ >= 1))",
(char*)NULL };
/* * * * * * * * * * * * * * * * * * * * * * * * * *
*
* Description of Darwin_Ll_Funcs_Avail fix
*/
tSCC zDarwin_Ll_Funcs_AvailName[] =
"darwin_ll_funcs_avail";
/*
* File name selection pattern
*/
tSCC zDarwin_Ll_Funcs_AvailList[] =
"architecture/ppc/math.h\0architecture/i386/math.h\0";
/*
* Machine/OS name selection pattern
*/
tSCC* apzDarwin_Ll_Funcs_AvailMachs[] = {
"*-*-darwin*",
(const char*)NULL };
/*
* content selection pattern - do fix if pattern found
*/
tSCC zDarwin_Ll_Funcs_AvailSelect0[] =
"#if[^_]*__STDC_VERSION__[^_]*__STDC_VERSION__[^1]*199901L[^_]*__STRICT_ANSI__[^_]*__GNUC__[^)]*";
#define DARWIN_LL_FUNCS_AVAIL_TEST_CT 1
static tTestDesc aDarwin_Ll_Funcs_AvailTests[] = {
{ TT_EGREP, zDarwin_Ll_Funcs_AvailSelect0, (regex_t*)NULL }, };
/*
* Fix Command Arguments for Darwin_Ll_Funcs_Avail
*/
static const char* apzDarwin_Ll_Funcs_AvailPatch[] = { sed_cmd_z,
"-e", "s/#if[^_]*__STDC_VERSION__[^_]*__STDC_VERSION__[^_]*199901L[^_]*__STRICT_ANSI__[^_]*__GNUC__[^\\)]*)/#if !(__DARWIN_NO_LONG_LONG)/",
(char*)NULL };
/* * * * * * * * * * * * * * * * * * * * * * * * * *
*
* Description of Darwin_Longjmp_Noreturn fix
@ -2904,6 +2990,86 @@ static const char* apzDarwin_Os_Trace_3Patch[] = {
#endif",
(char*)NULL };
/* * * * * * * * * * * * * * * * * * * * * * * * * *
*
* Description of Darwin_Os_Base_1 fix
*/
tSCC zDarwin_Os_Base_1Name[] =
"darwin_os_base_1";
/*
* File name selection pattern
*/
tSCC zDarwin_Os_Base_1List[] =
"os/base.h\0";
/*
* Machine/OS name selection pattern
*/
tSCC* apzDarwin_Os_Base_1Machs[] = {
"*-*-darwin*",
(const char*)NULL };
/*
* content selection pattern - do fix if pattern found
*/
tSCC zDarwin_Os_Base_1Select0[] =
"#define __has_attribute.*\n\
#endif";
#define DARWIN_OS_BASE_1_TEST_CT 1
static tTestDesc aDarwin_Os_Base_1Tests[] = {
{ TT_EGREP, zDarwin_Os_Base_1Select0, (regex_t*)NULL }, };
/*
* Fix Command Arguments for Darwin_Os_Base_1
*/
static const char* apzDarwin_Os_Base_1Patch[] = {
"format",
"%0\n\
#ifndef __has_extension\n\
#define __has_extension(x) 0\n\
#endif",
(char*)NULL };
/* * * * * * * * * * * * * * * * * * * * * * * * * *
*
* Description of Darwin_Dispatch_Object_1 fix
*/
tSCC zDarwin_Dispatch_Object_1Name[] =
"darwin_dispatch_object_1";
/*
* File name selection pattern
*/
tSCC zDarwin_Dispatch_Object_1List[] =
"dispatch/object.h\0";
/*
* Machine/OS name selection pattern
*/
tSCC* apzDarwin_Dispatch_Object_1Machs[] = {
"*-*-darwin*",
(const char*)NULL };
/*
* content selection pattern - do fix if pattern found
*/
tSCC zDarwin_Dispatch_Object_1Select0[] =
"typedef void.*\\^dispatch_block_t.*";
#define DARWIN_DISPATCH_OBJECT_1_TEST_CT 1
static tTestDesc aDarwin_Dispatch_Object_1Tests[] = {
{ TT_EGREP, zDarwin_Dispatch_Object_1Select0, (regex_t*)NULL }, };
/*
* Fix Command Arguments for Darwin_Dispatch_Object_1
*/
static const char* apzDarwin_Dispatch_Object_1Patch[] = {
"format",
"#if __BLOCKS__\n\
%0\n\
#endif",
(char*)NULL };
/* * * * * * * * * * * * * * * * * * * * * * * * * *
*
* Description of Darwin_Private_Extern fix
@ -3260,6 +3426,48 @@ static const char* apzDarwin_Stdint_7Patch[] = {
#endif",
(char*)NULL };
/* * * * * * * * * * * * * * * * * * * * * * * * * *
*
* Description of Darwin_Ucred__Atomic fix
*/
tSCC zDarwin_Ucred__AtomicName[] =
"darwin_ucred__Atomic";
/*
* File name selection pattern
*/
tSCC zDarwin_Ucred__AtomicList[] =
"sys/ucred.h\0";
/*
* Machine/OS name selection pattern
*/
tSCC* apzDarwin_Ucred__AtomicMachs[] = {
"*-*-darwin*",
(const char*)NULL };
/*
* content selection pattern - do fix if pattern found
*/
tSCC zDarwin_Ucred__AtomicSelect0[] =
"_Atomic";
#define DARWIN_UCRED__ATOMIC_TEST_CT 1
static tTestDesc aDarwin_Ucred__AtomicTests[] = {
{ TT_EGREP, zDarwin_Ucred__AtomicSelect0, (regex_t*)NULL }, };
/*
* Fix Command Arguments for Darwin_Ucred__Atomic
*/
static const char* apzDarwin_Ucred__AtomicPatch[] = {
"wrap",
"#if (__STDC_VERSION__ < 201112L) || defined(__cplusplus)\n\
# define _Atomic volatile\n\
#endif\n",
"#if (__STDC_VERSION__ < 201112L) || defined(__cplusplus)\n\
# undef _Atomic\n\
#endif\n",
(char*)NULL };
/* * * * * * * * * * * * * * * * * * * * * * * * * *
*
* Description of Dec_Intern_Asm fix
@ -10139,9 +10347,9 @@ static const char* apzX11_SprintfPatch[] = {
*
* List of all fixes
*/
#define REGEX_COUNT 285
#define REGEX_COUNT 291
#define MACH_LIST_SIZE_LIMIT 187
#define FIX_COUNT 248
#define FIX_COUNT 253
/*
* Enumerate the fixes
@ -10150,6 +10358,7 @@ typedef enum {
AAB_AIX_STDIO_FIXIDX,
AAB_AIX_FCNTL_FIXIDX,
AAB_DARWIN7_9_LONG_DOUBLE_FUNCS_FIXIDX,
DARWIN_API_AVAILABILITY_FIXIDX,
AAB_FD_ZERO_ASM_POSIX_TYPES_H_FIXIDX,
AAB_FD_ZERO_GNU_TYPES_H_FIXIDX,
AAB_FD_ZERO_SELECTBITS_H_FIXIDX,
@ -10210,10 +10419,13 @@ typedef enum {
DARWIN_9_LONG_DOUBLE_FUNCS_2_FIXIDX,
DARWIN_EXTERNC_FIXIDX,
DARWIN_GCC4_BREAKAGE_FIXIDX,
DARWIN_LL_FUNCS_AVAIL_FIXIDX,
DARWIN_LONGJMP_NORETURN_FIXIDX,
DARWIN_OS_TRACE_1_FIXIDX,
DARWIN_OS_TRACE_2_FIXIDX,
DARWIN_OS_TRACE_3_FIXIDX,
DARWIN_OS_BASE_1_FIXIDX,
DARWIN_DISPATCH_OBJECT_1_FIXIDX,
DARWIN_PRIVATE_EXTERN_FIXIDX,
DARWIN_STDINT_1_FIXIDX,
DARWIN_STDINT_2_FIXIDX,
@ -10222,6 +10434,7 @@ typedef enum {
DARWIN_STDINT_5_FIXIDX,
DARWIN_STDINT_6_FIXIDX,
DARWIN_STDINT_7_FIXIDX,
DARWIN_UCRED__ATOMIC_FIXIDX,
DEC_INTERN_ASM_FIXIDX,
DJGPP_WCHAR_H_FIXIDX,
ECD_CURSOR_FIXIDX,
@ -10413,6 +10626,11 @@ tFixDesc fixDescList[ FIX_COUNT ] = {
AAB_DARWIN7_9_LONG_DOUBLE_FUNCS_TEST_CT, FD_MACH_ONLY | FD_REPLACEMENT,
aAab_Darwin7_9_Long_Double_FuncsTests, apzAab_Darwin7_9_Long_Double_FuncsPatch, 0 },
{ zDarwin_Api_AvailabilityName, zDarwin_Api_AvailabilityList,
apzDarwin_Api_AvailabilityMachs,
DARWIN_API_AVAILABILITY_TEST_CT, FD_MACH_ONLY | FD_SUBROUTINE,
aDarwin_Api_AvailabilityTests, apzDarwin_Api_AvailabilityPatch, 0 },
{ zAab_Fd_Zero_Asm_Posix_Types_HName, zAab_Fd_Zero_Asm_Posix_Types_HList,
apzAab_Fd_Zero_Asm_Posix_Types_HMachs,
AAB_FD_ZERO_ASM_POSIX_TYPES_H_TEST_CT, FD_MACH_ONLY | FD_REPLACEMENT,
@ -10713,6 +10931,11 @@ tFixDesc fixDescList[ FIX_COUNT ] = {
DARWIN_GCC4_BREAKAGE_TEST_CT, FD_MACH_ONLY | FD_SUBROUTINE,
aDarwin_Gcc4_BreakageTests, apzDarwin_Gcc4_BreakagePatch, 0 },
{ zDarwin_Ll_Funcs_AvailName, zDarwin_Ll_Funcs_AvailList,
apzDarwin_Ll_Funcs_AvailMachs,
DARWIN_LL_FUNCS_AVAIL_TEST_CT, FD_MACH_ONLY,
aDarwin_Ll_Funcs_AvailTests, apzDarwin_Ll_Funcs_AvailPatch, 0 },
{ zDarwin_Longjmp_NoreturnName, zDarwin_Longjmp_NoreturnList,
apzDarwin_Longjmp_NoreturnMachs,
DARWIN_LONGJMP_NORETURN_TEST_CT, FD_MACH_ONLY | FD_SUBROUTINE,
@ -10733,6 +10956,16 @@ tFixDesc fixDescList[ FIX_COUNT ] = {
DARWIN_OS_TRACE_3_TEST_CT, FD_MACH_ONLY | FD_SUBROUTINE,
aDarwin_Os_Trace_3Tests, apzDarwin_Os_Trace_3Patch, 0 },
{ zDarwin_Os_Base_1Name, zDarwin_Os_Base_1List,
apzDarwin_Os_Base_1Machs,
DARWIN_OS_BASE_1_TEST_CT, FD_MACH_ONLY | FD_SUBROUTINE,
aDarwin_Os_Base_1Tests, apzDarwin_Os_Base_1Patch, 0 },
{ zDarwin_Dispatch_Object_1Name, zDarwin_Dispatch_Object_1List,
apzDarwin_Dispatch_Object_1Machs,
DARWIN_DISPATCH_OBJECT_1_TEST_CT, FD_MACH_ONLY | FD_SUBROUTINE,
aDarwin_Dispatch_Object_1Tests, apzDarwin_Dispatch_Object_1Patch, 0 },
{ zDarwin_Private_ExternName, zDarwin_Private_ExternList,
apzDarwin_Private_ExternMachs,
DARWIN_PRIVATE_EXTERN_TEST_CT, FD_MACH_ONLY | FD_SUBROUTINE,
@ -10773,6 +11006,11 @@ tFixDesc fixDescList[ FIX_COUNT ] = {
DARWIN_STDINT_7_TEST_CT, FD_MACH_ONLY | FD_SUBROUTINE,
aDarwin_Stdint_7Tests, apzDarwin_Stdint_7Patch, 0 },
{ zDarwin_Ucred__AtomicName, zDarwin_Ucred__AtomicList,
apzDarwin_Ucred__AtomicMachs,
DARWIN_UCRED__ATOMIC_TEST_CT, FD_MACH_ONLY | FD_SUBROUTINE,
aDarwin_Ucred__AtomicTests, apzDarwin_Ucred__AtomicPatch, 0 },
{ zDec_Intern_AsmName, zDec_Intern_AsmList,
apzDec_Intern_AsmMachs,
DEC_INTERN_ASM_TEST_CT, FD_MACH_ONLY,

View File

@ -194,6 +194,33 @@ fix = {
_EndOfHeader_;
};
/*
* SDKs for 10.13 and 10.14 omit the definitions for API_AVAILABLE where
* __attribute__((availability)) is not supported.
*/
fix = {
hackname = darwin_api_availability;
mach = "*-*-darwin*";
files = os/availability.h;
bypass = "__IPHONE_OS_VERSION_MIN_REQUIRED";
select =
" *#define __API_AVAILABLE.*\n"
" *#define __API_DEPRECATED.*\n"
" *#define __API_DEPRECATED_WITH_REPLACEMENT.*\n"
" *#define __API_UNAVAILABLE.*\n";
c_fix = format;
c_fix_arg =
" #define API_AVAILABLE(...)\n"
" #define API_DEPRECATED(...)\n"
" #define API_DEPRECATED_WITH_REPLACEMENT(...)\n"
" #define API_UNAVAILABLE(...)\n";
test_text =
"#define __API_AVAILABLE(...)\n"
"#define __API_DEPRECATED(...)\n"
"#define __API_DEPRECATED_WITH_REPLACEMENT(...)\n"
"#define __API_UNAVAILABLE(...)\n";
};
/*
* This fixes __FD_ZERO bug for linux 2.x.y (x <= 2 && y <= some n)
*/
@ -1364,12 +1391,12 @@ fix = {
};
/*
* For the AAB_darwin7_9_long_double_funcs fix to be useful,
* you have to not use "" includes.
* For the AAB_darwin7_9_long_double_funcs fix (and later fixes for long long)
* to be useful, the main math.h must use <> and not "" includes.
*/
fix = {
hackname = darwin_9_long_double_funcs_2;
mach = "*-*-darwin7.9*";
mach = "*-*-darwin*";
files = math.h;
select = '#include[ \t]+\"';
c_fix = format;
@ -1377,7 +1404,7 @@ fix = {
c_fix_arg = '([ \t]*#[ \t]*include[ \t]+)"([a-z0-9/]+)\.h"';
test_text = '#include "architecture/ppc/math.h"';
test_text = '#include <architecture/ppc/math.h>';
};
/*
@ -1420,6 +1447,22 @@ fix = {
"(__GNUC_MINOR__ >= 1)\n";
};
/*
* math.h hides the long long functions that are available on the system for
* 10.5 and 10.6 SDKs, we expect to use them in G++ without specifying a value
* for __STDC_VERSION__, or switching __STRICT_ANSI__ off.
*/
fix = {
hackname = darwin_ll_funcs_avail;
mach = "*-*-darwin*";
files = architecture/ppc/math.h, architecture/i386/math.h;
select = "#if[^_]*__STDC_VERSION__[^_]*__STDC_VERSION__[^1]*199901L[^_]*"
"__STRICT_ANSI__[^_]*__GNUC__[^\)]*";
sed = "s/#if[^_]*__STDC_VERSION__[^_]*__STDC_VERSION__[^_]*199901L[^_]*"
"__STRICT_ANSI__[^_]*__GNUC__[^\\)]*\)/#if\ !\(__DARWIN_NO_LONG_LONG\)/";
test_text = "#if\ !(__DARWIN_NO_LONG_LONG)";
};
/*
* Before Mac OS X 10.8 <i386/setjmp.h> doesn't mark longjump noreturn.
*/
@ -1491,6 +1534,49 @@ fix = {
_EOText_;
};
/*
* In macOS 10.10 <os/base.h>, doesn't have __has_extension guarded.
*/
fix = {
hackname = darwin_os_base_1;
mach = "*-*-darwin*";
files = os/base.h;
select = <<- OS_BASE_1_SEL
#define __has_attribute.*
#endif
OS_BASE_1_SEL;
c_fix = format;
c_fix_arg = <<- OS_BASE_1_FIX
%0
#ifndef __has_extension
#define __has_extension(x) 0
#endif
OS_BASE_1_FIX;
test_text = <<- OS_BASE_1_TEST
#define __has_attribute(x) 0
#endif
#if __GNUC__
OS_BASE_1_TEST;
};
/*
* In macOS 10.10 <dispatch/object.h>, has unguarded block syntax.
*/
fix = {
hackname = darwin_dispatch_object_1;
mach = "*-*-darwin*";
files = dispatch/object.h;
select = "typedef void.*\\^dispatch_block_t.*";
c_fix = format;
c_fix_arg = "#if __BLOCKS__\n%0\n#endif";
test_text = <<- DISPATCH_OBJECT_1_TEST
typedef void (^dispatch_block_t)(void);
__BEGIN_DECLS
DISPATCH_OBJECT_1_TEST;
};
/*
* __private_extern__ doesn't exist in FSF GCC. Even if it did,
* why would you ever put it in a system header file?
@ -1688,6 +1774,25 @@ fix = {
"#define UINTMAX_C(v) (v ## ULL)";
};
/* The SDK included with XCode 10.2 has the file <sys/ucred.h> that uses the
C11 _Atomic keyword (exposing it to C++ code). The work-around here follows
the header in declaring the entity volatile when _Atomic is not available.
*/
fix = {
hackname = darwin_ucred__Atomic;
mach = "*-*-darwin*";
files = sys/ucred.h;
select = "_Atomic";
c_fix = wrap;
c_fix_arg = "#if (__STDC_VERSION__ < 201112L) || defined(__cplusplus)\n"
"# define _Atomic volatile\n"
"#endif\n";
c_fix_arg = "#if (__STDC_VERSION__ < 201112L) || defined(__cplusplus)\n"
"# undef _Atomic\n"
"#endif\n";
test_text = ""; /* Don't provide this for wrap fixes. */
};
/*
* Fix <c_asm.h> on Digital UNIX V4.0:
* It contains a prototype for a DEC C internal asm() function,

View File

@ -12,3 +12,8 @@
#if defined( BROKEN_NAN_CHECK )
#if 1
#endif /* BROKEN_NAN_CHECK */
#if defined( DARWIN_LL_FUNCS_AVAIL_CHECK )
#if !(__DARWIN_NO_LONG_LONG)
#endif /* DARWIN_LL_FUNCS_AVAIL_CHECK */

View File

@ -0,0 +1,18 @@
/* DO NOT EDIT THIS FILE.
It has been auto-edited by fixincludes from:
"fixinc/tests/inc/dispatch/object.h"
This had to be done to correct non-standard usages in the
original, manufacturer supplied header file. */
#if defined( DARWIN_DISPATCH_OBJECT_1_CHECK )
#if __BLOCKS__
typedef void (^dispatch_block_t)(void);
#endif
__BEGIN_DECLS
#endif /* DARWIN_DISPATCH_OBJECT_1_CHECK */

View File

@ -0,0 +1,18 @@
/* DO NOT EDIT THIS FILE.
It has been auto-edited by fixincludes from:
"fixinc/tests/inc/os/availability.h"
This had to be done to correct non-standard usages in the
original, manufacturer supplied header file. */
#if defined( DARWIN_API_AVAILABILITY_CHECK )
#define API_AVAILABLE(...)
#define API_DEPRECATED(...)
#define API_DEPRECATED_WITH_REPLACEMENT(...)
#define API_UNAVAILABLE(...)
#endif /* DARWIN_API_AVAILABILITY_CHECK */

View File

@ -0,0 +1,20 @@
/* DO NOT EDIT THIS FILE.
It has been auto-edited by fixincludes from:
"fixinc/tests/inc/os/base.h"
This had to be done to correct non-standard usages in the
original, manufacturer supplied header file. */
#if defined( DARWIN_OS_BASE_1_CHECK )
#define __has_attribute(x) 0
#endif
#ifndef __has_extension
#define __has_extension(x) 0
#endif
#if __GNUC__
#endif /* DARWIN_OS_BASE_1_CHECK */

View File

@ -1 +1 @@
7.3.0
7.5.0

File diff suppressed because it is too large Load Diff

View File

@ -1 +1 @@
20180125
20191114

View File

@ -1,3 +1,289 @@
2019-11-14 Release Manager
* GCC 7.5.0 released.
2019-10-12 Eric Botcazou <ebotcazou@adacore.com>
PR ada/91995
* sem_util.ads (Defining_Entity): Remove 2nd and 3th parameters.
* sem_util.adb (Defining_Entity): Remove 2nd and 3th parameters,
and adjust accordingly.
2019-10-11 Eric Botcazou <ebotcazou@adacore.com>
* gcc-interface/decl.c (annotate_value) <INTEGER_CST>: Really test the
sign of the value when deciding to build a NEGATE_EXPR.
<PLUS_EXPR>: Remove redundant line.
<BIT_AND_EXPR>: Do the negation here.
2019-09-23 Eric Botcazou <ebotcazou@adacore.com>
* gcc-interface/trans.c (Attribute_to_gnu): Test Can_Use_Internal_Rep
on the underlying type of the node.
(Call_to_gnu): Likewise with the type of the prefix.
2019-09-06 Iain Sandoe <iain@sandoe.co.uk>
Backport from mainline.
2019-07-02 Iain Sandoe <iain@sandoe.co.uk>
* system-darwin-ppc.ads: Set Stack_Check_Probes True for
PPC Darwin.
2019-09-06 Iain Sandoe <iain@sandoe.co.uk>
Backport from mainline.
2019-06-30 Iain Sandoe <iain@sandoe.co.uk>
* gnatlink.adb (Link_Step): Push -shared-libgcc explicitly, when it
is the target default (unless overidden by the static flag).
When the user has put an instance of shared/static-libgcc do not push
a duplicate of this.
2019-06-29 Eric Botcazou <ebotcazou@adacore.com>
* gcc-interface/trans.c (mark_visited_r): Set TYPE_SIZES_GIMPLIFIED on
the main variant of a type, if any.
2019-06-29 Eric Botcazou <ebotcazou@adacore.com>
* gcc-interface/decl.c (set_nonaliased_component_on_array_type): Add
missing guard for the presence of TYPE_CANONICAL.
(set_reverse_storage_order_on_array_type): Likewise.
2019-05-28 Eric Botcazou <ebotcazou@adacore.com>
* gcc-interface/trans.c (walk_nesting_tree): New static function.
(finalize_nrv): Use it to walk the entire nesting tree.
2019-05-07 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
* gcc-interface/Makefile.in (install-gcc-specs): Use foreach.
Honor DESTDIR.
2019-02-26 Eric Botcazou <ebotcazou@adacore.com>
PR ada/81956
Backport from mainline
2017-09-06 Ed Schonberg <schonberg@adacore.com>
* exp_ch6.adb (Expand_Call_Helper): Do not optimize calls to
null procedures when GNAT coverage is used, so that their (empty)
bodies are properly covered.
2017-09-06 Ed Schonberg <schonberg@adacore.com>
* exp_ch6.adb (Expand_Call_Helper): Replace call to null
procedure by a single null statement, after evaluating the
actuals that require it.
2019-02-23 Eric Botcazou <ebotcazou@adacore.com>
PR ada/89349
Backport from mainline
2018-05-25 Arnaud Charlet <charlet@adacore.com>
* osint.ads (Unknown_Attributes): No longer pretend this is a constant.
(No_File_Info_Cache): Initialize separately.
* osint.adb (No_File_Info_Cache): Update initializer.
2019-02-08 Eric Botcazou <ebotcazou@adacore.com>
* gcc-interface/trans.c (Loop_Statement_to_gnu): Replace tests on
individual flag_unswitch_loops and flag_tree_loop_vectorize switches
with test on global optimize switch.
(Raise_Error_to_gnu): Likewise.
2019-02-07 Eric Botcazou <ebotcazou@adacore.com>
* s-linux-sparc.ads (ETIMEDOUT): Set to correct value.
2019-02-06 Eric Botcazou <ebotcazou@adacore.com>
Backport from mainline
2017-09-05 Eric Botcazou <ebotcazou@adacore.com>
* gcc-interface/decl.c (annotate_value): Tidy up.
<INTEGER_CST>: Set TCODE instead of recursing.
<COMPONENT_REF>: Set TCODE instead of calling Create_Node manually.
<MULT_EXPR, PLUS_EXPR>: Fold conversions into inner operations.
<BIT_AND_EXPR>: Adjust.
<CALL_EXPR>: Do not fall through.
2019-01-27 Eric Botcazou <ebotcazou@adacore.com>
* gcc-interface/decl.c (array_type_has_nonaliased_component): Return
the same value for every dimension of a multidimensional array type.
2019-01-26 Eric Botcazou <ebotcazou@adacore.com>
* gcc-interface/trans.c (gnat_to_gnu) <N_Assignment_Statement>: Use
DECL_SIZE_UNIT instead of TYPE_SIZE_UNIT for the size to be assigned
by a call to memset if the LHS is a DECL.
2019-01-26 Eric Botcazou <ebotcazou@adacore.com>
* gcc-interface/trans.c (struct loop_info_d): Remove artificial field.
(Loop_Statement_to_gnu): Do not set it.
2019-01-26 Eric Botcazou <ebotcazou@adacore.com>
* gcc-interface/decl.c (annotate_value) <INTEGER_CST>: Use test on
the sign bit instead of on the sign of the value.
<PLUS_EXPR>: Turn addition of negative constant into subtraction.
<BIT_AND_EXPR>: Simplify.
2018-12-24 Iain Sandoe <iain@sandoe.co.uk>
* adaint.c [__APPLE__] (__gnat_lwp_self): Ensure that the system
interface used is available on the target.
2018-12-06 Release Manager
* GCC 7.4.0 released.
2018-11-15 Eric Botcazou <ebotcazou@adacore.com>
* gcc-interface/misc.c (gnat_init_gcc_eh): Do not override the switch
-fnon-call-exceptions passed on the command line in -gnatp mode.
2018-11-13 Eric Botcazou <ebotcazou@adacore.com>
* gcc-interface/misc.c (gnat_init_gcc_eh): Set -fnon-call-exceptions
for the runtime on platforms where System.Machine_Overflow is true.
2018-11-08 Eric Botcazou <ebotcazou@adacore.com>
* fe.h (Suppress_Checks): Declare.
* gcc-interface/misc.c (gnat_init_gcc_eh): Set -fnon-call-exceptions
only if checks are not suppressed and -faggressive-loop-optimizations
only if they are.
* gcc-interface/trans.c (struct loop_info_d): Remove has_checks and
warned_aggressive_loop_optimizations fields.
(gigi): Do not clear warn_aggressive_loop_optimizations here.
(Raise_Error_to_gnu): Do not set has_checks.
(gnat_to_gnu) <N_Indexed_Component>: Remove support for aggressive
loop optimizations.
2018-10-22 Eric Botcazou <ebotcazou@adacore.com>
* gcc-interface/utils.c (unchecked_convert): Use local variables for
the biased and reverse SSO attributes of both types.
Further extend the processing of integral types in the presence of
reverse SSO to all scalar types.
2018-10-22 Eric Botcazou <ebotcazou@adacore.com>
* gcc-interface/trans.c (Pragma_to_gnu) <Pragma_Inspection_Point>: Use
a simple memory constraint in all cases.
2018-09-13 Eric Botcazou <ebotcazou@adacore.com>
Backport from mainline
2018-07-31 Eric Botcazou <ebotcazou@adacore.com>
* s-osinte-solaris.ads (upad64_t): New private type.
(mutex_t): Use it for 'lock' and 'data' components.
(cond_t): Likewise for 'data' and use single 'flags' component.
2018-07-17 Eric Botcazou <ebotcazou@adacore.com>
* gcc-interface/decl.c (choices_to_gnu): Rename parameters. Deal with
an operand of Character type. Factor out range generation to the end.
Check that the bounds are literals and convert them to the type of the
operand before building the ranges.
* gcc-interface/utils.c (make_dummy_type): Minor tweak.
(make_packable_type): Propagate TYPE_DEBUG_TYPE.
(maybe_pad_type): Likewise.
2018-07-17 Eric Botcazou <ebotcazou@adacore.com>
* gcc-interface/decl.c (gnat_to_gnu_entity) <E_Variable>: Deal with
more rvalues in the expression of a renaming.
2018-06-12 Eric Botcazou <ebotcazou@adacore.com>
* gcc-interface/ada-tree.h (TYPE_RETURN_BY_DIRECT_REF_P): Change from
using TYPE_LANG_FLAG_4 to using TYPE_LANG_FLAG_0.
(TYPE_ALIGN_OK): Move around.
(TYPE_PADDING_FOR_COMPONENT): Remove superfluous parentheses.
* gcc-interface/decl.c (change_qualified_type): Move to...
(gnat_to_gnu_entity): Adjust comment.
* gcc-interface/gigi.h (change_qualified_type): ...here; make inline.
(ceil_pow2): Use ceil_log2.
* gcc-interface/utils.c (finish_subprog_decl): Add couple of comments
and do not set TREE_SIDE_EFFECTS.
(handle_noreturn_attribute): Use change_qualified_type.
2018-06-12 Eric Botcazou <ebotcazou@adacore.com>
* gcc-interface/decl.c (gnat_to_gnu_entity) <E_Constant>: Do not get
the expression of a dispatch table that is not being defined.
<E_Record_Subtype>: Remove obsolete kludge.
2018-06-12 Eric Botcazou <ebotcazou@adacore.com>
Backpor from mainline
2018-06-02 Eric Botcazou <ebotcazou@adacore.com>
* gcc-interface/decl.c (gnat_to_gnu_entity) <E_Constant>: If this is
not a definition, retrieve the expression only if it's a compile-time
known value if we are just annotating types.
* gcc-interface/utils.c (convert): Do not try to upcast properly for a
conversion between tagged types in type_annotate_only mode.
2018-06-12 Eric Botcazou <ebotcazou@adacore.com>
Backport from mainline
2018-06-11 Eric Botcazou <ebotcazou@adacore.com>
* gcc-interface/decl.c (gnat_to_gnu_entity) <E_Array_Type>: Reuse the
existing fields of a dummy fat pointer type, if any. Clear the
TYPE_DECL_SUPPRESS_DEBUG on the fat pointer type after completing it.
2018-06-02 Eric Botcazou <ebotcazou@adacore.com>
* gcc-interface/ada-tree.h (TYPE_PADDING_FOR_COMPONENT): New macro.
* gcc-interface/decl.c (gnat_to_gnu_component_type): Cache the padding
type built for an aliased component with variable size.
2018-06-02 Eric Botcazou <ebotcazou@adacore.com>
Backport from mainline
2018-05-31 Eric Botcazou <ebotcazou@adacore.com>
* gcc-interface/trans.c (Call_to_gnu): If this is a function call and
there is no target, also create a temporary for the return value for
an allocator if the type is an unconstrained record type with default
discriminant.
2018-04-12 Sebastian Huber <sebastian.huber@embedded-brains.de>
Backport from mainline
2018-03-07 Sebastian Huber <sebastian.huber@embedded-brains.de>
* gcc-interface/Makefile.in (OSCONS_CPP): Remove redundant
$(GNATLIBCFLAGS).
(OSCONS_EXTRACT): Add $(GNATLIBCFLAGS_FOR_C).
2018-03-12 Eric Botcazou <ebotcazou@adacore.com>
PR ada/82813
* gcc-interface/misc.c (gnat_post_options): Disable string overflow
warnings.
2018-03-10 Eric Botcazou <ebotcazou@adacore.com>
* gcc-interface/trans.c (node_has_volatile_full_access) <N_Identifier>:
Consider only entities for objects.
2018-03-06 Eric Botcazou <ebotcazou@adacore.com>
* gcc-interface/trans.c (convert_with_check): Fix typo in the condition
guarding the overflow check emitted for the upper bound of a floating-
point conversion.
2018-01-25 Release Manager
* GCC 7.3.0 released.

View File

@ -3174,9 +3174,13 @@ __gnat_lwp_self (void)
#endif
#if defined (__APPLE__)
#include <mach/thread_info.h>
#include <mach/mach_init.h>
#include <mach/thread_act.h>
# if __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ >= 1060
# include <mach/thread_info.h>
# include <mach/mach_init.h>
# include <mach/thread_act.h>
# else
# include <pthread.h>
# endif
/* System-wide thread identifier. Note it could be truncated on 32 bit
hosts.
@ -3184,6 +3188,7 @@ __gnat_lwp_self (void)
void *
__gnat_lwp_self (void)
{
#if __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ >= 1060
thread_identifier_info_data_t data;
mach_msg_type_number_t count = THREAD_IDENTIFIER_INFO_COUNT;
kern_return_t kret;
@ -3194,6 +3199,9 @@ __gnat_lwp_self (void)
return (void *)(uintptr_t)data.thread_id;
else
return 0;
#else
return (void *)pthread_mach_thread_np (pthread_self ());
#endif
}
#endif

View File

@ -3937,6 +3937,23 @@ package body Exp_Ch6 is
Unchecked_Convert_To
(RTE (RE_Address), Relocate_Node (First_Actual (Call_Node))));
return;
-- A call to a null procedure is replaced by a null statement, but we
-- are not allowed to ignore possible side effects of the call, so we
-- make sure that actuals are evaluated.
-- We also suppress this optimization for GNATCoverage.
elsif Is_Null_Procedure (Subp)
and then not Opt.Suppress_Control_Flow_Optimizations
then
Actual := First_Actual (Call_Node);
while Present (Actual) loop
Remove_Side_Effects (Actual);
Next_Actual (Actual);
end loop;
Rewrite (Call_Node, Make_Null_Statement (Loc));
return;
end if;
-- Handle inlining. No action needed if the subprogram is not inlined

View File

@ -177,6 +177,7 @@ extern Boolean In_Same_Source_Unit (Node_Id, Node_Id);
#define GNAT_Mode opt__gnat_mode
#define List_Representation_Info opt__list_representation_info
#define No_Strict_Aliasing_CP opt__no_strict_aliasing
#define Suppress_Checks opt__suppress_checks
typedef enum {
Front_End_SJLJ, Back_End_ZCX, Back_End_SJLJ
@ -191,6 +192,7 @@ extern Boolean Generate_SCO_Instance_Table;
extern Boolean GNAT_Mode;
extern Int List_Representation_Info;
extern Boolean No_Strict_Aliasing_CP;
extern Boolean Suppress_Checks;
#define ZCX_Exceptions opt__zcx_exceptions
#define SJLJ_Exceptions opt__sjlj_exceptions

View File

@ -2660,9 +2660,8 @@ gnatlink-re: ../stamp-tools gnatmake-re
install-gcc-specs:
# Install all the requested GCC spec files.
for f in $(GCC_SPEC_FILES); do \
$(INSTALL_DATA_DATE) $(srcdir)/ada/$$f $(libsubdir)/; \
done
$(foreach f,$(GCC_SPEC_FILES), \
$(INSTALL_DATA_DATE) $(srcdir)/ada/$(f) $(DESTDIR)$(libsubdir)/;)
install-gnatlib: ../stamp-gnatlib-$(RTSDIR) install-gcc-specs
$(RMDIR) $(DESTDIR)$(ADA_RTL_OBJ_DIR)
@ -2756,9 +2755,9 @@ OSCONS_CC=$(subst ./xgcc,../../xgcc,$(subst -B./, -B../../,$(GCC_FOR_TARGET)))
# ada/types.h does not conflict with a same-named system header (VxWorks
# has a <types.h> header).
OSCONS_CPP=$(OSCONS_CC) $(GNATLIBCFLAGS) $(GNATLIBCFLAGS_FOR_C) -E -C \
OSCONS_CPP=$(OSCONS_CC) $(GNATLIBCFLAGS_FOR_C) -E -C \
-DTARGET=\"$(target)\" -iquote $(fsrcpfx)ada $(fsrcpfx)ada/s-oscons-tmplt.c > s-oscons-tmplt.i
OSCONS_EXTRACT=$(OSCONS_CC) -S s-oscons-tmplt.i
OSCONS_EXTRACT=$(OSCONS_CC) $(GNATLIBCFLAGS_FOR_C) -S s-oscons-tmplt.i
# Note: if you need to build with a non-GNU compiler, you could adapt the
# following definitions (written for VMS DEC-C)

View File

@ -6,7 +6,7 @@
* *
* C Header File *
* *
* Copyright (C) 1992-2016, Free Software Foundation, Inc. *
* Copyright (C) 1992-2018, Free Software Foundation, Inc. *
* *
* GNAT is free software; you can redistribute it and/or modify it under *
* terms of the GNU General Public License as published by the Free Soft- *
@ -83,6 +83,12 @@ do { \
((TREE_CODE (NODE) == INTEGER_TYPE || TREE_CODE (NODE) == ARRAY_TYPE) \
&& TYPE_PACKED_ARRAY_TYPE_P (NODE))
/* For FUNCTION_TYPEs, nonzero if the function returns by direct reference,
i.e. the callee returns a pointer to a memory location it has allocated
and the caller only needs to dereference the pointer. */
#define TYPE_RETURN_BY_DIRECT_REF_P(NODE) \
TYPE_LANG_FLAG_0 (FUNCTION_TYPE_CHECK (NODE))
/* For INTEGER_TYPE, nonzero if this is a modular type with a modulus that
is not equal to two to the power of its mode's size. */
#define TYPE_MODULAR_P(NODE) TYPE_LANG_FLAG_1 (INTEGER_TYPE_CHECK (NODE))
@ -152,12 +158,6 @@ do { \
#define TYPE_CONVENTION_FORTRAN_P(NODE) \
TYPE_LANG_FLAG_4 (ARRAY_TYPE_CHECK (NODE))
/* For FUNCTION_TYPEs, nonzero if the function returns by direct reference,
i.e. the callee returns a pointer to a memory location it has allocated
and the caller only needs to dereference the pointer. */
#define TYPE_RETURN_BY_DIRECT_REF_P(NODE) \
TYPE_LANG_FLAG_4 (FUNCTION_TYPE_CHECK (NODE))
/* For RECORD_TYPE, UNION_TYPE and ENUMERAL_TYPE, nonzero if this is a dummy
type, made to correspond to a private or incomplete type. */
#define TYPE_DUMMY_P(NODE) \
@ -186,6 +186,9 @@ do { \
/* True for a dummy type if TYPE appears in a profile. */
#define TYPE_DUMMY_IN_PROFILE_P(NODE) TYPE_LANG_FLAG_6 (NODE)
/* True if objects of this type are guaranteed to be properly aligned. */
#define TYPE_ALIGN_OK(NODE) TYPE_LANG_FLAG_7 (NODE)
/* True for types that implement a packed array and for original packed array
types. */
#define TYPE_IMPL_PACKED_ARRAY_P(NODE) \
@ -199,9 +202,6 @@ do { \
alignment value the type ought to have. */
#define TYPE_MAX_ALIGN(NODE) (TYPE_PRECISION (RECORD_OR_UNION_CHECK (NODE)))
/* True if objects of tagged types are guaranteed to be properly aligned. */
#define TYPE_ALIGN_OK(NODE) TYPE_LANG_FLAG_7 (NODE)
/* For an UNCONSTRAINED_ARRAY_TYPE, this is the record containing both the
template and the object.
@ -232,6 +232,11 @@ do { \
refer to the routine gnat_to_gnu_entity. */
#define TYPE_CI_CO_LIST(NODE) TYPE_LANG_SLOT_1 (FUNCTION_TYPE_CHECK (NODE))
/* For an ARRAY_TYPE with variable size, this is the padding type built for
the array type when it is itself the component type of another array. */
#define TYPE_PADDING_FOR_COMPONENT(NODE) \
TYPE_LANG_SLOT_1 (ARRAY_TYPE_CHECK (NODE))
/* For a VECTOR_TYPE, this is the representative array type. */
#define TYPE_REPRESENTATIVE_ARRAY(NODE) \
TYPE_LANG_SLOT_1 (VECTOR_TYPE_CHECK (NODE))

View File

@ -206,7 +206,6 @@ static tree gnat_to_gnu_component_type (Entity_Id, bool, bool);
static tree gnat_to_gnu_subprog_type (Entity_Id, bool, bool, tree *);
static tree gnat_to_gnu_field (Entity_Id, tree, int, bool, bool);
static tree gnu_ext_name_for_subprog (Entity_Id, tree);
static tree change_qualified_type (tree, int);
static void set_nonaliased_component_on_array_type (tree);
static void set_reverse_storage_order_on_array_type (tree);
static bool same_discriminant_p (Entity_Id, Entity_Id);
@ -592,17 +591,22 @@ gnat_to_gnu_entity (Entity_Id gnat_entity, tree gnu_expr, bool definition)
/* If we have a constant that we are not defining, get the expression it
was defined to represent. This is necessary to avoid generating dumb
elaboration code in simple cases, but we may throw it away later if it
is not a constant. But do not retrieve it if it is an allocator since
the designated type might still be dummy at this point. */
is not a constant. But do not do it for dispatch tables because they
are only referenced indirectly and we need to have a consistent view
of the exported and of the imported declarations of the tables from
external units for them to be properly merged in LTO mode. Moreover
simply do not retrieve the expression it if it is an allocator since
the designated type might still be dummy at this point. Note that we
invoke gnat_to_gnu_external and not gnat_to_gnu because the expression
may contain N_Expression_With_Actions nodes and thus declarations of
objects from other units that we need to discard. */
if (!definition
&& !No_Initialization (Declaration_Node (gnat_entity))
&& Present (Expression (Declaration_Node (gnat_entity)))
&& Nkind (Expression (Declaration_Node (gnat_entity)))
!= N_Allocator)
/* The expression may contain N_Expression_With_Actions nodes and
thus object declarations from other units. Discard them. */
gnu_expr
= gnat_to_gnu_external (Expression (Declaration_Node (gnat_entity)));
&& !Is_Dispatch_Table_Entity (gnat_entity)
&& Present (gnat_temp = Expression (Declaration_Node (gnat_entity)))
&& Nkind (gnat_temp) != N_Allocator
&& (!type_annotate_only || Compile_Time_Known_Value (gnat_temp)))
gnu_expr = gnat_to_gnu_external (gnat_temp);
/* ... fall through ... */
@ -968,8 +972,7 @@ gnat_to_gnu_entity (Entity_Id gnat_entity, tree gnu_expr, bool definition)
function call is a constant object. Therefore, it can be the
inner object of a constant renaming and the renaming must be
fully instantiated, i.e. it cannot be a reference to (part of)
an existing object. And treat other rvalues (addresses, null
expressions, constructors and literals) the same way. */
an existing object. And treat other rvalues the same way. */
tree inner = gnu_expr;
while (handled_component_p (inner) || CONVERT_EXPR_P (inner))
inner = TREE_OPERAND (inner, 0);
@ -980,11 +983,11 @@ gnat_to_gnu_entity (Entity_Id gnat_entity, tree gnu_expr, bool definition)
inner = TREE_OPERAND (inner, 1);
if ((TREE_CODE (inner) == CALL_EXPR
&& !call_is_atomic_load (inner))
|| TREE_CODE (inner) == ADDR_EXPR
|| TREE_CODE (inner) == NULL_EXPR
|| TREE_CODE (inner) == PLUS_EXPR
|| TREE_CODE (inner) == CONSTRUCTOR
|| CONSTANT_CLASS_P (inner)
|| COMPARISON_CLASS_P (inner)
|| BINARY_CLASS_P (inner)
|| EXPRESSION_CLASS_P (inner)
/* We need to detect the case where a temporary is created to
hold the return value, since we cannot safely rename it at
top level as it lives only in the elaboration routine. */
@ -1006,7 +1009,7 @@ gnat_to_gnu_entity (Entity_Id gnat_entity, tree gnu_expr, bool definition)
underlying object lives only in the elaboration routine. */
|| (TREE_CODE (inner) == INDIRECT_REF
&& (inner
= remove_conversions (TREE_OPERAND (inner, 0), true))
= remove_conversions (TREE_OPERAND (inner, 0), true))
&& TREE_CODE (inner) == VAR_DECL
&& DECL_RETURN_VALUE_P (inner)))
;
@ -2063,11 +2066,16 @@ gnat_to_gnu_entity (Entity_Id gnat_entity, tree gnu_expr, bool definition)
{
gnu_fat_type = TYPE_MAIN_VARIANT (TYPE_POINTER_TO (gnu_type));
TYPE_NAME (gnu_fat_type) = NULL_TREE;
gnu_ptr_template =
TREE_TYPE (DECL_CHAIN (TYPE_FIELDS (gnu_fat_type)));
gnu_template_type = TREE_TYPE (gnu_ptr_template);
/* Save the contents of the dummy type for update_pointer_to. */
TYPE_POINTER_TO (gnu_type) = copy_type (gnu_fat_type);
gnu_ptr_template =
TREE_TYPE (TREE_CHAIN (TYPE_FIELDS (gnu_fat_type)));
gnu_template_type = TREE_TYPE (gnu_ptr_template);
TYPE_FIELDS (TYPE_POINTER_TO (gnu_type))
= copy_node (TYPE_FIELDS (gnu_fat_type));
DECL_CHAIN (TYPE_FIELDS (TYPE_POINTER_TO (gnu_type)))
= copy_node (DECL_CHAIN (TYPE_FIELDS (gnu_fat_type)));
}
else
{
@ -2088,29 +2096,39 @@ gnat_to_gnu_entity (Entity_Id gnat_entity, tree gnu_expr, bool definition)
/* Build the fat pointer type. Use a "void *" object instead of
a pointer to the array type since we don't have the array type
yet (it will reference the fat pointer via the bounds). */
tem
= create_field_decl (get_identifier ("P_ARRAY"), ptr_type_node,
gnu_fat_type, NULL_TREE, NULL_TREE, 0, 0);
DECL_CHAIN (tem)
= create_field_decl (get_identifier ("P_BOUNDS"), gnu_ptr_template,
gnu_fat_type, NULL_TREE, NULL_TREE, 0, 0);
yet (it will reference the fat pointer via the bounds). Note
that we reuse the existing fields of a dummy type because for:
type Arr is array (Positive range <>) of Element_Type;
type Array_Ref is access Arr;
Var : Array_Ref := Null;
in a declarative part, Arr will be frozen only after Var, which
means that the fields used in the CONSTRUCTOR built for Null are
those of the dummy type, which in turn means that COMPONENT_REFs
of Var may be built with these fields. Now if COMPONENT_REFs of
Var are also built later with the fields of the final type, the
aliasing machinery may consider that the accesses are distinct
if the FIELD_DECLs are distinct as objects. */
if (COMPLETE_TYPE_P (gnu_fat_type))
{
/* We are going to lay it out again so reset the alias set. */
alias_set_type alias_set = TYPE_ALIAS_SET (gnu_fat_type);
TYPE_ALIAS_SET (gnu_fat_type) = -1;
finish_fat_pointer_type (gnu_fat_type, tem);
TYPE_ALIAS_SET (gnu_fat_type) = alias_set;
tem = TYPE_FIELDS (gnu_fat_type);
TREE_TYPE (tem) = ptr_type_node;
TREE_TYPE (DECL_CHAIN (tem)) = gnu_ptr_template;
TYPE_DECL_SUPPRESS_DEBUG (TYPE_STUB_DECL (gnu_fat_type)) = 0;
for (t = gnu_fat_type; t; t = TYPE_NEXT_VARIANT (t))
{
TYPE_FIELDS (t) = tem;
SET_TYPE_UNCONSTRAINED_ARRAY (t, gnu_type);
}
SET_TYPE_UNCONSTRAINED_ARRAY (t, gnu_type);
}
else
{
tem
= create_field_decl (get_identifier ("P_ARRAY"),
ptr_type_node, gnu_fat_type,
NULL_TREE, NULL_TREE, 0, 0);
DECL_CHAIN (tem)
= create_field_decl (get_identifier ("P_BOUNDS"),
gnu_ptr_template, gnu_fat_type,
NULL_TREE, NULL_TREE, 0, 0);
finish_fat_pointer_type (gnu_fat_type, tem);
SET_TYPE_UNCONSTRAINED_ARRAY (gnu_fat_type, gnu_type);
}
@ -3389,20 +3407,6 @@ gnat_to_gnu_entity (Entity_Id gnat_entity, tree gnu_expr, bool definition)
break;
}
/* If this is a record subtype associated with a dispatch table,
strip the suffix. This is necessary to make sure 2 different
subtypes associated with the imported and exported views of a
dispatch table are properly merged in LTO mode. */
if (Is_Dispatch_Table_Entity (gnat_entity))
{
char *p;
Get_Encoded_Name (gnat_entity);
p = strchr (Name_Buffer, '_');
gcc_assert (p);
strcpy (p+2, "dtS");
gnu_entity_name = get_identifier (Name_Buffer);
}
/* When the subtype has discriminants and these discriminants affect
the initial shape it has inherited, factor them in. But for an
Unchecked_Union (it must be an Itype), just return the type.
@ -4681,7 +4685,7 @@ gnat_to_gnu_entity (Entity_Id gnat_entity, tree gnu_expr, bool definition)
/* If this is not an unconstrained array type, set some flags. */
if (TREE_CODE (gnu_type) != UNCONSTRAINED_ARRAY_TYPE)
{
/* Tell the middle-end that objects of tagged types are guaranteed to
/* Record the property that objects of tagged types are guaranteed to
be properly aligned. This is necessary because conversions to the
class-wide type are translated into conversions to the root type,
which can be less aligned than some of its derived types. */
@ -5272,17 +5276,6 @@ gnat_to_gnu_component_type (Entity_Id gnat_array, bool definition,
Is_Bit_Packed_Array (gnat_array) ? TYPE_DECL : VAR_DECL,
true, Has_Component_Size_Clause (gnat_array));
/* If the array has aliased components and the component size can be zero,
force at least unit size to ensure that the components have distinct
addresses. */
if (!gnu_comp_size
&& Has_Aliased_Components (gnat_array)
&& (integer_zerop (TYPE_SIZE (gnu_type))
|| (TREE_CODE (gnu_type) == ARRAY_TYPE
&& !TREE_CONSTANT (TYPE_SIZE (gnu_type)))))
gnu_comp_size
= size_binop (MAX_EXPR, TYPE_SIZE (gnu_type), bitsize_unit_node);
/* If the component type is a RECORD_TYPE that has a self-referential size,
then use the maximum size for the component size. */
if (!gnu_comp_size
@ -5290,6 +5283,13 @@ gnat_to_gnu_component_type (Entity_Id gnat_array, bool definition,
&& CONTAINS_PLACEHOLDER_P (TYPE_SIZE (gnu_type)))
gnu_comp_size = max_size (TYPE_SIZE (gnu_type), true);
/* If the array has aliased components and the component size is zero, force
the unit size to ensure that the components have distinct addresses. */
if (!gnu_comp_size
&& Has_Aliased_Components (gnat_array)
&& integer_zerop (TYPE_SIZE (gnu_type)))
gnu_comp_size = bitsize_unit_node;
/* Honor the component size. This is not needed for bit-packed arrays. */
if (gnu_comp_size && !Is_Bit_Packed_Array (gnat_array))
{
@ -5312,6 +5312,30 @@ gnat_to_gnu_component_type (Entity_Id gnat_array, bool definition,
gnat_array);
}
/* This is a very special case where the array has aliased components and the
component size might be zero at run time. As explained above, we force at
least the unit size but we don't want to build a distinct padding type for
each invocation (they are not canonicalized if they have variable size) so
we cache this special padding type as TYPE_PADDING_FOR_COMPONENT. */
else if (Has_Aliased_Components (gnat_array)
&& TREE_CODE (gnu_type) == ARRAY_TYPE
&& !TREE_CONSTANT (TYPE_SIZE (gnu_type)))
{
if (TYPE_PADDING_FOR_COMPONENT (gnu_type))
gnu_type = TYPE_PADDING_FOR_COMPONENT (gnu_type);
else
{
gnu_comp_size
= size_binop (MAX_EXPR, TYPE_SIZE (gnu_type), bitsize_unit_node);
TYPE_PADDING_FOR_COMPONENT (gnu_type)
= maybe_pad_type (gnu_type, gnu_comp_size, 0, gnat_array,
true, false, definition, true);
gnu_type = TYPE_PADDING_FOR_COMPONENT (gnu_type);
create_type_decl (TYPE_NAME (gnu_type), gnu_type, true, debug_info_p,
gnat_array);
}
}
/* If the component type is a padded type made for a non-bit-packed array
of scalars with reverse storage order, we need to propagate the reverse
storage order to the padding type since it is the innermost enclosing
@ -6276,19 +6300,6 @@ gnu_ext_name_for_subprog (Entity_Id gnat_subprog, tree gnu_entity_name)
return gnu_ext_name;
}
/* Like build_qualified_type, but TYPE_QUALS is added to the existing
qualifiers on TYPE. */
static tree
change_qualified_type (tree type, int type_quals)
{
/* Qualifiers must be put on the associated array type. */
if (TREE_CODE (type) == UNCONSTRAINED_ARRAY_TYPE)
return type;
return build_qualified_type (type, TYPE_QUALS (type) | type_quals);
}
/* Set TYPE_NONALIASED_COMPONENT on an array type built by means of
build_nonshared_array_type. */
@ -6296,7 +6307,8 @@ static void
set_nonaliased_component_on_array_type (tree type)
{
TYPE_NONALIASED_COMPONENT (type) = 1;
TYPE_NONALIASED_COMPONENT (TYPE_CANONICAL (type)) = 1;
if (TYPE_CANONICAL (type))
TYPE_NONALIASED_COMPONENT (TYPE_CANONICAL (type)) = 1;
}
/* Set TYPE_REVERSE_STORAGE_ORDER on an array type built by means of
@ -6306,7 +6318,8 @@ static void
set_reverse_storage_order_on_array_type (tree type)
{
TYPE_REVERSE_STORAGE_ORDER (type) = 1;
TYPE_REVERSE_STORAGE_ORDER (TYPE_CANONICAL (type)) = 1;
if (TYPE_CANONICAL (type))
TYPE_REVERSE_STORAGE_ORDER (TYPE_CANONICAL (type)) = 1;
}
/* Return true if DISCR1 and DISCR2 represent the same discriminant. */
@ -6330,12 +6343,6 @@ same_discriminant_p (Entity_Id discr1, Entity_Id discr2)
static bool
array_type_has_nonaliased_component (tree gnu_type, Entity_Id gnat_type)
{
/* If the array type is not the innermost dimension of the GNAT type,
then it has a non-aliased component. */
if (TREE_CODE (TREE_TYPE (gnu_type)) == ARRAY_TYPE
&& TYPE_MULTI_ARRAY_P (TREE_TYPE (gnu_type)))
return true;
/* If the array type has an aliased component in the front-end sense,
then it also has an aliased component in the back-end sense. */
if (Has_Aliased_Components (gnat_type))
@ -6346,15 +6353,17 @@ array_type_has_nonaliased_component (tree gnu_type, Entity_Id gnat_type)
if (Is_Derived_Type (gnat_type))
{
tree gnu_parent_type = gnat_to_gnu_type (Etype (gnat_type));
int index;
if (TREE_CODE (gnu_parent_type) == UNCONSTRAINED_ARRAY_TYPE)
gnu_parent_type
= TREE_TYPE (TREE_TYPE (TYPE_FIELDS (TREE_TYPE (gnu_parent_type))));
for (index = Number_Dimensions (gnat_type) - 1; index > 0; index--)
gnu_parent_type = TREE_TYPE (gnu_parent_type);
return TYPE_NONALIASED_COMPONENT (gnu_parent_type);
}
/* For a multi-dimensional array type, find the component type. */
while (TREE_CODE (TREE_TYPE (gnu_type)) == ARRAY_TYPE
&& TYPE_MULTI_ARRAY_P (TREE_TYPE (gnu_type)))
gnu_type = TREE_TYPE (gnu_type);
/* Otherwise, rely exclusively on properties of the element type. */
return type_for_nonaliased_component_p (TREE_TYPE (gnu_type));
}
@ -6864,65 +6873,44 @@ elaborate_reference (tree ref, Entity_Id gnat_entity, bool definition,
the value passed against the list of choices. */
static tree
choices_to_gnu (tree operand, Node_Id choices)
choices_to_gnu (tree gnu_operand, Node_Id gnat_choices)
{
Node_Id choice;
Node_Id gnat_temp;
tree result = boolean_false_node;
tree this_test, low = 0, high = 0, single = 0;
tree gnu_result = boolean_false_node, gnu_type;
for (choice = First (choices); Present (choice); choice = Next (choice))
gnu_operand = maybe_character_value (gnu_operand);
gnu_type = TREE_TYPE (gnu_operand);
for (Node_Id gnat_choice = First (gnat_choices);
Present (gnat_choice);
gnat_choice = Next (gnat_choice))
{
switch (Nkind (choice))
tree gnu_low = NULL_TREE, gnu_high = NULL_TREE;
tree gnu_test;
switch (Nkind (gnat_choice))
{
case N_Range:
low = gnat_to_gnu (Low_Bound (choice));
high = gnat_to_gnu (High_Bound (choice));
this_test
= build_binary_op (TRUTH_ANDIF_EXPR, boolean_type_node,
build_binary_op (GE_EXPR, boolean_type_node,
operand, low, true),
build_binary_op (LE_EXPR, boolean_type_node,
operand, high, true),
true);
gnu_low = gnat_to_gnu (Low_Bound (gnat_choice));
gnu_high = gnat_to_gnu (High_Bound (gnat_choice));
break;
case N_Subtype_Indication:
gnat_temp = Range_Expression (Constraint (choice));
low = gnat_to_gnu (Low_Bound (gnat_temp));
high = gnat_to_gnu (High_Bound (gnat_temp));
this_test
= build_binary_op (TRUTH_ANDIF_EXPR, boolean_type_node,
build_binary_op (GE_EXPR, boolean_type_node,
operand, low, true),
build_binary_op (LE_EXPR, boolean_type_node,
operand, high, true),
true);
gnu_low = gnat_to_gnu (Low_Bound (Range_Expression
(Constraint (gnat_choice))));
gnu_high = gnat_to_gnu (High_Bound (Range_Expression
(Constraint (gnat_choice))));
break;
case N_Identifier:
case N_Expanded_Name:
/* This represents either a subtype range, an enumeration
literal, or a constant Ekind says which. If an enumeration
literal or constant, fall through to the next case. */
if (Ekind (Entity (choice)) != E_Enumeration_Literal
&& Ekind (Entity (choice)) != E_Constant)
/* This represents either a subtype range or a static value of
some kind; Ekind says which. */
if (Is_Type (Entity (gnat_choice)))
{
tree type = gnat_to_gnu_type (Entity (choice));
tree gnu_type = get_unpadded_type (Entity (gnat_choice));
low = TYPE_MIN_VALUE (type);
high = TYPE_MAX_VALUE (type);
this_test
= build_binary_op (TRUTH_ANDIF_EXPR, boolean_type_node,
build_binary_op (GE_EXPR, boolean_type_node,
operand, low, true),
build_binary_op (LE_EXPR, boolean_type_node,
operand, high, true),
true);
gnu_low = TYPE_MIN_VALUE (gnu_type);
gnu_high = TYPE_MAX_VALUE (gnu_type);
break;
}
@ -6930,27 +6918,49 @@ choices_to_gnu (tree operand, Node_Id choices)
case N_Character_Literal:
case N_Integer_Literal:
single = gnat_to_gnu (choice);
this_test = build_binary_op (EQ_EXPR, boolean_type_node, operand,
single, true);
gnu_low = gnat_to_gnu (gnat_choice);
break;
case N_Others_Choice:
this_test = boolean_true_node;
break;
default:
gcc_unreachable ();
}
if (result == boolean_false_node)
result = this_test;
/* Everything should be folded into constants at this point. */
gcc_assert (!gnu_low || TREE_CODE (gnu_low) == INTEGER_CST);
gcc_assert (!gnu_high || TREE_CODE (gnu_high) == INTEGER_CST);
if (gnu_low && TREE_TYPE (gnu_low) != gnu_type)
gnu_low = convert (gnu_type, gnu_low);
if (gnu_high && TREE_TYPE (gnu_high) != gnu_type)
gnu_high = convert (gnu_type, gnu_high);
if (gnu_low && gnu_high)
gnu_test
= build_binary_op (TRUTH_ANDIF_EXPR, boolean_type_node,
build_binary_op (GE_EXPR, boolean_type_node,
gnu_operand, gnu_low, true),
build_binary_op (LE_EXPR, boolean_type_node,
gnu_operand, gnu_high, true),
true);
else if (gnu_low)
gnu_test
= build_binary_op (EQ_EXPR, boolean_type_node, gnu_operand, gnu_low,
true);
else
result = build_binary_op (TRUTH_ORIF_EXPR, boolean_type_node, result,
this_test, true);
gnu_test = boolean_true_node;
if (gnu_result == boolean_false_node)
gnu_result = gnu_test;
else
gnu_result
= build_binary_op (TRUTH_ORIF_EXPR, boolean_type_node, gnu_result,
gnu_test, true);
}
return result;
return gnu_result;
}
/* Adjust PACKED setting as passed to gnat_to_gnu_field for a field of
@ -8040,9 +8050,8 @@ static Uint
annotate_value (tree gnu_size)
{
TCode tcode;
Node_Ref_Or_Val ops[3], ret, pre_op1 = No_Uint;
Node_Ref_Or_Val ops[3] = { No_Uint, No_Uint, No_Uint };
struct tree_int_map in;
int i;
/* See if we've already saved the value for this node. */
if (EXPR_P (gnu_size))
@ -8059,9 +8068,7 @@ annotate_value (tree gnu_size)
in.base.from = NULL_TREE;
/* If we do not return inside this switch, TCODE will be set to the
code to use for a Create_Node operand and LEN (set above) will be
the number of recursive calls for us to make. */
code to be used in a call to Create_Node. */
switch (TREE_CODE (gnu_size))
{
case INTEGER_CST:
@ -8070,38 +8077,46 @@ annotate_value (tree gnu_size)
if (tree_int_cst_sgn (gnu_size) < 0)
{
tree t = wide_int_to_tree (sizetype, wi::neg (gnu_size));
return annotate_value (build1 (NEGATE_EXPR, sizetype, t));
tcode = Negate_Expr;
ops[0] = UI_From_gnu (t);
}
return TREE_OVERFLOW (gnu_size) ? No_Uint : UI_From_gnu (gnu_size);
else
return TREE_OVERFLOW (gnu_size) ? No_Uint : UI_From_gnu (gnu_size);
break;
case COMPONENT_REF:
/* The only case we handle here is a simple discriminant reference. */
if (DECL_DISCRIMINANT_NUMBER (TREE_OPERAND (gnu_size, 1)))
{
tree n = DECL_DISCRIMINANT_NUMBER (TREE_OPERAND (gnu_size, 1));
tree ref = gnu_size;
gnu_size = TREE_OPERAND (ref, 1);
/* Climb up the chain of successive extensions, if any. */
while (TREE_CODE (TREE_OPERAND (gnu_size, 0)) == COMPONENT_REF
&& DECL_NAME (TREE_OPERAND (TREE_OPERAND (gnu_size, 0), 1))
while (TREE_CODE (TREE_OPERAND (ref, 0)) == COMPONENT_REF
&& DECL_NAME (TREE_OPERAND (TREE_OPERAND (ref, 0), 1))
== parent_name_id)
gnu_size = TREE_OPERAND (gnu_size, 0);
ref = TREE_OPERAND (ref, 0);
if (TREE_CODE (TREE_OPERAND (gnu_size, 0)) == PLACEHOLDER_EXPR)
return
Create_Node (Discrim_Val, annotate_value (n), No_Uint, No_Uint);
if (TREE_CODE (TREE_OPERAND (ref, 0)) == PLACEHOLDER_EXPR)
{
/* Fall through to common processing as a FIELD_DECL. */
tcode = Discrim_Val;
ops[0] = UI_From_gnu (DECL_DISCRIMINANT_NUMBER (gnu_size));
}
else
return No_Uint;
}
else
return No_Uint;
break;
return No_Uint;
CASE_CONVERT: case NON_LVALUE_EXPR:
CASE_CONVERT:
case NON_LVALUE_EXPR:
return annotate_value (TREE_OPERAND (gnu_size, 0));
/* Now just list the operations we handle. */
case COND_EXPR: tcode = Cond_Expr; break;
case PLUS_EXPR: tcode = Plus_Expr; break;
case MINUS_EXPR: tcode = Minus_Expr; break;
case MULT_EXPR: tcode = Mult_Expr; break;
case TRUNC_DIV_EXPR: tcode = Trunc_Div_Expr; break;
case CEIL_DIV_EXPR: tcode = Ceil_Div_Expr; break;
case FLOOR_DIV_EXPR: tcode = Floor_Div_Expr; break;
@ -8126,20 +8141,55 @@ annotate_value (tree gnu_size)
case EQ_EXPR: tcode = Eq_Expr; break;
case NE_EXPR: tcode = Ne_Expr; break;
case PLUS_EXPR:
/* Turn addition of negative constant into subtraction. */
if (TREE_CODE (TREE_OPERAND (gnu_size, 1)) == INTEGER_CST
&& tree_int_cst_sign_bit (TREE_OPERAND (gnu_size, 1)))
{
tcode = Minus_Expr;
wide_int wop1 = wi::neg (TREE_OPERAND (gnu_size, 1));
ops[1] = annotate_value (wide_int_to_tree (sizetype, wop1));
break;
}
/* ... fall through ... */
case MULT_EXPR:
tcode = (TREE_CODE (gnu_size) == MULT_EXPR ? Mult_Expr : Plus_Expr);
/* Fold conversions from bytes to bits into inner operations. */
if (TREE_CODE (TREE_OPERAND (gnu_size, 1)) == INTEGER_CST
&& CONVERT_EXPR_P (TREE_OPERAND (gnu_size, 0)))
{
tree inner_op = TREE_OPERAND (TREE_OPERAND (gnu_size, 0), 0);
if (TREE_CODE (inner_op) == TREE_CODE (gnu_size)
&& TREE_CODE (TREE_OPERAND (inner_op, 1)) == INTEGER_CST)
{
ops[0] = annotate_value (TREE_OPERAND (inner_op, 0));
tree inner_op_op1 = TREE_OPERAND (inner_op, 1);
tree gnu_size_op1 = TREE_OPERAND (gnu_size, 1);
wide_int op1;
if (TREE_CODE (gnu_size) == MULT_EXPR)
op1 = wi::mul (inner_op_op1, gnu_size_op1);
else
{
op1 = wi::add (inner_op_op1, gnu_size_op1);
if (wi::zext (op1, TYPE_PRECISION (sizetype)) == 0)
return ops[0];
}
ops[1] = annotate_value (wide_int_to_tree (sizetype, op1));
}
}
break;
case BIT_AND_EXPR:
tcode = Bit_And_Expr;
/* For negative values in sizetype, build NEGATE_EXPR of the opposite.
Such values appear in expressions with aligning patterns. Note that,
since sizetype is unsigned, we have to jump through some hoops. */
Such values can appear in expressions with aligning patterns. */
if (TREE_CODE (TREE_OPERAND (gnu_size, 1)) == INTEGER_CST)
{
tree op1 = TREE_OPERAND (gnu_size, 1);
wide_int signed_op1 = wi::sext (op1, TYPE_PRECISION (sizetype));
if (wi::neg_p (signed_op1))
{
op1 = wide_int_to_tree (sizetype, wi::neg (signed_op1));
pre_op1 = annotate_value (build1 (NEGATE_EXPR, sizetype, op1));
}
wide_int wop1 = wi::neg (TREE_OPERAND (gnu_size, 1));
tree op1 = wide_int_to_tree (sizetype, wop1);
ops[1] = annotate_value (build1 (NEGATE_EXPR, sizetype, op1));
}
break;
@ -8150,34 +8200,26 @@ annotate_value (tree gnu_size)
if (List_Representation_Info == 3 || type_annotate_only)
{
tree t = maybe_inline_call_in_expr (gnu_size);
if (t)
return annotate_value (t);
return t ? annotate_value (t) : No_Uint;
}
else
return Uint_Minus_1;
/* Fall through... */
default:
return No_Uint;
}
/* Now get each of the operands that's relevant for this code. If any
cannot be expressed as a repinfo node, say we can't. */
for (i = 0; i < 3; i++)
ops[i] = No_Uint;
for (i = 0; i < TREE_CODE_LENGTH (TREE_CODE (gnu_size)); i++)
{
if (i == 1 && pre_op1 != No_Uint)
ops[i] = pre_op1;
else
for (int i = 0; i < TREE_CODE_LENGTH (TREE_CODE (gnu_size)); i++)
if (ops[i] == No_Uint)
{
ops[i] = annotate_value (TREE_OPERAND (gnu_size, i));
if (ops[i] == No_Uint)
return No_Uint;
}
if (ops[i] == No_Uint)
return No_Uint;
}
ret = Create_Node (tcode, ops[0], ops[1], ops[2]);
Node_Ref_Or_Val ret = Create_Node (tcode, ops[0], ops[1], ops[2]);
/* Save the result in the cache. */
if (in.base.from)
@ -8190,7 +8232,7 @@ annotate_value (tree gnu_size)
h = annotate_value_cache->find_slot (&in, INSERT);
gcc_assert (!*h);
*h = ggc_alloc<tree_int_map> ();
(*h)->base.from = gnu_size;
(*h)->base.from = in.base.from;
(*h)->to = ret;
}

View File

@ -1074,7 +1074,7 @@ maybe_vector_array (tree exp)
static inline unsigned HOST_WIDE_INT
ceil_pow2 (unsigned HOST_WIDE_INT x)
{
return (unsigned HOST_WIDE_INT) 1 << (floor_log2 (x - 1) + 1);
return (unsigned HOST_WIDE_INT) 1 << ceil_log2 (x);
}
/* Return true if EXP, a CALL_EXPR, is an atomic load. */
@ -1171,3 +1171,16 @@ maybe_debug_type (tree type)
return type;
}
/* Like build_qualified_type, but TYPE_QUALS is added to the existing
qualifiers on TYPE. */
static inline tree
change_qualified_type (tree type, int type_quals)
{
/* Qualifiers must be put on the associated array type. */
if (TREE_CODE (type) == UNCONSTRAINED_ARRAY_TYPE)
return type;
return build_qualified_type (type, TYPE_QUALS (type) | type_quals);
}

View File

@ -262,6 +262,9 @@ gnat_post_options (const char **pfilename ATTRIBUTE_UNUSED)
/* No psABI change warnings for Ada. */
warn_psabi = 0;
/* No string overflow warnings for Ada. */
warn_stringop_overflow = 0;
/* No caret by default for Ada. */
if (!global_options_set.x_flag_diagnostics_show_caret)
global_dc->show_caret = false;
@ -393,7 +396,7 @@ gnat_init_gcc_eh (void)
using_eh_for_cleanups ();
/* Turn on -fexceptions, -fnon-call-exceptions and -fdelete-dead-exceptions.
The first one triggers the generation of the necessary exception tables.
The first one activates the support for exceptions in the compiler.
The second one is useful for two reasons: 1/ we map some asynchronous
signals like SEGV to exceptions, so we need to ensure that the insns
which can lead to such signals are correctly attached to the exception
@ -403,10 +406,26 @@ gnat_init_gcc_eh (void)
for such calls to actually raise in Ada.
The third one is an optimization that makes it possible to delete dead
instructions that may throw exceptions, most notably loads and stores,
as permitted in Ada. */
as permitted in Ada.
Turn off -faggressive-loop-optimizations because it may optimize away
out-of-bound array accesses that we want to be able to catch.
If checks are disabled, we use the same settings as the C++ compiler,
except for the runtime on platforms where S'Machine_Overflow is true
because the runtime depends on FP (hardware) checks being properly
handled despite being compiled in -gnatp mode. */
flag_exceptions = 1;
flag_non_call_exceptions = 1;
flag_delete_dead_exceptions = 1;
if (Suppress_Checks)
{
if (!global_options_set.x_flag_non_call_exceptions)
flag_non_call_exceptions = Machine_Overflows_On_Target && GNAT_Mode;
}
else
{
flag_non_call_exceptions = 1;
flag_aggressive_loop_optimizations = 0;
warn_aggressive_loop_optimizations = 0;
}
init_eh ();
}

View File

@ -197,9 +197,6 @@ struct GTY(()) loop_info_d {
tree low_bound;
tree high_bound;
vec<range_check_info, va_gc> *checks;
bool artificial;
bool has_checks;
bool warned_aggressive_loop_optimizations;
};
typedef struct loop_info_d *loop_info;
@ -658,10 +655,6 @@ gigi (Node_Id gnat_root,
/* Now translate the compilation unit proper. */
Compilation_Unit_to_gnu (gnat_root);
/* Disable -Waggressive-loop-optimizations since we implement our own
version of the warning. */
warn_aggressive_loop_optimizations = 0;
/* Then process the N_Validate_Unchecked_Conversion nodes. We do this at
the very end to avoid having to second-guess the front-end when we run
into dummy nodes during the regular processing. */
@ -1266,32 +1259,18 @@ Pragma_to_gnu (Node_Id gnat_node)
{
Node_Id gnat_expr = Expression (gnat_temp);
tree gnu_expr = gnat_to_gnu (gnat_expr);
int use_address;
machine_mode mode;
tree asm_constraint = NULL_TREE;
#ifdef ASM_COMMENT_START
char *comment;
#endif
if (TREE_CODE (gnu_expr) == UNCONSTRAINED_ARRAY_REF)
gnu_expr = TREE_OPERAND (gnu_expr, 0);
/* Use the value only if it fits into a normal register,
otherwise use the address. */
mode = TYPE_MODE (TREE_TYPE (gnu_expr));
use_address = ((GET_MODE_CLASS (mode) != MODE_INT
&& GET_MODE_CLASS (mode) != MODE_PARTIAL_INT)
|| GET_MODE_SIZE (mode) > UNITS_PER_WORD);
if (use_address)
gnu_expr = build_unary_op (ADDR_EXPR, NULL_TREE, gnu_expr);
gnu_expr = maybe_unconstrained_array (gnu_expr);
gnat_mark_addressable (gnu_expr);
#ifdef ASM_COMMENT_START
comment = concat (ASM_COMMENT_START,
" inspection point: ",
Get_Name_String (Chars (gnat_expr)),
use_address ? " address" : "",
" is in %0",
" is at %0",
NULL);
asm_constraint = build_string (strlen (comment), comment);
free (comment);
@ -1301,8 +1280,8 @@ Pragma_to_gnu (Node_Id gnat_node)
NULL_TREE,
tree_cons
(build_tree_list (NULL_TREE,
build_string (1, "g")),
gnu_expr, NULL_TREE),
build_string (1, "m")),
gnu_expr, NULL_TREE),
NULL_TREE, NULL_TREE);
ASM_VOLATILE_P (gnu_expr) = 1;
set_expr_location_from_node (gnu_expr, gnat_node);
@ -1727,32 +1706,29 @@ Attribute_to_gnu (Node_Id gnat_node, tree *gnu_result_type_p, int attribute)
/* For other address attributes applied to a nested function,
find an inner ADDR_EXPR and annotate it so that we can issue
a useful warning with -Wtrampolines. */
else if (TREE_CODE (TREE_TYPE (gnu_prefix)) == FUNCTION_TYPE)
else if (TREE_CODE (TREE_TYPE (gnu_prefix)) == FUNCTION_TYPE
&& (gnu_expr = remove_conversions (gnu_result, false))
&& TREE_CODE (gnu_expr) == ADDR_EXPR
&& decl_function_context (TREE_OPERAND (gnu_expr, 0)))
{
gnu_expr = remove_conversions (gnu_result, false);
set_expr_location_from_node (gnu_expr, gnat_node);
if (TREE_CODE (gnu_expr) == ADDR_EXPR
&& decl_function_context (TREE_OPERAND (gnu_expr, 0)))
{
set_expr_location_from_node (gnu_expr, gnat_node);
/* Also check the inlining status. */
check_inlining_for_nested_subprog (TREE_OPERAND (gnu_expr, 0));
/* Also check the inlining status. */
check_inlining_for_nested_subprog (TREE_OPERAND (gnu_expr, 0));
/* Moreover, for 'Access or 'Unrestricted_Access with non-
foreign-compatible representation, mark the ADDR_EXPR so
that we can build a descriptor instead of a trampoline. */
if ((attribute == Attr_Access
|| attribute == Attr_Unrestricted_Access)
&& targetm.calls.custom_function_descriptors > 0
&& Can_Use_Internal_Rep (Underlying_Type (Etype (gnat_node))))
FUNC_ADDR_BY_DESCRIPTOR (gnu_expr) = 1;
/* Moreover, for 'Access or 'Unrestricted_Access with non-
foreign-compatible representation, mark the ADDR_EXPR so
that we can build a descriptor instead of a trampoline. */
if ((attribute == Attr_Access
|| attribute == Attr_Unrestricted_Access)
&& targetm.calls.custom_function_descriptors > 0
&& Can_Use_Internal_Rep (Etype (gnat_node)))
FUNC_ADDR_BY_DESCRIPTOR (gnu_expr) = 1;
/* Otherwise, we need to check that we are not violating the
No_Implicit_Dynamic_Code restriction. */
else if (targetm.calls.custom_function_descriptors != 0)
Check_Implicit_Dynamic_Code_Allowed (gnat_node);
}
/* Otherwise, we need to check that we are not violating the
No_Implicit_Dynamic_Code restriction. */
else if (targetm.calls.custom_function_descriptors != 0)
Check_Implicit_Dynamic_Code_Allowed (gnat_node);
}
break;
@ -2861,7 +2837,6 @@ Loop_Statement_to_gnu (Node_Id gnat_node)
/* Save the statement for later reuse. */
gnu_loop_info->stmt = gnu_loop_stmt;
gnu_loop_info->artificial = !Comes_From_Source (gnat_node);
/* Set the condition under which the loop must keep going.
For the case "LOOP .... END LOOP;" the condition is always true. */
@ -3124,7 +3099,7 @@ Loop_Statement_to_gnu (Node_Id gnat_node)
unswitching is enabled, do not require the loop bounds to be also
invariant, as their evaluation will still be ahead of the loop. */
if (vec_safe_length (gnu_loop_info->checks) > 0
&& (make_invariant (&gnu_low, &gnu_high) || flag_unswitch_loops))
&& (make_invariant (&gnu_low, &gnu_high) || optimize >= 3))
{
struct range_check_info_d *rci;
unsigned int i, n_remaining_checks = 0;
@ -3176,22 +3151,22 @@ Loop_Statement_to_gnu (Node_Id gnat_node)
/* Note that loop unswitching can only be applied a small number of
times to a given loop (PARAM_MAX_UNSWITCH_LEVEL default to 3). */
if (0 < n_remaining_checks && n_remaining_checks <= 3
&& optimize > 1 && !optimize_size)
if (IN_RANGE (n_remaining_checks, 1, 3)
&& optimize >= 2
&& !optimize_size)
FOR_EACH_VEC_ELT (*gnu_loop_info->checks, i, rci)
if (rci->invariant_cond != boolean_false_node)
{
TREE_OPERAND (rci->inserted_cond, 0) = rci->invariant_cond;
if (flag_unswitch_loops)
if (optimize >= 3)
add_stmt_with_node_force (rci->inserted_cond, gnat_node);
}
}
/* Second, if loop vectorization is enabled and the iterations of the
loop can easily be proved as independent, mark the loop. */
if (optimize
&& flag_tree_loop_vectorize
if (optimize >= 3
&& independent_iterations_p (LOOP_STMT_BODY (gnu_loop_stmt)))
LOOP_STMT_IVDEP (gnu_loop_stmt) = 1;
@ -3541,6 +3516,20 @@ finalize_nrv_unc_r (tree *tp, int *walk_subtrees, void *data)
return NULL_TREE;
}
/* Apply FUNC to all the sub-trees of nested functions in NODE. FUNC is called
with the DATA and the address of each sub-tree. If FUNC returns a non-NULL
value, the traversal is stopped. */
static void
walk_nesting_tree (struct cgraph_node *node, walk_tree_fn func, void *data)
{
for (node = node->nested; node; node = node->next_nested)
{
walk_tree_without_duplicates (&DECL_SAVED_TREE (node->decl), func, data);
walk_nesting_tree (node, func, data);
}
}
/* Finalize the Named Return Value optimization for FNDECL. The NRV bitmap
contains the candidates for Named Return Value and OTHER is a list of
the other return values. GNAT_RET is a representative return node. */
@ -3548,7 +3537,6 @@ finalize_nrv_unc_r (tree *tp, int *walk_subtrees, void *data)
static void
finalize_nrv (tree fndecl, bitmap nrv, vec<tree, va_gc> *other, Node_Id gnat_ret)
{
struct cgraph_node *node;
struct nrv_data data;
walk_tree_fn func;
unsigned int i;
@ -3569,10 +3557,7 @@ finalize_nrv (tree fndecl, bitmap nrv, vec<tree, va_gc> *other, Node_Id gnat_ret
return;
/* Prune also the candidates that are referenced by nested functions. */
node = cgraph_node::get_create (fndecl);
for (node = node->nested; node; node = node->next_nested)
walk_tree_without_duplicates (&DECL_SAVED_TREE (node->decl), prune_nrv_r,
&data);
walk_nesting_tree (cgraph_node::get_create (fndecl), prune_nrv_r, &data);
if (bitmap_empty_p (nrv))
return;
@ -4059,6 +4044,8 @@ node_has_volatile_full_access (Node_Id gnat_node)
case N_Identifier:
case N_Expanded_Name:
gnat_entity = Entity (gnat_node);
if (!Is_Object (gnat_entity))
break;
return Is_Volatile_Full_Access (gnat_entity)
|| Is_Volatile_Full_Access (Etype (gnat_entity));
@ -4300,7 +4287,8 @@ Call_to_gnu (Node_Id gnat_node, tree *gnu_result_type_p, tree gnu_target,
/* If the access type doesn't require foreign-compatible representation,
be prepared for descriptors. */
if (targetm.calls.custom_function_descriptors > 0
&& Can_Use_Internal_Rep (Etype (Prefix (Name (gnat_node)))))
&& Can_Use_Internal_Rep
(Underlying_Type (Etype (Prefix (Name (gnat_node))))))
by_descriptor = true;
}
else if (Nkind (Name (gnat_node)) == N_Attribute_Reference)
@ -4324,12 +4312,15 @@ Call_to_gnu (Node_Id gnat_node, tree *gnu_result_type_p, tree gnu_target,
because we need to preserve the return value before copying back the
parameters.
2. There is no target and the call is made for neither an object nor a
2. There is no target and the call is made for neither an object, nor a
renaming declaration, nor a return statement, nor an allocator, and
the return type has variable size because in this case the gimplifier
cannot create the temporary, or more generally is simply an aggregate
type, because the gimplifier would then create the temporary in the
outermost scope instead of locally.
cannot create the temporary, or more generally is an aggregate type,
because the gimplifier would create the temporary in the outermost
scope instead of locally. But there is an exception for an allocator
of an unconstrained record type with default discriminant because we
allocate the actual size in this case, unlike the other 3 cases, so
we need a temporary to fetch the discriminant and we create it here.
3. There is a target and it is a slice or an array with fixed size,
and the return type has variable size, because the gimplifier
@ -4348,8 +4339,9 @@ Call_to_gnu (Node_Id gnat_node, tree *gnu_result_type_p, tree gnu_target,
&& Nkind (Parent (gnat_node)) != N_Object_Declaration
&& Nkind (Parent (gnat_node)) != N_Object_Renaming_Declaration
&& Nkind (Parent (gnat_node)) != N_Simple_Return_Statement
&& !(Nkind (Parent (gnat_node)) == N_Qualified_Expression
&& Nkind (Parent (Parent (gnat_node))) == N_Allocator)
&& (!(Nkind (Parent (gnat_node)) == N_Qualified_Expression
&& Nkind (Parent (Parent (gnat_node))) == N_Allocator)
|| type_is_padding_self_referential (gnu_result_type))
&& AGGREGATE_TYPE_P (gnu_result_type)
&& !TYPE_IS_FAT_POINTER_P (gnu_result_type))
|| (gnu_target
@ -5652,9 +5644,8 @@ Raise_Error_to_gnu (Node_Id gnat_node, tree *gnu_result_type_p)
rci->inserted_cond
= build1 (SAVE_EXPR, boolean_type_node, boolean_true_node);
vec_safe_push (loop->checks, rci);
loop->has_checks = true;
gnu_cond = build_noreturn_cond (gnat_to_gnu (gnat_cond));
if (flag_unswitch_loops)
if (optimize >= 3)
gnu_cond = build_binary_op (TRUTH_ANDIF_EXPR,
boolean_type_node,
rci->inserted_cond,
@ -5665,14 +5656,6 @@ Raise_Error_to_gnu (Node_Id gnat_node, tree *gnu_result_type_p)
gnu_cond,
rci->inserted_cond);
}
/* Or else, if aggressive loop optimizations are enabled, we just
record that there are checks applied to iteration variables. */
else if (optimize
&& flag_aggressive_loop_optimizations
&& inside_loop_p ()
&& (loop = find_loop_for (gnu_index)))
loop->has_checks = true;
}
break;
@ -6288,45 +6271,9 @@ gnat_to_gnu (Node_Id gnat_node)
gcc_assert (TREE_CODE (gnu_type) == ARRAY_TYPE);
gnat_temp = gnat_expr_array[i];
gnu_expr = maybe_character_value (gnat_to_gnu (gnat_temp));
struct loop_info_d *loop;
gnu_result
= build_binary_op (ARRAY_REF, NULL_TREE, gnu_result, gnu_expr);
/* Array accesses are bound-checked so they cannot trap, but this
is valid only if they are not hoisted ahead of the check. We
need to mark them as no-trap to get decent loop optimizations
in the presence of -fnon-call-exceptions, so we do it when we
know that the original expression had no side-effects. */
if (TREE_CODE (gnu_result) == ARRAY_REF
&& !(Nkind (gnat_temp) == N_Identifier
&& Ekind (Entity (gnat_temp)) == E_Constant))
TREE_THIS_NOTRAP (gnu_result) = 1;
/* If aggressive loop optimizations are enabled, we warn for loops
overrunning a simple array of size 1 not at the end of a record.
This is aimed to catch misuses of the trailing array idiom. */
if (optimize
&& flag_aggressive_loop_optimizations
&& inside_loop_p ()
&& TREE_CODE (TREE_TYPE (gnu_type)) != ARRAY_TYPE
&& TREE_CODE (gnu_array_object) != ARRAY_REF
&& tree_int_cst_equal (TYPE_MIN_VALUE (TYPE_DOMAIN (gnu_type)),
TYPE_MAX_VALUE (TYPE_DOMAIN (gnu_type)))
&& !array_at_struct_end_p (gnu_result)
&& (loop = find_loop_for (gnu_expr))
&& !loop->artificial
&& !loop->has_checks
&& tree_int_cst_equal (TYPE_MIN_VALUE (TYPE_DOMAIN (gnu_type)),
loop->low_bound)
&& can_be_lower_p (loop->low_bound, loop->high_bound)
&& !loop->warned_aggressive_loop_optimizations
&& warning (OPT_Waggressive_loop_optimizations,
"out-of-bounds access may be optimized away"))
{
inform (EXPR_LOCATION (loop->stmt), "containing loop");
loop->warned_aggressive_loop_optimizations = true;
}
}
gnu_result_type = get_unpadded_type (Etype (gnat_node));
@ -6965,21 +6912,29 @@ gnat_to_gnu (Node_Id gnat_node)
/* Or else, use memset when the conditions are met. */
else if (use_memset_p)
{
tree value = fold_convert (integer_type_node, gnu_rhs);
tree to = gnu_lhs;
tree type = TREE_TYPE (to);
tree size
= SUBSTITUTE_PLACEHOLDER_IN_EXPR (TYPE_SIZE_UNIT (type), to);
tree to_ptr = build_fold_addr_expr (to);
tree value
= real_zerop (gnu_rhs)
? integer_zero_node
: fold_convert (integer_type_node, gnu_rhs);
tree dest = build_fold_addr_expr (gnu_lhs);
tree t = builtin_decl_explicit (BUILT_IN_MEMSET);
if (TREE_CODE (value) == INTEGER_CST)
/* Be extra careful not to write too much data. */
tree size;
if (TREE_CODE (gnu_lhs) == COMPONENT_REF)
size = DECL_SIZE_UNIT (TREE_OPERAND (gnu_lhs, 1));
else if (DECL_P (gnu_lhs))
size = DECL_SIZE_UNIT (gnu_lhs);
else
size = TYPE_SIZE_UNIT (TREE_TYPE (gnu_lhs));
size = SUBSTITUTE_PLACEHOLDER_IN_EXPR (size, gnu_lhs);
if (TREE_CODE (value) == INTEGER_CST && !integer_zerop (value))
{
tree mask
= build_int_cst (integer_type_node,
((HOST_WIDE_INT) 1 << BITS_PER_UNIT) - 1);
value = int_const_binop (BIT_AND_EXPR, value, mask);
}
gnu_result = build_call_expr (t, 3, to_ptr, value, size);
gnu_result = build_call_expr (t, 3, dest, value, size);
}
/* Otherwise build a regular assignment. */
@ -8143,8 +8098,9 @@ mark_visited_r (tree *tp, int *walk_subtrees, void *data ATTRIBUTE_UNUSED)
else if (!TYPE_IS_DUMMY_P (t))
TREE_VISITED (t) = 1;
/* The test in gimplify_type_sizes is on the main variant. */
if (TYPE_P (t))
TYPE_SIZES_GIMPLIFIED (t) = 1;
TYPE_SIZES_GIMPLIFIED (TYPE_MAIN_VARIANT (t)) = 1;
return NULL_TREE;
}
@ -9272,7 +9228,7 @@ convert_with_check (Entity_Id gnat_type, tree gnu_expr, bool overflowp,
? tree_int_cst_lt (gnu_out_ub, gnu_in_ub)
: (FLOAT_TYPE_P (gnu_base_type)
? real_less (&TREE_REAL_CST (gnu_out_ub),
&TREE_REAL_CST (gnu_in_lb))
&TREE_REAL_CST (gnu_in_ub))
: 1))
gnu_cond
= build_binary_op (TRUTH_ORIF_EXPR, boolean_type_node, gnu_cond,

View File

@ -1036,7 +1036,9 @@ make_packable_type (tree type, bool in_record, unsigned int max_align)
finish_record_type (new_type, nreverse (new_field_list), 2, false);
relate_alias_sets (new_type, type, ALIAS_SET_COPY);
if (TYPE_STUB_DECL (type))
if (gnat_encodings == DWARF_GNAT_ENCODINGS_MINIMAL)
SET_TYPE_DEBUG_TYPE (new_type, TYPE_DEBUG_TYPE (type));
else if (TYPE_STUB_DECL (type))
SET_DECL_PARALLEL_TYPE (TYPE_STUB_DECL (new_type),
DECL_PARALLEL_TYPE (TYPE_STUB_DECL (type)));
@ -1367,7 +1369,7 @@ maybe_pad_type (tree type, tree size, unsigned int align,
finish_record_type (record, field, 1, false);
if (gnat_encodings == DWARF_GNAT_ENCODINGS_MINIMAL)
SET_TYPE_DEBUG_TYPE (record, type);
SET_TYPE_DEBUG_TYPE (record, maybe_debug_type (type));
/* Set the RM size if requested. */
if (set_rm_size)
@ -3255,8 +3257,11 @@ finish_subprog_decl (tree decl, tree asm_name, tree type)
DECL_BY_REFERENCE (result_decl) = TREE_ADDRESSABLE (type);
DECL_RESULT (decl) = result_decl;
/* Propagate the "const" property. */
TREE_READONLY (decl) = TYPE_READONLY (type);
TREE_SIDE_EFFECTS (decl) = TREE_THIS_VOLATILE (decl) = TYPE_VOLATILE (type);
/* Propagate the "noreturn" property. */
TREE_THIS_VOLATILE (decl) = TYPE_VOLATILE (type);
if (asm_name)
{
@ -4543,9 +4548,12 @@ convert (tree type, tree expr)
etype)))
return build1 (VIEW_CONVERT_EXPR, type, expr);
/* If we are converting between tagged types, try to upcast properly. */
/* If we are converting between tagged types, try to upcast properly.
But don't do it if we are just annotating types since tagged types
aren't fully laid out in this mode. */
else if (ecode == RECORD_TYPE && code == RECORD_TYPE
&& TYPE_ALIGN_OK (etype) && TYPE_ALIGN_OK (type))
&& TYPE_ALIGN_OK (etype) && TYPE_ALIGN_OK (type)
&& !type_annotate_only)
{
tree child_etype = etype;
do {
@ -5022,8 +5030,16 @@ unchecked_convert (tree type, tree expr, bool notrunc_p)
tree etype = TREE_TYPE (expr);
enum tree_code ecode = TREE_CODE (etype);
enum tree_code code = TREE_CODE (type);
const bool ebiased
= (ecode == INTEGER_TYPE && TYPE_BIASED_REPRESENTATION_P (etype));
const bool biased
= (code == INTEGER_TYPE && TYPE_BIASED_REPRESENTATION_P (type));
const bool ereverse
= (AGGREGATE_TYPE_P (etype) && TYPE_REVERSE_STORAGE_ORDER (etype));
const bool reverse
= (AGGREGATE_TYPE_P (type) && TYPE_REVERSE_STORAGE_ORDER (type));
tree tem;
int c;
int c = 0;
/* If the expression is already of the right type, we are done. */
if (etype == type)
@ -5039,7 +5055,7 @@ unchecked_convert (tree type, tree expr, bool notrunc_p)
|| (ecode == RECORD_TYPE && TYPE_JUSTIFIED_MODULAR_P (etype))))
|| code == UNCONSTRAINED_ARRAY_TYPE)
{
if (ecode == INTEGER_TYPE && TYPE_BIASED_REPRESENTATION_P (etype))
if (ebiased)
{
tree ntype = copy_type (etype);
TYPE_BIASED_REPRESENTATION_P (ntype) = 0;
@ -5047,7 +5063,7 @@ unchecked_convert (tree type, tree expr, bool notrunc_p)
expr = build1 (NOP_EXPR, ntype, expr);
}
if (code == INTEGER_TYPE && TYPE_BIASED_REPRESENTATION_P (type))
if (biased)
{
tree rtype = copy_type (type);
TYPE_BIASED_REPRESENTATION_P (rtype) = 0;
@ -5076,30 +5092,35 @@ unchecked_convert (tree type, tree expr, bool notrunc_p)
Finally, for the sake of consistency, we do the unchecked conversion
to an integral type with reverse storage order as soon as the source
type is an aggregate type with reverse storage order, even if there
are no considerations of precision or size involved. */
else if (INTEGRAL_TYPE_P (type)
&& TYPE_RM_SIZE (type)
&& (tree_int_cst_compare (TYPE_RM_SIZE (type),
TYPE_SIZE (type)) < 0
|| (AGGREGATE_TYPE_P (etype)
&& TYPE_REVERSE_STORAGE_ORDER (etype))))
are no considerations of precision or size involved. Ultimately, we
further extend this processing to any scalar type. */
else if ((INTEGRAL_TYPE_P (type)
&& TYPE_RM_SIZE (type)
&& ((c = tree_int_cst_compare (TYPE_RM_SIZE (type),
TYPE_SIZE (type))) < 0
|| ereverse))
|| (SCALAR_FLOAT_TYPE_P (type) && ereverse))
{
tree rec_type = make_node (RECORD_TYPE);
unsigned HOST_WIDE_INT prec = TREE_INT_CST_LOW (TYPE_RM_SIZE (type));
tree field_type, field;
if (AGGREGATE_TYPE_P (etype))
TYPE_REVERSE_STORAGE_ORDER (rec_type)
= TYPE_REVERSE_STORAGE_ORDER (etype);
TYPE_REVERSE_STORAGE_ORDER (rec_type) = ereverse;
if (type_unsigned_for_rm (type))
field_type = make_unsigned_type (prec);
if (c < 0)
{
const unsigned HOST_WIDE_INT prec
= TREE_INT_CST_LOW (TYPE_RM_SIZE (type));
if (type_unsigned_for_rm (type))
field_type = make_unsigned_type (prec);
else
field_type = make_signed_type (prec);
SET_TYPE_RM_SIZE (field_type, TYPE_RM_SIZE (type));
}
else
field_type = make_signed_type (prec);
SET_TYPE_RM_SIZE (field_type, TYPE_RM_SIZE (type));
field_type = type;
field = create_field_decl (get_identifier ("OBJ"), field_type, rec_type,
NULL_TREE, bitsize_zero_node, 1, 0);
NULL_TREE, bitsize_zero_node, c < 0, 0);
finish_record_type (rec_type, field, 1, false);
@ -5114,31 +5135,35 @@ unchecked_convert (tree type, tree expr, bool notrunc_p)
The same considerations as above apply if the target type is an aggregate
type with reverse storage order and we also proceed similarly. */
else if (INTEGRAL_TYPE_P (etype)
&& TYPE_RM_SIZE (etype)
&& (tree_int_cst_compare (TYPE_RM_SIZE (etype),
TYPE_SIZE (etype)) < 0
|| (AGGREGATE_TYPE_P (type)
&& TYPE_REVERSE_STORAGE_ORDER (type))))
else if ((INTEGRAL_TYPE_P (etype)
&& TYPE_RM_SIZE (etype)
&& ((c = tree_int_cst_compare (TYPE_RM_SIZE (etype),
TYPE_SIZE (etype))) < 0
|| reverse))
|| (SCALAR_FLOAT_TYPE_P (etype) && reverse))
{
tree rec_type = make_node (RECORD_TYPE);
unsigned HOST_WIDE_INT prec = TREE_INT_CST_LOW (TYPE_RM_SIZE (etype));
vec<constructor_elt, va_gc> *v;
vec_alloc (v, 1);
tree field_type, field;
if (AGGREGATE_TYPE_P (type))
TYPE_REVERSE_STORAGE_ORDER (rec_type)
= TYPE_REVERSE_STORAGE_ORDER (type);
TYPE_REVERSE_STORAGE_ORDER (rec_type) = reverse;
if (type_unsigned_for_rm (etype))
field_type = make_unsigned_type (prec);
if (c < 0)
{
const unsigned HOST_WIDE_INT prec
= TREE_INT_CST_LOW (TYPE_RM_SIZE (etype));
if (type_unsigned_for_rm (etype))
field_type = make_unsigned_type (prec);
else
field_type = make_signed_type (prec);
SET_TYPE_RM_SIZE (field_type, TYPE_RM_SIZE (etype));
}
else
field_type = make_signed_type (prec);
SET_TYPE_RM_SIZE (field_type, TYPE_RM_SIZE (etype));
field_type = etype;
field = create_field_decl (get_identifier ("OBJ"), field_type, rec_type,
NULL_TREE, bitsize_zero_node, 1, 0);
NULL_TREE, bitsize_zero_node, c < 0, 0);
finish_record_type (rec_type, field, 1, false);
@ -5237,8 +5262,8 @@ unchecked_convert (tree type, tree expr, bool notrunc_p)
if the input is also an integral type and both are unsigned or both are
signed and have the same precision. */
if (!notrunc_p
&& !biased
&& INTEGRAL_TYPE_P (type)
&& !(code == INTEGER_TYPE && TYPE_BIASED_REPRESENTATION_P (type))
&& TYPE_RM_SIZE (type)
&& tree_int_cst_compare (TYPE_RM_SIZE (type), TYPE_SIZE (type)) < 0
&& !(INTEGRAL_TYPE_P (etype)
@ -6113,8 +6138,7 @@ handle_noreturn_attribute (tree *node, tree name, tree ARG_UNUSED (args),
&& TREE_CODE (TREE_TYPE (type)) == FUNCTION_TYPE)
TREE_TYPE (*node)
= build_pointer_type
(build_type_variant (TREE_TYPE (type),
TYPE_READONLY (TREE_TYPE (type)), 1));
(change_qualified_type (TREE_TYPE (type), TYPE_QUAL_VOLATILE));
else
{
warning (OPT_Wattributes, "%qs attribute ignored",

View File

@ -1888,6 +1888,7 @@ begin
Clean_Link_Option_Set : declare
J : Natural;
Shared_Libgcc_Seen : Boolean := False;
Static_Libgcc_Seen : Boolean := False;
begin
J := Linker_Options.First;
@ -1909,7 +1910,7 @@ begin
end if;
end if;
-- Remove duplicate -shared-libgcc switch
-- Remove duplicate -shared-libgcc switches
if Linker_Options.Table (J).all = Shared_Libgcc_String then
if Shared_Libgcc_Seen then
@ -1923,6 +1924,20 @@ begin
end if;
end if;
-- Remove duplicate -static-libgcc switches
if Linker_Options.Table (J).all = Static_Libgcc_String then
if Static_Libgcc_Seen then
Linker_Options.Table (J .. Linker_Options.Last - 1) :=
Linker_Options.Table (J + 1 .. Linker_Options.Last);
Linker_Options.Decrement_Last;
Num_Args := Num_Args - 1;
else
Static_Libgcc_Seen := True;
end if;
end if;
-- Here we just check for a canonical form that matches the
-- pragma Linker_Options set in the NT runtime.
@ -1954,14 +1969,27 @@ begin
-- libgcc, if gcc is not called with -shared-libgcc, call it
-- with -static-libgcc, as there are some platforms where one
-- of these two switches is compulsory to link.
-- Don't push extra switches if we already saw one.
if Shared_Libgcc_Default = 'T'
and then not Shared_Libgcc_Seen
and then not Static_Libgcc_Seen
then
Linker_Options.Increment_Last;
Linker_Options.Table (Linker_Options.Last) := Static_Libgcc;
Num_Args := Num_Args + 1;
end if;
-- Likewise, the reverse.
if Shared_Libgcc_Default = 'H'
and then not Static_Libgcc_Seen
and then not Shared_Libgcc_Seen
then
Linker_Options.Increment_Last;
Linker_Options.Table (Linker_Options.Last) := Shared_Libgcc;
Num_Args := Num_Args + 1;
end if;
end if;
end Clean_Link_Option_Set;

View File

@ -250,8 +250,7 @@ package body Osint is
Attr : aliased File_Attributes;
end record;
No_File_Info_Cache : constant File_Info_Cache :=
(No_File, Unknown_Attributes);
No_File_Info_Cache : constant File_Info_Cache := (No_File, (others => 0));
package File_Name_Hash_Table is new GNAT.HTable.Simple_HTable (
Header_Num => File_Hash_Num,

View File

@ -273,10 +273,26 @@ package Osint is
-- from the disk and then cached in the File_Attributes parameter (possibly
-- along with other values).
type File_Attributes is private;
Unknown_Attributes : constant File_Attributes;
File_Attributes_Size : constant Natural := 32;
-- This should be big enough to fit a "struct file_attributes" on any
-- system. It doesn't cause any malfunction if it is too big (which avoids
-- the need for either mapping the struct exactly or importing the sizeof
-- from C, which would result in dynamic code). However, it does waste
-- space (e.g. when a component of this type appears in a record, if it is
-- unnecessarily large). Note: for runtime units, use System.OS_Constants.
-- SIZEOF_struct_file_attributes instead, which has the exact value.
type File_Attributes is
array (1 .. File_Attributes_Size)
of System.Storage_Elements.Storage_Element;
for File_Attributes'Alignment use Standard'Maximum_Alignment;
Unknown_Attributes : File_Attributes;
-- A cache for various attributes for a file (length, accessibility,...)
-- This must be initialized to Unknown_Attributes prior to the first call.
-- Will be initialized properly at elaboration (for efficiency later on,
-- avoid function calls every time we want to reset the attributes) prior
-- to the first usage. We cannot make it constant since the compiler may
-- put it in a read-only section.
function Is_Directory
(Name : C_File_Name;
@ -769,22 +785,4 @@ private
-- detected, the file being written is deleted, and a fatal error is
-- signalled.
File_Attributes_Size : constant Natural := 32;
-- This should be big enough to fit a "struct file_attributes" on any
-- system. It doesn't cause any malfunction if it is too big (which avoids
-- the need for either mapping the struct exactly or importing the sizeof
-- from C, which would result in dynamic code). However, it does waste
-- space (e.g. when a component of this type appears in a record, if it is
-- unnecessarily large). Note: for runtime units, use System.OS_Constants.
-- SIZEOF_struct_file_attributes instead, which has the exact value.
type File_Attributes is
array (1 .. File_Attributes_Size)
of System.Storage_Elements.Storage_Element;
for File_Attributes'Alignment use Standard'Maximum_Alignment;
Unknown_Attributes : constant File_Attributes := (others => 0);
-- Will be initialized properly at elaboration (for efficiency later on,
-- avoid function calls every time we want to reset the attributes).
end Osint;

View File

@ -70,7 +70,7 @@ package System.Linux is
EINVAL : constant := 22;
ENOMEM : constant := 12;
EPERM : constant := 1;
ETIMEDOUT : constant := 110;
ETIMEDOUT : constant := 60;
-------------
-- Signals --

View File

@ -536,17 +536,18 @@ private
end record;
pragma Convention (C, record_type_3);
type upad64_t is new Interfaces.Unsigned_64;
type mutex_t is record
flags : record_type_3;
lock : String (1 .. 8);
data : String (1 .. 8);
lock : upad64_t;
data : upad64_t;
end record;
pragma Convention (C, mutex_t);
type cond_t is record
flag : array_type_9;
Xtype : unsigned_long;
data : String (1 .. 8);
flags : record_type_3;
data : upad64_t;
end record;
pragma Convention (C, cond_t);

View File

@ -5203,10 +5203,7 @@ package body Sem_Util is
-- Defining_Entity --
---------------------
function Defining_Entity
(N : Node_Id;
Empty_On_Errors : Boolean := False) return Entity_Id
is
function Defining_Entity (N : Node_Id) return Entity_Id is
Err : Entity_Id := Empty;
begin
@ -5285,14 +5282,10 @@ package body Sem_Util is
-- can continue semantic analysis.
elsif Nam = Error then
if Empty_On_Errors then
return Empty;
else
Err := Make_Temporary (Sloc (N), 'T');
Set_Defining_Unit_Name (N, Err);
Err := Make_Temporary (Sloc (N), 'T');
Set_Defining_Unit_Name (N, Err);
return Err;
end if;
return Err;
-- If not an entity, get defining identifier
@ -5307,11 +5300,7 @@ package body Sem_Util is
return Entity (Identifier (N));
when others =>
if Empty_On_Errors then
return Empty;
else
raise Program_Error;
end if;
raise Program_Error;
end case;
end Defining_Entity;

View File

@ -474,9 +474,7 @@ package Sem_Util is
-- in the case of a descendant of a generic formal type (returns Int'Last
-- instead of 0).
function Defining_Entity
(N : Node_Id;
Empty_On_Errors : Boolean := False) return Entity_Id;
function Defining_Entity (N : Node_Id) return Entity_Id;
-- Given a declaration N, returns the associated defining entity. If the
-- declaration has a specification, the entity is obtained from the
-- specification. If the declaration has a defining unit name, then the
@ -487,19 +485,6 @@ package Sem_Util is
-- local entities declared during loop expansion. These entities need
-- debugging information, generated through Qualify_Entity_Names, and
-- the loop declaration must be placed in the table Name_Qualify_Units.
--
-- Set flag Empty_On_Error to change the behavior of this routine as
-- follows:
--
-- * True - A declaration that lacks a defining entity returns Empty.
-- A node that does not allow for a defining entity returns Empty.
--
-- * False - A declaration that lacks a defining entity is given a new
-- internally generated entity which is subsequently returned. A node
-- that does not allow for a defining entity raises Program_Error.
--
-- The former semantics is appropriate for the back end; the latter
-- semantics is appropriate for the front end.
function Denotes_Discriminant
(N : Node_Id;

View File

@ -158,7 +158,7 @@ private
Preallocated_Stacks : constant Boolean := False;
Signed_Zeros : constant Boolean := True;
Stack_Check_Default : constant Boolean := False;
Stack_Check_Probes : constant Boolean := False;
Stack_Check_Probes : constant Boolean := True;
Stack_Check_Limits : constant Boolean := False;
Support_Aggregates : constant Boolean := True;
Support_Atomic_Primitives : constant Boolean := Word_Size = 64;

View File

@ -2997,7 +2997,8 @@ write_dependence_p (const_rtx mem,
int ret;
gcc_checking_assert (x_canonicalized
? (x_addr != NULL_RTX && x_mode != VOIDmode)
? (x_addr != NULL_RTX
&& (x_mode != VOIDmode || GET_MODE (x) == VOIDmode))
: (x_addr == NULL_RTX && x_mode == VOIDmode));
if (MEM_VOLATILE_P (x) && MEM_VOLATILE_P (mem))

View File

@ -1,3 +1,16 @@
2019-11-14 Release Manager
* GCC 7.5.0 released.
2018-12-06 Release Manager
* GCC 7.4.0 released.
2018-07-04 Martin Jambor <mjambor@suse.cz>
PR hsa/86371
* Make-lang.in (BRIGINCLUDES): Remove erroneous include path in $HOME.
2018-01-25 Release Manager
* GCC 7.3.0 released.

View File

@ -235,8 +235,7 @@ brig.stagefeedback: stagefeedback-start
CFLAGS-brig/brig-lang.o += -DDEFAULT_TARGET_VERSION=\"$(version)\" \
-DDEFAULT_TARGET_MACHINE=\"$(target_noncanonical)\"
BRIGINCLUDES = -I $(srcdir)/brig -I ${HOME}/local/include \
-I $(srcdir)/brig/brigfrontend
BRIGINCLUDES = -I $(srcdir)/brig -I $(srcdir)/brig/brigfrontend
brig/brig-machine.o: brig/brigfrontend/brig-machine.c
$(COMPILE) $(BRIGINCLUDES) $<

View File

@ -2508,7 +2508,7 @@ expand_builtin_int_roundingfn (tree exp, rtx target)
tree arg;
if (!validate_arglist (exp, REAL_TYPE, VOID_TYPE))
gcc_unreachable ();
return NULL_RTX;
arg = CALL_EXPR_ARG (exp, 0);
@ -2644,7 +2644,7 @@ expand_builtin_int_roundingfn_2 (tree exp, rtx target)
enum built_in_function fallback_fn = BUILT_IN_NONE;
if (!validate_arglist (exp, REAL_TYPE, VOID_TYPE))
gcc_unreachable ();
return NULL_RTX;
arg = CALL_EXPR_ARG (exp, 0);
@ -7538,8 +7538,7 @@ builtin_mathfn_code (const_tree t)
const_tree argtype, parmtype;
const_call_expr_arg_iterator iter;
if (TREE_CODE (t) != CALL_EXPR
|| TREE_CODE (CALL_EXPR_FN (t)) != ADDR_EXPR)
if (TREE_CODE (t) != CALL_EXPR)
return END_BUILTINS;
fndecl = get_callee_fndecl (t);
@ -9271,7 +9270,7 @@ fold_builtin_strpbrk (location_t loc, tree s1, tree s2, tree type)
if (p2[0] == '\0')
/* strpbrk(x, "") == NULL.
Evaluate and ignore s1 in case it had side-effects. */
return omit_one_operand_loc (loc, TREE_TYPE (s1), integer_zero_node, s1);
return omit_one_operand_loc (loc, type, integer_zero_node, s1);
if (p2[1] != '\0')
return NULL_TREE; /* Really call strpbrk. */
@ -9775,6 +9774,9 @@ maybe_emit_sprintf_chk_warning (tree exp, enum built_in_function fcode)
static void
maybe_emit_free_warning (tree exp)
{
if (call_expr_nargs (exp) != 1)
return;
tree arg = CALL_EXPR_ARG (exp, 0);
STRIP_NOPS (arg);

View File

@ -1,3 +1,97 @@
2019-11-14 Release Manager
* GCC 7.5.0 released.
2019-09-05 Iain Sandoe <iain@sandoe.co.uk>
Backport from mainline
2019-08-23 Iain Sandoe <iain@sandoe.co.uk>
PR pch/61250
* c-lex.c (c_lex_with_flags): Don't call
c_common_no_more_pch () from here.
2019-08-30 Richard Biener <rguenther@suse.de>
Backport from mainline
2019-05-15 Richard Biener <rguenther@suse.de>
PR c/90474
* c-common.c (c_common_mark_addressable_vec): Also mark
a COMPOUND_LITERAL_EXPR_DECL addressable similar to
c_mark_addressable.
2019-08-30 Jakub Jelinek <jakub@redhat.com>
Backported from mainline
2019-06-25 Jakub Jelinek <jakub@redhat.com>
PR sanitizer/90954
* c-omp.c (c_finish_omp_atomic): Allow tree_invariant_p in addition
to SAVE_EXPR in first operand of a COMPOUND_EXPR.
2019-04-09 Eric Botcazou <ebotcazou@adacore.com>
* c-ada-spec.c (print_destructor): Deal with deleting destructors.
(dump_ada_declaration) <FUNCTION_DECL>: Likewise.
2018-12-06 Release Manager
* GCC 7.4.0 released.
2018-06-22 Jakub Jelinek <jakub@redhat.com>
Backported from mainline
2018-06-20 Jakub Jelinek <jakub@redhat.com>
PR c++/86210
* c-common.c (check_nonnull_arg): Use fold_for_warn. Adjust obsolete
comment.
2018-05-11 Jakub Jelinek <jakub@redhat.com>
PR c/85696
* c-omp.c (c_omp_predetermined_sharing): Return
OMP_CLAUSE_DEFAULT_SHARED for artificial vars with integral type.
2018-05-10 Jakub Jelinek <jakub@redhat.com>
PR c++/85662
* c-common.h (fold_offsetof_1): Removed.
(fold_offsetof): Add TYPE argument defaulted to size_type_node and
CTX argument defaulted to ERROR_MARK.
* c-common.c (fold_offsetof_1): Renamed to ...
(fold_offsetof): ... this. Remove wrapper function. Add TYPE
argument, convert the pointer constant to TYPE and use size_binop
with PLUS_EXPR instead of fold_build_pointer_plus if type is not
a pointer type. Adjust recursive calls.
2018-04-26 Richard Biener <rguenther@suse.de>
Backport from mainline
2018-03-16 Richard Biener <rguenther@suse.de>
PR c/84873
* c-gimplify.c (c_gimplify_expr): Revert previous change. Instead
unshare the possibly folded expression.
2018-03-15 Richard Biener <rguenther@suse.de>
PR c/84873
* c-gimplify.c (c_gimplify_expr): Do not fold expressions.
2018-03-03 Jakub Jelinek <jakub@redhat.com>
Backported from mainline
2018-01-27 Jakub Jelinek <jakub@redhat.com>
* c-cppbuiltin.c (c_cpp_builtins): Use ggc_strdup for the fp_suffix
argument.
(LAZY_HEX_FP_VALUES_CNT): Define.
(lazy_hex_fp_values): Allow up to LAZY_HEX_FP_VALUES_CNT lazy hex fp
values rather than just 12.
(builtin_define_with_hex_fp_value): Likewise.
2018-01-25 Release Manager
* GCC 7.3.0 released.

View File

@ -2663,6 +2663,8 @@ print_destructor (pretty_printer *buffer, tree t)
tree decl_name = DECL_NAME (DECL_ORIGIN (t));
pp_string (buffer, "Delete_");
if (strncmp (IDENTIFIER_POINTER (DECL_NAME (t)), "__del", 5) == 0)
pp_string (buffer, "And_Free_");
pp_ada_tree_identifier (buffer, decl_name, t, false);
}
@ -2915,8 +2917,9 @@ print_ada_declaration (pretty_printer *buffer, tree t, tree type, int spc)
if (DECL_ARTIFICIAL (t))
return 0;
/* Only consider constructors/destructors for complete objects. */
if (strncmp (IDENTIFIER_POINTER (decl_name), "__comp", 6) != 0)
/* Only consider complete constructors and deleting destructors. */
if (strncmp (IDENTIFIER_POINTER (decl_name), "__comp", 6) != 0
&& strncmp (IDENTIFIER_POINTER (decl_name), "__del", 5) != 0)
return 0;
}

View File

@ -5434,10 +5434,8 @@ check_nonnull_arg (void *ctx, tree param, unsigned HOST_WIDE_INT param_num)
if (TREE_CODE (TREE_TYPE (param)) != POINTER_TYPE)
return;
/* When not optimizing diagnose the simple cases of null arguments.
When optimization is enabled defer the checking until expansion
when more cases can be detected. */
if (integer_zerop (param))
/* Diagnose the simple cases of null arguments. */
if (integer_zerop (fold_for_warn (param)))
{
warning_at (pctx->loc, OPT_Wnonnull, "null argument where non-null "
"required (argument %lu)", (unsigned long) param_num);
@ -6253,10 +6251,11 @@ c_common_to_target_charset (HOST_WIDE_INT c)
/* Fold an offsetof-like expression. EXPR is a nested sequence of component
references with an INDIRECT_REF of a constant at the bottom; much like the
traditional rendering of offsetof as a macro. Return the folded result. */
traditional rendering of offsetof as a macro. TYPE is the desired type of
the whole expression. Return the folded result. */
tree
fold_offsetof_1 (tree expr, enum tree_code ctx)
fold_offsetof (tree expr, tree type, enum tree_code ctx)
{
tree base, off, t;
tree_code code = TREE_CODE (expr);
@ -6281,10 +6280,10 @@ fold_offsetof_1 (tree expr, enum tree_code ctx)
error ("cannot apply %<offsetof%> to a non constant address");
return error_mark_node;
}
return TREE_OPERAND (expr, 0);
return convert (type, TREE_OPERAND (expr, 0));
case COMPONENT_REF:
base = fold_offsetof_1 (TREE_OPERAND (expr, 0), code);
base = fold_offsetof (TREE_OPERAND (expr, 0), type, code);
if (base == error_mark_node)
return base;
@ -6301,7 +6300,7 @@ fold_offsetof_1 (tree expr, enum tree_code ctx)
break;
case ARRAY_REF:
base = fold_offsetof_1 (TREE_OPERAND (expr, 0), code);
base = fold_offsetof (TREE_OPERAND (expr, 0), type, code);
if (base == error_mark_node)
return base;
@ -6358,23 +6357,16 @@ fold_offsetof_1 (tree expr, enum tree_code ctx)
/* Handle static members of volatile structs. */
t = TREE_OPERAND (expr, 1);
gcc_assert (VAR_P (t));
return fold_offsetof_1 (t);
return fold_offsetof (t, type);
default:
gcc_unreachable ();
}
if (!POINTER_TYPE_P (type))
return size_binop (PLUS_EXPR, base, convert (type, off));
return fold_build_pointer_plus (base, off);
}
/* Likewise, but convert it to the return type of offsetof. */
tree
fold_offsetof (tree expr)
{
return convert (size_type_node, fold_offsetof_1 (expr));
}
/* *PTYPE is an incomplete array. Complete it with a domain based on
INITIAL_VALUE. If INITIAL_VALUE is not present, use 1 if DO_DEFAULT
@ -6537,6 +6529,8 @@ c_common_mark_addressable_vec (tree t)
return;
if (!VAR_P (t) || !DECL_HARD_REGISTER (t))
TREE_ADDRESSABLE (t) = 1;
if (TREE_CODE (t) == COMPOUND_LITERAL_EXPR)
TREE_ADDRESSABLE (COMPOUND_LITERAL_EXPR_DECL (t)) = 1;
}

View File

@ -1053,8 +1053,8 @@ extern bool c_dump_tree (void *, tree);
extern void verify_sequence_points (tree);
extern tree fold_offsetof_1 (tree, tree_code ctx = ERROR_MARK);
extern tree fold_offsetof (tree);
extern tree fold_offsetof (tree, tree = size_type_node,
tree_code ctx = ERROR_MARK);
extern int complete_array_type (tree *, tree, bool);

View File

@ -1119,7 +1119,7 @@ c_cpp_builtins (cpp_reader *pfile)
floatn_nx_types[i].extended ? "X" : "");
sprintf (csuffix, "F%d%s", floatn_nx_types[i].n,
floatn_nx_types[i].extended ? "x" : "");
builtin_define_float_constants (prefix, csuffix, "%s", NULL,
builtin_define_float_constants (prefix, ggc_strdup (csuffix), "%s", NULL,
FLOATN_NX_TYPE_NODE (i));
}
@ -1566,7 +1566,14 @@ struct GTY(()) lazy_hex_fp_value_struct
int digits;
const char *fp_suffix;
};
static GTY(()) struct lazy_hex_fp_value_struct lazy_hex_fp_values[12];
/* Number of the expensive to compute macros we should evaluate lazily.
Each builtin_define_float_constants invocation calls
builtin_define_with_hex_fp_value 4 times and builtin_define_float_constants
is called for FLT, DBL, LDBL and up to NUM_FLOATN_NX_TYPES times for
FLTNN*. */
#define LAZY_HEX_FP_VALUES_CNT (4 * (3 + NUM_FLOATN_NX_TYPES))
static GTY(()) struct lazy_hex_fp_value_struct
lazy_hex_fp_values[LAZY_HEX_FP_VALUES_CNT];
static GTY(()) int lazy_hex_fp_value_count;
static bool
@ -1611,7 +1618,7 @@ builtin_define_with_hex_fp_value (const char *macro,
char dec_str[64], buf1[256], buf2[256];
/* This is very expensive, so if possible expand them lazily. */
if (lazy_hex_fp_value_count < 12
if (lazy_hex_fp_value_count < LAZY_HEX_FP_VALUES_CNT
&& flag_dump_macros == 0
&& !cpp_get_options (parse_in)->traditional)
{

View File

@ -244,7 +244,9 @@ c_gimplify_expr (tree *expr_p, gimple_seq *pre_p ATTRIBUTE_UNUSED,
unsigned_type_node)
&& !types_compatible_p (TYPE_MAIN_VARIANT (TREE_TYPE (*op1_p)),
integer_type_node))
*op1_p = convert (unsigned_type_node, *op1_p);
/* Make sure to unshare the result, tree sharing is invalid
during gimplification. */
*op1_p = unshare_expr (convert (unsigned_type_node, *op1_p));
break;
}

View File

@ -387,7 +387,6 @@ enum cpp_ttype
c_lex_with_flags (tree *value, location_t *loc, unsigned char *cpp_flags,
int lex_flags)
{
static bool no_more_pch;
const cpp_token *tok;
enum cpp_ttype type;
unsigned char add_flags = 0;
@ -621,12 +620,6 @@ c_lex_with_flags (tree *value, location_t *loc, unsigned char *cpp_flags,
if (cpp_flags)
*cpp_flags = tok->flags | add_flags;
if (!no_more_pch)
{
no_more_pch = true;
c_common_no_more_pch ();
}
timevar_pop (TV_CPP);
return type;

View File

@ -256,7 +256,7 @@ c_finish_omp_atomic (location_t loc, enum tree_code code,
if (TREE_CODE (x) == COMPOUND_EXPR)
{
pre = TREE_OPERAND (x, 0);
gcc_assert (TREE_CODE (pre) == SAVE_EXPR);
gcc_assert (TREE_CODE (pre) == SAVE_EXPR || tree_invariant_p (pre));
x = TREE_OPERAND (x, 1);
}
gcc_assert (TREE_CODE (x) == MODIFY_EXPR);
@ -1540,5 +1540,13 @@ c_omp_predetermined_sharing (tree decl)
if (TREE_READONLY (decl))
return OMP_CLAUSE_DEFAULT_SHARED;
/* Predetermine artificial variables holding integral values, those
are usually result of gimplify_one_sizepos or SAVE_EXPR
gimplification. */
if (VAR_P (decl)
&& DECL_ARTIFICIAL (decl)
&& INTEGRAL_TYPE_P (TREE_TYPE (decl)))
return OMP_CLAUSE_DEFAULT_SHARED;
return OMP_CLAUSE_DEFAULT_UNSPECIFIED;
}

View File

@ -1,3 +1,140 @@
2019-11-14 Release Manager
* GCC 7.5.0 released.
2019-09-05 Iain Sandoe <iain@sandoe.co.uk>
Backport from mainline.
2019-08-23 Iain Sandoe <iain@sandoe.co.uk>
PR pch/61250
* c-parser.c (c_parse_file): Call c_common_no_more_pch ()
after determining that the first token is not
PRAGMA_GCC_PCH_PREPROCESS.
2019-08-30 Jakub Jelinek <jakub@redhat.com>
Backported from mainline
2019-04-19 Jakub Jelinek <jakub@redhat.com>
PR c++/90108
* c-decl.c (merge_decls): If remove is main variant and
DECL_ORIGINAL_TYPE is some other type, remove a DECL_ORIGINAL_TYPE
variant that has newdecl as TYPE_NAME if any.
2019-04-12 Jakub Jelinek <jakub@redhat.com>
PR c/89933
* c-decl.c (merge_decls): When newdecl's type is its main variant,
don't try to remove it from the variant list, but instead assert
it has no variants.
2019-03-19 Jakub Jelinek <jakub@redhat.com>
PR c/89734
* c-decl.c (grokdeclarator): Call c_build_qualified_type on function
return type even if quals_used is 0. Formatting fixes.
2019-01-16 Joseph Myers <joseph@codesourcery.com>
Backport from mainline
2019-01-07 Joseph Myers <joseph@codesourcery.com>
PR c/88720
PR c/88726
* c-decl.c (pop_scope): Use TREE_PUBLIC and b->nested to determine
whether a function is nested, not DECL_EXTERNAL. Diagnose inline
functions declared but never defined only for external scope, not
for other scopes.
2018-01-02 Segher Boessenkool <segher@kernel.crashing.org>
Backport from trunk
2018-12-06 Segher Boessenkool <segher@kernel.crashing.org>
PR inline-asm/55681
* c-parser.c (c_parser_asm_statement): Update grammar. Allow any
combination of volatile and goto, in any order, without repetitions.
Backport from trunk
2018-12-06 Segher Boessenkool <segher@kernel.crashing.org>
* c-parser.c (c_parser_asm_statement): Detect the inline keyword
after asm. Pass a flag for it to build_asm_expr.
* c-tree.h (build_asm_expr): Update declaration.
* c-typeck.c (build_asm_stmt): Add is_inline parameter. Use it to
set ASM_INLINE_P.
Backport from trunk
2018-12-08 Segher Boessenkool <segher@kernel.crashing.org>
* c-parser (c_parser_asm_statement) [RID_INLINE]: Delete stray line
setting "quals".
Backport from trunk
2018-12-19 Segher Boessenkool <segher@kernel.crashing.org>
* c-parser.c (c_parser_asm_statement): Rewrite the loop to work without
"done" boolean variable.
Backport from trunk
2018-12-19 Segher Boessenkool <segher@kernel.crashing.org>
* c-parser.c (c_parser_asm_statement): Keep track of the location each
asm qualifier is first seen; use that to give nicer "duplicate asm
qualifier" messages. Delete 'quals" variable, instead pass the
"is_volatile_ flag to build_asm_stmt directly.
* c-tree.h (build_asm_stmt): Make the first arg bool instead of tree.
* c-typeck.c (build_asm_stmt): Ditto; adjust.
Backport from trunk
2018-12-19 Segher Boessenkool <segher@kernel.crashing.org>
* c-parser.c (c_parser_asm_statement) <RID_CONST, RID_RESTRICT>: Give
a more specific error message (instead of just falling through).
And extra for the backport
2019-01-02 Segher Boessenkool <segher@kernel.crashing.org>
* c-parser.c (c_parser_asm_statement): Output a warning instead of an
error for const and restrict.
2018-12-06 Release Manager
* GCC 7.4.0 released.
2018-06-22 Jakub Jelinek <jakub@redhat.com>
Backported from mainline
2018-05-11 Jakub Jelinek <jakub@redhat.com>
PR c/85696
* c-typeck.c (c_finish_omp_clauses): Don't use
c_omp_predetermined_sharing, instead just check TREE_READONLY.
2018-05-10 Jakub Jelinek <jakub@redhat.com>
PR c++/85662
* c-fold.c (c_fully_fold_internal): Use fold_offsetof rather than
fold_offsetof_1, pass TREE_TYPE (expr) as TYPE to it and drop the
fold_convert_loc.
* c-typeck.c (build_unary_op): Use fold_offsetof rather than
fold_offsetof_1, pass argtype as TYPE to it and drop the
fold_convert_loc.
2018-03-21 Jakub Jelinek <jakub@redhat.com>
PR c/84999
* c-typeck.c (build_binary_op): If c_common_type_for_size fails when
building vector comparison, diagnose it and return error_mark_node.
2018-03-15 Jakub Jelinek <jakub@redhat.com>
PR c/84853
* c-typeck.c (build_binary_op) <case RSHIFT_EXPR, case LSHIFT_EXPR>:
If code1 is INTEGER_TYPE, only allow code0 VECTOR_TYPE if it has
INTEGER_TYPE element type.
2018-01-25 Release Manager
* GCC 7.3.0 released.

View File

@ -1235,8 +1235,9 @@ pop_scope (void)
&& DECL_ABSTRACT_ORIGIN (p) != 0
&& DECL_ABSTRACT_ORIGIN (p) != p)
TREE_ADDRESSABLE (DECL_ABSTRACT_ORIGIN (p)) = 1;
if (!DECL_EXTERNAL (p)
if (!TREE_PUBLIC (p)
&& !DECL_INITIAL (p)
&& !b->nested
&& scope != file_scope
&& scope != external_scope)
{
@ -1252,7 +1253,7 @@ pop_scope (void)
in the same translation unit." */
if (!flag_gnu89_inline
&& !lookup_attribute ("gnu_inline", DECL_ATTRIBUTES (p))
&& scope != external_scope)
&& scope == external_scope)
pedwarn (input_location, 0,
"inline function %q+D declared but never defined", p);
DECL_EXTERNAL (p) = 1;
@ -2347,13 +2348,33 @@ merge_decls (tree newdecl, tree olddecl, tree newtype, tree oldtype)
if (TYPE_NAME (TREE_TYPE (newdecl)) == newdecl)
{
tree remove = TREE_TYPE (newdecl);
for (tree t = TYPE_MAIN_VARIANT (remove); ;
t = TYPE_NEXT_VARIANT (t))
if (TYPE_NEXT_VARIANT (t) == remove)
{
TYPE_NEXT_VARIANT (t) = TYPE_NEXT_VARIANT (remove);
break;
}
if (TYPE_MAIN_VARIANT (remove) == remove)
{
gcc_assert (TYPE_NEXT_VARIANT (remove) == NULL_TREE);
/* If remove is the main variant, no need to remove that
from the list. One of the DECL_ORIGINAL_TYPE
variants, e.g. created for aligned attribute, might still
refer to the newdecl TYPE_DECL though, so remove that one
in that case. */
if (DECL_ORIGINAL_TYPE (newdecl)
&& DECL_ORIGINAL_TYPE (newdecl) != remove)
for (tree t = TYPE_MAIN_VARIANT (DECL_ORIGINAL_TYPE (newdecl));
t; t = TYPE_MAIN_VARIANT (t))
if (TYPE_NAME (TYPE_NEXT_VARIANT (t)) == newdecl)
{
TYPE_NEXT_VARIANT (t)
= TYPE_NEXT_VARIANT (TYPE_NEXT_VARIANT (t));
break;
}
}
else
for (tree t = TYPE_MAIN_VARIANT (remove); ;
t = TYPE_NEXT_VARIANT (t))
if (TYPE_NEXT_VARIANT (t) == remove)
{
TYPE_NEXT_VARIANT (t) = TYPE_NEXT_VARIANT (remove);
break;
}
}
}
@ -6360,10 +6381,12 @@ grokdeclarator (const struct c_declarator *declarator,
quals_used &= TYPE_QUAL_ATOMIC;
if (quals_used && VOID_TYPE_P (type) && really_funcdef)
pedwarn (specs_loc, 0,
"function definition has qualified void return type");
"function definition has qualified void "
"return type");
else
warning_at (specs_loc, OPT_Wignored_qualifiers,
"type qualifiers ignored on function return type");
"type qualifiers ignored on function "
"return type");
/* Ensure an error for restrict on invalid types; the
DR#423 resolution is not entirely clear about
@ -6373,8 +6396,7 @@ grokdeclarator (const struct c_declarator *declarator,
&& (!POINTER_TYPE_P (type)
|| !C_TYPE_OBJECT_OR_INCOMPLETE_P (TREE_TYPE (type))))
error_at (loc, "invalid use of %<restrict%>");
if (quals_used)
type = c_build_qualified_type (type, quals_used);
type = c_build_qualified_type (type, quals_used);
}
type_quals = TYPE_UNQUALIFIED;

View File

@ -403,7 +403,7 @@ c_fully_fold_internal (tree expr, bool in_init, bool *maybe_const_operands,
&& (op1 = get_base_address (op0)) != NULL_TREE
&& INDIRECT_REF_P (op1)
&& TREE_CONSTANT (TREE_OPERAND (op1, 0)))
ret = fold_convert_loc (loc, TREE_TYPE (expr), fold_offsetof_1 (op0));
ret = fold_offsetof (op0, TREE_TYPE (expr));
else if (op0 != orig_op0 || in_init)
ret = in_init
? fold_build1_initializer_loc (loc, code, TREE_TYPE (expr), op0)

View File

@ -6089,61 +6089,104 @@ c_parser_for_statement (c_parser *parser, bool ivdep, bool *if_p)
}
/* Parse an asm statement, a GNU extension. This is a full-blown asm
statement with inputs, outputs, clobbers, and volatile tag
allowed.
statement with inputs, outputs, clobbers, and volatile, inline, and goto
tags allowed.
asm-qualifier:
volatile
inline
goto
asm-qualifier-list:
asm-qualifier-list asm-qualifier
asm-qualifier
asm-statement:
asm type-qualifier[opt] ( asm-argument ) ;
asm type-qualifier[opt] goto ( asm-goto-argument ) ;
asm asm-qualifier-list[opt] ( asm-argument ) ;
asm-argument:
asm-string-literal
asm-string-literal : asm-operands[opt]
asm-string-literal : asm-operands[opt] : asm-operands[opt]
asm-string-literal : asm-operands[opt] : asm-operands[opt] : asm-clobbers[opt]
asm-goto-argument:
asm-string-literal : asm-operands[opt] : asm-operands[opt] \
: asm-clobbers[opt]
asm-string-literal : : asm-operands[opt] : asm-clobbers[opt] \
: asm-goto-operands
Qualifiers other than volatile are accepted in the syntax but
warned for. */
The form with asm-goto-operands is valid if and only if the
asm-qualifier-list contains goto, and is the only allowed form in that case.
Duplicate asm-qualifiers are not allowed. */
static tree
c_parser_asm_statement (c_parser *parser)
{
tree quals, str, outputs, inputs, clobbers, labels, ret;
bool simple, is_goto;
tree str, outputs, inputs, clobbers, labels, ret;
bool simple;
location_t asm_loc = c_parser_peek_token (parser)->location;
int section, nsections;
gcc_assert (c_parser_next_token_is_keyword (parser, RID_ASM));
c_parser_consume_token (parser);
if (c_parser_next_token_is_keyword (parser, RID_VOLATILE))
{
quals = c_parser_peek_token (parser)->value;
c_parser_consume_token (parser);
}
else if (c_parser_next_token_is_keyword (parser, RID_CONST)
|| c_parser_next_token_is_keyword (parser, RID_RESTRICT))
{
warning_at (c_parser_peek_token (parser)->location,
0,
"%E qualifier ignored on asm",
c_parser_peek_token (parser)->value);
quals = NULL_TREE;
c_parser_consume_token (parser);
}
else
quals = NULL_TREE;
is_goto = false;
if (c_parser_next_token_is_keyword (parser, RID_GOTO))
/* Handle the asm-qualifier-list. */
location_t volatile_loc = UNKNOWN_LOCATION;
location_t inline_loc = UNKNOWN_LOCATION;
location_t goto_loc = UNKNOWN_LOCATION;
for (;;)
{
c_parser_consume_token (parser);
is_goto = true;
c_token *token = c_parser_peek_token (parser);
location_t loc = token->location;
switch (token->keyword)
{
case RID_VOLATILE:
if (volatile_loc)
{
error_at (loc, "duplicate asm qualifier %qE", token->value);
inform (volatile_loc, "first seen here");
}
else
volatile_loc = loc;
c_parser_consume_token (parser);
continue;
case RID_INLINE:
if (inline_loc)
{
error_at (loc, "duplicate asm qualifier %qE", token->value);
inform (inline_loc, "first seen here");
}
else
inline_loc = loc;
c_parser_consume_token (parser);
continue;
case RID_GOTO:
if (goto_loc)
{
error_at (loc, "duplicate asm qualifier %qE", token->value);
inform (goto_loc, "first seen here");
}
else
goto_loc = loc;
c_parser_consume_token (parser);
continue;
case RID_CONST:
case RID_RESTRICT:
warning_at (loc, 0, "%qE is not an asm qualifier", token->value);
c_parser_consume_token (parser);
continue;
default:
break;
}
break;
}
bool is_volatile = (volatile_loc != UNKNOWN_LOCATION);
bool is_inline = (inline_loc != UNKNOWN_LOCATION);
bool is_goto = (goto_loc != UNKNOWN_LOCATION);
/* ??? Follow the C++ parser rather than using the
lex_untranslated_string kludge. */
parser->lex_untranslated_string = true;
@ -6216,8 +6259,9 @@ c_parser_asm_statement (c_parser *parser)
if (!c_parser_require (parser, CPP_SEMICOLON, "expected %<;%>"))
c_parser_skip_to_end_of_block_or_statement (parser);
ret = build_asm_stmt (quals, build_asm_expr (asm_loc, str, outputs, inputs,
clobbers, labels, simple));
ret = build_asm_stmt (is_volatile,
build_asm_expr (asm_loc, str, outputs, inputs,
clobbers, labels, simple, is_inline));
error:
parser->lex_untranslated_string = false;
@ -18170,6 +18214,8 @@ c_parse_file (void)
if (c_parser_peek_token (&tparser)->pragma_kind == PRAGMA_GCC_PCH_PREPROCESS)
c_parser_pragma_pch_preprocess (&tparser);
else
c_common_no_more_pch ();
the_parser = ggc_alloc<c_parser> ();
*the_parser = tparser;

View File

@ -659,8 +659,9 @@ extern tree build_compound_literal (location_t, tree, tree, bool);
extern void check_compound_literal_type (location_t, struct c_type_name *);
extern tree c_start_case (location_t, location_t, tree, bool);
extern void c_finish_case (tree, tree);
extern tree build_asm_expr (location_t, tree, tree, tree, tree, tree, bool);
extern tree build_asm_stmt (tree, tree);
extern tree build_asm_expr (location_t, tree, tree, tree, tree, tree, bool,
bool);
extern tree build_asm_stmt (bool, tree);
extern int c_types_compatible_p (tree, tree);
extern tree c_begin_compound_stmt (bool);
extern tree c_end_compound_stmt (location_t, tree, bool);

View File

@ -4638,7 +4638,7 @@ build_unary_op (location_t location, enum tree_code code, tree xarg,
if (val && INDIRECT_REF_P (val)
&& TREE_CONSTANT (TREE_OPERAND (val, 0)))
{
ret = fold_convert_loc (location, argtype, fold_offsetof_1 (arg));
ret = fold_offsetof (arg, argtype);
goto return_build_unary_op;
}
@ -9669,9 +9669,9 @@ process_init_element (location_t loc, struct c_expr value, bool implicit,
(guaranteed to be 'volatile' or null) and ARGS (represented using
an ASM_EXPR node). */
tree
build_asm_stmt (tree cv_qualifier, tree args)
build_asm_stmt (bool is_volatile, tree args)
{
if (!ASM_VOLATILE_P (args) && cv_qualifier)
if (is_volatile)
ASM_VOLATILE_P (args) = 1;
return add_stmt (args);
}
@ -9680,10 +9680,12 @@ build_asm_stmt (tree cv_qualifier, tree args)
some INPUTS, and some CLOBBERS. The latter three may be NULL.
SIMPLE indicates whether there was anything at all after the
string in the asm expression -- asm("blah") and asm("blah" : )
are subtly different. We use a ASM_EXPR node to represent this. */
are subtly different. We use a ASM_EXPR node to represent this.
LOC is the location of the asm, and IS_INLINE says whether this
is asm inline. */
tree
build_asm_expr (location_t loc, tree string, tree outputs, tree inputs,
tree clobbers, tree labels, bool simple)
tree clobbers, tree labels, bool simple, bool is_inline)
{
tree tail;
tree args;
@ -9801,6 +9803,7 @@ build_asm_expr (location_t loc, tree string, tree outputs, tree inputs,
as volatile. */
ASM_INPUT_P (args) = simple;
ASM_VOLATILE_P (args) = (noutputs == 0);
ASM_INLINE_P (args) = is_inline;
return args;
}
@ -11150,7 +11153,8 @@ build_binary_op (location_t location, enum tree_code code,
converted = 1;
}
else if ((code0 == INTEGER_TYPE || code0 == FIXED_POINT_TYPE
|| code0 == VECTOR_TYPE)
|| (code0 == VECTOR_TYPE
&& TREE_CODE (TREE_TYPE (type0)) == INTEGER_TYPE))
&& code1 == INTEGER_TYPE)
{
doing_shift = true;
@ -11207,7 +11211,8 @@ build_binary_op (location_t location, enum tree_code code,
converted = 1;
}
else if ((code0 == INTEGER_TYPE || code0 == FIXED_POINT_TYPE
|| code0 == VECTOR_TYPE)
|| (code0 == VECTOR_TYPE
&& TREE_CODE (TREE_TYPE (type0)) == INTEGER_TYPE))
&& code1 == INTEGER_TYPE)
{
doing_shift = true;
@ -11299,6 +11304,13 @@ build_binary_op (location_t location, enum tree_code code,
/* Always construct signed integer vector type. */
intt = c_common_type_for_size (GET_MODE_BITSIZE
(TYPE_MODE (TREE_TYPE (type0))), 0);
if (!intt)
{
error_at (location, "could not find an integer type "
"of the same size as %qT",
TREE_TYPE (type0));
return error_mark_node;
}
result_type = build_opaque_vector_type (intt,
TYPE_VECTOR_SUBPARTS (type0));
converted = 1;
@ -11458,6 +11470,13 @@ build_binary_op (location_t location, enum tree_code code,
/* Always construct signed integer vector type. */
intt = c_common_type_for_size (GET_MODE_BITSIZE
(TYPE_MODE (TREE_TYPE (type0))), 0);
if (!intt)
{
error_at (location, "could not find an integer type "
"of the same size as %qT",
TREE_TYPE (type0));
return error_mark_node;
}
result_type = build_opaque_vector_type (intt,
TYPE_VECTOR_SUBPARTS (type0));
converted = 1;
@ -13744,22 +13763,11 @@ c_finish_omp_clauses (tree clauses, enum c_omp_region_type ort)
if (VAR_P (t) && DECL_THREAD_LOCAL_P (t))
share_name = "threadprivate";
else switch (c_omp_predetermined_sharing (t))
else if (TREE_READONLY (t))
{
case OMP_CLAUSE_DEFAULT_UNSPECIFIED:
break;
case OMP_CLAUSE_DEFAULT_SHARED:
/* const vars may be specified in firstprivate clause. */
if (OMP_CLAUSE_CODE (c) == OMP_CLAUSE_FIRSTPRIVATE
&& TREE_READONLY (t))
break;
share_name = "shared";
break;
case OMP_CLAUSE_DEFAULT_PRIVATE:
share_name = "private";
break;
default:
gcc_unreachable ();
if (OMP_CLAUSE_CODE (c) != OMP_CLAUSE_FIRSTPRIVATE)
share_name = "shared";
}
if (share_name)
{

View File

@ -1196,65 +1196,79 @@ static GTY(()) tree alloc_object_size_limit;
static tree
alloc_max_size (void)
{
if (!alloc_object_size_limit)
if (alloc_object_size_limit)
return alloc_object_size_limit;
alloc_object_size_limit = TYPE_MAX_VALUE (ssizetype);
if (!warn_alloc_size_limit)
return alloc_object_size_limit;
const char *optname = "-Walloc-size-larger-than=";
char *end = NULL;
errno = 0;
unsigned HOST_WIDE_INT unit = 1;
unsigned HOST_WIDE_INT limit
= strtoull (warn_alloc_size_limit, &end, 10);
/* If the value is too large to be represented use the maximum
representable value that strtoull sets limit to (setting
errno to ERANGE). */
if (end && *end)
{
alloc_object_size_limit = TYPE_MAX_VALUE (ssizetype);
if (warn_alloc_size_limit)
/* Numeric option arguments are at most INT_MAX. Make it
possible to specify a larger value by accepting common
suffixes. */
if (!strcmp (end, "kB"))
unit = 1000;
else if (!strcasecmp (end, "KiB") || !strcmp (end, "KB"))
unit = 1024;
else if (!strcmp (end, "MB"))
unit = HOST_WIDE_INT_UC (1000) * 1000;
else if (!strcasecmp (end, "MiB"))
unit = HOST_WIDE_INT_UC (1024) * 1024;
else if (!strcasecmp (end, "GB"))
unit = HOST_WIDE_INT_UC (1000) * 1000 * 1000;
else if (!strcasecmp (end, "GiB"))
unit = HOST_WIDE_INT_UC (1024) * 1024 * 1024;
else if (!strcasecmp (end, "TB"))
unit = HOST_WIDE_INT_UC (1000) * 1000 * 1000 * 1000;
else if (!strcasecmp (end, "TiB"))
unit = HOST_WIDE_INT_UC (1024) * 1024 * 1024 * 1024;
else if (!strcasecmp (end, "PB"))
unit = HOST_WIDE_INT_UC (1000) * 1000 * 1000 * 1000 * 1000;
else if (!strcasecmp (end, "PiB"))
unit = HOST_WIDE_INT_UC (1024) * 1024 * 1024 * 1024 * 1024;
else if (!strcasecmp (end, "EB"))
unit = HOST_WIDE_INT_UC (1000) * 1000 * 1000 * 1000 * 1000
* 1000;
else if (!strcasecmp (end, "EiB"))
unit = HOST_WIDE_INT_UC (1024) * 1024 * 1024 * 1024 * 1024
* 1024;
else
{
char *end = NULL;
errno = 0;
unsigned HOST_WIDE_INT unit = 1;
unsigned HOST_WIDE_INT limit
= strtoull (warn_alloc_size_limit, &end, 10);
if (!errno)
{
if (end && *end)
{
/* Numeric option arguments are at most INT_MAX. Make it
possible to specify a larger value by accepting common
suffixes. */
if (!strcmp (end, "kB"))
unit = 1000;
else if (!strcasecmp (end, "KiB") || strcmp (end, "KB"))
unit = 1024;
else if (!strcmp (end, "MB"))
unit = HOST_WIDE_INT_UC (1000) * 1000;
else if (!strcasecmp (end, "MiB"))
unit = HOST_WIDE_INT_UC (1024) * 1024;
else if (!strcasecmp (end, "GB"))
unit = HOST_WIDE_INT_UC (1000) * 1000 * 1000;
else if (!strcasecmp (end, "GiB"))
unit = HOST_WIDE_INT_UC (1024) * 1024 * 1024;
else if (!strcasecmp (end, "TB"))
unit = HOST_WIDE_INT_UC (1000) * 1000 * 1000 * 1000;
else if (!strcasecmp (end, "TiB"))
unit = HOST_WIDE_INT_UC (1024) * 1024 * 1024 * 1024;
else if (!strcasecmp (end, "PB"))
unit = HOST_WIDE_INT_UC (1000) * 1000 * 1000 * 1000 * 1000;
else if (!strcasecmp (end, "PiB"))
unit = HOST_WIDE_INT_UC (1024) * 1024 * 1024 * 1024 * 1024;
else if (!strcasecmp (end, "EB"))
unit = HOST_WIDE_INT_UC (1000) * 1000 * 1000 * 1000 * 1000
* 1000;
else if (!strcasecmp (end, "EiB"))
unit = HOST_WIDE_INT_UC (1024) * 1024 * 1024 * 1024 * 1024
* 1024;
else
unit = 0;
}
if (unit)
{
wide_int w = wi::uhwi (limit, HOST_BITS_PER_WIDE_INT + 64);
w *= unit;
if (wi::ltu_p (w, alloc_object_size_limit))
alloc_object_size_limit = wide_int_to_tree (ssizetype, w);
}
}
/* This could mean an unknown suffix or a bad prefix, like
"+-1". */
warning_at (UNKNOWN_LOCATION, 0,
"invalid argument %qs to %qs",
warn_alloc_size_limit, optname);
/* Ignore the limit extracted by strtoull. */
unit = 0;
}
}
if (unit)
{
widest_int w = wi::mul (limit, unit);
if (w < wi::to_widest (alloc_object_size_limit))
alloc_object_size_limit
= wide_int_to_tree (ptrdiff_type_node, w);
else
alloc_object_size_limit = build_all_ones_cst (size_type_node);
}
return alloc_object_size_limit;
}
@ -3133,9 +3147,14 @@ expand_call (tree exp, rtx target, int ignore)
if (CALL_EXPR_RETURN_SLOT_OPT (exp)
&& target
&& MEM_P (target)
&& !(MEM_ALIGN (target) < TYPE_ALIGN (rettype)
&& SLOW_UNALIGNED_ACCESS (TYPE_MODE (rettype),
MEM_ALIGN (target))))
/* If rettype is addressable, we may not create a temporary.
If target is properly aligned at runtime and the compiler
just doesn't know about it, it will work fine, otherwise it
will be UB. */
&& (TREE_ADDRESSABLE (rettype)
|| !(MEM_ALIGN (target) < TYPE_ALIGN (rettype)
&& SLOW_UNALIGNED_ACCESS (TYPE_MODE (rettype),
MEM_ALIGN (target)))))
structure_value_addr = XEXP (target, 0);
else
{
@ -3314,6 +3333,28 @@ expand_call (tree exp, rtx target, int ignore)
|| dbg_cnt (tail_call) == false)
try_tail_call = 0;
/* Workaround buggy C/C++ wrappers around Fortran routines with
character(len=constant) arguments if the hidden string length arguments
are passed on the stack; if the callers forget to pass those arguments,
attempting to tail call in such routines leads to stack corruption.
Avoid tail calls in functions where at least one such hidden string
length argument is passed (partially or fully) on the stack in the
caller and the callee needs to pass any arguments on the stack.
See PR90329. */
if (try_tail_call && args_size.constant != 0)
for (tree arg = DECL_ARGUMENTS (current_function_decl);
arg; arg = DECL_CHAIN (arg))
if (DECL_HIDDEN_STRING_LENGTH (arg) && DECL_INCOMING_RTL (arg))
{
subrtx_iterator::array_type array;
FOR_EACH_SUBRTX (iter, array, DECL_INCOMING_RTL (arg), NONCONST)
if (MEM_P (*iter))
{
try_tail_call = 0;
break;
}
}
/* If the user has marked the function as requiring tail-call
optimization, attempt it. */
if (must_tail_call)

View File

@ -1620,10 +1620,13 @@ outgoing_edges_match (int mode, basic_block bb1, basic_block bb2)
if (crtl->shrink_wrapped
&& single_succ_p (bb1)
&& single_succ (bb1) == EXIT_BLOCK_PTR_FOR_FN (cfun)
&& !JUMP_P (BB_END (bb1))
&& (!JUMP_P (BB_END (bb1))
/* Punt if the only successor is a fake edge to exit, the jump
must be some weird one. */
|| (single_succ_edge (bb1)->flags & EDGE_FAKE) != 0)
&& !(CALL_P (BB_END (bb1)) && SIBLING_CALL_P (BB_END (bb1))))
return false;
/* If BB1 has only one successor, we may be looking at either an
unconditional jump, or a fake edge to exit. */
if (single_succ_p (bb1)

View File

@ -1252,10 +1252,10 @@ set_parm_rtl (tree parm, rtx x)
allocate it, which means that in-frame portion is just a
pointer. ??? We've got a pseudo for sure here, do we
actually dynamically allocate its spilling area if needed?
??? Isn't it a problem when POINTER_SIZE also exceeds
MAX_SUPPORTED_STACK_ALIGNMENT, as on cris and lm32? */
??? Isn't it a problem when Pmode alignment also exceeds
MAX_SUPPORTED_STACK_ALIGNMENT, as can happen on cris and lm32? */
if (align > MAX_SUPPORTED_STACK_ALIGNMENT)
align = POINTER_SIZE;
align = GET_MODE_ALIGNMENT (Pmode);
record_alignment_for_reg_var (align);
}
@ -1375,7 +1375,7 @@ expand_one_ssa_partition (tree var)
/* If the variable alignment is very large we'll dynamicaly allocate
it, which means that in-frame portion is just a pointer. */
if (align > MAX_SUPPORTED_STACK_ALIGNMENT)
align = POINTER_SIZE;
align = GET_MODE_ALIGNMENT (Pmode);
record_alignment_for_reg_var (align);
@ -1592,7 +1592,7 @@ expand_one_var (tree var, bool toplevel, bool really_expand)
/* If the variable alignment is very large we'll dynamicaly allocate
it, which means that in-frame portion is just a pointer. */
if (align > MAX_SUPPORTED_STACK_ALIGNMENT)
align = POINTER_SIZE;
align = GET_MODE_ALIGNMENT (Pmode);
}
record_alignment_for_reg_var (align);
@ -2997,14 +2997,14 @@ expand_asm_stmt (gasm *stmt)
generating_concat_p = 0;
if ((TREE_CODE (val) == INDIRECT_REF
&& allows_mem)
if ((TREE_CODE (val) == INDIRECT_REF && allows_mem)
|| (DECL_P (val)
&& (allows_mem || REG_P (DECL_RTL (val)))
&& ! (REG_P (DECL_RTL (val))
&& GET_MODE (DECL_RTL (val)) != TYPE_MODE (type)))
|| ! allows_reg
|| is_inout)
|| is_inout
|| TREE_ADDRESSABLE (type))
{
op = expand_expr (val, NULL_RTX, VOIDmode,
!allows_reg ? EXPAND_MEMORY : EXPAND_WRITE);
@ -3013,7 +3013,7 @@ expand_asm_stmt (gasm *stmt)
if (! allows_reg && !MEM_P (op))
error ("output number %d not directly addressable", i);
if ((! allows_mem && MEM_P (op))
if ((! allows_mem && MEM_P (op) && GET_MODE (op) != BLKmode)
|| GET_CODE (op) == CONCAT)
{
rtx old_op = op;
@ -6466,6 +6466,14 @@ pass_expand::execute (function *fun)
find_many_sub_basic_blocks (blocks);
purge_all_dead_edges ();
/* After initial rtl generation, call back to finish generating
exception support code. We need to do this before cleaning up
the CFG as the code does not expect dead landing pads. */
if (fun->eh->region_tree != NULL)
finish_eh_generation ();
/* Call expand_stack_alignment after finishing all
updates to crtl->preferred_stack_boundary. */
expand_stack_alignment ();
/* Fixup REG_EQUIV notes in the prologue if there are tailcalls in this
@ -6473,12 +6481,6 @@ pass_expand::execute (function *fun)
if (crtl->tail_call_emit)
fixup_tail_calls ();
/* After initial rtl generation, call back to finish generating
exception support code. We need to do this before cleaning up
the CFG as the code does not expect dead landing pads. */
if (fun->eh->region_tree != NULL)
finish_eh_generation ();
/* Remove unreachable blocks, otherwise we cannot compute dominators
which are needed for loop state verification. As a side-effect
this also compacts blocks.

View File

@ -1067,7 +1067,7 @@ can_duplicate_block_p (const_basic_block bb)
AFTER. */
basic_block
duplicate_block (basic_block bb, edge e, basic_block after)
duplicate_block (basic_block bb, edge e, basic_block after, copy_bb_data *id)
{
edge s, n;
basic_block new_bb;
@ -1083,7 +1083,7 @@ duplicate_block (basic_block bb, edge e, basic_block after)
gcc_checking_assert (can_duplicate_block_p (bb));
new_bb = cfg_hooks->duplicate_block (bb);
new_bb = cfg_hooks->duplicate_block (bb, id);
if (after)
move_block_after (new_bb, after);
@ -1355,13 +1355,14 @@ copy_bbs (basic_block *bbs, unsigned n, basic_block *new_bbs,
unsigned i, j;
basic_block bb, new_bb, dom_bb;
edge e;
copy_bb_data id;
/* Duplicate bbs, update dominators, assign bbs to loops. */
for (i = 0; i < n; i++)
{
/* Duplicate. */
bb = bbs[i];
new_bb = new_bbs[i] = duplicate_block (bb, NULL, after);
new_bb = new_bbs[i] = duplicate_block (bb, NULL, after, &id);
after = new_bb;
bb->flags |= BB_DUPLICATED;
if (bb->loop_father)

View File

@ -54,6 +54,19 @@ struct profile_record
bool run;
};
typedef int_hash <unsigned short, 0> dependence_hash;
/* Optional data for duplicate_block. */
struct copy_bb_data
{
copy_bb_data() : dependence_map (NULL) {}
~copy_bb_data () { delete dependence_map; }
/* A map from the copied BBs dependence info cliques to
equivalents in the BBs duplicated to. */
hash_map<dependence_hash, unsigned short> *dependence_map;
};
struct cfg_hooks
{
@ -112,7 +125,7 @@ struct cfg_hooks
bool (*can_duplicate_block_p) (const_basic_block a);
/* Duplicate block A. */
basic_block (*duplicate_block) (basic_block a);
basic_block (*duplicate_block) (basic_block a, copy_bb_data *);
/* Higher level functions representable by primitive operations above if
we didn't have some oddities in RTL and Tree representations. */
@ -227,7 +240,8 @@ extern void tidy_fallthru_edges (void);
extern void predict_edge (edge e, enum br_predictor predictor, int probability);
extern bool predicted_by_p (const_basic_block bb, enum br_predictor predictor);
extern bool can_duplicate_block_p (const_basic_block);
extern basic_block duplicate_block (basic_block, edge, basic_block);
extern basic_block duplicate_block (basic_block, edge, basic_block,
copy_bb_data * = NULL);
extern bool block_ends_with_call_p (basic_block bb);
extern bool empty_block_p (basic_block);
extern basic_block split_block_before_cond_jump (basic_block);

View File

@ -220,6 +220,10 @@ struct GTY ((chain_next ("%h.next"))) loop {
/* True if the loop is part of an oacc kernels region. */
unsigned in_oacc_kernels_region : 1;
/* If this loop was inlined the main clique of the callee which does
not need remapping when copying the loop body. */
unsigned short owned_clique;
/* For SIMD loops, this is a unique identifier of the loop, referenced
by IFN_GOMP_SIMD_VF, IFN_GOMP_SIMD_LANE and IFN_GOMP_SIMD_LAST_LANE
builtins. */

View File

@ -1023,6 +1023,7 @@ copy_loop_info (struct loop *loop, struct loop *target)
target->warned_aggressive_loop_optimizations
|= loop->warned_aggressive_loop_optimizations;
target->in_oacc_kernels_region = loop->in_oacc_kernels_region;
target->owned_clique = loop->owned_clique;
}
/* Copies copy of LOOP as subloop of TARGET loop, placing newly

View File

@ -4204,7 +4204,7 @@ duplicate_insn_chain (rtx_insn *from, rtx_insn *to)
/* Create a duplicate of the basic block BB. */
static basic_block
cfg_layout_duplicate_bb (basic_block bb)
cfg_layout_duplicate_bb (basic_block bb, copy_bb_data *)
{
rtx_insn *insn;
basic_block new_bb;
@ -5013,9 +5013,9 @@ rtl_can_remove_branch_p (const_edge e)
}
static basic_block
rtl_duplicate_bb (basic_block bb)
rtl_duplicate_bb (basic_block bb, copy_bb_data *id)
{
bb = cfg_layout_duplicate_bb (bb);
bb = cfg_layout_duplicate_bb (bb, id);
bb->aux = NULL;
return bb;
}

View File

@ -321,6 +321,9 @@ public:
or abstract function kept for debug info purposes only. */
bool real_symbol_p (void);
/* Return true when the symbol needs to be output to the LTO symbol table. */
bool output_to_lto_symbol_table_p (void);
/* Determine if symbol declaration is needed. That is, visible to something
either outside this translation unit, something magic in the system
configury. This function is used just during symbol creation. */

View File

@ -1,6 +1,6 @@
/* Collect static initialization info into data structures that can be
traversed by C++ initialization and finalization routines.
Copyright (C) 1992-2017 Free Software Foundation, Inc.
Copyright (C) 1992-2018 Free Software Foundation, Inc.
Contributed by Chris Smith (csmith@convex.com).
Heavily modified by Michael Meissner (meissner@cygnus.com),
Per Bothner (bothner@cygnus.com), and John Gilmore (gnu@cygnus.com).
@ -201,6 +201,7 @@ static enum lto_mode_d lto_mode = LTO_MODE_NONE;
bool helpflag; /* true if --help */
static int shared_obj; /* true if -shared */
static int static_obj; /* true if -static */
static const char *c_file; /* <xxx>.c for constructor/destructor list. */
static const char *o_file; /* <xxx>.o for constructor/destructor list. */
@ -255,6 +256,7 @@ bool may_unlink_output_file = false;
#ifdef COLLECT_EXPORT_LIST
/* Lists to keep libraries to be scanned for global constructors/destructors. */
static struct head libs; /* list of libraries */
static struct head static_libs; /* list of statically linked libraries */
static struct path_prefix cmdline_lib_dirs; /* directories specified with -L */
static struct path_prefix libpath_lib_dirs; /* directories in LIBPATH */
static struct path_prefix *libpaths[3] = {&cmdline_lib_dirs,
@ -320,9 +322,7 @@ static void write_c_file_glob (FILE *, const char *);
static void scan_libraries (const char *);
#endif
#ifdef COLLECT_EXPORT_LIST
#if 0
static int is_in_list (const char *, struct id *);
#endif
static void write_aix_file (FILE *, struct id *);
static char *resolve_lib_name (const char *);
#endif
@ -911,6 +911,9 @@ main (int argc, char **argv)
int first_file;
int num_c_args;
char **old_argv;
#ifdef COLLECT_EXPORT_LIST
bool is_static = false;
#endif
int i;
for (i = 0; i < USE_LD_MAX; i++)
@ -1241,6 +1244,8 @@ main (int argc, char **argv)
*c_ptr++ = xstrdup (q);
if (strcmp (q, "-shared") == 0)
shared_obj = 1;
if (strcmp (q, "-static") == 0)
static_obj = 1;
if (*q == '-' && q[1] == 'B')
{
*c_ptr++ = xstrdup (q);
@ -1269,6 +1274,9 @@ main (int argc, char **argv)
/* Parse arguments. Remember output file spec, pass the rest to ld. */
/* After the first file, put in the c++ rt0. */
#ifdef COLLECT_EXPORT_LIST
is_static = static_obj;
#endif
first_file = 1;
while ((arg = *++argv) != (char *) 0)
{
@ -1374,6 +1382,18 @@ main (int argc, char **argv)
#endif
break;
#ifdef COLLECT_EXPORT_LIST
case 'b':
if (!strcmp (arg, "-bstatic"))
{
is_static = true;
}
else if (!strcmp (arg, "-bdynamic") || !strcmp (arg, "-bshared"))
{
is_static = false;
}
break;
#endif
case 'l':
if (first_file)
{
@ -1390,6 +1410,8 @@ main (int argc, char **argv)
/* Saving a full library name. */
add_to_list (&libs, s);
if (is_static)
add_to_list (&static_libs, s);
}
#endif
break;
@ -1490,6 +1512,8 @@ main (int argc, char **argv)
{
/* Saving a full library name. */
add_to_list (&libs, arg);
if (is_static)
add_to_list (&static_libs, arg);
}
#endif
}
@ -1501,6 +1525,8 @@ main (int argc, char **argv)
{
fprintf (stderr, "List of libraries:\n");
dump_list (stderr, "\t", libs.first);
fprintf (stderr, "List of statically linked libraries:\n");
dump_list (stderr, "\t", static_libs.first);
}
/* The AIX linker will discard static constructors in object files if
@ -1525,9 +1551,11 @@ main (int argc, char **argv)
this_filter &= ~SCAN_DWEH;
#endif
/* Scan object files. */
while (export_object_lst < object)
scan_prog_file (*export_object_lst++, PASS_OBJ, this_filter);
/* Scan libraries. */
for (; list; list = list->next)
scan_prog_file (list->name, PASS_FIRST, this_filter);
@ -1975,7 +2003,6 @@ write_list (FILE *stream, const char *prefix, struct id *list)
#ifdef COLLECT_EXPORT_LIST
/* This function is really used only on AIX, but may be useful. */
#if 0
static int
is_in_list (const char *prefix, struct id *list)
{
@ -1986,7 +2013,6 @@ is_in_list (const char *prefix, struct id *list)
}
return 0;
}
#endif
#endif /* COLLECT_EXPORT_LIST */
/* Added for debugging purpose. */
@ -2815,7 +2841,12 @@ scan_prog_file (const char *prog_name, scanpass which_pass,
case SYM_AIXI:
if (! (filter & SCAN_CTOR))
break;
if (is_shared && !aixlazy_flag)
if (is_shared && !aixlazy_flag
#ifdef COLLECT_EXPORT_LIST
&& ! static_obj
&& ! is_in_list (prog_name, static_libs.first)
#endif
)
add_to_list (&constructors, name);
break;

View File

@ -962,14 +962,17 @@ combine_validate_cost (rtx_insn *i0, rtx_insn *i1, rtx_insn *i2, rtx_insn *i3,
}
/* Delete any insns that copy a register to itself. */
/* Delete any insns that copy a register to itself.
Return true if the CFG was changed. */
static void
static bool
delete_noop_moves (void)
{
rtx_insn *insn, *next;
basic_block bb;
bool edges_deleted = false;
FOR_EACH_BB_FN (bb, cfun)
{
for (insn = BB_HEAD (bb); insn != NEXT_INSN (BB_END (bb)); insn = next)
@ -980,10 +983,12 @@ delete_noop_moves (void)
if (dump_file)
fprintf (dump_file, "deleting noop move %d\n", INSN_UID (insn));
delete_insn_and_edges (insn);
edges_deleted |= delete_insn_and_edges (insn);
}
}
}
return edges_deleted;
}
@ -1122,8 +1127,8 @@ insn_a_feeds_b (rtx_insn *a, rtx_insn *b)
/* Main entry point for combiner. F is the first insn of the function.
NREGS is the first unused pseudo-reg number.
Return nonzero if the combiner has turned an indirect jump
instruction into a direct jump. */
Return nonzero if the CFG was changed (e.g. if the combiner has
turned an indirect jump instruction into a direct jump). */
static int
combine_instructions (rtx_insn *f, unsigned int nregs)
{
@ -1501,7 +1506,7 @@ retry:
default_rtl_profile ();
clear_bb_flags ();
new_direct_jump_p |= purge_all_dead_edges ();
delete_noop_moves ();
new_direct_jump_p |= delete_noop_moves ();
/* Clean up. */
obstack_free (&insn_link_obstack, NULL);
@ -5482,11 +5487,15 @@ subst (rtx x, rtx from, rtx to, int in_dest, int in_cond, int unique_copy)
x = gen_rtx_CLOBBER (mode, const0_rtx);
}
else if (CONST_SCALAR_INT_P (new_rtx)
&& GET_CODE (x) == ZERO_EXTEND)
&& (GET_CODE (x) == ZERO_EXTEND
|| GET_CODE (x) == FLOAT
|| GET_CODE (x) == UNSIGNED_FLOAT))
{
x = simplify_unary_operation (ZERO_EXTEND, GET_MODE (x),
new_rtx, GET_MODE (XEXP (x, 0)));
gcc_assert (x);
x = simplify_unary_operation (GET_CODE (x), GET_MODE (x),
new_rtx,
GET_MODE (XEXP (x, 0)));
if (!x)
return gen_rtx_CLOBBER (VOIDmode, const0_rtx);
}
else
SUBST (XEXP (x, i), new_rtx);
@ -5637,7 +5646,11 @@ combine_simplify_rtx (rtx x, machine_mode op0_mode, int in_dest,
/* If everything is a comparison, what we have is highly unlikely
to be simpler, so don't use it. */
&& ! (COMPARISON_P (x)
&& (COMPARISON_P (true_rtx) || COMPARISON_P (false_rtx))))
&& (COMPARISON_P (true_rtx) || COMPARISON_P (false_rtx)))
/* Similarly, if we end up with one of the expressions the same
as the original, it is certainly not simpler. */
&& ! rtx_equal_p (x, true_rtx)
&& ! rtx_equal_p (x, false_rtx))
{
rtx cop1 = const0_rtx;
enum rtx_code cond_code = simplify_comparison (NE, &cond, &cop1);
@ -5799,8 +5812,9 @@ combine_simplify_rtx (rtx x, machine_mode op0_mode, int in_dest,
&& GET_MODE_PRECISION (mode) < GET_MODE_PRECISION (op0_mode)
&& subreg_lowpart_offset (mode, op0_mode) == SUBREG_BYTE (x)
&& HWI_COMPUTABLE_MODE_P (op0_mode)
&& (nonzero_bits (SUBREG_REG (x), op0_mode)
& GET_MODE_MASK (mode)) == 0)
&& ((nonzero_bits (SUBREG_REG (x), op0_mode)
& GET_MODE_MASK (mode)) == 0)
&& !side_effects_p (SUBREG_REG (x)))
return CONST0_RTX (mode);
}
@ -6325,7 +6339,7 @@ simplify_if_then_else (rtx x)
pc_rtx, pc_rtx, 0, 0, 0);
if (reg_mentioned_p (from, false_rtx))
false_rtx = subst (known_cond (copy_rtx (false_rtx), false_code,
from, false_val),
from, false_val),
pc_rtx, pc_rtx, 0, 0, 0);
SUBST (XEXP (x, 1), swapped ? false_rtx : true_rtx);
@ -7472,6 +7486,7 @@ make_extraction (machine_mode mode, rtx inner, HOST_WIDE_INT pos,
/* We can't do this if we are widening INNER_MODE (it
may not be aligned, for one thing). */
&& GET_MODE_PRECISION (inner_mode) >= GET_MODE_PRECISION (tmode)
&& pos + len <= GET_MODE_PRECISION (is_mode)
&& (inner_mode == tmode
|| (! mode_dependent_address_p (XEXP (inner, 0),
MEM_ADDR_SPACE (inner))
@ -7623,6 +7638,10 @@ make_extraction (machine_mode mode, rtx inner, HOST_WIDE_INT pos,
&& GET_MODE_SIZE (extraction_mode) < GET_MODE_SIZE (mode))
extraction_mode = mode;
/* Punt if len is too large for extraction_mode. */
if (len > GET_MODE_PRECISION (extraction_mode))
return NULL_RTX;
if (!MEM_P (inner))
wanted_inner_mode = wanted_inner_reg_mode;
else
@ -9179,6 +9198,7 @@ if_then_else_cond (rtx x, rtx *ptrue, rtx *pfalse)
if (COMPARISON_P (cond0)
&& COMPARISON_P (cond1)
&& SCALAR_INT_MODE_P (mode)
&& ((GET_CODE (cond0) == reversed_comparison_code (cond1, NULL)
&& rtx_equal_p (XEXP (cond0, 0), XEXP (cond1, 0))
&& rtx_equal_p (XEXP (cond0, 1), XEXP (cond1, 1)))
@ -9327,12 +9347,12 @@ known_cond (rtx x, enum rtx_code cond, rtx reg, rtx val)
if (COMPARISON_P (x))
{
if (comparison_dominates_p (cond, code))
return const_true_rtx;
return VECTOR_MODE_P (GET_MODE (x)) ? x : const_true_rtx;
code = reversed_comparison_code (x, NULL);
if (code != UNKNOWN
&& comparison_dominates_p (cond, code))
return const0_rtx;
return CONST0_RTX (GET_MODE (x));
else
return x;
}
@ -9375,7 +9395,7 @@ known_cond (rtx x, enum rtx_code cond, rtx reg, rtx val)
/* We must simplify subreg here, before we lose track of the
original inner_mode. */
new_rtx = simplify_subreg (GET_MODE (x), r,
inner_mode, SUBREG_BYTE (x));
inner_mode, SUBREG_BYTE (x));
if (new_rtx)
return new_rtx;
else
@ -9400,7 +9420,7 @@ known_cond (rtx x, enum rtx_code cond, rtx reg, rtx val)
/* We must simplify the zero_extend here, before we lose
track of the original inner_mode. */
new_rtx = simplify_unary_operation (ZERO_EXTEND, GET_MODE (x),
r, inner_mode);
r, inner_mode);
if (new_rtx)
return new_rtx;
else
@ -11322,8 +11342,15 @@ change_zero_ext (rtx pat)
x = gen_rtx_LSHIFTRT (inner_mode, XEXP (x, 0), GEN_INT (start));
else
x = XEXP (x, 0);
if (mode != inner_mode)
x = gen_lowpart_SUBREG (mode, x);
{
if (REG_P (x) && HARD_REGISTER_P (x)
&& !can_change_dest_mode (x, 0, mode))
continue;
x = gen_lowpart_SUBREG (mode, x);
}
}
else if (GET_CODE (x) == ZERO_EXTEND
&& SCALAR_INT_MODE_P (mode)
@ -11335,7 +11362,13 @@ change_zero_ext (rtx pat)
size = GET_MODE_PRECISION (GET_MODE (XEXP (x, 0)));
x = SUBREG_REG (XEXP (x, 0));
if (GET_MODE (x) != mode)
x = gen_lowpart_SUBREG (mode, x);
{
if (REG_P (x) && HARD_REGISTER_P (x)
&& !can_change_dest_mode (x, 0, mode))
continue;
x = gen_lowpart_SUBREG (mode, x);
}
}
else if (GET_CODE (x) == ZERO_EXTEND
&& SCALAR_INT_MODE_P (mode)
@ -13081,8 +13114,11 @@ record_dead_and_set_regs_1 (rtx dest, const_rtx setter, void *data)
if (REG_P (dest))
{
/* If we are setting the whole register, we know its value. Otherwise
show that we don't know the value. We can handle SUBREG in
some cases. */
show that we don't know the value. We can handle a SUBREG if it's
the low part, but we must be careful with paradoxical SUBREGs on
RISC architectures because we cannot strip e.g. an extension around
a load and record the naked load since the RTL middle-end considers
that the upper bits are defined according to LOAD_EXTEND_OP. */
if (GET_CODE (setter) == SET && dest == SET_DEST (setter))
record_value_for_reg (dest, record_dead_insn, SET_SRC (setter));
else if (GET_CODE (setter) == SET
@ -13091,8 +13127,12 @@ record_dead_and_set_regs_1 (rtx dest, const_rtx setter, void *data)
&& GET_MODE_PRECISION (GET_MODE (dest)) <= BITS_PER_WORD
&& subreg_lowpart_p (SET_DEST (setter)))
record_value_for_reg (dest, record_dead_insn,
gen_lowpart (GET_MODE (dest),
SET_SRC (setter)));
WORD_REGISTER_OPERATIONS
&& word_register_operation_p (SET_SRC (setter))
&& paradoxical_subreg_p (SET_DEST (setter))
? SET_SRC (setter)
: gen_lowpart (GET_MODE (dest),
SET_SRC (setter)));
else
record_value_for_reg (dest, record_dead_insn, NULL_RTX);
}

View File

@ -616,7 +616,7 @@ x86_cpus="generic intel"
# Common parts for widely ported systems.
case ${target} in
*-*-darwin*)
tmake_file="t-darwin ${cpu_type}/t-darwin"
tmake_file="t-darwin "
tm_file="${tm_file} darwin.h"
case ${target} in
*-*-darwin9*)
@ -1440,16 +1440,25 @@ hppa[12]*-*-hpux11*)
dwarf2=no
fi
;;
i[34567]86-*-darwin1[89]*)
echo "Error: 32bit target is not supported after Darwin17" 1>&2
;;
i[34567]86-*-darwin*)
need_64bit_isa=yes
# Baseline choice for a machine that allows m64 support.
with_cpu=${with_cpu:-core2}
tmake_file="${tmake_file} ${cpu_type}/t-darwin32-biarch t-slibgcc"
tm_file="${tm_file} ${cpu_type}/darwin32-biarch.h"
;;
x86_64-*-darwin1[89]* | x86_64-*-darwin2[01]*)
# Only 64b from now
with_cpu=${with_cpu:-core2}
tmake_file="${tmake_file} t-slibgcc"
;;
x86_64-*-darwin*)
with_cpu=${with_cpu:-core2}
tmake_file="${tmake_file} ${cpu_type}/t-darwin64 t-slibgcc"
tm_file="${tm_file} ${cpu_type}/darwin64.h"
tmake_file="${tmake_file} ${cpu_type}/t-darwin64-biarch t-slibgcc"
tm_file="${tm_file} ${cpu_type}/darwin64-biarch.h"
;;
i[34567]86-*-elfiamcu)
tm_file="${tm_file} i386/unix.h i386/att.h dbxelf.h elfos.h newlib-stdint.h i386/iamcu.h"
@ -1461,7 +1470,7 @@ x86_64-*-elf*)
tm_file="${tm_file} i386/unix.h i386/att.h dbxelf.h elfos.h newlib-stdint.h i386/i386elf.h i386/x86-64.h"
;;
x86_64-*-rtems*)
tm_file="${tm_file} i386/unix.h i386/att.h dbxelf.h elfos.h newlib-stdint.h i386/i386elf.h i386/x86-64.h i386/rtemself.h"
tm_file="${tm_file} i386/unix.h i386/att.h dbxelf.h elfos.h newlib-stdint.h i386/i386elf.h i386/x86-64.h i386/rtemself.h rtems.h"
;;
i[34567]86-*-rdos*)
tm_file="${tm_file} i386/unix.h i386/att.h dbxelf.h elfos.h newlib-stdint.h i386/i386elf.h i386/rdos.h"
@ -2046,10 +2055,17 @@ riscv*-*-linux*)
;;
riscv*-*-elf* | riscv*-*-rtems*)
tm_file="elfos.h newlib-stdint.h ${tm_file} riscv/elf.h"
case "x${enable_multilib}" in
xno) ;;
xyes) tmake_file="${tmake_file} riscv/t-elf-multilib" ;;
*) echo "Unknown value for enable_multilib"; exit 1
case ${target} in
*-*-rtems*)
tm_file="${tm_file} rtems.h riscv/rtems.h"
tmake_file="${tmake_file} riscv/t-rtems"
;;
*)
case "x${enable_multilib}" in
xno) ;;
xyes) tmake_file="${tmake_file} riscv/t-elf-multilib" ;;
*) echo "Unknown value for enable_multilib"; exit 1
esac
esac
tmake_file="${tmake_file} riscv/t-riscv"
gnu_ld=yes
@ -2057,11 +2073,6 @@ riscv*-*-elf* | riscv*-*-rtems*)
# Force .init_array support. The configure script cannot always
# automatically detect that GAS supports it, yet we require it.
gcc_cv_initfini_array=yes
case ${target} in
riscv*-*-rtems*)
tm_file="${tm_file} rtems.h riscv/rtems.h"
;;
esac
;;
mips*-*-netbsd*) # NetBSD/mips, either endian.
target_cpu_default="MASK_ABICALLS"
@ -2344,26 +2355,31 @@ pdp11-*-*)
# extra_headers=
# ;;
powerpc-*-darwin*)
extra_options="${extra_options} rs6000/darwin.opt"
extra_options="${extra_options} ${cpu_type}/darwin.opt"
case ${target} in
*-darwin1[0-9]* | *-darwin[8-9]*)
tmake_file="${tmake_file} rs6000/t-darwin8"
tm_file="${tm_file} rs6000/darwin8.h"
*-darwin1[0-9]* | *-darwin9*)
tmake_file="${tmake_file} ${cpu_type}/t-darwin32-biarch"
tm_file="${tm_file} ${cpu_type}/darwin32-biarch.h"
;;
*-darwin8*)
tmake_file="${tmake_file} ${cpu_type}/t-darwin32-biarch"
tm_file="${tm_file} ${cpu_type}/darwin32-biarch.h"
tm_file="${tm_file} ${cpu_type}/darwin8.h"
;;
*-darwin7*)
tm_file="${tm_file} rs6000/darwin7.h"
tm_file="${tm_file} ${cpu_type}/darwin7.h"
;;
*-darwin[0-6]*)
*-darwin[456]*)
# Earlier - single arch, with 32b only
# OS X 10.0, the first edition is Darwin4
;;
esac
tmake_file="${tmake_file} t-slibgcc"
extra_headers=altivec.h
;;
powerpc64-*-darwin*)
extra_options="${extra_options} ${cpu_type}/darwin.opt"
tmake_file="${tmake_file} ${cpu_type}/t-darwin64 t-slibgcc"
tm_file="${tm_file} ${cpu_type}/darwin8.h ${cpu_type}/darwin64.h"
extra_headers=altivec.h
tmake_file="${tmake_file} ${cpu_type}/t-darwin64-biarch t-slibgcc"
tm_file="${tm_file} ${cpu_type}/darwin64-biarch.h"
;;
powerpc*-*-freebsd*)
tm_file="${tm_file} dbxelf.h elfos.h ${fbsd_tm_file} rs6000/sysv4.h"
@ -4314,14 +4330,12 @@ case "${target}" in
echo "#undef LINK_OS_EXTRA_SPEC32"
echo "#define LINK_OS_EXTRA_SPEC32" \
"\"%(link_os_new_dtags)" \
"-rpath $prefix/lib -rpath $at/lib" \
"-L $prefix/lib -L $at/lib\""
"-rpath $prefix/lib -rpath $at/lib\""
echo
echo "#undef LINK_OS_EXTRA_SPEC64"
echo "#define LINK_OS_EXTRA_SPEC64" \
"\"%(link_os_new_dtags)" \
"-rpath $prefix/lib64 -rpath $at/lib64" \
"-L $prefix/lib64 -L $at/lib64\""
"-rpath $prefix/lib64 -rpath $at/lib64\""
echo
echo "#undef LINK_OS_NEW_DTAGS_SPEC"
echo "#define LINK_OS_NEW_DTAGS_SPEC" \
@ -4334,7 +4348,10 @@ case "${target}" in
echo "#define MD_EXEC_PREFIX \"$at/bin/\""
echo
echo "#undef MD_STARTFILE_PREFIX"
echo "#define MD_STARTFILE_PREFIX \"$at/lib/\"") \
echo "#define MD_STARTFILE_PREFIX \"$prefix/lib/\""
echo
echo "#undef MD_STARTFILE_PREFIX_1"
echo "#define MD_STARTFILE_PREFIX_1 \"$at/lib/\"") \
> advance-toolchain.h
else
echo "Unknown advance-toolchain $with_advance_toolchain"

View File

@ -134,6 +134,8 @@ aarch64_update_cpp_builtins (cpp_reader *pfile)
aarch64_def_or_undef (TARGET_CRYPTO, "__ARM_FEATURE_CRYPTO", pfile);
aarch64_def_or_undef (TARGET_SIMD_RDMA, "__ARM_FEATURE_QRDMX", pfile);
aarch64_def_or_undef (TARGET_LSE, "__ARM_FEATURE_ATOMICS", pfile);
/* Not for ACLE, but required to keep "float.h" correct if we switch
target between implementations that do or do not support ARMv8.2-A
16-bit floating-point extensions. */

View File

@ -2462,10 +2462,10 @@
break;
}
/* Fall through. */
case UNGE:
case UNLT:
std::swap (operands[2], operands[3]);
/* Fall through. */
case UNLE:
case UNGT:
case GT:
comparison = gen_aarch64_cmgt<mode>;
break;
@ -2476,10 +2476,10 @@
break;
}
/* Fall through. */
case UNGT:
case UNLE:
std::swap (operands[2], operands[3]);
/* Fall through. */
case UNLT:
case UNGE:
case GE:
comparison = gen_aarch64_cmge<mode>;
break;
@ -2490,6 +2490,7 @@
case UNEQ:
case ORDERED:
case UNORDERED:
case LTGT:
break;
default:
gcc_unreachable ();
@ -2501,21 +2502,35 @@
case UNGT:
case UNLE:
case UNLT:
case NE:
/* FCM returns false for lanes which are unordered, so if we use
the inverse of the comparison we actually want to emit, then
invert the result, we will end up with the correct result.
Note that a NE NaN and NaN NE b are true for all a, b.
{
/* All of the above must not raise any FP exceptions. Thus we first
check each operand for NaNs and force any elements containing NaN to
zero before using them in the compare.
Example: UN<cc> (a, b) -> UNORDERED (a, b) |
(cm<cc> (isnan (a) ? 0.0 : a,
isnan (b) ? 0.0 : b))
We use the following transformations for doing the comparisions:
a UNGE b -> a GE b
a UNGT b -> a GT b
a UNLE b -> b GE a
a UNLT b -> b GT a. */
Our transformations are:
a UNGE b -> !(b GT a)
a UNGT b -> !(b GE a)
a UNLE b -> !(a GT b)
a UNLT b -> !(a GE b)
a NE b -> !(a EQ b) */
gcc_assert (comparison != NULL);
emit_insn (comparison (operands[0], operands[2], operands[3]));
emit_insn (gen_one_cmpl<v_cmp_result>2 (operands[0], operands[0]));
rtx tmp0 = gen_reg_rtx (<V_cmp_result>mode);
rtx tmp1 = gen_reg_rtx (<V_cmp_result>mode);
rtx tmp2 = gen_reg_rtx (<V_cmp_result>mode);
emit_insn (gen_aarch64_cmeq<mode> (tmp0, operands[2], operands[2]));
emit_insn (gen_aarch64_cmeq<mode> (tmp1, operands[3], operands[3]));
emit_insn (gen_and<v_cmp_result>3 (tmp2, tmp0, tmp1));
emit_insn (gen_and<v_cmp_result>3 (tmp0, tmp0,
lowpart_subreg (<V_cmp_result>mode, operands[2], <MODE>mode)));
emit_insn (gen_and<v_cmp_result>3 (tmp1, tmp1,
lowpart_subreg (<V_cmp_result>mode, operands[3], <MODE>mode)));
gcc_assert (comparison != NULL);
emit_insn (comparison (operands[0],
lowpart_subreg (<MODE>mode, tmp0, <V_cmp_result>mode),
lowpart_subreg (<MODE>mode, tmp1, <V_cmp_result>mode)));
emit_insn (gen_orn<v_cmp_result>3 (operands[0], tmp2, operands[0]));
}
break;
case LT:
@ -2523,42 +2538,46 @@
case GT:
case GE:
case EQ:
case NE:
/* The easy case. Here we emit one of FCMGE, FCMGT or FCMEQ.
As a LT b <=> b GE a && a LE b <=> b GT a. Our transformations are:
a GE b -> a GE b
a GT b -> a GT b
a LE b -> b GE a
a LT b -> b GT a
a EQ b -> a EQ b */
a EQ b -> a EQ b
a NE b -> ~(a EQ b) */
gcc_assert (comparison != NULL);
emit_insn (comparison (operands[0], operands[2], operands[3]));
if (code == NE)
emit_insn (gen_one_cmpl<v_cmp_result>2 (operands[0], operands[0]));
break;
case UNEQ:
/* We first check (a > b || b > a) which is !UNEQ, inverting
this result will then give us (a == b || a UNORDERED b). */
case LTGT:
/* LTGT is not guranteed to not generate a FP exception. So let's
go the faster way : ((a > b) || (b > a)). */
emit_insn (gen_aarch64_cmgt<mode> (operands[0],
operands[2], operands[3]));
emit_insn (gen_aarch64_cmgt<mode> (tmp, operands[3], operands[2]));
emit_insn (gen_ior<v_cmp_result>3 (operands[0], operands[0], tmp));
emit_insn (gen_one_cmpl<v_cmp_result>2 (operands[0], operands[0]));
break;
case UNORDERED:
/* Operands are ORDERED iff (a > b || b >= a), so we can compute
UNORDERED as !ORDERED. */
emit_insn (gen_aarch64_cmgt<mode> (tmp, operands[2], operands[3]));
emit_insn (gen_aarch64_cmge<mode> (operands[0],
operands[3], operands[2]));
emit_insn (gen_ior<v_cmp_result>3 (operands[0], operands[0], tmp));
emit_insn (gen_one_cmpl<v_cmp_result>2 (operands[0], operands[0]));
break;
case ORDERED:
emit_insn (gen_aarch64_cmgt<mode> (tmp, operands[2], operands[3]));
emit_insn (gen_aarch64_cmge<mode> (operands[0],
operands[3], operands[2]));
emit_insn (gen_ior<v_cmp_result>3 (operands[0], operands[0], tmp));
case UNORDERED:
case UNEQ:
/* cmeq (a, a) & cmeq (b, b). */
emit_insn (gen_aarch64_cmeq<mode> (operands[0],
operands[2], operands[2]));
emit_insn (gen_aarch64_cmeq<mode> (tmp, operands[3], operands[3]));
emit_insn (gen_and<v_cmp_result>3 (operands[0], operands[0], tmp));
if (code == UNORDERED)
emit_insn (gen_one_cmpl<v_cmp_result>2 (operands[0], operands[0]));
else if (code == UNEQ)
{
emit_insn (gen_aarch64_cmeq<mode> (tmp, operands[2], operands[3]));
emit_insn (gen_orn<v_cmp_result>3 (operands[0], operands[0], tmp));
}
break;
default:

View File

@ -4664,13 +4664,13 @@ aarch64_select_cc_mode (RTX_CODE code, rtx x, rtx y)
case UNGT:
case UNGE:
case UNEQ:
case LTGT:
return CCFPmode;
case LT:
case LE:
case GT:
case GE:
case LTGT:
return CCFPEmode;
default:
@ -5721,7 +5721,7 @@ aarch64_class_max_nregs (reg_class_t regclass, machine_mode mode)
{
switch (regclass)
{
case CALLER_SAVE_REGS:
case TAILCALL_ADDR_REGS:
case POINTER_REGS:
case GENERAL_REGS:
case ALL_REGS:
@ -5804,7 +5804,7 @@ aarch64_elf_asm_constructor (rtx symbol, int priority)
-Wformat-truncation false positive, use a larger size. */
char buf[23];
snprintf (buf, sizeof (buf), ".init_array.%.5u", priority);
s = get_section (buf, SECTION_WRITE, NULL);
s = get_section (buf, SECTION_WRITE | SECTION_NOTYPE, NULL);
switch_to_section (s);
assemble_align (POINTER_SIZE);
assemble_aligned_integer (POINTER_BYTES, symbol);
@ -5824,7 +5824,7 @@ aarch64_elf_asm_destructor (rtx symbol, int priority)
-Wformat-truncation false positive, use a larger size. */
char buf[23];
snprintf (buf, sizeof (buf), ".fini_array.%.5u", priority);
s = get_section (buf, SECTION_WRITE, NULL);
s = get_section (buf, SECTION_WRITE | SECTION_NOTYPE, NULL);
switch_to_section (s);
assemble_align (POINTER_SIZE);
assemble_aligned_integer (POINTER_BYTES, symbol);
@ -6536,7 +6536,8 @@ aarch64_mask_and_shift_for_ubfiz_p (machine_mode mode, rtx mask, rtx shft_amnt)
return CONST_INT_P (mask) && CONST_INT_P (shft_amnt)
&& INTVAL (shft_amnt) < GET_MODE_BITSIZE (mode)
&& exact_log2 ((INTVAL (mask) >> INTVAL (shft_amnt)) + 1) >= 0
&& (INTVAL (mask) & ((1 << INTVAL (shft_amnt)) - 1)) == 0;
&& (INTVAL (mask)
& ((HOST_WIDE_INT_1U << INTVAL (shft_amnt)) - 1)) == 0;
}
/* Calculate the cost of calculating X, storing it in *COST. Result
@ -7799,10 +7800,10 @@ aarch64_register_move_cost (machine_mode mode,
= aarch64_tune_params.regmove_cost;
/* Caller save and pointer regs are equivalent to GENERAL_REGS. */
if (to == CALLER_SAVE_REGS || to == POINTER_REGS)
if (to == TAILCALL_ADDR_REGS || to == POINTER_REGS)
to = GENERAL_REGS;
if (from == CALLER_SAVE_REGS || from == POINTER_REGS)
if (from == TAILCALL_ADDR_REGS || from == POINTER_REGS)
from = GENERAL_REGS;
/* Moving between GPR and stack cost is the same as GP2GP. */
@ -8608,17 +8609,6 @@ aarch64_override_options_after_change_1 (struct gcc_options *opts)
if (opts->x_pcrelative_literal_loads == 1)
aarch64_pcrelative_literal_loads = true;
/* This is PR70113. When building the Linux kernel with
CONFIG_ARM64_ERRATUM_843419, support for relocations
R_AARCH64_ADR_PREL_PG_HI21 and R_AARCH64_ADR_PREL_PG_HI21_NC is
removed from the kernel to avoid loading objects with possibly
offending sequences. Without -mpc-relative-literal-loads we would
generate such relocations, preventing the kernel build from
succeeding. */
if (opts->x_pcrelative_literal_loads == 2
&& TARGET_FIX_ERR_A53_843419)
aarch64_pcrelative_literal_loads = true;
/* In the tiny memory model it makes no sense to disallow PC relative
literal pool loads. */
if (aarch64_cmodel == AARCH64_CMODEL_TINY

View File

@ -439,7 +439,7 @@ extern unsigned aarch64_architecture_version;
enum reg_class
{
NO_REGS,
CALLER_SAVE_REGS,
TAILCALL_ADDR_REGS,
GENERAL_REGS,
STACK_REG,
POINTER_REGS,
@ -454,7 +454,7 @@ enum reg_class
#define REG_CLASS_NAMES \
{ \
"NO_REGS", \
"CALLER_SAVE_REGS", \
"TAILCALL_ADDR_REGS", \
"GENERAL_REGS", \
"STACK_REG", \
"POINTER_REGS", \
@ -466,7 +466,7 @@ enum reg_class
#define REG_CLASS_CONTENTS \
{ \
{ 0x00000000, 0x00000000, 0x00000000 }, /* NO_REGS */ \
{ 0x0007ffff, 0x00000000, 0x00000000 }, /* CALLER_SAVE_REGS */ \
{ 0x0004ffff, 0x00000000, 0x00000000 }, /* TAILCALL_ADDR_REGS */\
{ 0x7fffffff, 0x00000000, 0x00000003 }, /* GENERAL_REGS */ \
{ 0x80000000, 0x00000000, 0x00000000 }, /* STACK_REG */ \
{ 0xffffffff, 0x00000000, 0x00000003 }, /* POINTER_REGS */ \

View File

@ -140,6 +140,7 @@
UNSPEC_RSQRTS
UNSPEC_NZCV
UNSPEC_XPACLRI
UNSPEC_COPYSIGN
])
(define_c_enum "unspecv" [
@ -3093,7 +3094,8 @@
(define_insn_and_split "*compare_cstore<mode>_insn"
[(set (match_operand:GPI 0 "register_operand" "=r")
(EQL:GPI (match_operand:GPI 1 "register_operand" "r")
(match_operand:GPI 2 "aarch64_imm24" "n")))]
(match_operand:GPI 2 "aarch64_imm24" "n")))
(clobber (reg:CC CC_REGNUM))]
"!aarch64_move_imm (INTVAL (operands[2]), <MODE>mode)
&& !aarch64_plus_operand (operands[2], <MODE>mode)
&& !reload_completed"
@ -5002,45 +5004,45 @@
;; LDR d2, #(1 << 63)
;; BSL v2.8b, [y], [x]
;;
;; or another, equivalent, sequence using one of BSL/BIT/BIF.
;; aarch64_simd_bsldf will select the best suited of these instructions
;; to generate based on register allocation, and knows how to partially
;; constant fold based on the values of X and Y, so expand through that.
;; or another, equivalent, sequence using one of BSL/BIT/BIF. Because
;; we expect these operations to nearly always operate on
;; floating-point values, we do not want the operation to be
;; simplified into a bit-field insert operation that operates on the
;; integer side, since typically that would involve three inter-bank
;; register copies. As we do not expect copysign to be followed by
;; other logical operations on the result, it seems preferable to keep
;; this as an unspec operation, rather than exposing the underlying
;; logic to the compiler.
(define_expand "copysigndf3"
[(match_operand:DF 0 "register_operand")
(match_operand:DF 1 "register_operand")
(match_operand:DF 2 "register_operand")]
(define_expand "copysign<GPF:mode>3"
[(match_operand:GPF 0 "register_operand")
(match_operand:GPF 1 "register_operand")
(match_operand:GPF 2 "register_operand")]
"TARGET_FLOAT && TARGET_SIMD"
{
rtx mask = gen_reg_rtx (DImode);
emit_move_insn (mask, GEN_INT (HOST_WIDE_INT_1U << 63));
emit_insn (gen_aarch64_simd_bsldf (operands[0], mask,
operands[2], operands[1]));
rtx bitmask = gen_reg_rtx (<V_INT_EQUIV>mode);
emit_move_insn (bitmask, GEN_INT (HOST_WIDE_INT_M1U
<< (GET_MODE_BITSIZE (<MODE>mode) - 1)));
emit_insn (gen_copysign<mode>3_insn (operands[0], operands[1], operands[2],
bitmask));
DONE;
}
)
;; As above, but we must first get to a 64-bit value if we wish to use
;; aarch64_simd_bslv2sf.
(define_expand "copysignsf3"
[(match_operand:SF 0 "register_operand")
(match_operand:SF 1 "register_operand")
(match_operand:SF 2 "register_operand")]
(define_insn "copysign<GPF:mode>3_insn"
[(set (match_operand:GPF 0 "register_operand" "=w,w,w,r")
(unspec:GPF [(match_operand:GPF 1 "register_operand" "w,0,w,r")
(match_operand:GPF 2 "register_operand" "w,w,0,0")
(match_operand:<V_INT_EQUIV> 3 "register_operand"
"0,w,w,X")]
UNSPEC_COPYSIGN))]
"TARGET_FLOAT && TARGET_SIMD"
{
rtx mask = gen_reg_rtx (DImode);
/* Juggle modes to get us in to a vector mode for BSL. */
rtx op1 = lowpart_subreg (V2SFmode, operands[1], SFmode);
rtx op2 = lowpart_subreg (V2SFmode, operands[2], SFmode);
rtx tmp = gen_reg_rtx (V2SFmode);
emit_move_insn (mask, GEN_INT (HOST_WIDE_INT_1U << 31));
emit_insn (gen_aarch64_simd_bslv2sf (tmp, mask, op2, op1));
emit_move_insn (operands[0], lowpart_subreg (SFmode, tmp, V2SFmode));
DONE;
}
"@
bsl\\t%0.<Vbtype>, %2.<Vbtype>, %1.<Vbtype>
bit\\t%0.<Vbtype>, %2.<Vbtype>, %3.<Vbtype>
bif\\t%0.<Vbtype>, %1.<Vbtype>, %3.<Vbtype>
bfxil\\t%<w1>0, %<w1>1, #0, <sizem1>"
[(set_attr "type" "neon_bsl<q>,neon_bsl<q>,neon_bsl<q>,bfm")]
)
;; -------------------------------------------------------------------

View File

@ -21,8 +21,8 @@
(define_register_constraint "k" "STACK_REG"
"@internal The stack register.")
(define_register_constraint "Ucs" "CALLER_SAVE_REGS"
"@internal The caller save registers.")
(define_register_constraint "Ucs" "TAILCALL_ADDR_REGS"
"@internal Registers suitable for an indirect tail call")
(define_register_constraint "w" "FP_REGS"
"Floating point and SIMD vector registers.")

View File

@ -404,7 +404,7 @@ fma_forest::merge_forest (fma_forest *other_forest)
/* Update root nodes' pointer to forest. */
for (other_root_iter = other_roots->begin ();
other_root_iter != other_roots->end (); other_root_iter++)
other_root_iter != other_roots->end (); ++other_root_iter)
(*other_root_iter)->set_forest (this);
/* Remove other_forest from the list of forests and move its tree roots in
@ -845,14 +845,13 @@ func_fma_steering::dfs (void (*process_forest) (fma_forest *),
void (*process_node) (fma_forest *, fma_node *),
bool free)
{
vec<fma_node *> to_process;
auto_vec<fma_node *> to_process;
auto_vec<fma_node *> to_free;
std::list<fma_forest *>::iterator forest_iter;
to_process.create (0);
/* For each forest. */
for (forest_iter = this->m_fma_forests.begin ();
forest_iter != this->m_fma_forests.end (); forest_iter++)
forest_iter != this->m_fma_forests.end (); ++forest_iter)
{
std::list<fma_root_node *>::iterator root_iter;
@ -861,7 +860,7 @@ func_fma_steering::dfs (void (*process_forest) (fma_forest *),
/* For each tree root in this forest. */
for (root_iter = (*forest_iter)->get_roots ()->begin ();
root_iter != (*forest_iter)->get_roots ()->end (); root_iter++)
root_iter != (*forest_iter)->get_roots ()->end (); ++root_iter)
{
if (process_root)
process_root (*forest_iter, *root_iter);
@ -879,28 +878,30 @@ func_fma_steering::dfs (void (*process_forest) (fma_forest *),
if (process_node)
process_node (*forest_iter, node);
/* Absence of children might indicate an alternate root of a *chain*.
It's ok to skip it here as the chain will be renamed when
processing the canonical root for that chain. */
if (node->get_children ()->empty ())
continue;
for (child_iter = node->get_children ()->begin ();
child_iter != node->get_children ()->end (); child_iter++)
child_iter != node->get_children ()->end (); ++child_iter)
to_process.safe_push (*child_iter);
/* Defer freeing so that the process_node callback can access the
parent and children of the node being processed. */
if (free)
to_free.safe_push (node);
}
if (free)
{
delete *forest_iter;
while (!to_free.is_empty ())
{
fma_node *node = to_free.pop ();
if (node->root_p ())
delete static_cast<fma_root_node *> (node);
else
delete node;
}
}
if (free)
delete *forest_iter;
}
to_process.release ();
}
/* Build the dependency trees of FMUL and FMADD/FMSUB instructions. */

View File

@ -438,7 +438,8 @@
(define_mode_attr sizen [(QI "8") (HI "16") (SI "32") (DI "64")])
;; Give the ordinal of the MSB in the mode
(define_mode_attr sizem1 [(QI "#7") (HI "#15") (SI "#31") (DI "#63")])
(define_mode_attr sizem1 [(QI "#7") (HI "#15") (SI "#31") (DI "#63")
(HF "#15") (SF "#31") (DF "#63")])
;; Attribute to describe constants acceptable in logical operations
(define_mode_attr lconst [(SI "K") (DI "L")])
@ -507,7 +508,7 @@
(V8HF "16b") (V2SF "8b")
(V4SF "16b") (V2DF "16b")
(DI "8b") (DF "8b")
(SI "8b")])
(SI "8b") (SF "8b")])
;; Define element mode for each vector mode.
(define_mode_attr VEL [(V8QI "QI") (V16QI "QI")
@ -648,6 +649,9 @@
;; Double vector types for ALLX.
(define_mode_attr Vallxd [(QI "8b") (HI "4h") (SI "2s")])
;; Mode with floating-point values replaced by like-sized integers.
(define_mode_attr V_INT_EQUIV [(DF "DI") (SF "SI")])
;; Mode of result of comparison operations.
(define_mode_attr V_cmp_result [(V8QI "V8QI") (V16QI "V16QI")
(V4HI "V4HI") (V8HI "V8HI")

View File

@ -6357,8 +6357,40 @@ alpha_gimplify_va_arg (tree valist, tree type, gimple_seq *pre_p,
offset = get_initialized_tmp_var (t, pre_p, NULL);
indirect = pass_by_reference (NULL, TYPE_MODE (type), type, false);
if (indirect)
type = build_pointer_type_for_mode (type, ptr_mode, true);
{
if (TREE_CODE (type) == COMPLEX_TYPE
&& targetm.calls.split_complex_arg (type))
{
tree real_part, imag_part, real_temp;
tree ptr_type = build_pointer_type_for_mode (TREE_TYPE (type),
ptr_mode, true);
real_part = alpha_gimplify_va_arg_1 (ptr_type, base,
offset, pre_p);
real_part = build_va_arg_indirect_ref (real_part);
/* Copy the value into a new temporary, lest the formal temporary
be reused out from under us. */
real_temp = get_initialized_tmp_var (real_part, pre_p, NULL);
imag_part = alpha_gimplify_va_arg_1 (ptr_type, base,
offset, pre_p);
imag_part = build_va_arg_indirect_ref (imag_part);
r = build2 (COMPLEX_EXPR, type, real_temp, imag_part);
/* Stuff the offset temporary back into its field. */
gimplify_assign (unshare_expr (offset_field),
fold_convert (TREE_TYPE (offset_field), offset),
pre_p);
return r;
}
else
type = build_pointer_type_for_mode (type, ptr_mode, true);
}
/* Find the value. Note that this will be a stable indirection, or
a composite of stable indirections in the case of complex. */
@ -7750,13 +7782,13 @@ alpha_expand_prologue (void)
int probed;
for (probed = 4096; probed < probed_size; probed += 8192)
emit_insn (gen_probe_stack (GEN_INT (-probed)));
emit_insn (gen_stack_probe_internal (GEN_INT (-probed)));
/* We only have to do this probe if we aren't saving registers or
if we are probing beyond the frame because of -fstack-check. */
if ((sa_size == 0 && probed_size > probed - 4096)
|| flag_stack_check)
emit_insn (gen_probe_stack (GEN_INT (-probed_size)));
emit_insn (gen_stack_probe_internal (GEN_INT (-probed_size)));
}
if (frame_size != 0)

View File

@ -4915,7 +4915,7 @@
;; Subroutine of stack space allocation. Perform a stack probe.
(define_expand "probe_stack"
(define_expand "stack_probe_internal"
[(set (match_dup 1) (match_operand:DI 0 "const_int_operand"))]
""
{
@ -4950,12 +4950,14 @@
int probed = 4096;
emit_insn (gen_probe_stack (GEN_INT (- probed)));
emit_insn (gen_stack_probe_internal (GEN_INT (- probed)));
while (probed + 8192 < INTVAL (operands[1]))
emit_insn (gen_probe_stack (GEN_INT (- (probed += 8192))));
emit_insn (gen_stack_probe_internal
(GEN_INT (- (probed += 8192))));
if (probed + 4096 < INTVAL (operands[1]))
emit_insn (gen_probe_stack (GEN_INT (- INTVAL(operands[1]))));
emit_insn (gen_stack_probe_internal
(GEN_INT (- INTVAL(operands[1]))));
}
operands[1] = GEN_INT (- INTVAL (operands[1]));

View File

@ -2576,7 +2576,7 @@ arm_expand_builtin (tree exp,
icode = CODE_FOR_set_fpscr;
arg0 = CALL_EXPR_ARG (exp, 0);
op0 = expand_normal (arg0);
pat = GEN_FCN (icode) (op0);
pat = GEN_FCN (icode) (force_reg (SImode, op0));
}
emit_insn (pat);
return target;
@ -2584,7 +2584,9 @@ arm_expand_builtin (tree exp,
case ARM_BUILTIN_CMSE_NONSECURE_CALLER:
target = gen_reg_rtx (SImode);
op0 = arm_return_addr (0, NULL_RTX);
emit_insn (gen_addsi3 (target, op0, const1_rtx));
emit_insn (gen_andsi3 (target, op0, const1_rtx));
op1 = gen_rtx_EQ (SImode, target, const0_rtx);
emit_insn (gen_cstoresi4 (target, op1, target, const0_rtx));
return target;
case ARM_BUILTIN_TEXTRMSB:

View File

@ -3001,7 +3001,8 @@ arm_option_override_internal (struct gcc_options *opts,
/* Thumb2 inline assembly code should always use unified syntax.
This will apply to ARM and Thumb1 eventually. */
opts->x_inline_asm_unified = TARGET_THUMB2_P (opts->x_target_flags);
if (TARGET_THUMB2_P (opts->x_target_flags))
opts->x_inline_asm_unified = true;
#ifdef SUBTARGET_OVERRIDE_INTERNAL_OPTIONS
SUBTARGET_OVERRIDE_INTERNAL_OPTIONS;
@ -8711,11 +8712,16 @@ static bool
arm_cannot_force_const_mem (machine_mode mode ATTRIBUTE_UNUSED, rtx x)
{
rtx base, offset;
split_const (x, &base, &offset);
if (ARM_OFFSETS_MUST_BE_WITHIN_SECTIONS_P)
if (SYMBOL_REF_P (base))
{
split_const (x, &base, &offset);
if (GET_CODE (base) == SYMBOL_REF
/* Function symbols cannot have an offset due to the Thumb bit. */
if ((SYMBOL_REF_FLAGS (base) & SYMBOL_FLAG_FUNCTION)
&& INTVAL (offset) != 0)
return true;
if (ARM_OFFSETS_MUST_BE_WITHIN_SECTIONS_P
&& !offset_within_block_p (base, INTVAL (offset)))
return true;
}
@ -11695,8 +11701,7 @@ neon_valid_immediate (rtx op, machine_mode mode, int inverse,
else
{
n_elts = 1;
if (mode == VOIDmode)
mode = DImode;
gcc_assert (mode != VOIDmode);
}
innersize = GET_MODE_UNIT_SIZE (mode);
@ -17367,7 +17372,11 @@ arm_reorg (void)
if (use_cmse)
cmse_nonsecure_call_clear_caller_saved ();
if (TARGET_THUMB1)
/* We cannot run the Thumb passes for thunks because there is no CFG. */
if (cfun->is_thunk)
;
else if (TARGET_THUMB1)
thumb1_reorg ();
else if (TARGET_THUMB2)
thumb2_reorg ();
@ -18187,12 +18196,18 @@ output_move_double (rtx *operands, bool emit, int *count)
gcc_assert ((REGNO (operands[1]) != IP_REGNUM)
|| (TARGET_ARM && TARGET_LDRD));
/* For TARGET_ARM the first source register of an STRD
must be even. This is usually the case for double-word
values but user assembly constraints can force an odd
starting register. */
bool allow_strd = TARGET_LDRD
&& !(TARGET_ARM && (REGNO (operands[1]) & 1) == 1);
switch (GET_CODE (XEXP (operands[0], 0)))
{
case REG:
if (emit)
{
if (TARGET_LDRD)
if (allow_strd)
output_asm_insn ("strd%?\t%1, [%m0]", operands);
else
output_asm_insn ("stm%?\t%m0, %M1", operands);
@ -18200,7 +18215,7 @@ output_move_double (rtx *operands, bool emit, int *count)
break;
case PRE_INC:
gcc_assert (TARGET_LDRD);
gcc_assert (allow_strd);
if (emit)
output_asm_insn ("strd%?\t%1, [%m0, #8]!", operands);
break;
@ -18208,7 +18223,7 @@ output_move_double (rtx *operands, bool emit, int *count)
case PRE_DEC:
if (emit)
{
if (TARGET_LDRD)
if (allow_strd)
output_asm_insn ("strd%?\t%1, [%m0, #-8]!", operands);
else
output_asm_insn ("stmdb%?\t%m0!, %M1", operands);
@ -18218,7 +18233,7 @@ output_move_double (rtx *operands, bool emit, int *count)
case POST_INC:
if (emit)
{
if (TARGET_LDRD)
if (allow_strd)
output_asm_insn ("strd%?\t%1, [%m0], #8", operands);
else
output_asm_insn ("stm%?\t%m0!, %M1", operands);
@ -18226,7 +18241,7 @@ output_move_double (rtx *operands, bool emit, int *count)
break;
case POST_DEC:
gcc_assert (TARGET_LDRD);
gcc_assert (allow_strd);
if (emit)
output_asm_insn ("strd%?\t%1, [%m0], #-8", operands);
break;
@ -18237,8 +18252,8 @@ output_move_double (rtx *operands, bool emit, int *count)
otherops[1] = XEXP (XEXP (XEXP (operands[0], 0), 1), 0);
otherops[2] = XEXP (XEXP (XEXP (operands[0], 0), 1), 1);
/* IWMMXT allows offsets larger than ldrd can handle,
fix these up with a pair of ldr. */
/* IWMMXT allows offsets larger than strd can handle,
fix these up with a pair of str. */
if (!TARGET_THUMB2
&& CONST_INT_P (otherops[2])
&& (INTVAL(otherops[2]) <= -256
@ -18303,7 +18318,7 @@ output_move_double (rtx *operands, bool emit, int *count)
return "";
}
}
if (TARGET_LDRD
if (allow_strd
&& (REG_P (otherops[2])
|| TARGET_THUMB2
|| (CONST_INT_P (otherops[2])
@ -19097,6 +19112,11 @@ arm_r3_live_at_start_p (void)
static int
arm_compute_static_chain_stack_bytes (void)
{
/* Once the value is updated from the init value of -1, do not
re-compute. */
if (cfun->machine->static_chain_stack_bytes != -1)
return cfun->machine->static_chain_stack_bytes;
/* See the defining assertion in arm_expand_prologue. */
if (IS_NESTED (arm_current_func_type ())
&& ((TARGET_APCS_FRAME && frame_pointer_needed && TARGET_ARM)
@ -19196,7 +19216,36 @@ arm_compute_save_reg_mask (void)
return save_reg_mask;
}
/* Compute a bit mask of which registers need to be
/* Return a mask for the call-clobbered low registers that are unused
at the end of the prologue. */
static unsigned long
thumb1_prologue_unused_call_clobbered_lo_regs (void)
{
unsigned long mask = 0;
for (int reg = 0; reg <= LAST_LO_REGNUM; reg++)
if (!callee_saved_reg_p (reg)
&& !REGNO_REG_SET_P (df_get_live_out (ENTRY_BLOCK_PTR_FOR_FN (cfun)),
reg))
mask |= 1 << reg;
return mask;
}
/* Similarly for the start of the epilogue. */
static unsigned long
thumb1_epilogue_unused_call_clobbered_lo_regs (void)
{
unsigned long mask = 0;
for (int reg = 0; reg <= LAST_LO_REGNUM; reg++)
if (!callee_saved_reg_p (reg)
&& !REGNO_REG_SET_P (df_get_live_in (EXIT_BLOCK_PTR_FOR_FN (cfun)),
reg))
mask |= 1 << reg;
return mask;
}
/* Compute a bit mask of which core registers need to be
saved on the stack for the current function. */
static unsigned long
thumb1_compute_save_reg_mask (void)
@ -19227,10 +19276,19 @@ thumb1_compute_save_reg_mask (void)
if (mask & 0xff || thumb_force_lr_save ())
mask |= (1 << LR_REGNUM);
/* Make sure we have a low work register if we need one.
We will need one if we are going to push a high register,
but we are not currently intending to push a low register. */
bool call_clobbered_scratch
= (thumb1_prologue_unused_call_clobbered_lo_regs ()
&& thumb1_epilogue_unused_call_clobbered_lo_regs ());
/* Make sure we have a low work register if we need one. We will
need one if we are going to push a high register, but we are not
currently intending to push a low register. However if both the
prologue and epilogue have a spare call-clobbered low register,
then we won't need to find an additional work register. It does
not need to be the same register in the prologue and
epilogue. */
if ((mask & 0xff) == 0
&& !call_clobbered_scratch
&& ((mask & 0x0f00) || TARGET_BACKTRACE))
{
/* Use thumb_find_work_register to choose which register
@ -21395,6 +21453,11 @@ arm_expand_prologue (void)
emit_insn (gen_movsi (stack_pointer_rtx, r1));
}
/* Let's compute the static_chain_stack_bytes required and store it. Right
now the value must the -1 as stored by arm_init_machine_status (). */
cfun->machine->static_chain_stack_bytes
= arm_compute_static_chain_stack_bytes ();
/* The static chain register is the same as the IP register. If it is
clobbered when creating the frame, we need to save and restore it. */
clobber_ip = IS_NESTED (func_type)
@ -24414,12 +24477,7 @@ thumb1_unexpanded_epilogue (void)
unsigned long mask = live_regs_mask & 0xff;
int next_hi_reg;
/* The available low registers depend on the size of the value we are
returning. */
if (size <= 12)
mask |= 1 << 3;
if (size <= 8)
mask |= 1 << 2;
mask |= thumb1_epilogue_unused_call_clobbered_lo_regs ();
if (mask == 0)
/* Oh dear! We have no low registers into which we can pop
@ -24427,7 +24485,7 @@ thumb1_unexpanded_epilogue (void)
internal_error
("no low registers available for popping high registers");
for (next_hi_reg = 8; next_hi_reg < 13; next_hi_reg++)
for (next_hi_reg = 12; next_hi_reg > LAST_LO_REGNUM; next_hi_reg--)
if (live_regs_mask & (1 << next_hi_reg))
break;
@ -24435,7 +24493,7 @@ thumb1_unexpanded_epilogue (void)
{
/* Find lo register(s) into which the high register(s) can
be popped. */
for (regno = 0; regno <= LAST_LO_REGNUM; regno++)
for (regno = LAST_LO_REGNUM; regno >= 0; regno--)
{
if (mask & (1 << regno))
high_regs_pushed--;
@ -24443,20 +24501,22 @@ thumb1_unexpanded_epilogue (void)
break;
}
mask &= (2 << regno) - 1; /* A noop if regno == 8 */
if (high_regs_pushed == 0 && regno >= 0)
mask &= ~((1 << regno) - 1);
/* Pop the values into the low register(s). */
thumb_pop (asm_out_file, mask);
/* Move the value(s) into the high registers. */
for (regno = 0; regno <= LAST_LO_REGNUM; regno++)
for (regno = LAST_LO_REGNUM; regno >= 0; regno--)
{
if (mask & (1 << regno))
{
asm_fprintf (asm_out_file, "\tmov\t%r, %r\n", next_hi_reg,
regno);
for (next_hi_reg++; next_hi_reg < 13; next_hi_reg++)
for (next_hi_reg--; next_hi_reg > LAST_LO_REGNUM;
next_hi_reg--)
if (live_regs_mask & (1 << next_hi_reg))
break;
}
@ -24542,6 +24602,7 @@ arm_init_machine_status (void)
#if ARM_FT_UNKNOWN != 0
machine->func_type = ARM_FT_UNKNOWN;
#endif
machine->static_chain_stack_bytes = -1;
return machine;
}
@ -24837,10 +24898,20 @@ thumb1_expand_prologue (void)
break;
/* Here we need to mask out registers used for passing arguments
even if they can be pushed. This is to avoid using them to stash the high
registers. Such kind of stash may clobber the use of arguments. */
even if they can be pushed. This is to avoid using them to
stash the high registers. Such kind of stash may clobber the
use of arguments. */
pushable_regs = l_mask & (~arg_regs_mask);
if (lr_needs_saving)
pushable_regs |= thumb1_prologue_unused_call_clobbered_lo_regs ();
/* Normally, LR can be used as a scratch register once it has been
saved; but if the function examines its own return address then
the value is still live and we need to avoid using it. */
bool return_addr_live
= REGNO_REG_SET_P (df_get_live_out (ENTRY_BLOCK_PTR_FOR_FN (cfun)),
LR_REGNUM);
if (lr_needs_saving || return_addr_live)
pushable_regs &= ~(1 << LR_REGNUM);
if (pushable_regs == 0)
@ -24881,6 +24952,11 @@ thumb1_expand_prologue (void)
push_mask |= 1 << LR_REGNUM;
real_regs_mask |= 1 << LR_REGNUM;
lr_needs_saving = false;
/* If the return address is not live at this point, we
can add LR to the list of registers that we can use
for pushes. */
if (!return_addr_live)
pushable_regs |= 1 << LR_REGNUM;
}
insn = thumb1_emit_multi_reg_push (push_mask, real_regs_mask);
@ -26412,6 +26488,8 @@ static void
arm32_output_mi_thunk (FILE *file, tree, HOST_WIDE_INT delta,
HOST_WIDE_INT vcall_offset, tree function)
{
const bool long_call_p = arm_is_long_call_p (function);
/* On ARM, this_regno is R0 or R1 depending on
whether the function returns an aggregate or not.
*/
@ -26449,9 +26527,22 @@ arm32_output_mi_thunk (FILE *file, tree, HOST_WIDE_INT delta,
TREE_USED (function) = 1;
}
rtx funexp = XEXP (DECL_RTL (function), 0);
if (long_call_p)
{
emit_move_insn (temp, funexp);
funexp = temp;
}
funexp = gen_rtx_MEM (FUNCTION_MODE, funexp);
rtx_insn * insn = emit_call_insn (gen_sibcall (funexp, const0_rtx, NULL_RTX));
rtx_insn *insn = emit_call_insn (gen_sibcall (funexp, const0_rtx, NULL_RTX));
SIBLING_CALL_P (insn) = 1;
emit_barrier ();
/* Indirect calls require a bit of fixup in PIC mode. */
if (long_call_p)
{
split_all_insns_noflow ();
arm_reorg ();
}
insn = get_insns ();
shorten_branches (insn);
@ -26853,7 +26944,10 @@ static bool
arm_array_mode_supported_p (machine_mode mode,
unsigned HOST_WIDE_INT nelems)
{
if (TARGET_NEON
/* We don't want to enable interleaved loads and stores for BYTES_BIG_ENDIAN
for now, as the lane-swapping logic needs to be extended in the expanders.
See PR target/82518. */
if (TARGET_NEON && !BYTES_BIG_ENDIAN
&& (VALID_NEON_DREG_MODE (mode) || VALID_NEON_QREG_MODE (mode))
&& (nelems >= 2 && nelems <= 4))
return true;

View File

@ -186,7 +186,7 @@ extern tree arm_fp16_type_node;
/* FPU supports converting between HFmode and DFmode in a single hardware
step. */
#define TARGET_FP16_TO_DOUBLE \
(TARGET_HARD_FLOAT && (TARGET_FP16 && TARGET_VFP5))
(TARGET_HARD_FLOAT && TARGET_FP16 && TARGET_VFP5 && TARGET_VFP_DOUBLE)
/* FPU supports fused-multiply-add operations. */
#define TARGET_FMA (bitmap_bit_p (arm_active_target.isa, isa_bit_VFPv4))
@ -1420,6 +1420,9 @@ typedef struct GTY(()) machine_function
machine_mode thumb1_cc_mode;
/* Set to 1 after arm_reorg has started. */
int after_arm_reorg;
/* The number of bytes used to store the static chain register on the
stack, above the stack frame. */
int static_chain_stack_bytes;
}
machine_function;
#endif

View File

@ -4486,65 +4486,78 @@
; ARMv6+ unaligned load/store instructions (used for packed structure accesses).
(define_insn "unaligned_loadsi"
[(set (match_operand:SI 0 "s_register_operand" "=l,r")
(unspec:SI [(match_operand:SI 1 "memory_operand" "Uw,m")]
[(set (match_operand:SI 0 "s_register_operand" "=l,l,r")
(unspec:SI [(match_operand:SI 1 "memory_operand" "m,Uw,m")]
UNSPEC_UNALIGNED_LOAD))]
"unaligned_access"
"ldr%?\t%0, %1\t@ unaligned"
[(set_attr "arch" "t2,any")
(set_attr "length" "2,4")
(set_attr "predicable" "yes")
(set_attr "predicable_short_it" "yes,no")
"@
ldr\t%0, %1\t@ unaligned
ldr%?\t%0, %1\t@ unaligned
ldr%?\t%0, %1\t@ unaligned"
[(set_attr "arch" "t1,t2,32")
(set_attr "length" "2,2,4")
(set_attr "predicable" "no,yes,yes")
(set_attr "predicable_short_it" "no,yes,no")
(set_attr "type" "load1")])
;; The 16-bit Thumb1 variant of ldrsh requires two registers in the
;; address (there's no immediate format). That's tricky to support
;; here and we don't really need this pattern for that case, so only
;; enable for 32-bit ISAs.
(define_insn "unaligned_loadhis"
[(set (match_operand:SI 0 "s_register_operand" "=l,r")
[(set (match_operand:SI 0 "s_register_operand" "=r")
(sign_extend:SI
(unspec:HI [(match_operand:HI 1 "memory_operand" "Uw,Uh")]
(unspec:HI [(match_operand:HI 1 "memory_operand" "Uh")]
UNSPEC_UNALIGNED_LOAD)))]
"unaligned_access"
"unaligned_access && TARGET_32BIT"
"ldrsh%?\t%0, %1\t@ unaligned"
[(set_attr "arch" "t2,any")
(set_attr "length" "2,4")
(set_attr "predicable" "yes")
(set_attr "predicable_short_it" "yes,no")
[(set_attr "predicable" "yes")
(set_attr "type" "load_byte")])
(define_insn "unaligned_loadhiu"
[(set (match_operand:SI 0 "s_register_operand" "=l,r")
[(set (match_operand:SI 0 "s_register_operand" "=l,l,r")
(zero_extend:SI
(unspec:HI [(match_operand:HI 1 "memory_operand" "Uw,m")]
(unspec:HI [(match_operand:HI 1 "memory_operand" "m,Uw,m")]
UNSPEC_UNALIGNED_LOAD)))]
"unaligned_access"
"ldrh%?\t%0, %1\t@ unaligned"
[(set_attr "arch" "t2,any")
(set_attr "length" "2,4")
(set_attr "predicable" "yes")
(set_attr "predicable_short_it" "yes,no")
"@
ldrh\t%0, %1\t@ unaligned
ldrh%?\t%0, %1\t@ unaligned
ldrh%?\t%0, %1\t@ unaligned"
[(set_attr "arch" "t1,t2,32")
(set_attr "length" "2,2,4")
(set_attr "predicable" "no,yes,yes")
(set_attr "predicable_short_it" "no,yes,no")
(set_attr "type" "load_byte")])
(define_insn "unaligned_storesi"
[(set (match_operand:SI 0 "memory_operand" "=Uw,m")
(unspec:SI [(match_operand:SI 1 "s_register_operand" "l,r")]
[(set (match_operand:SI 0 "memory_operand" "=m,Uw,m")
(unspec:SI [(match_operand:SI 1 "s_register_operand" "l,l,r")]
UNSPEC_UNALIGNED_STORE))]
"unaligned_access"
"str%?\t%1, %0\t@ unaligned"
[(set_attr "arch" "t2,any")
(set_attr "length" "2,4")
(set_attr "predicable" "yes")
(set_attr "predicable_short_it" "yes,no")
"@
str\t%1, %0\t@ unaligned
str%?\t%1, %0\t@ unaligned
str%?\t%1, %0\t@ unaligned"
[(set_attr "arch" "t1,t2,32")
(set_attr "length" "2,2,4")
(set_attr "predicable" "no,yes,yes")
(set_attr "predicable_short_it" "no,yes,no")
(set_attr "type" "store1")])
(define_insn "unaligned_storehi"
[(set (match_operand:HI 0 "memory_operand" "=Uw,m")
(unspec:HI [(match_operand:HI 1 "s_register_operand" "l,r")]
[(set (match_operand:HI 0 "memory_operand" "=m,Uw,m")
(unspec:HI [(match_operand:HI 1 "s_register_operand" "l,l,r")]
UNSPEC_UNALIGNED_STORE))]
"unaligned_access"
"strh%?\t%1, %0\t@ unaligned"
[(set_attr "arch" "t2,any")
(set_attr "length" "2,4")
(set_attr "predicable" "yes")
(set_attr "predicable_short_it" "yes,no")
"@
strh\t%1, %0\t@ unaligned
strh%?\t%1, %0\t@ unaligned
strh%?\t%1, %0\t@ unaligned"
[(set_attr "arch" "t1,t2,32")
(set_attr "length" "2,2,4")
(set_attr "predicable" "no,yes,yes")
(set_attr "predicable_short_it" "no,yes,no")
(set_attr "type" "store1")])
@ -6002,52 +6015,29 @@
}
}
if (ARM_OFFSETS_MUST_BE_WITHIN_SECTIONS_P)
split_const (operands[1], &base, &offset);
if (INTVAL (offset) != 0
&& targetm.cannot_force_const_mem (SImode, operands[1]))
{
split_const (operands[1], &base, &offset);
if (GET_CODE (base) == SYMBOL_REF
&& !offset_within_block_p (base, INTVAL (offset)))
{
tmp = can_create_pseudo_p () ? gen_reg_rtx (SImode) : operands[0];
emit_move_insn (tmp, base);
emit_insn (gen_addsi3 (operands[0], tmp, offset));
DONE;
}
tmp = can_create_pseudo_p () ? gen_reg_rtx (SImode) : operands[0];
emit_move_insn (tmp, base);
emit_insn (gen_addsi3 (operands[0], tmp, offset));
DONE;
}
tmp = can_create_pseudo_p () ? NULL_RTX : operands[0];
/* Recognize the case where operand[1] is a reference to thread-local
data and load its address to a register. */
data and load its address to a register. Offsets have been split off
already. */
if (arm_tls_referenced_p (operands[1]))
{
rtx tmp = operands[1];
rtx addend = NULL;
if (GET_CODE (tmp) == CONST && GET_CODE (XEXP (tmp, 0)) == PLUS)
{
addend = XEXP (XEXP (tmp, 0), 1);
tmp = XEXP (XEXP (tmp, 0), 0);
}
gcc_assert (GET_CODE (tmp) == SYMBOL_REF);
gcc_assert (SYMBOL_REF_TLS_MODEL (tmp) != 0);
tmp = legitimize_tls_address (tmp,
!can_create_pseudo_p () ? operands[0] : 0);
if (addend)
{
tmp = gen_rtx_PLUS (SImode, tmp, addend);
tmp = force_operand (tmp, operands[0]);
}
operands[1] = tmp;
}
operands[1] = legitimize_tls_address (operands[1], tmp);
else if (flag_pic
&& (CONSTANT_P (operands[1])
|| symbol_mentioned_p (operands[1])
|| label_mentioned_p (operands[1])))
operands[1] = legitimize_pic_address (operands[1], SImode,
(!can_create_pseudo_p ()
? operands[0]
: 0));
operands[1] =
legitimize_pic_address (operands[1], SImode, tmp);
}
"
)

View File

@ -35,7 +35,6 @@ extern "C" {
#if __ARM_FEATURE_CMSE & 1
#include <stddef.h>
#include <stdint.h>
#ifdef __ARM_BIG_ENDIAN
@ -174,9 +173,9 @@ cmse_nonsecure_caller (void)
#define CMSE_MPU_NONSECURE 16
#define CMSE_NONSECURE 18
#define cmse_nsfptr_create(p) ((typeof ((p))) ((intptr_t) (p) & ~1))
#define cmse_nsfptr_create(p) ((__typeof__ ((p))) ((__INTPTR_TYPE__) (p) & ~1))
#define cmse_is_nsfptr(p) (!((intptr_t) (p) & 1))
#define cmse_is_nsfptr(p) (!((__INTPTR_TYPE__) (p) & 1))
#endif /* __ARM_FEATURE_CMSE & 2 */
@ -188,7 +187,7 @@ __extension__ void *
cmse_check_address_range (void *, size_t, int);
#define cmse_check_pointed_object(p, f) \
((typeof ((p))) cmse_check_address_range ((p), sizeof (*(p)), (f)))
((__typeof__ ((p))) cmse_check_address_range ((p), sizeof (*(p)), (f)))
#endif /* __ARM_FEATURE_CMSE & 1 */

View File

@ -31,7 +31,8 @@
;; 'H' was previously used for FPA.
;; The following multi-letter normal constraints have been used:
;; in ARM/Thumb-2 state: Da, Db, Dc, Dd, Dn, Dl, DL, Do, Dv, Dy, Di, Dt, Dp, Dz
;; in ARM/Thumb-2 state: Da, Db, Dc, Dd, Dn, DN, Dm, Dl, DL, Do, Dv, Dy, Di,
;; Dt, Dp, Dz
;; in Thumb-1 state: Pa, Pb, Pc, Pd, Pe
;; in Thumb-2 state: Pj, PJ, Ps, Pt, Pu, Pv, Pw, Px, Py
;; in all states: Pf
@ -294,14 +295,28 @@
(and (match_code "const_double,const_int")
(match_test "TARGET_32BIT && arm_const_double_by_immediates (op)")))
(define_constraint "Dn"
(define_constraint "Dm"
"@internal
In ARM/Thumb-2 state a const_vector or const_int which can be loaded with a
Neon vmov immediate instruction."
(and (match_code "const_vector,const_int")
In ARM/Thumb-2 state a const_vector which can be loaded with a Neon vmov
immediate instruction."
(and (match_code "const_vector")
(match_test "TARGET_32BIT
&& imm_for_neon_mov_operand (op, GET_MODE (op))")))
(define_constraint "Dn"
"@internal
In ARM/Thumb-2 state a DImode const_int which can be loaded with a Neon vmov
immediate instruction."
(and (match_code "const_int")
(match_test "TARGET_32BIT && imm_for_neon_mov_operand (op, DImode)")))
(define_constraint "DN"
"@internal
In ARM/Thumb-2 state a TImode const_int which can be loaded with a Neon vmov
immediate instruction."
(and (match_code "const_int")
(match_test "TARGET_32BIT && imm_for_neon_mov_operand (op, TImode)")))
(define_constraint "Dl"
"@internal
In ARM/Thumb-2 state a const_vector which can be used with a Neon vorr or

View File

@ -25,14 +25,14 @@
(define_insn "*neon_mov<mode>"
[(set (match_operand:VDX 0 "nonimmediate_operand"
"=w,Un,w, w, ?r,?w,?r,?r, ?Us")
"=w,Un,w, w, w, ?r,?w,?r,?r, ?Us")
(match_operand:VDX 1 "general_operand"
" w,w, Dn,Uni, w, r, r, Usi,r"))]
" w,w, Dm,Dn,Uni, w, r, r, Usi,r"))]
"TARGET_NEON
&& (register_operand (operands[0], <MODE>mode)
|| register_operand (operands[1], <MODE>mode))"
{
if (which_alternative == 2)
if (which_alternative == 2 || which_alternative == 3)
{
int width, is_valid;
static char templ[40];
@ -53,31 +53,32 @@
switch (which_alternative)
{
case 0: return "vmov\t%P0, %P1 @ <mode>";
case 1: case 3: return output_move_neon (operands);
case 2: gcc_unreachable ();
case 4: return "vmov\t%Q0, %R0, %P1 @ <mode>";
case 5: return "vmov\t%P0, %Q1, %R1 @ <mode>";
case 1: case 4: return output_move_neon (operands);
case 2: case 3: gcc_unreachable ();
case 5: return "vmov\t%Q0, %R0, %P1 @ <mode>";
case 6: return "vmov\t%P0, %Q1, %R1 @ <mode>";
default: return output_move_double (operands, true, NULL);
}
}
[(set_attr "type" "neon_move<q>,neon_store1_1reg,neon_move<q>,\
neon_load1_1reg, neon_to_gp<q>,neon_from_gp<q>,mov_reg,\
neon_load1_2reg, neon_store1_2reg")
(set_attr "length" "4,4,4,4,4,4,8,8,8")
(set_attr "arm_pool_range" "*,*,*,1020,*,*,*,1020,*")
(set_attr "thumb2_pool_range" "*,*,*,1018,*,*,*,1018,*")
(set_attr "neg_pool_range" "*,*,*,1004,*,*,*,1004,*")])
neon_move<q>,neon_load1_1reg, neon_to_gp<q>,\
neon_from_gp<q>,mov_reg,neon_load1_2reg,\
neon_store1_2reg")
(set_attr "length" "4,4,4,4,4,4,4,8,8,8")
(set_attr "arm_pool_range" "*,*,*,*,1020,*,*,*,1020,*")
(set_attr "thumb2_pool_range" "*,*,*,*,1018,*,*,*,1018,*")
(set_attr "neg_pool_range" "*,*,*,*,1004,*,*,*,1004,*")])
(define_insn "*neon_mov<mode>"
[(set (match_operand:VQXMOV 0 "nonimmediate_operand"
"=w,Un,w, w, ?r,?w,?r,?r, ?Us")
"=w,Un,w, w, w, ?r,?w,?r,?r, ?Us")
(match_operand:VQXMOV 1 "general_operand"
" w,w, Dn,Uni, w, r, r, Usi, r"))]
" w,w, Dm,DN,Uni, w, r, r, Usi, r"))]
"TARGET_NEON
&& (register_operand (operands[0], <MODE>mode)
|| register_operand (operands[1], <MODE>mode))"
{
if (which_alternative == 2)
if (which_alternative == 2 || which_alternative == 3)
{
int width, is_valid;
static char templ[40];
@ -98,20 +99,20 @@
switch (which_alternative)
{
case 0: return "vmov\t%q0, %q1 @ <mode>";
case 1: case 3: return output_move_neon (operands);
case 2: gcc_unreachable ();
case 4: return "vmov\t%Q0, %R0, %e1 @ <mode>\;vmov\t%J0, %K0, %f1";
case 5: return "vmov\t%e0, %Q1, %R1 @ <mode>\;vmov\t%f0, %J1, %K1";
case 1: case 4: return output_move_neon (operands);
case 2: case 3: gcc_unreachable ();
case 5: return "vmov\t%Q0, %R0, %e1 @ <mode>\;vmov\t%J0, %K0, %f1";
case 6: return "vmov\t%e0, %Q1, %R1 @ <mode>\;vmov\t%f0, %J1, %K1";
default: return output_move_quad (operands);
}
}
[(set_attr "type" "neon_move_q,neon_store2_2reg_q,neon_move_q,\
neon_load2_2reg_q,neon_to_gp_q,neon_from_gp_q,\
mov_reg,neon_load1_4reg,neon_store1_4reg")
(set_attr "length" "4,8,4,8,8,8,16,8,16")
(set_attr "arm_pool_range" "*,*,*,1020,*,*,*,1020,*")
(set_attr "thumb2_pool_range" "*,*,*,1018,*,*,*,1018,*")
(set_attr "neg_pool_range" "*,*,*,996,*,*,*,996,*")])
neon_move_q,neon_load2_2reg_q,neon_to_gp_q,\
neon_from_gp_q,mov_reg,neon_load1_4reg,neon_store1_4reg")
(set_attr "length" "4,8,4,4,8,8,8,16,8,16")
(set_attr "arm_pool_range" "*,*,*,*,1020,*,*,*,1020,*")
(set_attr "thumb2_pool_range" "*,*,*,*,1018,*,*,*,1018,*")
(set_attr "neg_pool_range" "*,*,*,*,996,*,*,*,996,*")])
(define_expand "movti"
[(set (match_operand:TI 0 "nonimmediate_operand" "")
@ -1007,7 +1008,7 @@
(define_insn "vashl<mode>3"
[(set (match_operand:VDQIW 0 "s_register_operand" "=w,w")
(ashift:VDQIW (match_operand:VDQIW 1 "s_register_operand" "w,w")
(match_operand:VDQIW 2 "imm_lshift_or_reg_neon" "w,Dn")))]
(match_operand:VDQIW 2 "imm_lshift_or_reg_neon" "w,Dm")))]
"TARGET_NEON"
{
switch (which_alternative)
@ -1026,7 +1027,7 @@
(define_insn "vashr<mode>3_imm"
[(set (match_operand:VDQIW 0 "s_register_operand" "=w")
(ashiftrt:VDQIW (match_operand:VDQIW 1 "s_register_operand" "w")
(match_operand:VDQIW 2 "imm_for_neon_rshift_operand" "Dn")))]
(match_operand:VDQIW 2 "imm_for_neon_rshift_operand" "Dm")))]
"TARGET_NEON"
{
return neon_output_shift_immediate ("vshr", 's', &operands[2],
@ -1039,7 +1040,7 @@
(define_insn "vlshr<mode>3_imm"
[(set (match_operand:VDQIW 0 "s_register_operand" "=w")
(lshiftrt:VDQIW (match_operand:VDQIW 1 "s_register_operand" "w")
(match_operand:VDQIW 2 "imm_for_neon_rshift_operand" "Dn")))]
(match_operand:VDQIW 2 "imm_for_neon_rshift_operand" "Dm")))]
"TARGET_NEON"
{
return neon_output_shift_immediate ("vshr", 'u', &operands[2],
@ -1143,12 +1144,12 @@
)
(define_insn_and_split "ashldi3_neon"
[(set (match_operand:DI 0 "s_register_operand" "= w, w,?&r,?r,?&r, ?w,w")
(ashift:DI (match_operand:DI 1 "s_register_operand" " 0w, w, 0r, 0, r, 0w,w")
(match_operand:SI 2 "general_operand" "rUm, i, r, i, i,rUm,i")))
(clobber (match_scratch:SI 3 "= X, X,?&r, X, X, X,X"))
(clobber (match_scratch:SI 4 "= X, X,?&r, X, X, X,X"))
(clobber (match_scratch:DI 5 "=&w, X, X, X, X, &w,X"))
[(set (match_operand:DI 0 "s_register_operand" "= w, w, &r, r, &r, ?w,?w")
(ashift:DI (match_operand:DI 1 "s_register_operand" " 0w, w, 0r, 0, r, 0w, w")
(match_operand:SI 2 "general_operand" "rUm, i, r, i, i,rUm, i")))
(clobber (match_scratch:SI 3 "= X, X, &r, X, X, X, X"))
(clobber (match_scratch:SI 4 "= X, X, &r, X, X, X, X"))
(clobber (match_scratch:DI 5 "=&w, X, X, X, X, &w, X"))
(clobber (reg:CC_C CC_REGNUM))]
"TARGET_NEON"
"#"
@ -1243,7 +1244,7 @@
;; ashrdi3_neon
;; lshrdi3_neon
(define_insn_and_split "<shift>di3_neon"
[(set (match_operand:DI 0 "s_register_operand" "= w, w,?&r,?r,?&r,?w,?w")
[(set (match_operand:DI 0 "s_register_operand" "= w, w, &r, r, &r,?w,?w")
(RSHIFTS:DI (match_operand:DI 1 "s_register_operand" " 0w, w, 0r, 0, r,0w, w")
(match_operand:SI 2 "reg_or_int_operand" " r, i, r, i, i, r, i")))
(clobber (match_scratch:SI 3 "=2r, X, &r, X, X,2r, X"))

View File

@ -1,7 +1,7 @@
# Custom RTEMS multilibs for ARM
MULTILIB_OPTIONS = mbig-endian mthumb march=armv6-m/march=armv7-a/march=armv7-r/march=armv7-m/mcpu=cortex-m7 mfpu=neon/mfpu=vfp/mfpu=vfpv3-d16/mfpu=fpv4-sp-d16/mfpu=fpv5-d16 mfloat-abi=hard
MULTILIB_DIRNAMES = eb thumb armv6-m armv7-a armv7-r armv7-m cortex-m7 neon vfp vfpv3-d16 fpv4-sp-d16 fpv5-d16 hard
MULTILIB_OPTIONS = mbig-endian mthumb march=armv6-m/march=armv7-a/march=armv7-r/mcpu=cortex-m3/mcpu=cortex-m4/mcpu=cortex-m7 mfpu=neon/mfpu=vfp/mfpu=vfpv3-d16/mfpu=fpv4-sp-d16/mfpu=fpv5-d16 mfloat-abi=hard
MULTILIB_DIRNAMES = eb thumb armv6-m armv7-a armv7-r cortex-m3 cortex-m4 cortex-m7 neon vfp vfpv3-d16 fpv4-sp-d16 fpv5-d16 hard
# Enumeration of multilibs
@ -16,7 +16,8 @@ MULTILIB_REQUIRED += mthumb/march=armv7-a/mfpu=neon/mfloat-abi=hard
MULTILIB_REQUIRED += mthumb/march=armv7-a
MULTILIB_REQUIRED += mthumb/march=armv7-r/mfpu=vfpv3-d16/mfloat-abi=hard
MULTILIB_REQUIRED += mthumb/march=armv7-r
MULTILIB_REQUIRED += mthumb/march=armv7-m/mfpu=fpv4-sp-d16/mfloat-abi=hard
MULTILIB_REQUIRED += mthumb/mcpu=cortex-m3
MULTILIB_REQUIRED += mthumb/mcpu=cortex-m4
MULTILIB_REQUIRED += mthumb/mcpu=cortex-m4/mfpu=fpv4-sp-d16/mfloat-abi=hard
MULTILIB_REQUIRED += mthumb/mcpu=cortex-m7/mfpu=fpv5-d16/mfloat-abi=hard
MULTILIB_REQUIRED += mthumb/march=armv7-m
MULTILIB_REQUIRED += mthumb

View File

@ -3579,13 +3579,14 @@ avr_out_lpm (rtx_insn *insn, rtx *op, int *plen)
gcc_unreachable();
case 1:
return avr_asm_len ("%4lpm %0,%a2", xop, plen, 1);
avr_asm_len ("%4lpm %0,%a2", xop, plen, 1);
break;
case 2:
if (REGNO (dest) == REG_Z)
return avr_asm_len ("%4lpm %5,%a2+" CR_TAB
"%4lpm %B0,%a2" CR_TAB
"mov %A0,%5", xop, plen, 3);
avr_asm_len ("%4lpm %5,%a2+" CR_TAB
"%4lpm %B0,%a2" CR_TAB
"mov %A0,%5", xop, plen, 3);
else
{
avr_asm_len ("%4lpm %A0,%a2+" CR_TAB
@ -3614,9 +3615,9 @@ avr_out_lpm (rtx_insn *insn, rtx *op, int *plen)
"%4lpm %B0,%a2+", xop, plen, 2);
if (REGNO (dest) == REG_Z - 2)
return avr_asm_len ("%4lpm %5,%a2+" CR_TAB
"%4lpm %C0,%a2" CR_TAB
"mov %D0,%5", xop, plen, 3);
avr_asm_len ("%4lpm %5,%a2+" CR_TAB
"%4lpm %C0,%a2" CR_TAB
"mov %D0,%5", xop, plen, 3);
else
{
avr_asm_len ("%4lpm %C0,%a2+" CR_TAB

View File

@ -153,6 +153,9 @@ FIXME: DRIVER_SELF_SPECS has changed.
#define FIRST_PSEUDO_REGISTER 36
#define GENERAL_REGNO_P(N) IN_RANGE (N, 2, 31)
#define GENERAL_REG_P(X) (REG_P (X) && GENERAL_REGNO_P (REGNO (X)))
#define FIXED_REGISTERS {\
1,1,/* r0 r1 */\
0,0,/* r2 r3 */\

View File

@ -3362,6 +3362,8 @@
(match_operand:HI 1 "reg_or_0_operand"))]
"optimize
&& reload_completed
&& GENERAL_REG_P (operands[0])
&& (operands[1] == const0_rtx || GENERAL_REG_P (operands[1]))
&& (!AVR_HAVE_MOVW
|| const0_rtx == operands[1])"
[(set (match_dup 2) (match_dup 3))

View File

@ -463,41 +463,32 @@ static const char *framework_defaults [] =
/* Register the GNU objective-C runtime include path if STDINC. */
void
darwin_register_objc_includes (const char *sysroot, const char *iprefix,
int stdinc)
darwin_register_objc_includes (const char *sysroot ATTRIBUTE_UNUSED,
const char *iprefix, int stdinc)
{
const char *fname;
size_t len;
/* We do not do anything if we do not want the standard includes. */
if (!stdinc)
return;
/* If we want standard includes; Register the GNU OBJC runtime include
path if we are compiling OBJC with GNU-runtime.
This path is compiler-relative, we don't want to prepend the sysroot
since it's not expected to find the headers there. */
fname = GCC_INCLUDE_DIR "-gnu-runtime";
/* Register the GNU OBJC runtime include path if we are compiling OBJC
with GNU-runtime. */
if (c_dialect_objc () && !flag_next_runtime)
if (stdinc && c_dialect_objc () && !flag_next_runtime)
{
const char *fname = GCC_INCLUDE_DIR "-gnu-runtime";
char *str;
/* See if our directory starts with the standard prefix.
size_t len;
/* See if our directory starts with the standard prefix.
"Translate" them, i.e. replace /usr/local/lib/gcc... with
IPREFIX and search them first. */
if (iprefix && (len = cpp_GCC_INCLUDE_DIR_len) != 0 && !sysroot
if (iprefix && (len = cpp_GCC_INCLUDE_DIR_len) != 0
&& !strncmp (fname, cpp_GCC_INCLUDE_DIR, len))
{
str = concat (iprefix, fname + len, NULL);
/* FIXME: wrap the headers for C++awareness. */
add_path (str, SYSTEM, /*c++aware=*/false, false);
add_path (str, SYSTEM, /*c++aware=*/true, false);
}
/* Should this directory start with the sysroot? */
if (sysroot)
str = concat (sysroot, fname, NULL);
else
str = update_path (fname, "");
add_path (str, SYSTEM, /*c++aware=*/false, false);
str = update_path (fname, "");
add_path (str, SYSTEM, /*c++aware=*/true, false);
}
}

View File

@ -26,6 +26,91 @@ along with GCC; see the file COPYING3. If not see
#include "opts.h"
#include "diagnostic-core.h"
/* Validate a version string (either given on the command line or, perhaps
as MACOSX_DEPLOYMENT_TARGET).
The specs %version-compare() function doesn't accept leading '0' on
numbers so strip them out. Do sanity checking here too.
Return:
* original string means it was OK and we didn't want to change it.
* new string means it was OK but we rewrote it to avoid possible format
problems.
* NULL means we didn't like what we saw.
*/
static const char *
validate_macosx_version_min (const char *version_str)
{
size_t version_len;
unsigned long major, minor, tiny = 0;
char *end;
const char *old_version = version_str;
bool need_rewrite = false;
version_len = strlen (version_str);
if (version_len < 4) /* The minimum would be 10.x */
return NULL;
/* Version string must consist of digits and periods only. */
if (strspn (version_str, "0123456789.") != version_len)
return NULL;
if (!ISDIGIT (version_str[0]) || !ISDIGIT (version_str[version_len - 1]))
return NULL;
if (version_str[0] == '0')
need_rewrite = true;
major = strtoul (version_str, &end, 10);
version_str = end + ((*end == '.') ? 1 : 0);
if (major != 10) /* So far .. all MacOS 10 ... */
return NULL;
/* Version string components must be present and numeric. */
if (!ISDIGIT (version_str[0]))
return NULL;
/* If we have one or more leading zeros on a component, then rewrite the
version string. */
if (version_str[0] == '0' && version_str[1] != '\0'
&& version_str[1] != '.')
need_rewrite = true;
minor = strtoul (version_str, &end, 10);
version_str = end + ((*end == '.') ? 1 : 0);
if (minor > 99)
return NULL;
/* If 'tiny' is present it must be numeric. */
if (*end != '\0' && !ISDIGIT (version_str[0]))
return NULL;
/* If we have one or more leading zeros on a component, then rewrite the
version string. */
if (*end != '\0' && version_str[0] == '0'
&& version_str[1] != '\0')
need_rewrite = true;
tiny = strtoul (version_str, &end, 10);
if (tiny > 99)
return NULL;
/* Version string must contain no more than three tokens. */
if (*end != '\0')
return NULL;
if (need_rewrite)
{
char *new_version;
asprintf (&new_version, "10.%lu.%lu", minor, tiny);
return new_version;
}
return old_version;
}
#ifndef CROSS_DIRECTORY_STRUCTURE
#include <sys/sysctl.h>
#include "xregex.h"
@ -120,16 +205,39 @@ darwin_default_min_version (void)
if (new_flag != NULL)
{
size_t len = strlen (new_flag);
if (len > 128) { /* Arbitrary limit, number should be like xx.yy.zz */
warning (0, "couldn%'t understand version %s\n", new_flag);
return NULL;
}
new_flag = xstrndup (new_flag, len);
const char *checked = validate_macosx_version_min (new_flag);
if (checked == NULL)
{
warning (0, "couldn%'t understand version %s\n", new_flag);
return NULL;
}
new_flag = xstrndup (checked, strlen (checked));
}
return new_flag;
}
/* See if we can find the sysroot from the SDKROOT environment variable. */
static const char *
maybe_get_sysroot_from_sdkroot ()
{
const char *maybe_sysroot = getenv ("SDKROOT");
/* We'll use the same rules as the clang driver, for compatibility.
1) The path must be absolute
2) Ignore "/", that is the default anyway and we do not want the
sysroot semantics to be applied to it.
3) It must exist (actually, we'll check it's readable too). */
if (maybe_sysroot == NULL
|| *maybe_sysroot != '/'
|| strlen (maybe_sysroot) == 1
|| access (maybe_sysroot, R_OK) == -1)
return NULL;
return xstrndup (maybe_sysroot, strlen (maybe_sysroot));
}
/* Translate -filelist and -framework options in *DECODED_OPTIONS
(size *DECODED_OPTIONS_COUNT) to use -Xlinker so that they are
considered to be linker inputs in the case that no other inputs are
@ -154,6 +262,7 @@ darwin_driver_init (unsigned int *decoded_options_count,
bool appendM64 = false;
const char *vers_string = NULL;
bool seen_version_min = false;
bool seen_sysroot_p = false;
for (i = 1; i < *decoded_options_count; i++)
{
@ -181,7 +290,7 @@ darwin_driver_init (unsigned int *decoded_options_count,
if (*decoded_options_count > i) {
memmove (*decoded_options + i,
*decoded_options + i + 1,
((*decoded_options_count - i)
((*decoded_options_count - i - 1)
* sizeof (struct cl_decoded_option)));
}
--i;
@ -215,7 +324,29 @@ darwin_driver_init (unsigned int *decoded_options_count,
case OPT_mmacosx_version_min_:
seen_version_min = true;
vers_string = xstrndup ((*decoded_options)[i].arg, 32);
vers_string =
validate_macosx_version_min ((*decoded_options)[i].arg);
if (vers_string == NULL)
warning (0, "%qs is not valid for %<mmacosx-version-min%>\n",
(*decoded_options)[i].arg);
else if (vers_string == (*decoded_options)[i].arg)
vers_string = xstrndup ((*decoded_options)[i].arg, 32);
/* Now we've examined it, and verified/re-written, put it to
one side and append later. */
if (*decoded_options_count > i) {
memmove (*decoded_options + i,
*decoded_options + i + 1,
((*decoded_options_count - i - 1)
* sizeof (struct cl_decoded_option)));
}
--i;
--*decoded_options_count;
break;
case OPT__sysroot_:
case OPT_isysroot:
seen_sysroot_p = true;
break;
default:
break;
@ -278,26 +409,40 @@ darwin_driver_init (unsigned int *decoded_options_count,
&(*decoded_options)[*decoded_options_count - 1]);
}
/* We will need to know the OS X version we're trying to build for here
so that we can figure out the mechanism and source for the sysroot to
be used. */
if (! seen_version_min && *decoded_options_count > 1)
if (! seen_sysroot_p)
{
/* Not set by the User, try to figure it out. */
vers_string = darwin_default_min_version ();
if (vers_string != NULL)
/* We will pick up an SDKROOT if we didn't specify a sysroot and treat
it as overriding any configure-time --with-sysroot. */
const char *sdkroot = maybe_get_sysroot_from_sdkroot ();
if (sdkroot)
{
++*decoded_options_count;
*decoded_options = XRESIZEVEC (struct cl_decoded_option,
*decoded_options,
*decoded_options_count);
generate_option (OPT_mmacosx_version_min_, vers_string, 1, CL_DRIVER,
&(*decoded_options)[*decoded_options_count - 1]);
generate_option (OPT__sysroot_, sdkroot, 1, CL_DRIVER,
&(*decoded_options)[*decoded_options_count - 1]);
}
}
/* Create and push the major version for assemblers that need it. */
/* We will need to know the OS X version we're trying to build for here
so that we can figure out the mechanism and source for the sysroot to
be used. */
if (! seen_version_min && *decoded_options_count > 1)
/* Not set by the User, try to figure it out. */
vers_string = darwin_default_min_version ();
/* Create and push a cleaned up version, plus the major version for
assemblers and other cases that need it. */
if (vers_string != NULL)
{
++*decoded_options_count;
*decoded_options = XRESIZEVEC (struct cl_decoded_option,
*decoded_options,
*decoded_options_count);
generate_option (OPT_mmacosx_version_min_, vers_string, 1, CL_DRIVER,
&(*decoded_options)[*decoded_options_count - 1]);
char *asm_major = NULL;
const char *first_period = strchr(vers_string, '.');
if (first_period != NULL)

View File

@ -53,8 +53,6 @@ extern void darwin_set_default_type_attributes (tree);
#endif /* TREE_CODE */
extern void machopic_finish (FILE *);
extern int machopic_reloc_rw_mask (void);
extern section *machopic_select_section (tree, int, unsigned HOST_WIDE_INT);

View File

@ -71,15 +71,9 @@ along with GCC; see the file COPYING3. If not see
setting the second word in the .non_lazy_symbol_pointer data
structure to symbol. See indirect_data for the code that handles
the extra indirection, and machopic_output_indirection and its use
of MACHO_SYMBOL_STATIC for the code that handles @code{static}
of MACHO_SYMBOL_FLAG_STATIC for the code that handles @code{static}
symbol indirection. */
/* For darwin >= 9 (OSX 10.5) the linker is capable of making the necessary
branch islands and we no longer need to emit darwin stubs.
However, if we are generating code for earlier systems (or for use in the
kernel) the stubs might still be required, and this will be set true. */
int darwin_emit_branch_islands = false;
typedef struct GTY(()) cdtor_record {
rtx symbol;
int priority; /* [con/de]structor priority */
@ -101,6 +95,10 @@ int generating_for_darwin_version ;
for weak or single-definition items. */
static bool ld_uses_coal_sects = false;
/* Very old (ld_classic) linkers need a symbol to mark the start of
each FDE. */
static bool ld_needs_eh_markers = false;
/* Section names. */
section * darwin_sections[NUM_DARWIN_SECTIONS];
@ -246,7 +244,7 @@ name_needs_quotes (const char *name)
int
machopic_symbol_defined_p (rtx sym_ref)
{
if (SYMBOL_REF_FLAGS (sym_ref) & MACHO_SYMBOL_FLAG_DEFINED)
if (MACHO_SYMBOL_DEFINED_P (sym_ref))
return true;
/* If a symbol references local and is not an extern to this
@ -255,7 +253,7 @@ machopic_symbol_defined_p (rtx sym_ref)
{
/* If the symbol references a variable and the variable is a
common symbol, then this symbol is not defined. */
if (SYMBOL_REF_FLAGS (sym_ref) & MACHO_SYMBOL_FLAG_VARIABLE)
if (MACHO_SYMBOL_VARIABLE_P (sym_ref))
{
tree decl = SYMBOL_REF_DECL (sym_ref);
if (!decl)
@ -451,6 +449,13 @@ typedef struct GTY ((for_user)) machopic_indirection
bool stub_p;
/* True iff this stub or pointer has been referenced. */
bool used;
/* True iff a non-lazy symbol pointer should be emitted into the .data
section, rather than the non-lazy symbol pointers section. The cases
for which this occurred seem to have been unintentional, and later
toolchains emit all of the indirections to the 'usual' section. We
are keeping this in case it is necessary to preserve compatibility with
older toolchains. */
bool nlsp_in_data_section;
} machopic_indirection;
struct indirection_hasher : ggc_ptr_hash<machopic_indirection>
@ -485,7 +490,7 @@ indirection_hasher::equal (machopic_indirection *s, const char *k)
/* Return the name of the non-lazy pointer (if STUB_P is false) or
stub (if STUB_B is true) corresponding to the given name.
If we have a situation like:
PR71767 - If we have a situation like:
global_weak_symbol:
....
@ -494,36 +499,22 @@ Lnon_weak_local:
ld64 will be unable to split this into two atoms (because the "L" makes
the second symbol 'invisible'). This means that legitimate direct accesses
to the second symbol will appear to be non-allowed direct accesses to an
atom of type weak, global which are not allowed.
to the second symbol will appear to be direct accesses to an atom of type
weak, global which are not allowed.
To avoid this, we make the indirections have a leading 'l' (lower-case L)
which has a special meaning: linker can see this and use it to determine
atoms, but it is not placed into the final symbol table.
The implementation here is somewhat heavy-handed in that it will also mark
indirections to the __IMPORT,__pointers section the same way which is
really unnecessary, since ld64 _can_ split those into atoms as they are
fixed size. FIXME: determine if this is a penalty worth extra code to
fix.
To avoid this, we make any data-section indirections have a leading 'l'
(lower-case L) which has a special meaning: linker can see this and use
it to determine atoms, but it is not placed into the final symbol table.
Symbols in the non-lazy symbol pointers section (or stubs) do not have this
problem because ld64 already knows the size of each entry.
*/
const char *
machopic_indirection_name (rtx sym_ref, bool stub_p)
{
char *buffer;
const char *name = XSTR (sym_ref, 0);
size_t namelen = strlen (name);
machopic_indirection *p;
bool needs_quotes;
const char *suffix;
char L_or_l = 'L';
const char *prefix = user_label_prefix;
const char *quote = "";
tree id;
id = maybe_get_identifier (name);
tree id = maybe_get_identifier (name);
if (id)
{
tree id_orig = id;
@ -531,43 +522,47 @@ machopic_indirection_name (rtx sym_ref, bool stub_p)
while (IDENTIFIER_TRANSPARENT_ALIAS (id))
id = TREE_CHAIN (id);
if (id != id_orig)
{
name = IDENTIFIER_POINTER (id);
namelen = strlen (name);
}
name = IDENTIFIER_POINTER (id);
}
const char *prefix = user_label_prefix;
/* If we are emitting the label 'verbatim' then omit the U_L_P and count
the name without the leading '*'. */
if (name[0] == '*')
{
prefix = "";
++name;
--namelen;
}
needs_quotes = name_needs_quotes (name);
if (needs_quotes)
{
quote = "\"";
}
/* Here we are undoing a number of causes that placed some indirections
(apparently erroneously) into the .data section. Specifically, some
symbols that are ABI mandated indirections and some hidden symbols
were being placed there - which cause difficulties with later
versions of ld64. Iff (after these checks) some symbol still gets an
indirection in the data section, we want to adjust the indirection
name to be linker visible to deal with PR71767 (notes above). */
bool nlsp_in_data_section =
! MACHO_SYMBOL_MUST_INDIRECT_P (sym_ref)
&& ! MACHO_SYMBOL_HIDDEN_VIS_P (sym_ref)
&& (machopic_symbol_defined_p (sym_ref) || SYMBOL_REF_LOCAL_P (sym_ref))
&& ! indirect_data (sym_ref);
if (stub_p)
suffix = STUB_SUFFIX;
else
{
suffix = NON_LAZY_POINTER_SUFFIX;
/* Let the linker see this. */
L_or_l = 'l';
}
buffer = XALLOCAVEC (char, 2 /* strlen ("&L") or ("&l") */
+ strlen (prefix)
+ namelen
+ strlen (suffix)
+ 2 * strlen (quote)
+ 1 /* '\0' */);
const char *suffix = stub_p ? STUB_SUFFIX : NON_LAZY_POINTER_SUFFIX;
/* If the indirection is in the data section, let the linker see it. */
char L_or_l = (!stub_p && nlsp_in_data_section) ? 'l' : 'L';
/* We have mangled symbols with spaces and punctuation which typically
need surrounding in quotes for the assembler to consume them. */
const char *quote = name_needs_quotes (name) ? "\"" : "";
char *buffer = XALLOCAVEC (char, 2 /* strlen ("&L") or ("&l") */
+ strlen (prefix)
+ strlen (name)
+ strlen (suffix)
+ 2 * strlen (quote)
+ 1 /* '\0' */);
/* Construct the name of the non-lazy pointer or stub. */
sprintf (buffer, "&%s%c%s%s%s%s", quote, L_or_l, prefix, name, suffix, quote);
sprintf (buffer, "&%s%c%s%s%s%s", quote, L_or_l, prefix, name,
suffix, quote);
if (!machopic_indirections)
machopic_indirections = hash_table<indirection_hasher>::create_ggc (37);
@ -576,10 +571,9 @@ machopic_indirection_name (rtx sym_ref, bool stub_p)
= machopic_indirections->find_slot_with_hash (buffer,
htab_hash_string (buffer),
INSERT);
machopic_indirection *p;
if (*slot)
{
p = *slot;
}
p = *slot;
else
{
p = ggc_alloc<machopic_indirection> ();
@ -587,6 +581,7 @@ machopic_indirection_name (rtx sym_ref, bool stub_p)
p->ptr_name = xstrdup (buffer);
p->stub_p = stub_p;
p->used = false;
p->nlsp_in_data_section = nlsp_in_data_section;
*slot = p;
}
@ -662,7 +657,7 @@ machopic_indirect_data_reference (rtx orig, rtx reg)
/* some other cpu -- writeme! */
gcc_unreachable ();
}
else if (defined)
else if (defined && ! MACHO_SYMBOL_MUST_INDIRECT_P (orig))
{
rtx offset = NULL;
if (DARWIN_PPC || HAVE_lo_sum)
@ -704,6 +699,7 @@ machopic_indirect_data_reference (rtx orig, rtx reg)
machopic_indirection_name (orig, /*stub_p=*/false)));
SYMBOL_REF_DATA (ptr_ref) = SYMBOL_REF_DATA (orig);
SYMBOL_REF_FLAGS (ptr_ref) |= MACHO_SYMBOL_FLAG_INDIRECTION;
ptr_ref = gen_const_mem (Pmode, ptr_ref);
machopic_define_symbol (ptr_ref);
@ -786,7 +782,7 @@ machopic_indirect_data_reference (rtx orig, rtx reg)
rtx
machopic_indirect_call_target (rtx target)
{
if (! darwin_emit_branch_islands)
if (! darwin_symbol_stubs)
return target;
if (GET_CODE (target) != MEM)
@ -794,8 +790,7 @@ machopic_indirect_call_target (rtx target)
if (MACHOPIC_INDIRECT
&& GET_CODE (XEXP (target, 0)) == SYMBOL_REF
&& !(SYMBOL_REF_FLAGS (XEXP (target, 0))
& MACHO_SYMBOL_FLAG_DEFINED))
&& ! MACHO_SYMBOL_DEFINED_P (XEXP (target, 0)))
{
rtx sym_ref = XEXP (target, 0);
const char *stub_name = machopic_indirection_name (sym_ref,
@ -804,6 +799,7 @@ machopic_indirect_call_target (rtx target)
XEXP (target, 0) = gen_rtx_SYMBOL_REF (mode, stub_name);
SYMBOL_REF_DATA (XEXP (target, 0)) = SYMBOL_REF_DATA (sym_ref);
SYMBOL_REF_FLAGS (XEXP (target, 0)) |= MACHO_SYMBOL_FLAG_INDIRECTION;
MEM_READONLY_P (target) = 1;
MEM_NOTRAP_P (target) = 1;
}
@ -841,7 +837,7 @@ machopic_legitimize_pic_address (rtx orig, machine_mode mode, rtx reg)
{
if (reg == 0)
{
gcc_assert (!reload_in_progress);
gcc_assert (!lra_in_progress);
reg = gen_reg_rtx (Pmode);
}
@ -925,7 +921,7 @@ machopic_legitimize_pic_address (rtx orig, machine_mode mode, rtx reg)
emit_use (gen_rtx_REG (Pmode, PIC_OFFSET_TABLE_REGNUM));
#endif
if (reload_in_progress)
if (lra_in_progress)
df_set_regs_ever_live (REGNO (pic), true);
pic_ref = gen_rtx_PLUS (Pmode, pic,
machopic_gen_offset (XEXP (orig, 0)));
@ -949,7 +945,7 @@ machopic_legitimize_pic_address (rtx orig, machine_mode mode, rtx reg)
if (reg == 0)
{
gcc_assert (!reload_in_progress);
gcc_assert (!lra_in_progress);
reg = gen_reg_rtx (Pmode);
}
@ -995,7 +991,7 @@ machopic_legitimize_pic_address (rtx orig, machine_mode mode, rtx reg)
#if 0
emit_use (pic_offset_table_rtx);
#endif
if (reload_in_progress)
if (lra_in_progress)
df_set_regs_ever_live (REGNO (pic), true);
pic_ref = gen_rtx_PLUS (Pmode,
pic,
@ -1072,129 +1068,160 @@ machopic_legitimize_pic_address (rtx orig, machine_mode mode, rtx reg)
return pic_ref;
}
/* Output the stub or non-lazy pointer in *SLOT, if it has been used.
DATA is the FILE* for assembly output. Called from
htab_traverse. */
/* Callbacks to output the stub or non-lazy pointers.
Each works on the item in *SLOT,if it has been used.
DATA is the FILE* for assembly output.
Called from htab_traverses, invoked from machopic_finish(). */
int
machopic_output_data_section_indirection (machopic_indirection **slot,
FILE *asm_out_file)
{
machopic_indirection *p = *slot;
if (!p->used || !p->nlsp_in_data_section)
return 1;
rtx symbol = p->symbol;
/* The original symbol name. */
const char *sym_name = XSTR (symbol, 0);
/* The name of the indirection symbol. */
const char *ptr_name = p->ptr_name;
switch_to_section (data_section);
assemble_align (GET_MODE_ALIGNMENT (Pmode));
assemble_label (asm_out_file, ptr_name);
assemble_integer (gen_rtx_SYMBOL_REF (Pmode, sym_name),
GET_MODE_SIZE (Pmode),
GET_MODE_ALIGNMENT (Pmode), 1);
return 1;
}
int
machopic_output_stub_indirection (machopic_indirection **slot,
FILE *asm_out_file)
{
machopic_indirection *p = *slot;
if (!p->used || !p->stub_p)
return 1;
rtx symbol = p->symbol;
/* The original symbol name. */
const char *sym_name = XSTR (symbol, 0);
/* The name of the stub symbol. */
const char *ptr_name = p->ptr_name;
tree id = maybe_get_identifier (sym_name);
if (id)
{
tree id_orig = id;
while (IDENTIFIER_TRANSPARENT_ALIAS (id))
id = TREE_CHAIN (id);
if (id != id_orig)
sym_name = IDENTIFIER_POINTER (id);
}
char *sym = XALLOCAVEC (char, strlen (sym_name) + 2);
if (sym_name[0] == '*' || sym_name[0] == '&')
strcpy (sym, sym_name + 1);
else if (sym_name[0] == '-' || sym_name[0] == '+')
strcpy (sym, sym_name);
else
sprintf (sym, "%s%s", user_label_prefix, sym_name);
char *stub = XALLOCAVEC (char, strlen (ptr_name) + 2);
if (ptr_name[0] == '*' || ptr_name[0] == '&')
strcpy (stub, ptr_name + 1);
else
sprintf (stub, "%s%s", user_label_prefix, ptr_name);
machopic_output_stub (asm_out_file, sym, stub);
return 1;
}
int
machopic_output_indirection (machopic_indirection **slot, FILE *asm_out_file)
{
machopic_indirection *p = *slot;
rtx symbol;
const char *sym_name;
const char *ptr_name;
if (!p->used)
if (!p->used || p->stub_p || p->nlsp_in_data_section)
return 1;
symbol = p->symbol;
sym_name = XSTR (symbol, 0);
ptr_name = p->ptr_name;
rtx symbol = p->symbol;
/* The original symbol name. */
const char *sym_name = XSTR (symbol, 0);
/* The nonlazy-stub symbol name. */
const char *ptr_name = p->ptr_name;
if (p->stub_p)
switch_to_section (darwin_sections[machopic_nl_symbol_ptr_section]);
/* Mach-O symbols are passed around in code through indirect references and
the original symbol_ref hasn't passed through the generic handling and
reference-catching in output_operand, so we need to manually mark weak
references as such. */
if (SYMBOL_REF_WEAK (symbol))
{
char *sym;
char *stub;
tree id;
tree decl = SYMBOL_REF_DECL (symbol);
gcc_checking_assert (DECL_P (decl));
id = maybe_get_identifier (sym_name);
if (id)
if (decl != NULL_TREE
&& DECL_EXTERNAL (decl) && TREE_PUBLIC (decl)
/* Handle only actual external-only definitions, not
e.g. extern inline code or variables for which
storage has been allocated. */
&& !TREE_STATIC (decl))
{
tree id_orig = id;
while (IDENTIFIER_TRANSPARENT_ALIAS (id))
id = TREE_CHAIN (id);
if (id != id_orig)
sym_name = IDENTIFIER_POINTER (id);
fputs ("\t.weak_reference ", asm_out_file);
assemble_name (asm_out_file, sym_name);
fputc ('\n', asm_out_file);
}
sym = XALLOCAVEC (char, strlen (sym_name) + 2);
if (sym_name[0] == '*' || sym_name[0] == '&')
strcpy (sym, sym_name + 1);
else if (sym_name[0] == '-' || sym_name[0] == '+')
strcpy (sym, sym_name);
else
sprintf (sym, "%s%s", user_label_prefix, sym_name);
stub = XALLOCAVEC (char, strlen (ptr_name) + 2);
if (ptr_name[0] == '*' || ptr_name[0] == '&')
strcpy (stub, ptr_name + 1);
else
sprintf (stub, "%s%s", user_label_prefix, ptr_name);
machopic_output_stub (asm_out_file, sym, stub);
}
else if (! indirect_data (symbol)
&& (machopic_symbol_defined_p (symbol)
|| SYMBOL_REF_LOCAL_P (symbol)))
{
switch_to_section (data_section);
assemble_align (GET_MODE_ALIGNMENT (Pmode));
assemble_label (asm_out_file, ptr_name);
assemble_integer (gen_rtx_SYMBOL_REF (Pmode, sym_name),
GET_MODE_SIZE (Pmode),
GET_MODE_ALIGNMENT (Pmode), 1);
}
else
{
rtx init = const0_rtx;
switch_to_section (darwin_sections[machopic_nl_symbol_ptr_section]);
assemble_name (asm_out_file, ptr_name);
fprintf (asm_out_file, ":\n");
/* Mach-O symbols are passed around in code through indirect
references and the original symbol_ref hasn't passed through
the generic handling and reference-catching in
output_operand, so we need to manually mark weak references
as such. */
if (SYMBOL_REF_WEAK (symbol))
{
tree decl = SYMBOL_REF_DECL (symbol);
gcc_assert (DECL_P (decl));
fprintf (asm_out_file, "\t.indirect_symbol ");
assemble_name (asm_out_file, sym_name);
fprintf (asm_out_file, "\n");
if (decl != NULL_TREE
&& DECL_EXTERNAL (decl) && TREE_PUBLIC (decl)
/* Handle only actual external-only definitions, not
e.g. extern inline code or variables for which
storage has been allocated. */
&& !TREE_STATIC (decl))
{
fputs ("\t.weak_reference ", asm_out_file);
assemble_name (asm_out_file, sym_name);
fputc ('\n', asm_out_file);
}
}
/* Variables that are marked with MACHO_SYMBOL_FLAG_STATIC need to
have their symbol name instead of 0 in the second entry of
the non-lazy symbol pointer data structure when they are
defined. This allows the runtime to rebind newer instances
of the translation unit with the original instance of the
symbol. */
assemble_name (asm_out_file, ptr_name);
fprintf (asm_out_file, ":\n");
rtx init = const0_rtx;
if (MACHO_SYMBOL_STATIC_P (symbol) && machopic_symbol_defined_p (symbol))
init = gen_rtx_SYMBOL_REF (Pmode, sym_name);
fprintf (asm_out_file, "\t.indirect_symbol ");
assemble_name (asm_out_file, sym_name);
fprintf (asm_out_file, "\n");
/* Variables that are marked with MACHO_SYMBOL_STATIC need to
have their symbol name instead of 0 in the second entry of
the non-lazy symbol pointer data structure when they are
defined. This allows the runtime to rebind newer instances
of the translation unit with the original instance of the
symbol. */
if ((SYMBOL_REF_FLAGS (symbol) & MACHO_SYMBOL_STATIC)
&& machopic_symbol_defined_p (symbol))
init = gen_rtx_SYMBOL_REF (Pmode, sym_name);
assemble_integer (init, GET_MODE_SIZE (Pmode),
GET_MODE_ALIGNMENT (Pmode), 1);
}
assemble_integer (init, GET_MODE_SIZE (Pmode),
GET_MODE_ALIGNMENT (Pmode), 1);
return 1;
}
void
static void
machopic_finish (FILE *asm_out_file)
{
if (machopic_indirections)
machopic_indirections
->traverse_noresize<FILE *, machopic_output_indirection> (asm_out_file);
if (!machopic_indirections)
return;
/* First output an symbol indirections that have been placed into .data
(we don't expect these now). */
machopic_indirections->traverse_noresize
<FILE *, machopic_output_data_section_indirection> (asm_out_file);
machopic_indirections->traverse_noresize
<FILE *, machopic_output_stub_indirection> (asm_out_file);
machopic_indirections->traverse_noresize
<FILE *, machopic_output_indirection> (asm_out_file);
}
int
@ -1209,25 +1236,51 @@ machopic_operand_p (rtx op)
&& XINT (XEXP (op, 0), 1) == UNSPEC_MACHOPIC_OFFSET);
}
/* This function records whether a given name corresponds to a defined
or undefined function or variable, for machopic_classify_ident to
use later. */
/* This function:
computes and caches a series of flags that characterise the symbol's
properties that affect Mach-O code gen (including accidental cases
from older toolchains).
TODO:
Here we also need to do enough analysis to determine if a symbol's
name needs to be made linker-visible. This is more tricky - since
it depends on whether we've previously seen a global weak definition
in the same section.
*/
void
darwin_encode_section_info (tree decl, rtx rtl, int first ATTRIBUTE_UNUSED)
darwin_encode_section_info (tree decl, rtx rtl, int first)
{
rtx sym_ref;
/* Do the standard encoding things first. */
default_encode_section_info (decl, rtl, first);
if (TREE_CODE (decl) != FUNCTION_DECL && TREE_CODE (decl) != VAR_DECL)
/* Careful not to prod global register variables. */
if (!MEM_P (rtl))
return;
sym_ref = XEXP (rtl, 0);
if (TREE_CODE (decl) == VAR_DECL)
/* Do the standard encoding things first; this sets:
SYMBOL_FLAG_FUNCTION,
SYMBOL_FLAG_LOCAL, (binds_local_p)
TLS_MODEL, SYMBOL_FLAG_SMALL
SYMBOL_FLAG_EXTERNAL. */
default_encode_section_info (decl, rtl, first);
if (! VAR_OR_FUNCTION_DECL_P (decl))
return;
rtx sym_ref = XEXP (rtl, 0);
if (VAR_P (decl))
SYMBOL_REF_FLAGS (sym_ref) |= MACHO_SYMBOL_FLAG_VARIABLE;
/* Only really common if there's no initialiser. */
bool really_common_p = (DECL_COMMON (decl)
&& (DECL_INITIAL (decl) == NULL
|| (!in_lto_p
&& DECL_INITIAL (decl) == error_mark_node)));
/* For Darwin, if we have specified visibility and it's not the default
that's counted 'hidden'. */
if (DECL_VISIBILITY_SPECIFIED (decl)
&& DECL_VISIBILITY (decl) != VISIBILITY_DEFAULT)
SYMBOL_REF_FLAGS (sym_ref) |= MACHO_SYMBOL_FLAG_HIDDEN_VIS;
if (!DECL_EXTERNAL (decl)
&& (!TREE_PUBLIC (decl) || !DECL_WEAK (decl))
&& ! lookup_attribute ("weakref", DECL_ATTRIBUTES (decl))
@ -1238,7 +1291,13 @@ darwin_encode_section_info (tree decl, rtx rtl, int first ATTRIBUTE_UNUSED)
SYMBOL_REF_FLAGS (sym_ref) |= MACHO_SYMBOL_FLAG_DEFINED;
if (! TREE_PUBLIC (decl))
SYMBOL_REF_FLAGS (sym_ref) |= MACHO_SYMBOL_STATIC;
SYMBOL_REF_FLAGS (sym_ref) |= MACHO_SYMBOL_FLAG_STATIC;
/* Short cut check for Darwin 'must indirect' rules. */
if (really_common_p
|| (DECL_WEAK (decl) && ! MACHO_SYMBOL_HIDDEN_VIS_P (sym_ref))
|| lookup_attribute ("weakref", DECL_ATTRIBUTES (decl)))
SYMBOL_REF_FLAGS (sym_ref) |= MACHO_SYMBOL_FLAG_MUST_INDIRECT;
}
void
@ -1255,12 +1314,13 @@ darwin_mark_decl_preserved (const char *name)
}
static section *
darwin_rodata_section (int use_coal, bool zsize)
darwin_rodata_section (int use_coal, bool zsize, int reloc)
{
return (use_coal
? darwin_sections[const_coal_section]
: (zsize ? darwin_sections[zobj_const_section]
: darwin_sections[const_section]));
: reloc ? darwin_sections[const_data_section]
: darwin_sections[const_section]));
}
static section *
@ -1553,7 +1613,7 @@ machopic_select_section (tree decl,
case SECCAT_RODATA:
case SECCAT_SRODATA:
base_section = darwin_rodata_section (use_coal, zsize);
base_section = darwin_rodata_section (use_coal, zsize, reloc);
break;
case SECCAT_RODATA_MERGE_STR:
@ -2082,11 +2142,11 @@ darwin_emit_unwind_label (FILE *file, tree decl, int for_eh, int empty)
static int invok_count = 0;
static tree last_fun_decl = NULL_TREE;
/* We use the linker to emit the .eh labels for Darwin 9 and above. */
if (! for_eh || generating_for_darwin_version >= 9)
/* Modern linkers can produce distinct FDEs without compiler support. */
if (! for_eh || ! ld_needs_eh_markers)
return;
/* FIXME: This only works when the eh for all sections of a function is
/* FIXME: This only works when the eh for all sections of a function are
emitted at the same time. If that changes, we would need to use a lookup
table of some form to determine what to do. Also, we should emit the
unadorned label for the partition containing the public label for a
@ -2908,12 +2968,10 @@ darwin_file_end (void)
if (flag_objc_abi >= 2)
{
flags = 16;
output_section_asm_op
(darwin_sections[objc2_image_info_section]->unnamed.data);
switch_to_section (darwin_sections[objc2_image_info_section]);
}
else
output_section_asm_op
(darwin_sections[objc_image_info_section]->unnamed.data);
switch_to_section (darwin_sections[objc_image_info_section]);
ASM_OUTPUT_ALIGN (asm_out_file, 2);
fputs ("L_OBJC_ImageInfo:\n", asm_out_file);
@ -3119,17 +3177,19 @@ darwin_override_options (void)
: (generating_for_darwin_version >= 9) ? 1
: 0);
/* Objective-C family ABI 2 is only valid for next/m64 at present. */
if (global_options_set.x_flag_objc_abi && flag_next_runtime)
{
if (TARGET_64BIT && global_options.x_flag_objc_abi < 2)
error_at (UNKNOWN_LOCATION, "%<-fobjc-abi-version%> >= 2 must be"
" used for %<-m64%> targets with"
" %<-fnext-runtime%>");
if (!TARGET_64BIT && global_options.x_flag_objc_abi >= 2)
error_at (UNKNOWN_LOCATION, "%<-fobjc-abi-version%> >= 2 is not"
" supported on %<-m32%> targets with"
" %<-fnext-runtime%>");
if (TARGET_64BIT && global_options.x_flag_objc_abi != 2)
/* The Objective-C family ABI 2 is the only valid version NeXT/m64. */
error_at (UNKNOWN_LOCATION,
"%<-fobjc-abi-version%> 2 must be used for 64 bit targets"
" with %<-fnext-runtime%>");
else if (!TARGET_64BIT && global_options.x_flag_objc_abi >= 2)
/* ABI versions 0 and 1 are the only valid versions NeXT/m32. */
error_at (UNKNOWN_LOCATION,
"%<-fobjc-abi-version%> %d is not supported for 32 bit"
" targets with %<-fnext-runtime%>",
global_options.x_flag_objc_abi);
}
/* Don't emit DWARF3/4 unless specifically selected. This is a
@ -3197,8 +3257,6 @@ darwin_override_options (void)
/* so no tables either.. */
flag_unwind_tables = 0;
flag_asynchronous_unwind_tables = 0;
/* We still need to emit branch islands for kernel context. */
darwin_emit_branch_islands = true;
}
if (flag_var_tracking_uninit == 0
@ -3208,6 +3266,8 @@ darwin_override_options (void)
&& write_symbols == DWARF2_DEBUG)
flag_var_tracking_uninit = flag_var_tracking;
/* Final check on PCI options; for Darwin these are not dependent on the PIE
ones, although PIE does require PIC to support it. */
if (MACHO_DYNAMIC_NO_PIC_P)
{
if (flag_pic)
@ -3216,17 +3276,52 @@ darwin_override_options (void)
" %<-fpie%> or %<-fPIE%>");
flag_pic = 0;
}
else if (flag_pic == 1)
else if (flag_pic == 1
|| (flag_pic == 0 && !(flag_mkernel || flag_apple_kext)))
{
/* Darwin's -fpic is -fPIC. */
/* Darwin's -fpic is -fPIC.
We only support "static" code in the kernel and kernel exts. */
flag_pic = 2;
}
/* It is assumed that branch island stubs are needed for earlier systems. */
if (generating_for_darwin_version < 9)
darwin_emit_branch_islands = true;
else
emit_aligned_common = true; /* Later systems can support aligned common. */
/* Linkers >= ld64-62.1 (at least) are capable of making the necessary PIC
indirections and we no longer need to emit pic symbol stubs.
However, if we are generating code for earlier ones (or for use in the
kernel) the stubs might still be required, and this will be set true.
If the user sets it on or off - then that takes precedence.
Linkers that don't need stubs, don't need the EH symbol markers either.
*/
if (!global_options_set.x_darwin_symbol_stubs)
{
if (darwin_target_linker)
{
if (strverscmp (darwin_target_linker, MIN_LD64_OMIT_STUBS) < 0)
{
darwin_symbol_stubs = true;
ld_needs_eh_markers = true;
}
}
else if (generating_for_darwin_version < 9)
{
/* If we don't know the linker version and we're targeting an old
system, we know no better than to assume the use of an earlier
linker. */
darwin_symbol_stubs = true;
ld_needs_eh_markers = true;
}
}
else if (DARWIN_X86 && darwin_symbol_stubs && TARGET_64BIT)
{
inform (input_location,
"%<-msymbol-stubs%> is not required for 64b code (ignored)");
darwin_symbol_stubs = false;
}
if (generating_for_darwin_version >= 9)
/* Later systems can support aligned common. */
emit_aligned_common = true;
/* The c_dialect...() macros are not available to us here. */
darwin_running_cxx = (strstr (lang_hooks.name, "C++") != 0);
@ -3674,21 +3769,4 @@ default_function_sections:
: text_section;
}
/* When a function is partitioned between sections, we need to insert a label
at the start of each new chunk - so that it may become a valid 'atom' for
eh and debug purposes. Without this the linker will emit warnings if one
tries to add line location information (since the switched fragment will
be anonymous). */
void
darwin_function_switched_text_sections (FILE *fp, tree decl, bool new_is_cold)
{
char buf[128];
snprintf (buf, 128, "%s%s",new_is_cold?"__cold_sect_of_":"__hot_sect_of_",
IDENTIFIER_POINTER (DECL_NAME (decl)));
/* Make sure we pick up all the relevant quotes etc. */
assemble_name_raw (fp, (const char *) buf);
fputs (":\n", fp);
}
#include "gt-darwin.h"

View File

@ -127,6 +127,24 @@ extern GTY(()) int darwin_ms_struct;
"%{fapple-kext|mkernel:-static}", \
"%{shared:-Zdynamiclib} %<shared"
#if LD64_HAS_EXPORT_DYNAMIC
#define DARWIN_RDYNAMIC "%{rdynamic:-export_dynamic}"
#else
#define DARWIN_RDYNAMIC "%{rdynamic:%nrdynamic is not supported}"
#endif
/* FIXME: we should check that the linker supports the -pie and -no_pie.
options. */
#define DARWIN_PIE_SPEC \
"%{pie|fpie|fPIE:\
%{mdynamic-no-pic: \
%n'-mdynamic-no-pic' overrides '-pie', '-fpie' or '-fPIE'; \
:%:version-compare(>= 10.5 mmacosx-version-min= -pie) }} "
#define DARWIN_NOPIE_SPEC \
"%{no-pie|fno-pie|fno-PIE: \
%:version-compare(>= 10.7 mmacosx-version-min= -no_pie) }"
#define DARWIN_CC1_SPEC \
"%{findirect-virtual-calls: -fapple-kext} %<findirect-virtual-calls " \
"%{fterminated-vtables: -fapple-kext} %<fterminated-vtables " \
@ -157,26 +175,37 @@ extern GTY(()) int darwin_ms_struct;
#define CPP_SPEC "%{static:%{!dynamic:-D__STATIC__}}%{!static:-D__DYNAMIC__}" \
" %{pthread:-D_REENTRANT}"
/* This is mostly a clone of the standard LINK_COMMAND_SPEC, plus
precomp, libtool, and fat build additions.
/* This is a fix for PR41260 by passing -no_compact_unwind on darwin10 and
later until the assembler, linker and libunwind are able to deal with the
output from GCC.
FIXME: we should check that the linker supports the option.
*/
#define DARWIN_NOCOMPACT_UNWIND \
" %:version-compare(>= 10.6 mmacosx-version-min= -no_compact_unwind) "
/* In Darwin linker specs we can put -lcrt0.o and ld will search the library
path for crt0.o or -lcrtx.a and it will search for for libcrtx.a. As for
other ports, we can also put xxx.{o,a}%s and get the appropriate complete
startfile absolute directory. This latter point is important when we want
to override ld's rule of .dylib being found ahead of .a and the user wants
the convenience library to be linked. */
/* The LINK_COMMAND spec is mostly a clone of the standard LINK_COMMAND_SPEC,
plus precomp, libtool, and fat build additions.
In general, random Darwin linker flags should go into LINK_SPEC
instead of LINK_COMMAND_SPEC. The command spec is better for
specifying the handling of options understood by generic Unix
linkers, and for positional arguments like libraries. */
#if LD64_HAS_EXPORT_DYNAMIC
#define DARWIN_EXPORT_DYNAMIC " %{rdynamic:-export_dynamic}"
#else
#define DARWIN_EXPORT_DYNAMIC " %{rdynamic: %nrdynamic is not supported}"
#endif
#define LINK_COMMAND_SPEC_A \
"%{!fdump=*:%{!fsyntax-only:%{!c:%{!M:%{!MM:%{!E:%{!S:\
%(linker)" \
LINK_PLUGIN_SPEC \
"%{flto*:%<fcompare-debug*} \
%{flto*} \
%{flto} %{fno-lto} %{flto=*} \
%l " LINK_COMPRESS_DEBUG_SPEC \
"%X %{s} %{t} %{Z} %{u*} \
%{e*} %{r} \
@ -192,10 +221,14 @@ extern GTY(()) int darwin_ms_struct;
%{%:sanitize(address): -lasan } \
%{%:sanitize(undefined): -lubsan } \
%(link_ssp) \
" DARWIN_EXPORT_DYNAMIC " %<rdynamic \
%(link_gcc_c_sequence) \
}}\
%{!nostdlib:%{!nostartfiles:%E}} %{T*} %{F*} }}}}}}}"
%{!nostdlib:%{!r:%{!nostartfiles:%E}}} %{T*} %{F*} "\
DARWIN_PIE_SPEC \
DARWIN_NOPIE_SPEC \
DARWIN_RDYNAMIC \
DARWIN_NOCOMPACT_UNWIND \
"}}}}}}} %<pie %<no-pie %<rdynamic "
#define DSYMUTIL "\ndsymutil"
@ -232,8 +265,6 @@ extern GTY(()) int darwin_ms_struct;
#define STANDARD_STARTFILE_PREFIX_1 ""
#define STANDARD_STARTFILE_PREFIX_2 ""
#define DARWIN_PIE_SPEC "%{fpie|pie|fPIE:}"
/* Please keep the random linker options in alphabetical order (modulo
'Z' and 'no' prefixes). Note that options taking arguments may appear
multiple times on a command line with different arguments each time,
@ -297,7 +328,6 @@ extern GTY(()) int darwin_ms_struct;
%:version-compare(< 10.5 mmacosx-version-min= -multiply_defined) \
%:version-compare(< 10.5 mmacosx-version-min= suppress)}} \
%{Zmultiplydefinedunused*:-multiply_defined_unused %*} \
" DARWIN_PIE_SPEC " \
%{prebind} %{noprebind} %{nofixprebinding} %{prebind_all_twolevel_modules} \
%{read_only_relocs} \
%{sectcreate*} %{sectorder*} %{seg1addr*} %{segprot*} \
@ -329,43 +359,42 @@ extern GTY(()) int darwin_ms_struct;
/* Support -mmacosx-version-min by supplying different (stub) libgcc_s.dylib
libraries to link against, and by not linking against libgcc_s on
earlier-than-10.3.9.
earlier-than-10.3.9. If we need exceptions, prior to 10.3.9, then we have
to link the static eh lib, since there's no shared version on the system.
Note that by default, -lgcc_eh is not linked against! This is
because in a future version of Darwin the EH frame information may
be in a new format, or the fallback routine might be changed; if
you want to explicitly link against the static version of those
routines, because you know you don't need to unwind through system
libraries, you need to explicitly say -static-libgcc.
Note that by default, except as above, -lgcc_eh is not linked against.
This is because,in general, we need to unwind through system libraries that
are linked with the shared unwinder in libunwind (or libgcc_s for 10.4/5).
If it is linked against, it has to be before -lgcc, because it may
The static version of the current libgcc unwinder (which differs from the
implementation in libunwind.dylib on systems Darwin10 [10.6]+) can be used
by specifying -static-libgcc.
If libgcc_eh is linked against, it has to be before -lgcc, because it might
need symbols from -lgcc. */
#undef REAL_LIBGCC_SPEC
#define REAL_LIBGCC_SPEC \
"%{static-libgcc|static: -lgcc_eh -lgcc; \
shared-libgcc|fexceptions|fgnu-runtime: \
%:version-compare(!> 10.5 mmacosx-version-min= -lgcc_s.10.4) \
shared-libgcc|fexceptions|fobjc-exceptions|fgnu-runtime: \
%:version-compare(!> 10.3.9 mmacosx-version-min= -lgcc_eh) \
%:version-compare(>< 10.3.9 10.5 mmacosx-version-min= -lgcc_s.10.4) \
%:version-compare(>< 10.5 10.6 mmacosx-version-min= -lgcc_s.10.5) \
%:version-compare(!> 10.5 mmacosx-version-min= -lgcc_ext.10.4) \
%:version-compare(>< 10.3.9 10.5 mmacosx-version-min= -lgcc_ext.10.4) \
%:version-compare(>= 10.5 mmacosx-version-min= -lgcc_ext.10.5) \
-lgcc ; \
:%:version-compare(>< 10.3.9 10.5 mmacosx-version-min= -lgcc_s.10.4) \
%:version-compare(>< 10.5 10.6 mmacosx-version-min= -lgcc_s.10.5) \
%:version-compare(!> 10.5 mmacosx-version-min= -lgcc_ext.10.4) \
%:version-compare(>< 10.3.9 10.5 mmacosx-version-min= -lgcc_ext.10.4) \
%:version-compare(>= 10.5 mmacosx-version-min= -lgcc_ext.10.5) \
-lgcc }"
/* We specify crt0.o as -lcrt0.o so that ld will search the library path.
crt3.o provides __cxa_atexit on systems that don't have it. Since
it's only used with C++, which requires passing -shared-libgcc, key
off that to avoid unnecessarily adding a destructor to every
powerpc program built. */
/* We specify crt0.o as -lcrt0.o so that ld will search the library path. */
#undef STARTFILE_SPEC
#define STARTFILE_SPEC \
"%{Zdynamiclib: %(darwin_dylib1) %{fgnu-tm: -lcrttms.o}} \
%{!Zdynamiclib:%{Zbundle:%{!static: \
"%{Zdynamiclib: %(darwin_dylib1) %{fgnu-tm: -lcrttms.o}} \
%{!Zdynamiclib:%{Zbundle:%{!static: \
%:version-compare(< 10.6 mmacosx-version-min= -lbundle1.o) \
%{fgnu-tm: -lcrttms.o}}} \
%{!Zbundle:%{pg:%{static:-lgcrt0.o} \
@ -379,7 +408,7 @@ extern GTY(()) int darwin_ms_struct;
%{!object:%{preload:-lcrt0.o} \
%{!preload: %(darwin_crt1) \
%(darwin_crt2)}}}}}} \
%{shared-libgcc:%:version-compare(< 10.5 mmacosx-version-min= crt3.o%s)}"
%(darwin_crt3)"
/* We want a destructor last in the list. */
#define TM_DESTRUCTOR "%{fgnu-tm: -lcrttme.o}"
@ -387,18 +416,30 @@ extern GTY(()) int darwin_ms_struct;
#define DARWIN_EXTRA_SPECS \
{ "darwin_crt1", DARWIN_CRT1_SPEC }, \
{ "darwin_crt2", DARWIN_CRT2_SPEC }, \
{ "darwin_crt3", DARWIN_CRT3_SPEC }, \
{ "darwin_dylib1", DARWIN_DYLIB1_SPEC },
#define DARWIN_DYLIB1_SPEC \
"%:version-compare(!> 10.5 mmacosx-version-min= -ldylib1.o) \
%:version-compare(>< 10.5 10.6 mmacosx-version-min= -ldylib1.10.5.o)"
#define DARWIN_CRT1_SPEC \
"%:version-compare(!> 10.5 mmacosx-version-min= -lcrt1.o) \
%:version-compare(>< 10.5 10.6 mmacosx-version-min= -lcrt1.10.5.o) \
%:version-compare(>< 10.6 10.8 mmacosx-version-min= -lcrt1.10.6.o) \
%{fgnu-tm: -lcrttms.o}"
#define DARWIN_CRT2_SPEC ""
/* crt3.o provides __cxa_atexit on systems that don't have it (and a fix
up for faulty versions on 10.4). Since it's only used with C++, which
requires passing -shared-libgcc, key off that to avoid unnecessarily
adding a destructor to every program built for 10.4 or earlier. */
#define DARWIN_CRT3_SPEC \
"%{shared-libgcc:%:version-compare(< 10.5 mmacosx-version-min= crt3.o%s)}"
#define DARWIN_DYLIB1_SPEC \
"%:version-compare(!> 10.5 mmacosx-version-min= -ldylib1.o) \
%:version-compare(>< 10.5 10.6 mmacosx-version-min= -ldylib1.10.5.o)"
#ifdef HAVE_AS_MMACOSX_VERSION_MIN_OPTION
/* Emit macosx version (but only major). */
#define ASM_MMACOSX_VERSION_MIN_SPEC \
@ -434,20 +475,29 @@ extern GTY(()) int darwin_ms_struct;
#define DWARF2_DEBUGGING_INFO 1
#define DEBUG_FRAME_SECTION "__DWARF,__debug_frame,regular,debug"
#define DEBUG_INFO_SECTION "__DWARF,__debug_info,regular,debug"
#define DEBUG_ABBREV_SECTION "__DWARF,__debug_abbrev,regular,debug"
#define DEBUG_ARANGES_SECTION "__DWARF,__debug_aranges,regular,debug"
#define DEBUG_MACINFO_SECTION "__DWARF,__debug_macinfo,regular,debug"
#define DEBUG_LINE_SECTION "__DWARF,__debug_line,regular,debug"
#define DEBUG_LOC_SECTION "__DWARF,__debug_loc,regular,debug"
#define DEBUG_PUBNAMES_SECTION "__DWARF,__debug_pubnames,regular,debug"
#define DEBUG_PUBTYPES_SECTION "__DWARF,__debug_pubtypes,regular,debug"
#define DEBUG_STR_SECTION "__DWARF,__debug_str,regular,debug"
#define DEBUG_RANGES_SECTION "__DWARF,__debug_ranges,regular,debug"
#define DEBUG_MACRO_SECTION "__DWARF,__debug_macro,regular,debug"
#define DEBUG_FRAME_SECTION "__DWARF,__debug_frame,regular,debug"
#define DEBUG_INFO_SECTION "__DWARF,__debug_info,regular,debug"
#define DEBUG_ABBREV_SECTION "__DWARF,__debug_abbrev,regular,debug"
#define DEBUG_ARANGES_SECTION "__DWARF,__debug_aranges,regular,debug"
#define DEBUG_MACINFO_SECTION "__DWARF,__debug_macinfo,regular,debug"
#define DEBUG_LINE_SECTION "__DWARF,__debug_line,regular,debug"
#define DEBUG_LOC_SECTION "__DWARF,__debug_loc,regular,debug"
#define DEBUG_LOCLISTS_SECTION "__DWARF,__debug_loclists,regular,debug"
#define DEBUG_STR_SECTION "__DWARF,__debug_str,regular,debug"
#define DEBUG_STR_OFFSETS_SECTION "__DWARF,__debug_str_offs,regular,debug"
#define DEBUG_RANGES_SECTION "__DWARF,__debug_ranges,regular,debug"
#define DEBUG_RNGLISTS_SECTION "__DWARF,__debug_rnglists,regular,debug"
#define DEBUG_MACRO_SECTION "__DWARF,__debug_macro,regular,debug"
#define TARGET_WANT_DEBUG_PUB_SECTIONS true
#define DEBUG_PUBNAMES_SECTION ((debug_generate_pub_sections == 2) \
? "__DWARF,__debug_gnu_pubn,regular,debug" \
: "__DWARF,__debug_pubnames,regular,debug")
#define DEBUG_PUBTYPES_SECTION ((debug_generate_pub_sections == 2) \
? "__DWARF,__debug_gnu_pubt,regular,debug" \
: "__DWARF,__debug_pubtypes,regular,debug")
/* When generating stabs debugging, use N_BINCL entries. */
@ -495,11 +545,6 @@ extern GTY(()) int darwin_ms_struct;
links to, so there's no need for weak-ness for that. */
#define GTHREAD_USE_WEAK 0
/* The Darwin linker doesn't want coalesced symbols to appear in
a static archive's table of contents. */
#undef TARGET_WEAK_NOT_IN_ARCHIVE_TOC
#define TARGET_WEAK_NOT_IN_ARCHIVE_TOC 1
/* On Darwin, we don't (at the time of writing) have linkonce sections
with names, so it's safe to make the class data not comdat. */
#define TARGET_CXX_CLASS_DATA_ALWAYS_COMDAT hook_bool_void_false
@ -705,10 +750,6 @@ extern GTY(()) section * darwin_sections[NUM_DARWIN_SECTIONS];
#undef TARGET_ASM_FUNCTION_SECTION
#define TARGET_ASM_FUNCTION_SECTION darwin_function_section
#undef TARGET_ASM_FUNCTION_SWITCHED_TEXT_SECTIONS
#define TARGET_ASM_FUNCTION_SWITCHED_TEXT_SECTIONS \
darwin_function_switched_text_sections
#undef TARGET_ASM_SELECT_RTX_SECTION
#define TARGET_ASM_SELECT_RTX_SECTION machopic_select_rtx_section
#undef TARGET_ASM_UNIQUE_SECTION
@ -755,21 +796,52 @@ extern GTY(()) section * darwin_sections[NUM_DARWIN_SECTIONS];
#undef TARGET_ASM_MARK_DECL_PRESERVED
#define TARGET_ASM_MARK_DECL_PRESERVED darwin_mark_decl_preserved
/* Set on a symbol with SYMBOL_FLAG_FUNCTION or
MACHO_SYMBOL_FLAG_VARIABLE to indicate that the function or
variable has been defined in this translation unit.
When porting Mach-O to new architectures you need to make
sure these aren't clobbered by the backend. */
/* Any port using this header needs to define the first available
subtarget symbol bit: SYMBOL_FLAG_SUBT_DEP. */
#define MACHO_SYMBOL_FLAG_VARIABLE (SYMBOL_FLAG_MACH_DEP)
#define MACHO_SYMBOL_FLAG_DEFINED ((SYMBOL_FLAG_MACH_DEP) << 1)
/* Is a variable. */
#define MACHO_SYMBOL_FLAG_VARIABLE (SYMBOL_FLAG_SUBT_DEP)
#define MACHO_SYMBOL_VARIABLE_P(RTX) \
((SYMBOL_REF_FLAGS (RTX) & MACHO_SYMBOL_FLAG_VARIABLE) != 0)
/* Set on a symbol that must be indirected, even when there is a
definition in the TU. The ABI mandates that common symbols are so
indirected, as are weak. If 'fix-and-continue' is operational then
data symbols might also be. */
#define MACHO_SYMBOL_FLAG_MUST_INDIRECT ((SYMBOL_FLAG_SUBT_DEP) << 1)
#define MACHO_SYMBOL_MUST_INDIRECT_P(RTX) \
((SYMBOL_REF_FLAGS (RTX) & MACHO_SYMBOL_FLAG_MUST_INDIRECT) != 0)
/* Set on a symbol with SYMBOL_FLAG_FUNCTION or MACHO_SYMBOL_FLAG_VARIABLE
to indicate that the function or variable is considered defined in this
translation unit. */
#define MACHO_SYMBOL_FLAG_DEFINED ((SYMBOL_FLAG_SUBT_DEP) << 2)
#define MACHO_SYMBOL_DEFINED_P(RTX) \
((SYMBOL_REF_FLAGS (RTX) & MACHO_SYMBOL_FLAG_DEFINED) != 0)
/* Set on a symbol that has specified non-default visibility. */
#define MACHO_SYMBOL_FLAG_HIDDEN_VIS ((SYMBOL_FLAG_SUBT_DEP) << 3)
#define MACHO_SYMBOL_HIDDEN_VIS_P(RTX) \
((SYMBOL_REF_FLAGS (RTX) & MACHO_SYMBOL_FLAG_HIDDEN_VIS) != 0)
/* Set on a symbol that is a pic stub or symbol indirection (i.e. the
L_xxxxx${stub,non_lazy_ptr,lazy_ptr}. */
#define MACHO_SYMBOL_FLAG_INDIRECTION ((SYMBOL_FLAG_SUBT_DEP) << 5)
#define MACHO_SYMBOL_INDIRECTION_P(RTX) \
((SYMBOL_REF_FLAGS (RTX) & MACHO_SYMBOL_FLAG_INDIRECTION) != 0)
/* Set on a symbol to indicate when fix-and-continue style code
generation is being used and the symbol refers to a static symbol
that should be rebound from new instances of a translation unit to
the original instance of the data. */
#define MACHO_SYMBOL_STATIC ((SYMBOL_FLAG_MACH_DEP) << 2)
#define MACHO_SYMBOL_FLAG_STATIC ((SYMBOL_FLAG_SUBT_DEP) << 6)
#define MACHO_SYMBOL_STATIC_P(RTX) \
((SYMBOL_REF_FLAGS (RTX) & MACHO_SYMBOL_FLAG_STATIC) != 0)
/* Symbolic names for various things we might know about a symbol. */
@ -962,8 +1034,12 @@ extern void darwin_driver_init (unsigned int *,struct cl_decoded_option **);
_tested_ version known to support this so far. */
#define MIN_LD64_NO_COAL_SECTS "236.4"
/* From at least version 62.1, ld64 can build symbol indirection stubs as
needed, and there is no need for the compiler to emit them. */
#define MIN_LD64_OMIT_STUBS "85.2"
#ifndef LD64_VERSION
#define LD64_VERSION "85.2"
#define LD64_VERSION "62.1"
#else
#define DEF_LD64 LD64_VERSION
#endif

View File

@ -18,197 +18,29 @@
; along with GCC; see the file COPYING3. If not see
; <http://www.gnu.org/licenses/>.
; Various linker options have a -Z added so that they can get to specs
; processing without interference. Note that an option name with a
; prefix that matches another option name, that also takes an
; argument, being mapped to a -Z linker option, needs to be modified
; so the prefix is different, otherwise a '*' after the shorter option
; will match with the longer one.
; We have a lot of Driver options, many of which are obsolete or very very
; rarely used so, to keep this file easier to manage:
all_load
Driver Alias(Zall_load)
; Please place all Non-driver options first (in alphabetical order), followed
; by Driver-only options.
allowable_client
Driver Separate Alias(Zallowable_client)
arch
Driver RejectNegative Separate
arch_errors_fatal
Driver Alias(Zarch_errors_fatal)
asm_macosx_version_min=
Driver RejectNegative Joined
bind_at_load
Driver Alias(Zbind_at_load)
bundle
Driver Alias(Zbundle)
bundle_loader
Driver Separate Alias(Zbundle_loader)
dead_strip
Driver Alias(Zdead_strip)
; Non-driver options.
dependency-file
C ObjC C++ ObjC++ Separate Alias(MF) MissingArgError(missing filename after %qs)
dylib_file
Driver Separate Alias(Zdylib_file)
fapple-kext
Target Report C++ Var(flag_apple_kext)
Generate code for darwin loadable kernel extensions.
dylinker
Driver
dynamic
Driver Alias(Zdynamic)
dynamiclib
Driver Alias(Zdynamiclib)
exported_symbols_list
Driver Separate Alias(Zexported_symbols_list)
filelist
Driver RejectNegative Separate
findirect-virtual-calls
Driver RejectNegative
flat_namespace
Driver RejectNegative Alias(Zflat_namespace)
force_cpusubtype_ALL
Driver RejectNegative Alias(Zforce_cpusubtype_ALL)
force_flat_namespace
Driver RejectNegative Alias(Zforce_flat_namespace)
framework
Driver RejectNegative Separate
fterminated-vtables
Driver RejectNegative
gfull
Driver
gused
Driver
headerpad_max_install_names
Driver
image_base
Driver Separate Alias(Zimage_base)
init
Driver Separate Alias(Zinit)
install_name
Driver Separate Alias(Zinstall_name)
keep_private_externs
Driver
iframework
Target RejectNegative C ObjC C++ ObjC++ Joined Separate
-iframework <dir> Add <dir> to the end of the system framework include path.
mconstant-cfstrings
Target Report Var(darwin_constant_cfstrings) Init(1)
Generate compile-time CFString objects.
multi_module
Driver RejectNegative Alias(Zmulti_module)
multiply_defined
Driver RejectNegative Separate Alias(Zmultiply_defined)
multiply_defined_unused
Driver RejectNegative Separate Alias(Zmultiplydefinedunused)
no_dead_strip_inits_and_terms
Driver Alias(Zno_dead_strip_inits_and_terms)
nofixprebinding
Driver
nomultidefs
Driver
noprebind
Driver
noseglinkedit
Driver
object
Driver
prebind
Driver
prebind_all_twolevel_modules
Driver
preload
Driver
private_bundle
Driver
pthread
Driver
rdynamic
Driver
seg_addr_table
Driver Separate Alias(Zseg_addr_table)
seg_addr_table_filename
Driver Separate Alias(Zfn_seg_addr_table_filename)
segaddr
Driver Separate Args(2) Alias(Zsegaddr)
seglinkedit
Driver
segs_read_only_addr
Driver Separate Alias(Zsegs_read_only_addr)
segs_read_write_addr
Driver Separate Alias(Zsegs_read_write_addr)
single_module
Driver Alias(Zsingle_module)
twolevel_namespace
Driver
twolevel_namespace_hints
Driver
umbrella
Driver Separate Alias(Zumbrella)
unexported_symbols_list
Driver Separate Alias(Zunexported_symbols_list)
weak_reference_mismatches
Driver Separate Alias(Zweak_reference_mismatches)
whatsloaded
Driver
whyload
Driver
y
Driver Joined
Mach
Driver
Wnonportable-cfstrings
Target Report Var(darwin_warn_nonportable_cfstrings) Init(1) Warning
Warn if constant CFString objects contain non-portable characters.
@ -226,32 +58,342 @@ mfix-and-continue
Target Report Var(darwin_fix_and_continue)
Generate code suitable for fast turn around debugging.
mkernel
Target Report Var(flag_mkernel)
Generate code for the kernel or loadable kernel extensions.
; The Init here is for the convenience of GCC developers, so that cc1
; and cc1plus don't crash if no -mmacosx-version-min is passed. The
; driver will always pass a -mmacosx-version-min, so in normal use the
; Init is never used.
mmacosx-version-min=
Target Joined Report Var(darwin_macosx_version_min) Init(DEF_MIN_OSX_VERSION)
Target RejectNegative Joined Report Var(darwin_macosx_version_min) Init(DEF_MIN_OSX_VERSION)
The earliest MacOS X version on which this program will run.
; Really, only relevant to PowerPC which has a 4 byte bool by default.
mone-byte-bool
Target RejectNegative Report Var(darwin_one_byte_bool)
Set sizeof(bool) to 1.
fapple-kext
Target Report C++ Var(flag_apple_kext)
Generate code for darwin loadable kernel extensions.
msymbol-stubs
Target Report Var(darwin_symbol_stubs) Init(0)
Force generation of external symbol indirection stubs.
mkernel
Target Report Var(flag_mkernel)
Generate code for the kernel or loadable kernel extensions.
; Some code-gen may be improved / adjusted if the linker is sufficiently modern.
mtarget-linker=
Target RejectNegative Joined Report Alias(mtarget-linker)
iframework
Target RejectNegative C ObjC C++ ObjC++ Joined Separate
-iframework <dir> Add <dir> to the end of the system framework include path.
mtarget-linker
Target RejectNegative Joined Separate Report Var(darwin_target_linker) Init(LD64_VERSION)
The version of ld64 in use for this toolchain.
X
; Driver options.
all_load
Driver RejectNegative Alias(Zall_load)
Loads all members of archive libraries
allowable_client
Driver RejectNegative Separate Alias(Zallowable_client)
-allowable_client <name> The output dylib is private to the client(s) named
arch
Driver RejectNegative Separate
-arch <name> Specify that the output file should be generated for architecture \"name\"
arch_errors_fatal
Driver RejectNegative Alias(Zarch_errors_fatal)
Mismatches between file architecture and the \"-arch\" are errors instead of warnings
asm_macosx_version_min=
Driver RejectNegative Joined
The earliest MacOS X version on which this program will run (formatted for the assembler)
bind_at_load
Driver RejectNegative Alias(Zbind_at_load)
Produce an output file that will bind symbols on load, rather than lazily.
bundle
Driver RejectNegative Alias(Zbundle)
Produce a Mach-O bundle (file type MH_BUNDLE)
bundle_loader
Driver RejectNegative Separate Alias(Zbundle_loader)
-bundle_loader <executable> Treat \"executable\" (that will be loading this bundle) as if it was one of the dynamic libraries the bundle is linked against for symbol resolution
client_name
Driver RejectNegative Separate
-client_name <name> Enable the executable being built to link against a private dylib (using allowable_client)
compatibility_version
Driver RejectNegative Separate
-compatibility_version <number> Set the minimum version for the client interface. Clients must record a greater number than this or the binding will fail at runtime
current_version
Driver RejectNegative Separate
-current_version <number> Set the current version for the library.
dead_strip
Driver RejectNegative Alias(Zdead_strip)
Remove code and data that is unreachable from any exported symbol (including the entry point)
dylib_file
Driver Separate Alias(Zdylib_file)
dylinker
Driver RejectNegative
Produce a Mach-O dylinker (file type MH_DYLINKER), only used for building dyld.
dylinker_install_name
Driver RejectNegative Separate
-dylinker_install_name <path> Only used for building dyld.
dynamic
Driver RejectNegative Alias(Zdynamic)
The default (and opposite of -static), implied by user mode executables, shared libraries and bundles.
dynamiclib
Driver RejectNegative Alias(Zdynamiclib)
Produce a Mach-O shared library (file type MH_DYLIB), synonym for -shared
exported_symbols_list
Driver RejectNegative Separate Alias(Zexported_symbols_list)
-exported_symbols_list <filename> Global symbols in \"filename\" will be exported from the linked output file, any symbols not mentioned will be treated as hidden.
filelist
Driver RejectNegative Separate
Supply a list of objects to be linked from a file, rather than the command line
findirect-virtual-calls
Driver RejectNegative
Used for generating code for some older kernel revisions.
flat_namespace
Driver RejectNegative Alias(Zflat_namespace)
Ignore the normal two-level namespace; resolve symbols in command line order and do not record which library provided the resolved symbol.
force_cpusubtype_ALL
Driver RejectNegative Alias(Zforce_cpusubtype_ALL)
For the assembler (and linker) permit any architecture sub-variant to be used without error.
force_flat_namespace
Driver RejectNegative Alias(Zforce_flat_namespace)
Set the output object such that, on loading, dyld will ignore any two-level information and resolve symbols in the discovery order for loaded libs.
framework
Driver RejectNegative Separate
-framework <name> The linker should search for the named framework in the framework search path.
fterminated-vtables
Driver RejectNegative
Used for generating code for some older kernel revisions.
gfull
Driver
Abbreviation for \"-g -fno-eliminate-unused-debug-symbols\"
gused
Driver RejectNegative
Abbreviation for \"-g -feliminate-unused-debug-symbols\"
headerpad_max_install_names
Driver RejectNegative
Automatically adds space for longer path names in load commands (up to MAXPATHLEN)
image_base
Driver RejectNegative Separate Alias(Zimage_base)
-image_base <address> Choose a base address for a dylib or bundle.
init
Driver RejectNegative Separate Alias(Zinit)
-init <symbol_name> The symbol \"symbol_name\" will be used as the first initialiser for a dylib.
install_name
Driver RejectNegative Separate Alias(Zinstall_name)
-install_name <name> Set the install name for a dylib.
keep_private_externs
Driver RejectNegative
Usually \"private extern\" (hidden) symbols are made local when linking, this command suppresses that such that they remain exported.
multi_module
Driver RejectNegative Alias(Zmulti_module)
(Obsolete after 10.4) Multi modules are ignored at runtime since MacOS 10.4
multiply_defined
Driver RejectNegative Separate Alias(Zmultiply_defined)
(Obsolete after 10.4) -multiply_defined <treatment> Provided a mechanism for warning about symbols defined in multiple dylibs.
multiply_defined_unused
Driver RejectNegative Separate Alias(Zmultiplydefinedunused)
(Obsolete after 10.4) -multiply_defined_unused <treatment> Provided a mechanism for warning about symbols defined in the current executable also being defined in linked dylibs.
no_dead_strip_inits_and_terms
Driver RejectNegative Alias(Zno_dead_strip_inits_and_terms)
(Obsolete) The linker never dead strips these items, so the option is not needed.
nofixprebinding
Driver RejectNegative
(Obsolete after 10.3.9) Set MH_NOPREFIXBINDING, in an exectuable.
nomultidefs
Driver RejectNegative
(Obsolete after 10.4) Set MH_NOMULTIDEFS in an umbrella framework.
noprebind
Driver RejectNegative Negative(prebind)
(Obsolete) LD_PREBIND is no longer supported.
noseglinkedit
Driver RejectNegative Negative(seglinkedit)
(Obsolete) This is the default.
object
Driver RejectNegative
pagezero_size
Driver RejectNegative Separate
-pagezero_size size Allows setting the page 0 size to 4kb for certain special cases.
prebind
Driver RejectNegative Negative(noprebind)
(Obsolete) LD_PREBIND is no longer supported.
prebind_all_twolevel_modules
Driver RejectNegative
(Obsolete) LD_PREBIND is no longer supported.
preload
Driver RejectNegative
Produces a Mach-O file suitable for embedded/ROM use.
private_bundle
Driver RejectNegative
(Obsolete) Allowed linking to proceed with \"-flat_namespace\" when a linked bundle contained a symbol also exported from the main executable.
pthread
Driver RejectNegative
rdynamic
Driver RejectNegative
Synonym for \"-export-dynamic\" for linker versions that support it.
read_only_relocs
Driver RejectNegative Separate
-read_only_relocs <treatment> This will allow relocs in read-only pages (not advisable).
sectalign
Driver RejectNegative Separate Args(3)
-sectalign <segname> <sectname> <value> Set section \"sectname\" in segment \"segname\" to have alignment \"value\" which must be an integral power of two expressed in hexadecimal form.
sectcreate
Driver RejectNegative Separate Args(3)
-sectcreate <segname> <sectname> <file> Create section \"sectname\" in segment \"segname\" from the contents of \"file\".
sectobjectsymbols
Driver RejectNegative Separate Args(2)
(Obsolete) -sectobjectsymbols <segname> <sectname> Setting a local symbol at the start of a section is no longer supported.
sectorder
Driver RejectNegative Separate Args(3)
(Obsolete) -sectorder <segname> <sectname> orderfile Replaced by a more general option \"-order_file\".
seg_addr_table
Driver RejectNegative Separate Alias(Zseg_addr_table)
-seg_addr_table <file> Specify the base addresses for dynamic libraries, \"file\" contains a line for each library.
; This is only usable by the ld_classic linker.
seg_addr_table_filename
Driver RejectNegative Separate Alias(Zfn_seg_addr_table_filename)
(Obsolete, ld_classic only) -seg_addr_table_filename <path>
seg1addr
Driver RejectNegative Separate
Synonym for \"image_base\"
segaddr
Driver RejectNegative Separate Args(2) Alias(Zsegaddr)
-segaddr <name> <address> Set the base address of segment \"name\" to \"address\" which must be aligned to a page boundary (currently 4kb).
; This is only usable by the ld_classic linker.
segcreate
Driver RejectNegative Separate Args(3)
(Obsolete, ld_classic only) -sectcreate segname sectname file
seglinkedit
Driver RejectNegative Negative(noseglinkedit)
(Obsolete) Object files with LINKEDIT sections are no longer supported.
segprot
Driver RejectNegative Separate Args(3)
-segprot <segname> max_prot init_prot The protection values are \"r\", \"w\", \"x\" or \"-\" the latter meaning \"no access\".
segs_read_only_addr
Driver RejectNegative Separate Alias(Zsegs_read_only_addr)
-segs_read_only_addr address Allows specifying the address of the read only portion of a dylib.
segs_read_write_addr
Driver RejectNegative Separate Alias(Zsegs_read_write_addr)
-segs_read_write_addr address Allows specifying the address of the read/write portion of a dylib.
single_module
Driver RejectNegative Alias(Zsingle_module)
(Obsolete) This is the default.
sub_library
Driver RejectNegative Separate
-sub_library <name> Library named \"name\" will be re-exported (only useful for dylibs).
sub_umbrella
Driver RejectNegative Separate
-sub_umbrella <name> Framework named \"name\" will be re-exported (only useful for dylibs).
twolevel_namespace
Driver RejectNegative
This is the default
twolevel_namespace_hints
Driver RejectNegative
Specifies content that can speed up dynamic loading when the binaries are unchanged.
umbrella
Driver RejectNegative Separate Alias(Zumbrella)
-umbrella <framework> The specified framework will be re-exported.
undefined
Driver RejectNegative Separate
-undefined <treatment> Specify the handling for undefined symbols (default is error).
unexported_symbols_list
Driver RejectNegative Separate Alias(Zunexported_symbols_list)
-unexported_symbols_list <filename> Don't export global symbols listed in filename.
weak_reference_mismatches
Driver RejectNegative Separate Alias(Zweak_reference_mismatches)
-weak_reference_mismatches <treatment> Specifies what to do if a symbol import conflicts between file (weak in one and not in another) the default is to treat the symbol as non-weak.
whatsloaded
Driver RejectNegative
Logs the object files the linker loads
whyload
Driver RejectNegative
Logs which symbol(s) caused an object to be loaded.
;(Obsolete, ignored) Strip symbols starting with "L", this is the default.
X
Driver RejectNegative
y
Driver RejectNegative Joined
(Obsolete, ignored) Old support similar to whyload.
Mach
Driver RejectNegative
(Obsolete and unhandled by ld64, ignored) ld should produce an executable (only handled by ld_classic).
;; These are not "real" options, but placeholders used to hide the real options
;; from generic options processing... FIXME: they can be eliminated now.
Zall_load
Driver
@ -343,62 +485,3 @@ Driver Separate
Zweak_reference_mismatches
Driver Separate
client_name
Driver Separate
compatibility_version
Driver Separate
current_version
Driver Separate
dylinker_install_name
Driver Separate
pagezero_size
Driver Separate
read_only_relocs
Driver Separate
sectalign
Driver Separate Args(3)
sectcreate
Driver Separate Args(3)
sectobjectsymbols
Driver Separate Args(2)
sectorder
Driver Separate Args(3)
seg1addr
Driver Separate
segcreate
Driver Separate Args(3)
segprot
Driver Separate Args(3)
segs_read_only_addr
Driver Separate
segs_read_write_addr
Driver Separate
sub_library
Driver Separate
sub_umbrella
Driver Separate
; Certain aspects of code-gen may be improved / adjusted if the version of ld64
; is sufficiently modern.
mtarget-linker
Target RejectNegative Joined Separate Report Var(darwin_target_linker) Init(LD64_VERSION)
The version of ld64 in use for this toolchain.
undefined
Driver Separate

View File

@ -18,17 +18,13 @@ You should have received a copy of the GNU General Public License
along with GCC; see the file COPYING3. If not see
<http://www.gnu.org/licenses/>. */
/* Fix PR41260 by passing -no_compact_unwind on darwin10 and later until
unwinder in libSystem is fixed to digest new epilog unwinding notes.
/* Fix PR47558 by linking against libSystem ahead of libgcc_ext. */
Fix PR47558 by linking against libSystem ahead of libgcc_ext. */
#undef LINK_GCC_C_SEQUENCE_SPEC
#define LINK_GCC_C_SEQUENCE_SPEC \
"%:version-compare(>= 10.6 mmacosx-version-min= -no_compact_unwind) \
%{!static:%{!static-libgcc: \
%:version-compare(>= 10.6 mmacosx-version-min= -lSystem) } } \
%{fno-pic|fno-PIC|fno-pie|fno-PIE|fapple-kext|mkernel|static|mdynamic-no-pic: \
%:version-compare(>= 10.7 mmacosx-version-min= -no_pie) } %G %L"
"%{!static:%{!static-libgcc: \
%:version-compare(>= 10.6 mmacosx-version-min= -lSystem) } } \
%G %L"
#undef DEF_MIN_OSX_VERSION
#define DEF_MIN_OSX_VERSION "10.6"

View File

@ -35,12 +35,6 @@ along with GCC; see the file COPYING3. If not see
/* Tell collect2 to run dsymutil for us as necessary. */
#define COLLECT_RUN_DSYMUTIL 1
#undef DARWIN_PIE_SPEC
#define DARWIN_PIE_SPEC \
"%{fpie|pie|fPIE: \
%{mdynamic-no-pic: %n'-mdynamic-no-pic' overrides '-pie', '-fpie' or '-fPIE'; \
:-pie}}"
/* Only ask as for debug data if the debug style is stabs (since as doesn't
yet generate dwarf.) */

View File

@ -122,7 +122,7 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
#define GNU_USER_TARGET_NO_PTHREADS_LIB_SPEC \
"%{shared:-lc} \
%{!shared:%{mieee-fp:-lieee} %{profile:-lc_p}%{!profile:-lc}}"
%{!shared:%{profile:-lc_p}%{!profile:-lc}}"
#define GNU_USER_TARGET_LIB_SPEC \
"%{pthread:-lpthread} " \

View File

@ -258,7 +258,7 @@ extern __inline __m256i
__attribute__ ((__gnu_inline__, __always_inline__, __artificial__))
_mm256_cmpgt_epi8 (__m256i __A, __m256i __B)
{
return (__m256i) ((__v32qi)__A > (__v32qi)__B);
return (__m256i) ((__v32qs)__A > (__v32qs)__B);
}
extern __inline __m256i

Some files were not shown because too many files have changed in this diff Show More