155520 Commits

Author SHA1 Message Date
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