]> git.ipfire.org Git - thirdparty/gcc.git/log
thirdparty/gcc.git
5 years ago[c-family] Backport fix for PCH / PR61250.
Iain Sandoe [Thu, 5 Sep 2019 19:27:31 +0000 (19:27 +0000)] 
[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

5 years ago[Darwin, X86, testsuite] Provide an asm shim for AVX512F tests.
Iain Sandoe [Thu, 5 Sep 2019 19:19:46 +0000 (19:19 +0000)] 
[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

5 years ago[Darwin] Fix PR87030 and tidy config fragments.
Iain Sandoe [Thu, 5 Sep 2019 19:14:35 +0000 (19:14 +0000)] 
[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

5 years ago[ObjC] Recognise 'instancetype' as equivalent to 'id'.
Iain Sandoe [Thu, 5 Sep 2019 19:06:44 +0000 (19:06 +0000)] 
[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

5 years agobackport: [multiple changes]
Richard Biener [Thu, 5 Sep 2019 12:11:52 +0000 (12:11 +0000)] 
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

5 years agoDaily bump.
GCC Administrator [Thu, 5 Sep 2019 00:16:10 +0000 (00:16 +0000)] 
Daily bump.

From-SVN: r275392

5 years ago[Darwin] Make a final check on PIC options.
Iain Sandoe [Wed, 4 Sep 2019 19:30:44 +0000 (19:30 +0000)] 
[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

5 years ago[Darwin] Don't jam symbol stubs on for kernel code.
Iain Sandoe [Wed, 4 Sep 2019 19:27:40 +0000 (19:27 +0000)] 
[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

5 years ago[Darwin, PPC] Do not use longcall for 64b code.
Iain Sandoe [Wed, 4 Sep 2019 19:24:42 +0000 (19:24 +0000)] 
[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

5 years ago[Darwin, PPC, libgcc] Ensure unwinder is built with altivec enabled.
Iain Sandoe [Wed, 4 Sep 2019 19:21:07 +0000 (19:21 +0000)] 
[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

5 years ago[Darwin, Driver] Fix driver crashes with valid command line input.
Iain Sandoe [Wed, 4 Sep 2019 19:17:41 +0000 (19:17 +0000)] 
[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

5 years ago[Darwin, fixincludes] Backport fix for PR83531
Iain Sandoe [Wed, 4 Sep 2019 19:11:08 +0000 (19:11 +0000)] 
[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

5 years ago[Darwin, fixincludes] Backport fix for Darwin9/10 TR1 test fails.
Iain Sandoe [Wed, 4 Sep 2019 19:06:36 +0000 (19:06 +0000)] 
[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

5 years ago[Darwin, fixincludes] Backport fixes Darwin14 header issues.
Iain Sandoe [Wed, 4 Sep 2019 19:01:49 +0000 (19:01 +0000)] 
[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

5 years agobackport: re PR tree-optimization/81740 (wrong code at -O3 in both 32-bit and 64...
Richard Biener [Wed, 4 Sep 2019 11:56:15 +0000 (11:56 +0000)] 
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

5 years agobackport: re PR tree-optimization/88149 (ICE in vect_transform_stmt since r265959)
Richard Biener [Wed, 4 Sep 2019 10:51:02 +0000 (10:51 +0000)] 
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

5 years agoBackport PRs 87929, 88030, 88415, 88448, 88903, 89698, 90006
Richard Biener [Wed, 4 Sep 2019 08:06:24 +0000 (08:06 +0000)] 
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

5 years agoDaily bump.
GCC Administrator [Wed, 4 Sep 2019 00:16:19 +0000 (00:16 +0000)] 
Daily bump.

From-SVN: r275359

5 years ago[Darwin, Objective-C] Don't prepend a sysroot for the gnu-objc headers.
Iain Sandoe [Tue, 3 Sep 2019 19:18:30 +0000 (19:18 +0000)] 
[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

5 years ago[Darwin, Objective-C] Switch Objective-C meta-data sections properly.
Iain Sandoe [Tue, 3 Sep 2019 19:13:23 +0000 (19:13 +0000)] 
[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

5 years ago[Darwin, PPC] Fix .machine directive in vecsave asm.
Iain Sandoe [Tue, 3 Sep 2019 19:08:38 +0000 (19:08 +0000)] 
[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

5 years ago[Darwin] Fix lto options.
Iain Sandoe [Tue, 3 Sep 2019 19:02:01 +0000 (19:02 +0000)] 
[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

5 years agoDaily bump.
GCC Administrator [Tue, 3 Sep 2019 00:16:22 +0000 (00:16 +0000)] 
Daily bump.

From-SVN: r275325

5 years agoBackport PRs 89135, 89296, 89392, 89572, 89710
Richard Biener [Mon, 2 Sep 2019 14:14:14 +0000 (14:14 +0000)] 
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

5 years agoBackport PRs 90020, 90278, 91126, 91131, 91162, 91200
Richard Biener [Mon, 2 Sep 2019 12:56:24 +0000 (12:56 +0000)] 
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

5 years agoPR middle-end/89303 add testcase for std::enable_shared_from_this
Jonathan Wakely [Mon, 2 Sep 2019 11:10:08 +0000 (12:10 +0100)] 
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

5 years agoPR libstdc++/91308 fix constraints on unique_ptr assignment
Jonathan Wakely [Mon, 2 Sep 2019 11:10:04 +0000 (12:10 +0100)] 
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

5 years agoPR libstdc++/51333 Define recursive_init_error constructor non-inline
Jonathan Wakely [Mon, 2 Sep 2019 11:10:00 +0000 (12:10 +0100)] 
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

5 years agoPR libstdc++/90770 fix missing src/debug/Makefile
Jonathan Wakely [Mon, 2 Sep 2019 11:09:55 +0000 (12:09 +0100)] 
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

5 years agoBackport documentation fixes
Jonathan Wakely [Mon, 2 Sep 2019 11:09:51 +0000 (12:09 +0100)] 
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

5 years agoFix uses of non-reserved names for template parameters
Jonathan Wakely [Mon, 2 Sep 2019 11:09:45 +0000 (12:09 +0100)] 
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

5 years agobackport: re PR tree-optimization/91137 (Wrong code with -O3)
Bin Cheng [Mon, 2 Sep 2019 10:10:44 +0000 (10:10 +0000)] 
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

5 years agoDaily bump.
GCC Administrator [Mon, 2 Sep 2019 00:16:24 +0000 (00:16 +0000)] 
Daily bump.

From-SVN: r275287

5 years agoDaily bump.
GCC Administrator [Sun, 1 Sep 2019 00:16:28 +0000 (00:16 +0000)] 
Daily bump.

From-SVN: r275261

5 years agors6000: Fix darn-3.c for GCC 8 and GCC 7
Segher Boessenkool [Sat, 31 Aug 2019 19:01:52 +0000 (21:01 +0200)] 
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

5 years agoDaily bump.
GCC Administrator [Sat, 31 Aug 2019 00:16:32 +0000 (00:16 +0000)] 
Daily bump.

From-SVN: r275232

5 years agoBackport PRs 89677, 90071, 90194, 90213, 90474, 90637, 90930
Richard Biener [Fri, 30 Aug 2019 16:44:17 +0000 (16:44 +0000)] 
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

5 years agobackport: re PR target/91481 (POWER9 "DARN" RNG intrinsic produces repeated output...
Segher Boessenkool [Fri, 30 Aug 2019 14:25:36 +0000 (16:25 +0200)] 
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

5 years agobackport: re PR target/91481 (POWER9 "DARN" RNG intrinsic produces repeated output...
Segher Boessenkool [Fri, 30 Aug 2019 14:23:55 +0000 (16:23 +0200)] 
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

5 years agobackport: altivec.md (unspec): Delete UNSPEC_DARN...
Segher Boessenkool [Fri, 30 Aug 2019 14:22:48 +0000 (16:22 +0200)] 
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

5 years agobackport: re PR target/91150 (wrong code with -O -mavx512vbmi due to wrong writemask)
Jakub Jelinek [Fri, 30 Aug 2019 12:49:27 +0000 (14:49 +0200)] 
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

5 years agobackport: re PR middle-end/78884 ([7/8] ICE when gimplifying VLA in OpenMP SIMD region)
Jakub Jelinek [Fri, 30 Aug 2019 12:48:57 +0000 (14:48 +0200)] 
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

5 years agobackport: re PR rtl-optimization/90756 (g++ ICE in convert_move, at expr.c:218 on...
Jakub Jelinek [Fri, 30 Aug 2019 12:48:18 +0000 (14:48 +0200)] 
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

5 years agobackport: re PR sanitizer/90954 (ICE: combining undefined behavior sanitizer with...
Jakub Jelinek [Fri, 30 Aug 2019 12:47:28 +0000 (14:47 +0200)] 
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

5 years agobackport: re PR c++/90950 (OpenMP clause handling rejecting references to incomplete...
Jakub Jelinek [Fri, 30 Aug 2019 12:46:52 +0000 (14:46 +0200)] 
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

5 years agobackport: re PR c/90760 (ICE on attributes section and alias in set_section, at symta...
Jakub Jelinek [Fri, 30 Aug 2019 12:46:13 +0000 (14:46 +0200)] 
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

5 years agobackport: re PR libgomp/90585 (libgomp hsa plugin ftbfs in the x32 multilib variant)
Jakub Jelinek [Fri, 30 Aug 2019 12:45:31 +0000 (14:45 +0200)] 
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

5 years agobackport: re PR pch/90326 (Using any precompiled header breaks definition of FLT_MAX)
Jakub Jelinek [Fri, 30 Aug 2019 12:45:01 +0000 (14:45 +0200)] 
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

5 years agobackport: re PR middle-end/90139 (ICE in emit_block_move_hints, at expr.c:1601)
Jakub Jelinek [Fri, 30 Aug 2019 12:44:03 +0000 (14:44 +0200)] 
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

5 years agobackport: re PR target/90811 ([nvptx] ptxas error on OpenMP offloaded code)
Jakub Jelinek [Fri, 30 Aug 2019 12:43:04 +0000 (14:43 +0200)] 
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

5 years agobackport: lang.opt (ftail-call-workaround=): Fix a typo - lenghts to lengths.
Jakub Jelinek [Fri, 30 Aug 2019 12:42:14 +0000 (14:42 +0200)] 
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

5 years agobackport: re PR fortran/90329 (Incompatibility between gfortran and C lapack calls)
Jakub Jelinek [Fri, 30 Aug 2019 12:41:43 +0000 (14:41 +0200)] 
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

5 years agobackport: re PR target/90187 (ICE in extract_insn, at recog.c:2304 x86_64)
Jakub Jelinek [Fri, 30 Aug 2019 12:39:50 +0000 (14:39 +0200)] 
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

5 years agobackport: re PR tree-optimization/90208 (error: EH landing pad label)
Jakub Jelinek [Fri, 30 Aug 2019 12:39:09 +0000 (14:39 +0200)] 
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

5 years agobackport: re PR c++/90108 (ICE: Segmentation fault (in c_tree_chain_next))
Jakub Jelinek [Fri, 30 Aug 2019 12:38:31 +0000 (14:38 +0200)] 
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

5 years agobackport: re PR rtl-optimization/90082 (ICE in delete_unmarked_insns, at dce.c:653)
Jakub Jelinek [Fri, 30 Aug 2019 12:37:28 +0000 (14:37 +0200)] 
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

5 years agobackport: re PR tree-optimization/90090 (ICE in mark_reachable_handlers, at tree...
Jakub Jelinek [Fri, 30 Aug 2019 12:36:49 +0000 (14:36 +0200)] 
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

5 years agobackport: re PR c/89933 (ICE in merge_decls, at c/c-decl.c:2517)
Jakub Jelinek [Fri, 30 Aug 2019 12:36:05 +0000 (14:36 +0200)] 
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

5 years agobackport: re PR middle-end/89998 (ICE: verify_gimple failed in printf-return-value)
Jakub Jelinek [Fri, 30 Aug 2019 12:35:05 +0000 (14:35 +0200)] 
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

5 years agobackport: re PR sanitizer/89869 (-fsanitize=undefined miscompilation)
Jakub Jelinek [Fri, 30 Aug 2019 12:34:19 +0000 (14:34 +0200)] 
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

5 years agobackport: re PR c/89872 (GCC does not generate read access to volatile compound literal)
Jakub Jelinek [Fri, 30 Aug 2019 12:33:40 +0000 (14:33 +0200)] 
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

5 years agobackport: re PR middle-end/89621 (ICE with allocatable character and openmp)
Jakub Jelinek [Fri, 30 Aug 2019 12:33:00 +0000 (14:33 +0200)] 
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

5 years agobackport: re PR c++/89796 (Incorrect warning generated with OpenMP atomic capture)
Jakub Jelinek [Fri, 30 Aug 2019 12:32:15 +0000 (14:32 +0200)] 
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

5 years agobackport: re PR c++/60702 (thread_local initialization)
Jakub Jelinek [Fri, 30 Aug 2019 12:31:21 +0000 (14:31 +0200)] 
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

5 years agobackport: re PR c++/60702 (thread_local initialization)
Jakub Jelinek [Fri, 30 Aug 2019 12:30:48 +0000 (14:30 +0200)] 
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

5 years agobackport: re PR c++/89767 (ICE with tuple and optimization)
Jakub Jelinek [Fri, 30 Aug 2019 12:29:13 +0000 (14:29 +0200)] 
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

5 years agobackport: re PR target/89752 (ICE in emit_move_insn, at expr.c:3723)
Jakub Jelinek [Fri, 30 Aug 2019 12:28:22 +0000 (14:28 +0200)] 
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

5 years agobackport: re PR rtl-optimization/89768 (ICE in compare_and_jump_seq at loop-unroll...
Jakub Jelinek [Fri, 30 Aug 2019 12:27:50 +0000 (14:27 +0200)] 
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

5 years agobackport: re PR target/89752 (ICE in emit_move_insn, at expr.c:3723)
Jakub Jelinek [Fri, 30 Aug 2019 12:27:21 +0000 (14:27 +0200)] 
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

5 years agobackport: re PR target/89726 (Incorrect inlined version of 'ceil' for 32bit)
Jakub Jelinek [Fri, 30 Aug 2019 12:26:30 +0000 (14:26 +0200)] 
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

5 years agobackport: re PR c/89734 (const qualifier on return type not erased inside __typeof__)
Jakub Jelinek [Fri, 30 Aug 2019 12:25:43 +0000 (14:25 +0200)] 
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

5 years agobackport: re PR debug/89704 (ICE in add_const_value_attribute, at dwarf2out.c:19685)
Jakub Jelinek [Fri, 30 Aug 2019 12:20:12 +0000 (14:20 +0200)] 
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

5 years agobackport: re PR rtl-optimization/89679 (wrong code with -Og -frerun-cse-after-loop...
Jakub Jelinek [Fri, 30 Aug 2019 12:19:33 +0000 (14:19 +0200)] 
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

5 years agobackport: re PR tree-optimization/89703 (ICE in compare_values_warnv, at tree-vrp...
Jakub Jelinek [Fri, 30 Aug 2019 12:18:54 +0000 (14:18 +0200)] 
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

5 years agobackport: re PR c++/89512 (ICE in get_expr_operands, at tree-ssa-operands.c:882)
Jakub Jelinek [Fri, 30 Aug 2019 12:18:01 +0000 (14:18 +0200)] 
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

5 years agobackport: re PR middle-end/88588 (ICE in make_decl_rtl, at varasm.c:1329)
Jakub Jelinek [Fri, 30 Aug 2019 12:17:22 +0000 (14:17 +0200)] 
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

5 years agobackport: re PR middle-end/89663 (ICE in expand_builtin_int_roundingfn_2, at builtins...
Jakub Jelinek [Fri, 30 Aug 2019 12:16:43 +0000 (14:16 +0200)] 
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

5 years agobackport: re PR fortran/89651 (OpenMP private array uninitialized warning with -O...
Jakub Jelinek [Fri, 30 Aug 2019 12:15:50 +0000 (14:15 +0200)] 
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

5 years agobackport: re PR c/88568 ('dllimport' no longer implies 'extern' in C)
Jakub Jelinek [Fri, 30 Aug 2019 12:14:46 +0000 (14:14 +0200)] 
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

5 years agobackport: re PR c++/82075 (structured binding fails with empty base class)
Jakub Jelinek [Fri, 30 Aug 2019 12:14:10 +0000 (14:14 +0200)] 
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

5 years agobackport: re PR c++/87148 (backward compatibility issue to take char [] as incomplet...
Jakub Jelinek [Fri, 30 Aug 2019 12:13:40 +0000 (14:13 +0200)] 
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

5 years agobackport: re PR target/89587 (gcc's rs6000 configuration unconditionally sets MULTIAR...
Jakub Jelinek [Fri, 30 Aug 2019 12:12:56 +0000 (14:12 +0200)] 
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

5 years agobackport: re PR middle-end/89590 (ICE in maybe_emit_free_warning)
Jakub Jelinek [Fri, 30 Aug 2019 12:12:24 +0000 (14:12 +0200)] 
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

5 years agobackport: re PR c/89521 (ICE in expand_builtin_int_roundingfn, at builtins.c:2697)
Jakub Jelinek [Fri, 30 Aug 2019 12:11:38 +0000 (14:11 +0200)] 
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

5 years agobackport: re PR c/89520 (ICE tree check: accessed operand 4 of call_expr with 3 opera...
Jakub Jelinek [Fri, 30 Aug 2019 12:11:06 +0000 (14:11 +0200)] 
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

5 years agobackport: re PR c++/89403 (ICE in maybe_clone_body, at cp/optimize.c:693)
Jakub Jelinek [Fri, 30 Aug 2019 12:10:10 +0000 (14:10 +0200)] 
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

5 years agobackport: re PR middle-end/89412 (gcc ICE in simplify_subreg, at simplify-rtx.c:6273...
Jakub Jelinek [Fri, 30 Aug 2019 12:08:46 +0000 (14:08 +0200)] 
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

5 years agobackport: re PR middle-end/89091 (ICE: Segmentation fault (in tree_class_check))
Jakub Jelinek [Fri, 30 Aug 2019 12:08:04 +0000 (14:08 +0200)] 
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

5 years agobackport: re PR tree-optimization/88074 (g++ hangs on math expression)
Jakub Jelinek [Fri, 30 Aug 2019 12:07:12 +0000 (14:07 +0200)] 
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

5 years agobackport: re PR target/89361 (s390 broken without S390_USE_TARGET_ATTRIBUTE, likely...
Jakub Jelinek [Fri, 30 Aug 2019 12:05:07 +0000 (14:05 +0200)] 
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

5 years agobackport: re PR middle-end/89303 (memory leak with shared_ptr and enable_shared_from_...
Jakub Jelinek [Fri, 30 Aug 2019 12:02:30 +0000 (14:02 +0200)] 
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

5 years agobackport: re PR tree-optimization/89278 (ICE in gimplify_modify_expr, at gimplify...
Jakub Jelinek [Fri, 30 Aug 2019 12:02:02 +0000 (14:02 +0200)] 
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

5 years agobackport: re PR other/89342 (ICE in maybe_default_option, at opts.c:347)
Jakub Jelinek [Fri, 30 Aug 2019 12:01:02 +0000 (14:01 +0200)] 
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

5 years agobackport: re PR rtl-optimization/89354 (Combine pass yields wrong code with -O2 and...
Jakub Jelinek [Fri, 30 Aug 2019 11:59:10 +0000 (13:59 +0200)] 
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

5 years agobackport: re PR tree-optimization/89314 (ICE in wide_int_to_tree_1, at tree.c:1561)
Jakub Jelinek [Fri, 30 Aug 2019 11:52:29 +0000 (13:52 +0200)] 
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

5 years agobackport: re PR middle-end/89303 (memory leak with shared_ptr and enable_shared_from_...
Jakub Jelinek [Fri, 30 Aug 2019 11:51:36 +0000 (13:51 +0200)] 
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

5 years agobackport: re PR middle-end/89281 (gcc/optabs.c:3901:30: runtime error: shift exponent...
Jakub Jelinek [Fri, 30 Aug 2019 11:50:35 +0000 (13:50 +0200)] 
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

5 years agobackport: re PR middle-end/89246 (LTO produces references to cloned symbols which...
Jakub Jelinek [Fri, 30 Aug 2019 11:50:04 +0000 (13:50 +0200)] 
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

5 years agobackport: re PR target/88861 (ICE in calc_dfs_tree, at dominance.c:458)
Jakub Jelinek [Fri, 30 Aug 2019 11:49:11 +0000 (13:49 +0200)] 
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

5 years agobackport: re PR rtl-optimization/89234 (ICE in get_eh_region_and_lp_from_rtx at gcc...
Jakub Jelinek [Fri, 30 Aug 2019 11:46:29 +0000 (13:46 +0200)] 
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