Commit Graph

73851 Commits

Author SHA1 Message Date
Iain Sandoe 0a8b0a4c6f [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.

2019-08-21  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.

From-SVN: r274806
2019-08-21 18:45:45 +00:00
Eric Botcazou 70a8c9b950 re PR rtl-optimization/91347 (hppa: wrong code generated with tail call optimisation)
PR rtl-optimization/91347
	* dse.c (scan_insn): Call add_wild_read for non-const/memset tail calls
	before reload if HARD_FRAME_POINTER_IS_ARG_POINTER.

From-SVN: r274709
2019-08-20 09:13:29 +00:00
Richard Earnshaw 88cf851d26 [aarch64] PR target/91386 Use copy_rtx to avoid modifying original insns in peep2 pattern
PR target/91386 is a situation where a peephole2 pattern substitution
is discarded late because the selected instructions contain
frame-related notes that we cannot redistribute (because the pattern
has more than one insn in the output).  Unfortunately, the original
insns were being modified during the generation, so after the undo we
are left with corrupt RTL.

We avoid this by ensuring that the modifications are always made on a
copy, so that the original insns are never changed.

	Backport from mainline
	2019-09-09  Richard Earnshaw  <rearnsha@arm.com>

	PR target/91386
        * config/aarch64/aarch64.c (aarch64_gen_adjusted_ldpstp): Use copy_rtx
        to preserve the contents of the original insns.

From-SVN: r274675
2019-08-19 16:11:30 +00:00
Bernd Edlinger 3be4451740 backport: re PR tree-optimization/91109 ([arm] gcc.c-torture/execute/20040709-1.c fails since r273135)
2019-08-16  Bernd Edlinger  <bernd.edlinger@hotmail.de>

        Backport from mainline
        2019-08-16  Bernd Edlinger  <bernd.edlinger@hotmail.de>

        PR tree-optimization/91109
        * lra-int.h (lra_need_for_scratch_reg_p): Declare.
        * lra.c (lra): Use lra_need_for_scratch_reg_p.
        * lra-spills.c (lra_need_for_scratch_reg_p): New function.

From-SVN: r274578
2019-08-16 16:37:04 +00:00
Bernd Edlinger caf4834ef8 backport: re PR tree-optimization/91109 ([arm] gcc.c-torture/execute/20040709-1.c fails since r273135)
2019-08-16  Bernd Edlinger  <bernd.edlinger@hotmail.de>

        Backport from mainline
        2019-08-07  Bernd Edlinger  <bernd.edlinger@hotmail.de>

        PR tree-optimization/91109
        * lra-remat.c (update_scratch_ops): Remove assignment of the
        hard register.

From-SVN: r274577
2019-08-16 16:31:13 +00:00
Steve Ellcey 0540982587 backport: omp-simd-clone.c (simd_clone_adjust_return_type): Remove call to build_distinct_type_copy.
2019-08-15  Steve Ellcey  <sellcey@marvell.com>

	Backport from mainline
	2019-08-02  Steve Ellcey  <sellcey@marvell.com>

	* omp-simd-clone.c (simd_clone_adjust_return_type): Remove call to
	build_distinct_type_copy.
	(simd_clone_adjust_argument_types): Ditto.
	(simd_clone_adjust): Call build_distinct_type_copy here.
	(expand_simd_clones): Ditto.

From-SVN: r274548
2019-08-15 20:41:47 +00:00
Richard Biener bb4446179d backport: [multiple changes]
2019-08-15  Richard Biener  <rguenther@suse.de>

	PR tree-optimization/91445
	* gcc.dg/torture/pr91445.c: New testcase.

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

	PR tree-optimization/91091
	* tree-ssa-alias.h (get_continuation_for_phi): Add tbaa_p parameter.
	(walk_non_aliased_vuses): Likewise.
	* tree-ssa-alias.c (maybe_skip_until): Pass down tbaa_p.
	(get_continuation_for_phi): New tbaa_p parameter and pass
	it down.
	(walk_non_aliased_vuses): Likewise.
	* tree-ssa-pre.c (translate_vuse_through_block): Likewise.
	* tree-ssa-scopedtables.c (avail_exprs_stack::lookup_avail_expr):
	Likewise.
	* tree-ssa-sccvn.c (struct vn_walk_cb_data): Add tbaa_p flag.
	(vn_reference_lookup_3): Handle and pass down tbaa_p flag.
	(vn_reference_lookup_pieces): Adjust.
	(vn_reference_lookup): Remove alias-set altering, instead pass
	down false as tbaa_p.

	* gcc.dg/tree-ssa/pr91091-2.c: New testcase.

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

	* tree-ssa-sccvn.h (vn_reference_lookup): Add last_vuse_ptr
	argument.
	* tree-ssa-sccvn.c (last_vuse_ptr, vn_walk_kind): Move
	globals into...
	(struct vn_walk_cb_data): New callback data struct.
	(vn_reference_lookup_2): Adjust.
	(vn_reference_lookup_3): Likewise.
	(vn_reference_lookup_pieces): Likewise.
	(vn_reference_lookup): Likewise, get last_vuse_ptr argument.
	(visit_reference_op_load): Adjust.

From-SVN: r274532
2019-08-15 12:02:47 +00:00
Martin Sebor 1a095ab0a9 backport: re PR c++/90947 (Simple lookup table of array of strings is miscompiled)
Backport from mainline

	2019-08-01  Martin Sebor  <msebor@redhat.com>

	PR c++/90947
	* tree.c (type_initializer_zero_p): Define.
	* tree.h (type_initializer_zero_p): New function.

	2019-08-05  Martin Sebor  <msebor@redhat.com>

	* doc/extend.texi (Common Variable Attributes): Document alias
	attribute.

	2019-08-01  Martin Sebor  <msebor@redhat.com>

	PR c++/90947
	* decl.c (reshape_init_array_1): Avoid truncating initializer
	lists containing string literals.

	2019-08-14  Martin Sebor  <msebor@redhat.com>

	PR tree-optimization/91294
	* gcc.dg/strlenopt-44.c: Adjust tested result.
	* gcc.dg/strlenopt-70.c: Avoid exercising unimplemnted optimization.
	* gcc.dg/strlenopt-73.c: New test.
	* gcc.dg/strlenopt-74.c: New test.
	* gcc.dg/strlenopt-75.c: New test.
	* gcc.dg/strlenopt-76.c: New test.
	* gcc.dg/strlenopt-77.c: New test.

From-SVN: r274494
2019-08-14 14:36:46 -06:00
Richard Biener 56067ed575 backport: [multiple changes]
2019-08-12  Richard Biener  <rguenther@suse.de>

	Backport from mainline
	2019-08-12  Richard Biener  <rguenther@suse.de>

	PR lto/91375
	* tree.c (free_lang_data_in_type): Do not free TYPE_BINFO dependent on
	flag_devirtualize.

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

	PR driver/91130
	* lto-wrapper.c (get_options_from_collect_gcc_options): Remove
	lang_mask option, always use CL_DRIVER.
	(find_and_merge_options): Adjust.
	(run_gcc): Likewise.

	2019-08-07  Richard Earnshaw  <rearnsha@arm.com>

	PR driver/91130
	* lto-wrapper.c (find_and_merge_options): Use CL_DRIVER when
	processing COLLECT_GCC_OPTIONS.
	(run_gcc): Likewise.

From-SVN: r274311
2019-08-12 12:59:08 +00:00
Jakub Jelinek a8e4a6e0ca * BASE-VER: Set to 9.2.1.
From-SVN: r274276
2019-08-12 10:40:24 +02:00
Jakub Jelinek a0c06cc27d Update ChangeLog and version files for release
From-SVN: r274274
2019-08-12 09:38:49 +02:00
Kito Cheng 41e094840b RISC-V: Promote type correctly for libcalls
- argument and return value for libcall won't promote at
   default_promote_function_mode_always_promote, however we expect it
   should sign-extend as normal function.

 - Witout this patch, this test case will fail at -march=rv64i -mabi=lp64.

 - The implementation of riscv_promote_function_mode is borrowed from MIPS.

gcc/ChangeLog

	Backport from mainline
	2019-08-05  Kito Cheng  <kito.cheng@sifive.com>

	* config/riscv/riscv.c (riscv_promote_function_mode): New.
	(TARGET_PROMOTE_FUNCTION_MODE): Use riscv_promote_function_mode.

gcc/testsuite/ChangeLog

	Backport from mainline
	2019-08-05  Kito Cheng  <kito.cheng@sifive.com>

	* gcc.target/riscv/promote-type-for-libcall.c: New.

From-SVN: r274108
2019-08-05 07:54:31 +00:00
Alan Modra 2aeeb52fc4 PR91349, powerpc64*-*-freebsd* defines _GNU_SOURCE
rev 266496 (git ab6b1bb456) undefined some macros in rs6000/freebsd.h
but missed doing the same in rs6000/freebsd64.h.

	PR target/91349
	* config/rs6000/freebsd64.h (CPLUSPLUS_CPP_SPEC),
	(LINK_GCC_C_SEQUENCE_SPEC): Undef.

From-SVN: r274106
2019-08-05 11:23:31 +09:30
Segher Boessenkool 691a9e8841 backport: rs6000.c (rs6000_dbx_register_number): Return the correct numbers for TFHAR, TFIAR, TEXASR.
Backport from trunk
	2019-05-02  Segher Boessenkool  <segher@kernel.crashing.org>

	* config/rs6000/rs6000.c (rs6000_dbx_register_number): Return the
	correct numbers for TFHAR, TFIAR, TEXASR.

From-SVN: r274097
2019-08-04 21:23:59 +02:00
Iain Sandoe 72f36fffb4 Darwin, backport fix for PR87030
273746 , 273749, 273768 [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-08-03  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: r274049
2019-08-03 20:16:22 +00:00
Iain Sandoe bd9a0dce18 Darwin, backport codegen fix.
Darwin only supports "static" code in the kernel and
kernel extensions.  This check tries to prevent the case
that cascaded PIC/PIE options on the command line cause
non-pic to be selected.

2019-08-03  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: r274048
2019-08-03 20:05:21 +00:00
Iain Sandoe 8e28d02d02 Darwin, backport kext codegen fix.
It's not correct for all current Darwin versions to jam
symbol stubs on for kexts.

2019-08-03  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: r274047
2019-08-03 19:58:33 +00:00
Iain Sandoe b2ba0fd304 Darwin, ppc, Fix test fails that depend on installed headers.
Several port tests use headers that Darwin has not been
installing.  This removes the override on the header install
thus making Darwin's set match the reset of the port.

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

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

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

From-SVN: r274046
2019-08-03 19:53:51 +00:00
Iain Sandoe a6e4cd6106 Darwin, ppc, backport fix for codegen in kexts.
This honours the users choice of float ABI in kexts.

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

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

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

From-SVN: r274045
2019-08-03 19:49:43 +00:00
Iain Sandoe 9964a11fd3 Darwin, ppc, backport wrong code fix.
We should never have been using longcalls by default in
64b code.

2019-08-03  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: r274044
2019-08-03 19:44:13 +00:00
Iain Sandoe 95c96b8a25 Darwin, ppc, backport test fixes.
Several tests expect support for the GCC target pragma.
Act on this for compatibility with the port.

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

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

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

From-SVN: r274042
2019-08-03 19:32:18 +00:00
Iain Sandoe 3e12a88316 Darwin, ppc, backport test fixes.
Some tests expect upper case versions of the ppc/ppc64
macros, so bring Darwin into line with other port
members.

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

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

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

From-SVN: r274041
2019-08-03 19:25:05 +00:00
Martin Sebor 6575dd2408 backport: PR tree-optimization/90989 - incorrrect strlen result after second strcpy
Backport from mainline

PR tree-optimization/90989 - incorrrect strlen result after second strcpy
	into the same destination

gcc/ChangeLog:

	PR tree-optimization/90989
	* tree-ssa-strlen.c (handle_char_store): Constrain a single character
	optimization to just single character stores.

gcc/testsuite/ChangeLog:

	PR tree-optimization/90989
	* gcc.dg/strlenopt-26.c: Exit with test result status.
	* gcc.dg/strlenopt-67.c: New test.

From-SVN: r274021
2019-08-02 10:57:19 -06:00
Iain Sandoe bcb176f838 darwin, backport driver fixes.
272260,r272479 - Darwin, Driver - 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-08-02  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-08-02  Iain Sandoe  <iain@sandoe.co.uk>

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

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

From-SVN: r274017
2019-08-02 14:54:57 +00:00
Iain Sandoe 926c0c8fb8 darwin, x86, backport fix for missing .p2align.
This fixes a number of testcases that expect use of
.p2align, which was omitted from the darwin X86 port
(but is available in all assemblers used with that).

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

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

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

From-SVN: r274016
2019-08-02 14:44:23 +00:00
Iain Sandoe 679c6492d1 darwin, objc, backport fix for objc header paths
Don't try to prepend a sysroot for the gnu-objc headers, which
are compiler-relative.

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 is 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.

gcc/

2019-08-02  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: r274015
2019-08-02 14:34:02 +00:00
Iain Sandoe 22105fb28b darwin, backport fix for objc section switches.
gcc/

2019-08-02  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: r274014
2019-08-02 14:25:04 +00:00
Richard Biener baefa04d76 backport: re PR tree-optimization/91280 (ICE in get_constraint_for_component_ref, at tree-ssa-structalias.c:3259 since r260354)
2019-08-02  Richard Biener  <rguenther@suse.de>

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

	PR tree-optimization/91280
	* tree-ssa-structalias.c (get_constraint_for_component_ref):
	Decompose MEM_REF manually for offset handling.

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

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

	PR tree-optimization/91293
	* tree-vect-slp.c (vect_build_slp_tree_2): Do not swap operands
	of reduction stmts.

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

From-SVN: r274007
2019-08-02 12:07:33 +00:00
Richard Biener 9d72c9e1bc backport: [multiple changes]
2019-08-02  Richard Biener  <rguenther@suse.de>

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

	PR tree-optimization/91178
	* tree-ssa-sccvn.c (vn_reference_maybe_forwprop_address):
	Use tail-recursion.

	* gcc.dg/torture/pr91178-2.c: New testcase.

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

	PR tree-optimization/91178
	* tree-ssa.c (release_defs_bitset): Iterate from higher to
	lower SSA names to avoid quadratic behavior in the common case.
	* tree-data-ref.c (split_constant_offset): Add limit argument
	and pass it down.  Initialize it from PARAM_SSA_NAME_DEF_CHAIN_LIMIT.
	(split_constant_offset_1): Add limit argument and use it to
	limit SSA def walking.  Optimize the common plus/minus case.

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

	2019-07-12  Martin Sebor  <msebor@redhat.com>

	* doc/invoke.texi (ssa-name-def-chain-limit): Document new --param.
	* params.def (PARAM_SSA_NAME_DEF_CHAIN_LIMIT): Add new --param.
	* tree-vrp.c (vrp_prop::check_mem_ref): Use
	PARAM_SSA_NAME_DEF_CHAIN_LIMIT.

	* gcc.dg/Warray-bounds-43.c: New test.

From-SVN: r274000
2019-08-02 08:40:34 +00:00
Jakub Jelinek 4d2186971e backport: re PR middle-end/91301 (ICE in omp_add_variable on random access iterator distribute parallel for private (iterator))
Backported from mainline
	2019-07-31  Jakub Jelinek  <jakub@redhat.com>

	PR middle-end/91301
	* gimplify.c (gimplify_omp_for): If for class iterator on
	distribute parallel for there is no data sharing clause
	on inner_for_stmt, look for private clause on combined
	parallel too and if found, move it to inner_for_stmt.

	* testsuite/libgomp.c++/for-27.C: New test.

From-SVN: r273966
2019-08-01 08:31:20 +02:00
Jakub Jelinek 82565b4ed7 backport: re PR middle-end/91216 (OpenMP ICE starting with r265930)
Backported from mainline
	2019-07-30  Jakub Jelinek  <jakub@redhat.com>

	PR middle-end/91216
	* omp-low.c (global_nonaddressable_vars): New variable.
	(use_pointer_for_field): For global decls, if they are non-addressable,
	remember it in the global_nonaddressable_vars bitmap, if they are
	addressable and in the global_nonaddressable_vars bitmap, ignore their
	TREE_ADDRESSABLE bit.
	(omp_copy_decl_2): Clear TREE_ADDRESSABLE also on private copies of
	vars in global_nonaddressable_vars bitmap.
	(execute_lower_omp): Free global_nonaddressable_vars bitmap.

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

From-SVN: r273965
2019-08-01 08:30:26 +02:00
Jakub Jelinek 1c0ee8716d 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: r273964
2019-08-01 08:29:22 +02:00
Jakub Jelinek c327c178f0 backport: re PR tree-optimization/91157 (ICE: verify_gimple failed (error: position plus size exceeds size of referenced object in 'bit_field_ref'))
Backported from mainline
	2019-07-17  Jakub Jelinek  <jakub@redhat.com>

	PR tree-optimization/91157
	* tree-vect-generic.c (expand_vector_comparison): Handle lhs being
	a vector boolean with scalar mode.
	(expand_vector_condition): Handle first operand being a vector boolean
	with scalar mode.
	(expand_vector_operations_1): For comparisons, don't bail out early
	if the return type is vector boolean with scalar mode, but comparison
	operand type is not.

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

From-SVN: r273963
2019-08-01 08:28:19 +02:00
Alan Modra d35a5e7259 [RS6000] PR91135, __linux__ not defined with -mcall-aixdesc on 9.x and ppc64
This patch makes the obvious fix for PR91135, and deletes extraneous
copies of GNU_USER_TARGET_D_OS_VERSIONS that appear in rs6000/linux.h
and rs6000/linux64.h.  Since all configurations using either of these
files also include linux.h there is no need to duplicate the macro.

	PR target/91135
	* config/rs6000/linux.h (GNU_USER_TARGET_D_OS_VERSIONS): Don't
	define.
	* config/rs6000/linux64.h (TARGET_OS_CPP_BUILTINS): Invoke
	GNU_USER_TARGET_OS_CPP_BUILTINS for aixdesc abi.
	(GNU_USER_TARGET_D_OS_VERSIONS): Don't define.

From-SVN: r273962
2019-08-01 15:27:12 +09:30
Jonathan Wakely 20ac9d2b38 Define C11 macros such as FLT_DECIMAL_DIG for C++17
Backport from mainline
2019-06-24  Jonathan Wakely  <jwakely@redhat.com>

	* ginclude/float.h (FLT_DECIMAL_DIG, DBL_DECIMAL_DIG, LDBL_DECIMAL_DIG)
	(FLT_HAS_SUBNORM, DBL_HAS_SUBNORM, LDBL_HAS_SUBNORM, FLT_TRUE_MIN)
	(DBL_TRUE_MIN, LDBL_TRUE_MIN): Also define for C++17.

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

	* testsuite/18_support/headers/cfloat/values_c++17.cc: New test.

From-SVN: r273949
2019-07-31 20:56:16 +01:00
Richard Biener 8153c366de Backport PRs 91126, 91131, 91145, 91162, 91200
2019-07-31  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-12  Richard Biener  <rguenther@suse.de>

	PR tree-optimization/91145
	* tree-vect-slp.c (vect_build_slp_tree_2): Fix reduction
	chain check.

	* gcc.dg/torture/pr91145.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.

From-SVN: r273939
2019-07-31 15:40:36 +00:00
Jan Hubicka ea7e4625c4 backport: i386-common.c: Use PROCESSOR_ZNVER2 scheduler for znver2.
Backport from mainline
	2019-07-23  Jan Hubicka  <hubicka@ucw.cz>

	* i386-common.c: Use PROCESSOR_ZNVER2 scheduler for znver2.
	* config/i386/znver1.md: Enable patterns for znver2 and add store
	variants which use extra AGU unit.

From-SVN: r273904
2019-07-30 09:28:13 +00:00
Jan Hubicka c2db11bbb9 backport: i386.c (ix86_option_override_internal): Default PARAM_AVOID_FMA_MAX_BITS to 256 for znver2.
Backport from mainline
	2019-07-23  Jan Hubicka  <hubicka@ucw.cz>

	* config/i386/i386.c (ix86_option_override_internal): Default
	PARAM_AVOID_FMA_MAX_BITS to 256 for znver2.
	* config/i386/x86-tune.def (X86_TUNE_AVOID_256FMA_CHAINS): Set
	for ZNVER2.

From-SVN: r273901
2019-07-30 08:10:22 +00:00
Jan Hubicka 53e62cf48e backport: x86-tune-costs.h (znver2_memcpy): Update.
Backport from mainline
	2019-07-23  Jan Hubicka  <hubicka@ucw.cz>

	* config/i386/x86-tune-costs.h (znver2_memcpy): Update.
	(znver2_costs): Update 256 bit SSE costs and multiplication.

From-SVN: r273900
2019-07-30 08:03:43 +00:00
Bin Cheng cb181d837e Fixup ChangeLog entry for revision 273754.
From-SVN: r273755
2019-07-24 01:32:59 +00:00
Bin Cheng 568b00c671 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.

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

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

From-SVN: r273754
2019-07-24 01:28:33 +00:00
Matthew Beliveau 01e83a1087 re PR rtl-optimization/91173 (ICE: in int_mode_for_mode, at stor-layout.c:403)
PR rtl-optimization/91173

	Backported from mainline
	2019-07-16  Jeff Law  <law@redhat.com>
	
	PR rtl-optimization/91173
	* tree-ssa-address.c (addr_for_mem_ref): If the base is an
	SSA_NAME with a constant value, fold its value into the offset
	and clear the base before calling gen_addr_rtx.
	* g++.dg/pr91173.C: New test.

From-SVN: r273741
2019-07-23 15:56:22 +00:00
Richard Biener d312963104 re PR debug/91231 (ICE in dwarf2out_inline_entry, at dwarf2out.c:27642)
2019-07-23  Richard Biener  <rguenther@suse.de>

	PR debug/91231
	* lto-streamer-in.c (input_function): Drop inline-entry markers
	that ended up with an unknown location block.

From-SVN: r273734
2019-07-23 11:17:37 +00:00
Paul A. Clarke a0cee637a0 [rs6000] Add _mm_blend_epi16 and _mm_blendv_epi8
Add compatibility implementations of _mm_blend_epi16 and _mm_blendv_epi8
intrinsics.

Respective test cases are copied almost verbatim (minor changes to
the dejagnu head lines) from i386.

2019-07-22  Paul A. Clarke  <pc@us.ibm.com>

[gcc]

	* config/rs6000/smmintrin.h (_mm_blend_epi16): New.
	(_mm_blendv_epi8): New.

[gcc/testsuite]

	* gcc.target/powerpc/sse4_1-check.h: New.
	* gcc.target/powerpc/sse4_1-pblendvb.c: New.
	* gcc.target/powerpc/sse4_1-pblendw.c: New.
	* gcc.target/powerpc/sse4_1-pblendw-2.c: New.

From-SVN: r273704
2019-07-22 16:32:37 +00:00
Martin Liska 883e30c4d9 Backport r273660
2019-07-22  Martin Liska  <mliska@suse.cz>

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

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

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

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

From-SVN: r273664
2019-07-22 09:37:18 +00:00
Claudiu Zissulescu b956e05c57 [ARC] Backport ix emitting TLS symbols.
From-SVN: r273658
2019-07-22 09:21:24 +02:00
Richard Sandiford 76eeeaa4bb Fix folding of vector EQ/NE
For vector1 != vector2, we returned false if any elements were equal,
rather than if all elements were equal.

2019-07-20  Richard Sandiford  <richard.sandiford@arm.com>

gcc/
	Backport from mainline
	2019-07-10  Richard Sandiford  <richard.sandiford@arm.com>

	* fold-const.c (fold_relational_const): Fix folding of
	vector-to-scalar NE_EXPRs.
	(test_vector_folding): Add more tests.

From-SVN: r273634
2019-07-20 18:49:59 +00:00
Jason Merrill 19aeedf7af PR c++/82081 - tail call optimization breaks noexcept
If a noexcept function calls a function that might throw, doing the tail
call optimization means that an exception thrown in the called function
will propagate out, breaking the noexcept specification.  So we need to
prevent the optimization in that case.

	* tree-tailcall.c (find_tail_calls): Don't turn a call from a
	nothrow function to a might-throw function into a tail call.

From-SVN: r273594
2019-07-19 04:52:41 -04:00
Kito Cheng 7632aabc09 RISC-V: Fix splitter for 32-bit AND on 64-bit target.
Fixes github.com/riscv/riscv-gcc issue #161.  We were accidentally using
BITS_PER_WORD to compute shift counts when we should have been using the
bitsize of the operand modes.  This was wrong when we had an SImode shift
and a 64-bit target.

	Andrew Waterman  <andrew@sifive.com>
	gcc/
	* config/riscv/riscv.md (lshrsi3_zero_extend_3+1): Use operands[1]
	bitsize	instead of BITS_PER_WORD.
	gcc/testsuite/
	* gcc.target/riscv/shift-shift-2.c: Add one more test.

gcc/ChangeLog:
2019-07-18  Kito Cheng  <kito.cheng@sifive.com>

	Backport from mainline
	2019-07-08  Andrew Waterman  <andrew@sifive.com>
		    Jim Wilson  <jimw@sifive.com>

	* config/riscv/riscv.md (lshrsi3_zero_extend_3+1): Use operands[1]
	bitsize	instead of BITS_PER_WORD.
	gcc/testsuite/

gcc/testsuite/ChangeLog:
2019-07-18  Kito Cheng  <kito.cheng@sifive.com>

	Backport from mainline
	2019-07-08  Jim Wilson  <jimw@sifive.com>

	* gcc.target/riscv/shift-shift-2.c: Add one more test.

From-SVN: r273566
2019-07-18 07:00:32 +00:00
John David Anglin cccbb4c6b0 pa.c (pa_som_asm_init_sections): Don't force all constant data into data section when generating PIC code.
* config/pa/pa.c (pa_som_asm_init_sections): Don't force all constant
	data into data section when generating PIC code.
	(pa_select_section): Use pa_reloc_rw_mask() to qualify relocs.
	(pa_reloc_rw_mask): Return 3 when generating PIC code and when
	generating code for SOM targets earlier than HP-UX 11.  Otherwise,
	return 2 for SOM and 0 for other targets.

From-SVN: r273558
2019-07-18 00:10:27 +00:00
Andreas Krebbel 9051978364 S/390: Fix vector shift count operand
We currently use subst definitions to handle the different variants of shift
count operands. Unfortunately, in the vector shift pattern the shift count
operand is used directly. Without it being adjusted for the 'subst' variants the
displacement value is omitted resulting in a wrong shift count being applied.

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

gcc/ChangeLog:

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

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

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

gcc/testsuite/ChangeLog:

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

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

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

From-SVN: r273546
2019-07-17 07:32:30 +00:00
Wilco Dijkstra 93750effc5 Fix alignment option parser (PR90684)
Fix the alignment option parser to always allow up to 4 alignments.
Now -falign-functions=16:8:8:8 no longer reports an error.

    gcc/
	PR driver/90684
	* gcc/opts.c (parse_and_check_align_values): Allow 4 alignment values.

From-SVN: r273533
2019-07-16 16:17:39 +00:00
Jakub Jelinek 803fcf21f4 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: r273477
2019-07-14 10:28:06 +02:00
Jakub Jelinek 223d142ccb 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: r273476
2019-07-14 10:27:12 +02:00
Richard Biener 9f2cfe108f Backport PRs 90369, 90900, 90914, 90972, 90982, 91004, 91062, 91063
2019-07-12  Richard Biener  <rguenther@suse.de>

	Backport from mainline
	2019-07-04  Jakub Jelinek  <jakub@redhat.com>

	PR tree-optimization/91063
	* tree-vect-stmts.c (vect_init_vector): Call gsi_remove to remove
	stmt from stmts sequence before calling vect_init_vector_1.
	Formatting fix.

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

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

	PR ipa/91062
	* tree-pass.h (execute_all_ipa_transforms): Add a flag
	parameter whether to disable GC collection.
	* passes.c (execute_one_ipa_transform_pass): Likewise, and
	honor it.
	(execute_all_ipa_transforms): Likewise and pass it down.
	* cgraph.c (cgraph_node::get_body): Do not invoke garbage
	collection from applying IPA transforms.
	* cgraphunit.c (cgraph_node::expand): Allow garbage collection
	from applying IPA transforms.

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

	PR testsuite/91004
	* g++.dg/torture/pr34850.C: Fix overly reduced testcase.

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

	PR ipa/90982
	* tree-inline.c (remap_ssa_name): Copy SSA range info.

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

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

	PR tree-optimization/90972
	* tree-vect-stmts.c (vect_init_vector): Handle CONSTANT_CLASS_P
	in common code, dealing with STRING_CST properly.

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

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

	PR debug/90914
	* dwarf2out.c (prune_unused_types_walk): Always consider
	function-local extern declarations as used.

	* g++.dg/debug/pr90914.C: New testcase.

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

	PR debug/90900
	* cfgexpand.c (expand_debug_expr): Treat NOTE_P DECL_RTL
	as if optimized away.

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

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

	PR lto/90369
	* lto-wrapper.c (debug_objcopy): Use the original filename
	including archive offset for the filename used for -save-temps.

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

From-SVN: r273437
2019-07-12 10:16:11 +00:00
Uros Bizjak 5ee0f4e7d9 backport: sse.md (*andnot<mode>3_bcst): Fix VI/VI48_AVX512VL typo.
Backported from mainline
	2019-07-06  Richard Sandiford  <richard.sandiford@arm.com>

	* config/i386/sse.md (*andnot<mode>3_bcst): Fix VI/VI48_AVX512VL typo.

From-SVN: r273422
2019-07-11 22:49:13 +02:00
Segher Boessenkool 54f3719d6d rs6000: Handle Modula-2 in the traceback table
This patch recognises Modula-2 as language for the traceback table,
fixing the problem shown in
https://gcc.gnu.org/ml/gcc-patches/2019-07/msg00848.html .

	* config/rs6000/rs6000.c (rs6000_output_function_epilogue): Handle
	Modula-2.

From-SVN: r273412
2019-07-11 20:42:20 +02:00
Richard Biener 21c034217c re PR tree-optimization/91108 (Fails to pun through unions)
2019-07-08  Richard Biener  <rguenther@suse.de>

	PR tree-optimization/91108
	* tree-ssa-sccvn.c: Include builtins.h.
	(vn_reference_lookup_3): Use only alignment constraints to
	verify same-valued store disambiguation.

	* gcc.dg/tree-ssa/pr91091-1.c: New testcase.
	* gcc.dg/tree-ssa/ssa-fre-78.c: Likewise.

From-SVN: r273233
2019-07-08 11:48:48 +00:00
Szabolcs Nagy 183b10be03 aarch64: emit .variant_pcs for aarch64_vector_pcs symbol references
Backport r271869
Backport r271913
Backport r272414

A dynamic linker with lazy binding support may need to handle vector PCS
function symbols specially, so an ELF symbol table marking was
introduced for such symbols.

Function symbol references and definitions that follow the vector PCS
are marked in the generated assembly with .variant_pcs and then the
STO_AARCH64_VARIANT_PCS st_other flag is set on the symbol in the object
file.  The marking is propagated to the dynamic symbol table by the
static linker so a dynamic linker can handle such symbols specially.

For this to work, the assembler, the static linker and the dynamic
linker has to be updated on a system.  Old assembler does not support
the new .variant_pcs directive, so a toolchain with old binutils won't
be able to compile code that references vector PCS symbols.

gcc/ChangeLog:

	* config/aarch64/aarch64-protos.h (aarch64_asm_output_alias): Declare.
	(aarch64_asm_output_external): Declare.
	* config/aarch64/aarch64.c (aarch64_asm_output_variant_pcs): New.
	(aarch64_declare_function_name): Call aarch64_asm_output_variant_pcs.
	(aarch64_asm_output_alias): New.
	(aarch64_asm_output_external): New.
	* config/aarch64/aarch64.h (ASM_OUTPUT_DEF_FROM_DECLS): Define.
	(ASM_OUTPUT_EXTERNAL): Define.

gcc/testsuite/ChangeLog:

	* gcc.target/aarch64/pcs_attribute-2.c: New test.
	* gcc.target/aarch64/torture/simd-abi-4.c: Check .variant_pcs support.
	* lib/target-supports.exp (check_effective_target_aarch64_variant_pcs):
	New.

gcc/ChangeLog:

	* config/aarch64/aarch64-protos.h (aarch64_asm_output_external): Remove
	const.
	* config/aarch64/aarch64.c (aarch64_asm_output_external): Call
	default_elf_asm_output_external.

gcc/testsuite/ChangeLog:

	* gcc.target/aarch64/pcs_attribute-2.c: Remove ifunc usage.
	* gcc.target/aarch64/pcs_attribute-3.c: New test.

From-SVN: r273140
2019-07-05 15:06:11 +00:00
Martin Liska b098c7983c Backport r272993
2019-07-04  Martin Liska  <mliska@suse.cz>

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

	PR tree-optimization/90892
	* builtins.c (inline_expand_builtin_string_cmp): Handle '\0'
	in string constants.
2019-07-04  Martin Liska  <mliska@suse.cz>

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

	PR tree-optimization/90892
	* gcc.dg/pr90892.c: New test.

From-SVN: r273074
2019-07-04 09:03:56 +00:00
Martin Liska f62121b1ca Backport r272992
2019-07-04  Martin Liska  <mliska@suse.cz>

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

	PR middle-end/90899
	* multiple_target.c (create_dispatcher_calls): Add to comdat
	group only if set for ifunc.
2019-07-04  Martin Liska  <mliska@suse.cz>

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

	PR middle-end/90899
	* gcc.target/i386/pr90899.c: New test.

From-SVN: r273073
2019-07-04 09:03:40 +00:00
Eric Botcazou 669c0e314c dwarf2out.c (add_scalar_info): Add back refererence to existing DIE if it has the DW_AT_data_member_location...
* dwarf2out.c (add_scalar_info): Add back refererence to existing DIE
	if it has the DW_AT_data_member_location attribute.

From-SVN: r273003
2019-07-03 12:01:30 +00:00
Andrew Stubbs 43806b822b Fix regrename ICE.
2019-07-02  Andrew Stubbs  <ams@codesourcery.com>

	Backport from mainline:
	gcc/
	2019-07-02  Andrew Stubbs  <ams@codesourcery.com>

	* config/gcn/gcn.md (movdi_symbol_save_scc): Convert to define_insn
	with inlined save and restore.

From-SVN: r272938
2019-07-02 13:57:56 +00:00
Eric Botcazou 9c715fa905 re PR middle-end/64242 (Longjmp expansion incorrect)
PR middle-end/64242
	* config/sparc/sparc.md (nonlocal_goto): Restore frame pointer last.
	Add frame clobber and schedule blockage.

From-SVN: r272890
2019-07-01 16:27:06 +00:00
Jakub Jelinek 0a4024807a backport: re PR c++/91024 (-Wimplicit-fallthrough is confused by likely/unlikely attributes)
Backported from mainline
	2019-06-27  Jakub Jelinek  <jakub@redhat.com>

	PR c++/91024
	* gimplify.c (collect_fallthrough_labels): Ignore GIMPLE_PREDICT
	statements.

	* g++.dg/warn/Wimplicit-fallthrough-4.C: New test.

From-SVN: r272804
2019-06-29 00:57:16 +02:00
Jakub Jelinek 11e313784f backport: re PR target/90991 (_mm_loadu_ps instrinsic translates to vmovaps in combination with _mm512_insertf32x4)
Backported from mainline
	2019-06-26  Jakub Jelinek  <jakub@redhat.com>

	PR target/90991
	* config/i386/sse.md
	(*<extract_type>_vinsert<shuffletype><extract_suf>_0): Use vmovupd,
	vmovups, vmovdqu, vmovdqu32 or vmovdqu64 instead of the aligned
	insns if operands[2] is misaligned_operand.

	* gcc.target/i386/avx512dq-pr90991-1.c: New test.

From-SVN: r272803
2019-06-29 00:56:27 +02:00
Jakub Jelinek 03b70afb51 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: r272800
2019-06-29 00:10:04 +02:00
Jeff Law a7c7481a07 re PR tree-optimization/90949 (null pointer check removed)
PR tree-optimization/90949
	* tree-ssa-copy.c (fini_copy_prop): Use reset_flow_sensitive_info.
	* tree-ssanames.c (reset_flow_sensitive_info): Reset non-null state.

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

From-SVN: r272793
2019-06-28 14:21:05 -06:00
Andrew Stubbs edbbdf0b8c Fix trampoline execution failures on GCN5.
2019-06-28  Andrew Stubbs  <ams@codesourcery.com>

	Backport from mainline:
	2019-05-22  Andrew Stubbs  <ams@codesourcery.com>

	* config/gcn/gcn.c (gcn_trampoline_init): Call "sorry" on GCN5.

From-SVN: r272788
2019-06-28 16:37:14 +00:00
Martin Jambor 7867b61fa3 [PR 90939] Remove outdated assert in ipcp_bits_lattice::meet_with
2019-06-26  Martin Jambor  <mjambor@suse.cz>

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

	testsuite/
	* g++.dg/lto/pr90939_[01].C: New test.

From-SVN: r272689
2019-06-26 14:04:08 +02:00
Rainer Orth d1bb76b1f9 Remove support for alternative Solaris 11.4 ld -V output
Backport from mainline
	2019-06-17  Rainer Orth  <ro@CeBiTec.Uni-Bielefeld.DE>

	* configure.ac (ld_vers) <*-*-solaris2*>: Remove support for
	alternative Solaris 11.4 format.
	* configure: Regenerate.

From-SVN: r272676
2019-06-26 09:15:46 +00:00
Claudiu Zissulescu fcb73d173b [ARC] Backport fix PR89838
gcc/
xxxx-xx-xx  Claudiu Zissulescu  <claziss@synopsys.com>

        * config/arc/arc.c (arc_symbol_binds_local_p): New function.
        (arc_legitimize_pic_address): Simplify and cleanup the function.
        (SYMBOLIC_CONST): Remove.
        (prepare_pic_move): Likewise.
        (prepare_move_operands): Handle complex mov cases here.
        (arc_legitimize_address_0): Remove call to
        arc_legitimize_pic_address.
        (arc_legitimize_address): Remove call to
        arc_legitimize_tls_address.
        * config/arc/arc.md (movqi_insn): Allow Cm3 match.
        (movhi_insn): Likewise.

/gcc/testsuite
xxxx-xx-xx  Claudiu Zissulescu  <claziss@synopsys.com

From-SVN: r272645
2019-06-25 13:02:21 +02:00
Andrew Stubbs 47fd1a8347 GCN: Wait for exit value to write before exiting.
2019-06-25  Andrew Stubbs  <ams@codesourcery.com>

	Backport from mainline
	2019-05-24  Andrew Stubbs  <ams@codesourcery.com>

	gcc/
	* config/gcn/gcn-run.c (main): Set a non-zero return value if the
	kernel does not exit cleanly.
	* config/gcn/gcn.md (gcn_return): Insert s_waitcnt before s_dcache_wb.

From-SVN: r272642
2019-06-25 09:47:15 +00:00
Andrew Stubbs 8abc773747 Fix 64-bit addition in prologue.
2019-06-25  Andrew Stubbs  <ams@codesourcery.com>

	Backport from mainline
	2019-05-24  Andrew Stubbs  <ams@codesourcery.com>

	gcc/
	* config/gcn/gcn.c (gcn_expand_prologue): Use gen_addsi3_scalar_carry
	for lo-part.

From-SVN: r272641
2019-06-25 09:47:09 +00:00
Richard Biener 4e4024c1f1 re PR tree-optimization/90930 (Excessive memory consumption)
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.

From-SVN: r272636
2019-06-25 07:30:44 +00:00
Richard Biener 69490dcd9e re PR tree-optimization/90930 (Excessive memory consumption)
2019-06-24  Richard Biener  <rguenther@suse.de>

	PR tree-optimization/90930
	PR tree-optimization/90316
	* tree-ssa-alias.c (walk_non_aliased_vuses): Add missing
	decrement of limit.

From-SVN: r272622
2019-06-24 17:19:36 +00:00
Jeff Law 4649f72c13 mips.c (mips_expand_builtin_insn): Swap the 1st and 3rd operands of the fmadd/fmsub/maddv builtin.
* config/mips/mips.c (mips_expand_builtin_insn): Swap the 1st
	and 3rd operands of the fmadd/fmsub/maddv builtin.

	* gcc.target/mips/msa-fmadd.c: New.

From-SVN: r272392
2019-06-17 11:27:30 -06:00
John David Anglin 28d9dbf10f re PR middle-end/64242 (Longjmp expansion incorrect)
PR middle-end/64242
	* config/pa/pa.md (nonlocal_goto): Restore frame pointer last.  Add
	frame clobbers and schedule block.
	(builtin_longjmp): Likewise.

From-SVN: r272362
2019-06-16 21:44:08 +00:00
Jakub Jelinek bb0e2d2799 re PR target/90811 ([nvptx] ptxas error on OpenMP offloaded code)
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: r272162
2019-06-11 18:43:09 +02:00
John David Anglin 610ce528d7 re PR target/90751 (-fpatchtable-function-entry broken on hppa-linux-gnu-gcc/hppa64-linux-gnu-gcc)
PR target/90751
	* config/pa/pa-linux.h (ASM_DECLARE_FUNCTION_NAME): Update comment.
	Call pa_output_function_label.
	(TARGET_ASM_FUNCTION_PROLOGUE): define.
	* config/pa/pa-protos.h (pa_output_function_label): Declare.
	* config/pa/pa.c (pa_output_function_prologue): Add ATTRIBUTE_UNUSED
	to declaration.
	(pa_linux_output_function_prologue): Declare.
	(TARGET_ASM_FUNCTION_PROLOGUE): Delete define.
	(pa_output_function_label): New.
	(pa_output_function_prologue): Revise to use pa_output_function_label.
	(pa_linux_output_function_prologue): New.
	* config/pa/pa.h (TARGET_ASM_FUNCTION_PROLOGUE): Define.

From-SVN: r272061
2019-06-07 23:20:44 +00:00
Richard Biener 6ea3780cab Backport PRs 90328, 90402, 90450, 90474
2019-06-06  Richard Biener  <rguenther@suse.de>

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

	PR tree-optimization/90450
	* tree-ssa-loop-im.c (struct im_mem_ref): Add ref_decomposed.
	(mem_ref_hasher::equal): Check it.
	(mem_ref_alloc): Initialize it.
	(gather_mem_refs_stmt): Set it.

	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-05-13  Richard Biener  <rguenther@suse.de>

	PR tree-optimization/90402
	* tree-if-conv.c (tree_if_conversion): Value number only
	the loop body by making the latch an exit of the region
	as well.
	* tree-ssa-sccvn.c (process_bb): Add flag whether to skip
	processing PHIs.
	(do_rpo_vn): Deal with multiple edges into the entry block
	that are not backedges inside the region by skipping PHIs
	of the entry block.

	* gcc.dg/torture/pr90402-1.c: New testcase.

	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.

From-SVN: r271995
2019-06-06 11:06:45 +00:00
Eric Botcazou 00acb8f17e fold-const.c (extract_muldiv_1): Do not distribute a multiplication by a power-of-two value.
* fold-const.c (extract_muldiv_1) <PLUS_EXPR>: Do not distribute a
	multiplication by a power-of-two value.
	(fold_plusminus_mult_expr): Use pow2p_hwi to spot a power-of-two value
	and turn the modulo operation into a masking operation.

From-SVN: r271964
2019-06-05 14:21:37 +00:00
Jakub Jelinek 2cb7bee247 re PR debug/90733 (ICE in simplify_subreg, at simplify-rtx.c:6440)
PR debug/90733
	* var-tracking.c (vt_expand_loc_callback): Don't create raw subregs
	with VOIDmode inner operands.

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

From-SVN: r271960
2019-06-05 14:22:22 +02:00
Iain Sandoe 1afda327df backport documentation for target supports (mfentry availability).
This was missed with the backport of the mfentry changes for
Darwin, and documents the target-supports addition only. (NFC).

Corrected ChangeLog

gcc/

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

	Backport from mainline.
	2019-05-23  Iain Sandoe  <iain@sandoe.co.uk>
	* doc/sourcebuild.texi: Document mfentry target support.

From-SVN: r271951
2019-06-05 08:27:37 +00:00
Jakub Jelinek 396d2098ee tree-predcom.c (is_inv_store_elimination_chain): Fix a typo - lenght to length.
* tree-predcom.c (is_inv_store_elimination_chain): Fix a typo - lenght
	to length.

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

From-SVN: r271771
2019-05-30 11:34:26 +02:00
Iain Sandoe f5f9cea667 Darwin, x86 - backport fix for mfentry test fails.
This will fix the cases by UNSUPPORTING for any target that cannot
support mfentry (including Linux -fpic -m32).

gcc/

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

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

	* config/i386/darwin.h: Reject -mfentry*.
	* doc/sourcebuild.texi: Document mfentry target support.

gcc/testsuite/

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

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

       * lib/target-supports.exp (check_effective_target_mfentry): New.
       * gcc.target/i386/fentry-override.c: Require effective target mfentry.
       * gcc.target/i386/fentry.c: Likewise
       * gcc.target/i386/fentryname1.c: Likewise
       * gcc.target/i386/fentryname2.c: Likewise
       * gcc.target/i386/fentryname3.c: Likewise
       * gcc.target/i386/nop-mcount.c: Likewise
       * gcc.target/i386/pr82699-2.c: Likewise
       * gcc.target/i386/pr82699-4.c: Likewise
       * gcc.target/i386/pr82699-5.c: Likewise
       * gcc.target/i386/pr82699-6.c: Likewise
       * gcc.target/i386/returninst1.c: Likewise
       * gcc.target/i386/returninst2.c: Likewise
       * gcc.target/i386/returninst3.c : Likewise

From-SVN: r271767
2019-05-30 08:06:38 +00:00
Iain Sandoe 914ded4e81 Darwin, backport fix for PR82920 part2 (mx32 is not supported)
gcc/

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

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

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

gcc/testsuite/

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

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

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

From-SVN: r271765
2019-05-30 07:56:10 +00:00
Iain Sandoe 9b86c15f62 Darwin, backport fix for pr82920 (part1, code)
gcc/

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

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

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

gcc/testsuite/

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

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

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

From-SVN: r271764
2019-05-30 07:51:32 +00:00
Jakub Jelinek ba33514340 re PR fortran/90329 (Incompatibility between gfortran and C lapack calls)
PR fortran/90329
	* lto-streamer.h (LTO_minor_version): Bump to 1.

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

	PR fortran/90329
	* 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
	* 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.

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

From-SVN: r271743
2019-05-29 17:55:12 +02:00
Jakub Jelinek 99bc5b3847 re PR bootstrap/90543 (Build failure on MINGW for gcc-9.1.0)
PR bootstrap/90543
	* optc-save-gen.awk: In cl_optimization_print, use correct condition
	for var_opt_string printing.  In cl_optimization_print_diff, print
	(null) instead of invoking undefined behavior if one of the
	var_opt_string pointers is NULL and use && instead of first || in the
	guarding condition.  For var_target_other options, handle const char *
	target variables similarly to const char * optimize node variables.

From-SVN: r271737
2019-05-29 11:35:34 +02:00
John David Anglin bee4cbe6aa pa.c (hppa_profile_hook): Remove offset adjustment.
* config/pa/pa.c (hppa_profile_hook): Remove offset adjustment.

From-SVN: r271721
2019-05-28 23:28:02 +00:00
Eric Botcazou 1416fdb015 dwarf2out.c (resolve_args_picking_1): Deal with DW_OP_GNU_addr_index and DW_OP_GNU_const_index opcodes.
* dwarf2out.c (resolve_args_picking_1): Deal with DW_OP_GNU_addr_index
	and DW_OP_GNU_const_index opcodes.

From-SVN: r271665
2019-05-27 16:12:41 +00:00
John David Anglin 7a5e7df8d4 re PR target/90530 (Invalid SUBREG insn generated by reload)
PR target/90530
	* config/pa/pa.c (pa_can_change_mode_class): Accept mode changes from
	DImode to SImode in floating-point registers on 64-bit target.
	* config/pa/pa.md (umulsidi3): Change nonimmediate_operand to
	register_operand in xmpyu patterns.

From-SVN: r271612
2019-05-24 23:15:49 +00:00
Martin Liska b8e1dc7573 Backport r271548
2019-05-24  Martin Liska  <mliska@suse.cz>

	Backport from mainline
	2019-05-23  Martin Liska  <mliska@suse.cz>

	PR sanitizer/90570
	* gimplify.c (gimplify_target_expr): Skip TREE_STATIC target
	expression similarly to gimplify_decl_expr.
2019-05-24  Martin Liska  <mliska@suse.cz>

	Backport from mainline
	2019-05-23  Martin Liska  <mliska@suse.cz>

	PR sanitizer/90570
	* g++.dg/asan/pr90570.C: New test.

From-SVN: r271593
2019-05-24 07:43:48 +00:00
Uros Bizjak 6080857e5a backport: re PR target/90547 (ICE in gen_lowpart_general, at rtlhooks.c:63)
Backported from mainline
	2019-05-21  Uroš Bizjak  <ubizjak@gmail.com>

	* config/i386/cpuid.h (__cpuid): For 32bit targets, zero
	%ebx and %ecx bafore calling cpuid with leaf 1 or
	non-constant leaf argument.

	2019-05-21  Uroš Bizjak  <ubizjak@gmail.com>

	PR target/90547
	* config/i386/i386.md (anddi_1 to andsi_1_zext splitter):
	Avoid calling gen_lowpart with CONST operand.

testsuite/ChangeLog:

	Backported from mainline
	2019-05-21  Uroš Bizjak  <ubizjak@gmail.com>

	PR target/90547
	* gcc.target/i386/pr90547.c: New test.

From-SVN: r271516
2019-05-22 20:49:22 +02:00
Sebastian Huber 204d3f53c6 [RTEMS] Change multilibs for ARM
Account for Cortex-M3 Errata 602117.  The -mfix-cortex-m3-ldrd option is
enabled by default, if -mcpu=cortex-m3 is used.

gcc/

	* config/arm/t-rtems: Replace ARMv7-M multilibs with Cortex-M
	multilibs.

From-SVN: r271452
2019-05-21 04:41:23 +00:00
Jeff Law 13d9be956e mips.c (mips_dwarf_frame_reg_mode): Replace TARGET_FLOAT64 with !TARGET_FLOAT32, thus handling both fp64 and fpxx modes.
* config/mips/mips.c (mips_dwarf_frame_reg_mode): Replace
	TARGET_FLOAT64 with !TARGET_FLOAT32, thus handling both fp64
	and fpxx modes.

	* g++.dg/eh/o32-fp.C: New.
	* gcc.target/mips/dwarfregtable-1.c: New.
	* gcc.target/mips/dwarfregtable-2.c: New.
	* gcc.target/mips/dwarfregtable-3.c: New.
	* gcc.target/mips/dwarfregtable-4.c: New.
	* gcc.target/mips/dwarfregtable.h: New.

From-SVN: r271433
2019-05-20 13:08:18 -06:00
Jakub Jelinek 8dc08facbd backport: re PR c++/90484 (ICE in equal_mem_array_ref_p at gcc/tree-ssa-scopedtables.c:550 since r270433 on i586)
Backported from mainline
	2019-05-16  Jakub Jelinek  <jakub@redhat.com>

	PR c++/90484
	* tree-ssa-scopedtables.c (equal_mem_array_ref_p): Don't assert that
	sz0 is equal to sz1, instead return false in that case.

From-SVN: r271356
2019-05-17 21:54:15 +02:00
Jakub Jelinek a734d291f3 backport: omp-low.c (lower_rec_input_clauses): If OMP_CLAUSE_IF has non-constant expression...
Backported from mainline
	2019-05-16  Jakub Jelinek  <jakub@redhat.com>

	* omp-low.c (lower_rec_input_clauses): If OMP_CLAUSE_IF
	has non-constant expression, force sctx.lane and use two
	argument IFN_GOMP_SIMD_LANE instead of single argument.
	* tree-ssa-dce.c (eliminate_unnecessary_stmts): Don't DCE
	two argument IFN_GOMP_SIMD_LANE without lhs.
	* tree-vectorizer.h (struct _loop_vec_info): Add simd_if_cond
	member.
	(LOOP_VINFO_SIMD_IF_COND, LOOP_REQUIRES_VERSIONING_FOR_SIMD_IF_COND):
	Define.
	(LOOP_REQUIRES_VERSIONING): Or in
	LOOP_REQUIRES_VERSIONING_FOR_SIMD_IF_COND.
	* tree-vect-loop.c (_loop_vec_info::_loop_vec_info): Initialize
	simd_if_cond.
	(vect_analyze_loop_2): Punt if LOOP_VINFO_SIMD_IF_COND is constant 0.
	* tree-vect-loop-manip.c (vect_loop_versioning): Add runtime check
	from simd if clause if needed.

	* gcc.dg/vect/vect-simd-1.c: New test.
	* gcc.dg/vect/vect-simd-2.c: New test.
	* gcc.dg/vect/vect-simd-3.c: New test.
	* gcc.dg/vect/vect-simd-4.c: New test.

From-SVN: r271355
2019-05-17 21:53:48 +02:00
Jakub Jelinek 0d50662086 backport: omp-low.c (lower_rec_input_clauses): For if (0) or simdlen (1) set max_vf to 1.
Backported from mainline
	2019-05-15  Jakub Jelinek  <jakub@redhat.com>

	* omp-low.c (lower_rec_input_clauses): For if (0) or simdlen (1) set
	max_vf to 1.
	* omp-expand.c (expand_omp_simd): For if (0) or simdlen (1) clear
	safelen_int and set loop->dont_vectorize.

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

From-SVN: r271354
2019-05-17 21:52:55 +02:00
Jakub Jelinek b1abd54e2a backport: re PR tree-optimization/90385 (ICE: tree check: expected ssa_name, have real_cst in transform_to_exit_first_loop_alt, at tree-parloops.c:1772)
Backported from mainline
	2019-05-10  Jakub Jelinek  <jakub@redhat.com>

	PR tree-optimization/90385
	* tree-parloops.c (try_create_reduction_list): Punt on non-SSA_NAME
	arguments of the exit phis.

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

From-SVN: r271352
2019-05-17 21:51:32 +02:00
Jakub Jelinek 9708806882 backport: re PR c++/90383 (GCC generates invalid constexpr copy/move assignment operators for types with trailing padding. (Again))
Backported from mainline
	2019-05-10  Jakub Jelinek  <jakub@redhat.com>

	PR c++/90383
	* tree-inline.h (struct copy_body_data): Add do_not_fold member.
	* tree-inline.c (remap_gimple_op_r): Avoid folding expressions if
	id->do_not_fold.
	(copy_tree_body_r): Likewise.
	(copy_fn): Set id.do_not_fold to true.

	* g++.dg/cpp1y/constexpr-90383-1.C: New test.
	* g++.dg/cpp1y/constexpr-90383-2.C: New test.

From-SVN: r271351
2019-05-17 21:50:52 +02:00
Jakub Jelinek 3f888c29af backport: re PR tree-optimization/90303 (ICE in hash_odr_name with fastcall attribute starting with r267359)
Backported from mainline
	2019-05-03  Jakub Jelinek  <jakub@redhat.com>

	PR tree-optimization/90303
	* ipa-devirt.c (obj_type_ref_class, get_odr_type): Don't use
	TYPE_CANONICAL for TYPE_STRUCTURAL_EQUALITY_P types in !in_lto_p mode.

	* g++.target/i386/pr90303.C: New test.

From-SVN: r271349
2019-05-17 21:48:25 +02:00
Richard Biener 36f6476b80 backport: [multiple changes]
2019-05-17  Richard Biener  <rguenther@suse.de>

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

	PR tree-optimization/90316
	* tree-ssa-alias.h (get_continuation_for_phi): Take walking
	limit by reference.
	(walk_non_aliased_vuses): Take walking limit argument.
	* tree-ssa-alias.c (maybe_skip_until): Take limit and abort
	walking if it is reached instead of just counting.
	(get_continuation_for_phi): Likewise.
	(walk_non_aliased_vuses): Likewise, instead of leaving counter
	limiting to the callback.
	* tree-ssa-sccvn.c (vn_reference_lookup_2): Adjust.
	(vn_reference_lookup_3): Likewise.
	(vn_reference_lookup_pieces): Likewise.
	(vn_reference_lookup): Likewise.
	* tree-ssa-pre.c (translate_vuse_through_block): Limit walking.
	* tree-ssa-scopedtables.c (vuse_eq): Adjust.
	(avail_exprs_stack::lookup_avail_expr): Likewise.

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

	PR tree-optimization/90316
	* tree-ssa-alias.c (maybe_skip_until): Pass in target BB,
	compute target on demand.
	(get_continuation_for_phi): Remove code walking stmts to
	get to a target virtual operand which could end up being
	quadratic.

From-SVN: r271314
2019-05-17 08:10:58 +00:00
Li Jia He e993da13a0 Fix a typo in two_value_replacement function
2019-05-15  Li Jia He  <helijia@linux.ibm.com>

	Backport from mainline.
	2019-05-07  Li Jia He  <helijia@linux.ibm.com>

	* tree-ssa-phiopt.c (two_value_replacement): Fix a typo in parameter
	detection.
	* gcc.dg/tree-ssa/pr37508.c: Add the no-ssa-phiopt option to skip phi
	optimization.
	* gcc.dg/tree-ssa/pr88676-2.c: New testcase.

From-SVN: r271198
2019-05-15 05:20:02 +00:00
Martin Liska e387342c67 Backport r271118
2019-05-14  Martin Liska  <mliska@suse.cz>

	Backport from mainline
	2019-05-13  Martin Liska  <mliska@suse.cz>

	PR tree-optimization/90416
	* tree-vect-stmts.c (vect_check_load_store_mask): Concatenate
	string instead of passing the second part as va_arg argument.

From-SVN: r271152
2019-05-14 08:47:40 +00:00
Martin Liska 1841ab40a2 Backport r271117
2019-05-14  Martin Liska  <mliska@suse.cz>

	Backport from mainline
	2019-05-13  Martin Liska  <mliska@suse.cz>

	PR gcov-profile/90380
	* gcov.c (handle_cycle): Do not support zero cycle count,
	it should not be possible.
	(path_contains_zero_cycle_arc): New function.
	(circuit): Ignore zero cycle arc counts.

From-SVN: r271151
2019-05-14 08:46:35 +00:00
Martin Liska 8af68c6ffc Backport r271116
2019-05-14  Martin Liska  <mliska@suse.cz>

	Backport from mainline
	2019-05-13  Martin Liska  <mliska@suse.cz>

	PR gcov-profile/90380
	* gcov.c (enum loop_type): Remove the enum and
	the operator.
	(handle_cycle): Assert that we should not reach
	a negative count.
	(circuit): Use loop_found instead of a tri-state loop_type.
	(get_cycles_count): Do not handle NEGATIVE_LOOP as it can't
	happen.

From-SVN: r271150
2019-05-14 08:46:27 +00:00
Chenghua Xu 1c0152ae21 Backport fix for PR90357.
2019-05-14  Chenghua Xu  <paul.hua.gm@gmail.com>
	
	PR target/90357
	* config/mips/mips.c (mips_split_move): Skip forward SRC into 
	next insn when the SRC reg is dead.

From-SVN: r271147
2019-05-14 03:25:38 +00:00
Andreas Tobler e2e9b7b30e backport: freebsd64.h: Add bits for 32-bit multilib support.
2019-05-11  Andreas Tobler <andreast@gcc.gnu.org>

	Backport from mainline.
	2019-04-25  Andreas Tobler  <andreast@gcc.gnu.org>

	* config/i386/freebsd64.h: Add bits for 32-bit multilib support.
	* config/i386/t-freebsd64: New file.
	* config.gcc: Add the t-freebsd64 for multilib support.

From-SVN: r271099
2019-05-11 22:43:00 +02:00
Kelvin Nilsen 455ea3748a backport: re PR middle-end/89765 (Multiple problems with vec-insert implementation on PowerPC)
gcc/ChangeLog:

2019-05-10  Kelvin Nilsen  <kelvin@gcc.gnu.org>

	Backport from mainline.
	2019-05-07  Kelvin Nilsen  <kelvin@gcc.gnu.org>

	PR target/89765
	* config/rs6000/rs6000-c.c (altivec_resolve_overloaded_builtin):
	In handling of ALTIVEC_BUILTIN_VEC_INSERT, use modular arithmetic
	to compute vector element selector for both constant and variable
	operands.

gcc/testsuite/ChangeLog:

2019-05-10  Kelvin Nilsen  <kelvin@gcc.gnu.org>

	Backport from mainline.
	2019-05-07  Kelvin Nilsen  <kelvin@gcc.gnu.org>

	PR target/89765
	* gcc.target/powerpc/pr89765-mc.c: New test.
	* gcc.target/powerpc/vsx-builtin-10c.c: New test.
	* gcc.target/powerpc/vsx-builtin-10d.c: New test.
	* gcc.target/powerpc/vsx-builtin-11c.c: New test.
	* gcc.target/powerpc/vsx-builtin-11d.c: New test.
	* gcc.target/powerpc/vsx-builtin-12c.c: New test.
	* gcc.target/powerpc/vsx-builtin-12d.c: New test.
	* gcc.target/powerpc/vsx-builtin-13c.c: New test.
	* gcc.target/powerpc/vsx-builtin-13d.c: New test.
	* gcc.target/powerpc/vsx-builtin-14c.c: New test.
	* gcc.target/powerpc/vsx-builtin-14d.c: New test.
	* gcc.target/powerpc/vsx-builtin-15c.c: New test.
	* gcc.target/powerpc/vsx-builtin-15d.c: New test.
	* gcc.target/powerpc/vsx-builtin-16c.c: New test.
	* gcc.target/powerpc/vsx-builtin-16d.c: New test.
	* gcc.target/powerpc/vsx-builtin-17c.c: New test.
	* gcc.target/powerpc/vsx-builtin-17d.c: New test.
	* gcc.target/powerpc/vsx-builtin-18c.c: New test.
	* gcc.target/powerpc/vsx-builtin-18d.c: New test.
	* gcc.target/powerpc/vsx-builtin-19c.c: New test.
	* gcc.target/powerpc/vsx-builtin-19d.c: New test.
	* gcc.target/powerpc/vsx-builtin-20c.c: New test.
	* gcc.target/powerpc/vsx-builtin-20d.c: New test.
	* gcc.target/powerpc/vsx-builtin-9c.c: New test.
	* gcc.target/powerpc/vsx-builtin-9d.c: New test.

From-SVN: r271064
2019-05-10 14:00:17 +00:00
Richard Biener 2b4107b450 tree-ssa-sccvn.c (visit_reference_op_call): Initialize value-id.
2019-05-10  Richard Biener  <rguenther@suse.de>

	* tree-ssa-sccvn.c (visit_reference_op_call): Initialize value-id.
	(do_rpo_vn): Initialize next_value_id.

From-SVN: r271062
2019-05-10 12:01:47 +00:00
Thomas Schwinge 239b7733c5 Clean up MPX-related stuff: CIF_CHKP
..., which was forgotten in recent r268844.

	gcc/
	* cif-code.def (CHKP): Remove.

trunk r271029

From-SVN: r271030
2019-05-09 11:52:53 +02:00
Kelvin Nilsen 38ff331a38 backport: re PR target/89424 (__builtin_vec_ext_v1ti (v, i) results in ICE with variable i (RS6000))
gcc/ChangeLog:

2019-05-07  Kelvin Nilsen  <kelvin@gcc.gnu.org>

	Backport from mainline.
	2019-05-06  Kelvin Nilsen  <kelvin@gcc.gnu.org>

	PR target/89424
	* config/rs6000/rs6000.c (rs6000_expand_vector_extract): Add
	handling of V1TImode.

gcc/testsuite/ChangeLog:

2019-05-07  Kelvin Nilsen  <kelvin@gcc.gnu.org>

	Backport from mainline.
	2019-05-06  Kelvin Nilsen  <kelvin@gcc.gnu.org>

	PR target/89424
	* gcc.target/powerpc/pr89424-0.c: New test.
	* gcc.target/powerpc/vsx-builtin-13a.c: Define macro PR89424 to
	enable testing of newly patched capability.
	* gcc.target/powerpc/vsx-builtin-13b.c: Likewise.
	* gcc.target/powerpc/vsx-builtin-20a.c: Likewise.
	* gcc.target/powerpc/vsx-builtin-20b.c: Likewise.

From-SVN: r270969
2019-05-07 16:22:21 +00:00
Martin Liska 6df94d59ac Backport r270899
2019-05-06  Martin Liska  <mliska@suse.cz>

	Backport from mainline
	2019-05-06  Martin Liska  <mliska@suse.cz>

	PR sanitizer/90312
	* config/i386/i386-options.c (ix86_option_override_internal): Error only
	when -mabi is selected to a non-default version.
2019-05-06  Martin Liska  <mliska@suse.cz>

	Backport from mainline
	2019-05-06  Martin Liska  <mliska@suse.cz>

	PR sanitizer/90312
	* gcc.dg/asan/pr87930.c: Run the test only on *linux or *gnu
	systems.
	* gcc.dg/tsan/pr88017.c: Likewise.

From-SVN: r270912
2019-05-06 14:01:45 +00:00
Michael Meissner 2dea4b1e49 Delete unintentional file from the wrong branch
From-SVN: r270875
2019-05-04 15:39:52 +00:00
Richard Biener 32d365a18b re PR tree-optimization/90316 (large compile time increase in opt / alias stmt walking for Go example)
2019-05-03  Richard Biener  <rguenther@suse.de>

	PR tree-optimization/90316
	* tree-ssa-pre.c (pass_pre::execute): Re-compute DOM fast queries
	before running VN.

From-SVN: r270849
2019-05-03 11:22:33 +00:00
Jakub Jelinek 93d725e5ce * BASE-VER: Set to 9.1.1.
From-SVN: r270842
2019-05-03 10:47:02 +02:00
GCC Administrator c8913260b0 Update ChangeLog and version files for release
From-SVN: r270839
2019-05-03 07:59:54 +00:00
Ramana Radhakrishnan 605dbfb0c4 [Patch AArch64] Add __ARM_FEATURE_ATOMICS
This keeps coming up repeatedly and the ACLE has finally added
__ARM_FEATURE_ATOMICS for the LSE feature in GCC. This is now part of
the latest ACLE release
(https://developer.arm.com/docs/101028/latest/5-feature-test-macros)

I know it's late for GCC-9 but this is a simple macro which need not
wait  for another year.

Ok for trunk and to backport to all release branches ?

Tested with a simple build and a smoke test.

Backport from mainline.
PR target/86538
* config/aarch64/aarch64-c.c (aarch64_update_cpp_builtins): Define
__ARM_FEATURE_ATOMICS

From-SVN: r270689
2019-04-30 12:02:30 +00:00
Martin Liska d020f96fa3 Subject: Backport r270675
2019-04-30  Martin Liska  <mliska@suse.cz>

	Backport from mainline
	2019-04-30  Martin Liska  <mliska@suse.cz>

	PR translation/90274
	* opts.c (print_filtered_help): Wrap string in _(...).

From-SVN: r270677
2019-04-30 08:51:23 +00:00
Martin Liska 9a0b2c5f5a Subject: Backport r270622
2019-04-30  Martin Liska  <mliska@suse.cz>

	Backport from mainline
	2019-04-27  Martin Liska  <mliska@suse.cz>

	PR middle-end/90258
	* opt-suggestions.c (option_proposer::build_option_suggestions):
	When get_valid_option_values returns empty values, add the
	misspelling candidate.
2019-04-30  Martin Liska  <mliska@suse.cz>

	Backport from mainline
	2019-04-27  Martin Liska  <mliska@suse.cz>

	PR middle-end/90258
	* gcc.dg/completion-5.c: New test.
	* gcc.target/i386/spellcheck-options-5.c: New test.

From-SVN: r270676
2019-04-30 08:35:28 +00:00
Richard Biener 889a8e2a6d re PR tree-optimization/90273 (GCC runs out of memory building Firefox)
PR tree-optimization/90273
	* tree-ssa-dce.c (eliminate_unnecessary_stmts): Eliminate
	useless debug stmts.

From-SVN: r270674
2019-04-30 09:40:06 +02:00
Iain Buclaw f069783899 [netbsd] d: Fix build failures on sparc*-netbsd
gcc/ChangeLog:

2019-04-27  Iain Buclaw  <ibuclaw@gdcproject.org>

	* config/netbsd-d.c: Include memmodel.h.  Remove unused tree.h,
	varasm.h, and netbsd-protos.h.

From-SVN: r270631
2019-04-28 08:02:10 +00:00
Segher Boessenkool d6ea820e70 revert r270484
I'm leaving the testsuite piece alone.

From-SVN: r270601
2019-04-26 15:49:53 +02:00
Jakub Jelinek 7b37de5c0f re PR tree-optimization/90240 (ICE in try_improve_iv_set, at tree-ssa-loop-ivopts.c:6694)
PR tree-optimization/90240
	Revert:
	2019-04-23  Bin Cheng  <bin.cheng@linux.alibaba.com>
 
	PR tree-optimization/90078
	* tree-ssa-loop-ivopts.c (comp_cost::operator +,-,+=,-+,/=,*=): Add
	checks for infinite_cost overflow.

	* gcc/testsuite/g++.dg/tree-ssa/pr90078.C: New test.

From-SVN: r270583
2019-04-25 20:08:14 +02:00
Jakub Jelinek 67647bd885 * DEV-PHASE: Set to prerelease.
From-SVN: r270582
2019-04-25 20:04:17 +02:00
Richard Biener f47f687a97 re PR middle-end/89765 (Multiple problems with vec-insert implementation on PowerPC)
PR middle-end/89765
	* gimplify.c (gimplify_expr): Avoid turning a lvalue
	VIEW_CONVERT_EXPR into one operating on an rvalue.

From-SVN: r270579
2019-04-25 19:58:56 +02:00
H.J. Lu 604ab090ad x86: Update message for target_clones and unsupported ISAs
Before AVX512F, processors with the newer ISAs also support the older
ISAs, i.e., AVX2 processors also support AVX and SSE4, SSE4 processors
also support SSSE3, ...   After AVX512F, an AVX512XX processor may not
support AVX512YY.  It means AVX512XX features, except for AVX512F, can't
be used to decide priority in target_clones.

This patch updates error message for ISAs with P_ZERO priority.  It also
merges _feature_list into _isa_names_table and marks ISAs, which have
unknown priority, with P_ZERO so that we only need to update one place
to add a new ISA feature.

gcc/

2019-04-25  H.J. Lu  <hongjiu.lu@intel.com>

	PR target/89929
	* config/i386/i386.c (feature_priority): Moved to file scope.
	(processor_features): Likewise.
	(processor_model): Likewise.
	(_arch_names_table): Likewise.
	(arch_names_table): Likewise.
	(_feature_list): Removed.
	(feature_list): Likewise.
	(_isa_names_table): Moved to file scope.  Add priority.
	(isa_names_table): Likewise.
	(get_builtin_code_for_version): Replace feature_list with
	isa_names_table.  Update error message for P_ZERO priority.

gcc/testsuite/

2019-04-25  Martin Liska  <mliska@suse.cz>
	    H.J. Lu  <hongjiu.lu@intel.com>

	PR target/89929
	* g++.target/i386/mv28.C: New test.
	* gcc.target/i386/mvc14.c: Likewise.
	* g++.target/i386/pr57362.C: Updated.

From-SVN: r270578
2019-04-25 10:00:28 -07:00
Richard Biener aeec4861c4 tree-pass.h (make_pass_phi_only_cprop): Remove.
2019-04-25  Richard Biener  <rguenther@suse.de>

	* tree-pass.h (make_pass_phi_only_cprop): Remove.
	* timevar.def (TV_TREE_PHI_CPROP): Likewise.

From-SVN: r270575
2019-04-25 14:55:42 +00:00
Jeff Law 33579b59aa re PR tree-optimization/90037 (-Wnull-dereference false positive after r269302)
PR tree-optimization/90037
	* Makefile.in (OBJS): Remove tree-ssa-phionlycprop.c
	* passes.def: Replace all instance of phi-only cprop with the
	lattice propagator.  Move propagation pass from after erroneous
	path isolation to before erroneous path isolation.
	* tree-ssa-phionlycprop.c: Remove.

	* gcc.dg/tree-ssa/20030710-1.c: Update dump file to scan.
	* gcc.dg/isolate-2.c: Likewise.
	* gcc.dg/isolate-4.c: Likewise.
	* gcc.dg/pr19431.c: Accept either ordering of PHI args.
	* gcc.dg/pr90037.c: New test.

From-SVN: r270574
2019-04-25 08:32:16 -06:00
Richard Biener a9e6359a90 re PR tree-optimization/90213 (UBSAN: signed integer overflow: -5621332293356458048 * 8 cannot be represented in type 'long int')
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.

From-SVN: r270570
2019-04-25 11:17:49 +00:00
Richard Biener f469220df6 re PR middle-end/90194 (ICE in expand_debug_expr, at cfgexpand.c:5244)
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.

From-SVN: r270569
2019-04-25 11:15:35 +00:00
Clement Chigot 265e6a0ae0 aix71.h (SUBTARGET_OVERRIDE_OPTIONS): Disable OPTION_MASK_VSX and OPTION_MASK_ALTIVEC from rs6000_isa_flags for Go on...
2019-04-24  Clement Chigot  <clement.chigot@atos.net>

        * config/rs6000/aix71.h (SUBTARGET_OVERRIDE_OPTIONS): Disable
        OPTION_MASK_VSX and OPTION_MASK_ALTIVEC from rs6000_isa_flags
        for Go on 32 bit AIX.
        * config/rs6000/aix72.h: Likewise.

From-SVN: r270553
2019-04-24 14:03:47 -04:00
Jakub Jelinek 73f1289e49 re PR target/90193 (asm goto with TLS "m" input operand generates incorrect assembler in O1 and O2)
PR target/90193
	* rtl.c (classify_insn): Return JUMP_INSN for asm goto.
	* emit-rtl.c (try_split): Copy over REG_LABEL_TARGET.

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

From-SVN: r270550
2019-04-24 17:49:36 +02:00
Andreas Krebbel 9fe1940081 S/390: Fix PR89952 incorrect CFI
This patch fixes a cases where inconsistent CFI is generated.

After restoring the hard frame pointer (r11) from an FPR we have to
set the CFA register.  In order to be able to set it back to the stack
pointer (r15) we have to make sure that r15 has been restored already.

The patch also adds a scheduler dependency to prevent the instruction
scheduler from swapping the r11 and r15 restore again.

gcc/ChangeLog:

2019-04-24  Andreas Krebbel  <krebbel@linux.ibm.com>

	PR target/89952
	* config/s390/s390.c (s390_restore_gprs_from_fprs): Restore GPRs
    	from FPRs in reverse order.  Generate REG_CFA_DEF_CFA note also
    	for restored hard frame pointer.
	(s390_sched_dependencies_evaluation): Implement new target hook.
	(TARGET_SCHED_DEPENDENCIES_EVALUATION_HOOK): New macro definition.

gcc/testsuite/ChangeLog:

2019-04-24  Andreas Krebbel  <krebbel@linux.ibm.com>

	PR target/89952
	* gcc.target/s390/pr89952.c: New test.

From-SVN: r270544
2019-04-24 13:40:38 +00:00
Claudiu Zissulescu fe3ddee943 [ARC][COMMITTED] Fix typos.
gcc/
xxxx-xx-xx  Claudiu Zissulescu  <claziss@synopsys.com>

	* config/arc/arc-options.def: Fix typos and spelling mistakes.
	* config/arc/arc.c (arc_init): Cleanup warning message.
	(arc_override_options): Likewise.

From-SVN: r270540
2019-04-24 12:15:47 +02:00
Jakub Jelinek de6ae2ce07 re PR target/90187 (ICE in extract_insn, at recog.c:2304 x86_64)
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++.target/i386/pr90187.C: New test.

From-SVN: r270537
2019-04-24 11:27:14 +02:00
Jakub Jelinek 3795b582ac re PR tree-optimization/90208 (error: EH landing pad label)
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-1.c: New test.
	* gcc.dg/tsan/pr90208-2.c: New test.

From-SVN: r270534
2019-04-24 10:14:50 +02:00
Jakub Jelinek 2bd49e6b64 re PR tree-optimization/90211 (ICE: tree check: expected ssa_name, have real_cst in first_readonly_imm_use, at ssa-iterators.h:351)
PR tree-optimization/90211
	* tree-parloops.c (try_create_reduction_list): Ignore phi arguments
	which are not SSA_NAMEs.

	* gcc.dg/autopar/pr90211.c: New test.

From-SVN: r270533
2019-04-24 10:13:29 +02:00
Sudakshina Das 32efff9f94 [GCC, AARCH64] Add GNU note section with BTI and PAC.
This patch adds the GNU NOTE section to the BTI and/or PAC
enabled objects for linux targets.

The patches for needed for these in binutils are already approved
and committed.
https://sourceware.org/ml/binutils/2019-03/msg00072.html

*** gcc/ChangeLog ***

2018-04-23  Sudakshina Das  <sudi.das@arm.com>

	* config/aarch64/aarch64-linux.h (TARGET_ASM_FILE_END): Define for
	AArch64.
	(aarch64_file_end_indicate_exec_stack): Add gnu note section.

gcc/testsuite/ChangeLog:

2018-04-23  Sudakshina Das  <sudi.das@arm.com>

	* gcc.target/aarch64/bti-1.c: Add scan directive for gnu note section
	for linux targets.
	* gcc.target/aarch64/va_arg_1.c: Update scan directive to not clash
	with GNU note section.

From-SVN: r270515
2019-04-23 15:51:25 +00:00
Roman Zhuykov 9fe3064bc6 modulo-sched: prevent division by zero (PR87979)
PR rtl-optimization/87979
	* modulo-sched.c (sms_schedule): Start ii value "mii" should
	not equal zero.

testsuite:

	PR rtl-optimization/87979
	* gcc.dg/pr87979.c: New test.

From-SVN: r270512
2019-04-23 13:14:57 +00:00
Roman Zhuykov 8d64622fce modulo-sched: fix branch scheduling issue (PR84032)
PR rtl-optimization/84032
	* modulo-sched.c (ps_insn_find_column): Change condition so that
	branch will always be the last insn in a row inside partial
	schedule.

testsuite:

	PR rtl-optimization/84032
	* gcc.dg/pr84032.c: New test.

From-SVN: r270511
2019-04-23 12:53:43 +00:00
Richard Biener 6e27100979 re PR debug/90131 (wrong debug info at -O3)
2019-04-23  Richard Biener  <rguenther@suse.de>

	PR debug/90131
	* tree-cfgcleanup.c (move_debug_stmts_from_forwarder): Add
	dest_single_pred_p argument.
	(remove_forwarder_block): Adjust.
	(remove_forwarder_block_with_phi): Likewise.

From-SVN: r270505
2019-04-23 10:10:10 +00:00
Ramana Radhakrishnan 48528842bd re PR target/89093 (C++ exception handling clobbers d8 VFP register)
PR target/89093
	* config/arm/arm.c (aapcs_vfp_is_call_or_return_candidate): Diagnose
	if used with general-regs-only.
	(arm_conditional_register_usage): Don't add non-general regs if
	general-regs-only.
	(arm_valid_target_attribute_rec): Handle general-regs-only.
	* config/arm/arm.h (TARGET_HARD_FLOAT): Return false if
	general-regs-only.
	(TARGET_HARD_FLOAT_SUB): Define.
	(TARGET_SOFT_FLOAT): Define as negation of TARGET_HARD_FLOAT_SUB.
	(TARGET_REALLY_IWMMXT): Add && !TARGET_GENERAL_REGS_ONLY.
	(TARGET_REALLY_IWMMXT2): Likewise.
	* config/arm/arm.opt: Add -mgeneral-regs-only.
	* doc/extend.texi: Document ARM general-regs-only target.
	* doc/invoke.texi: Document ARM -mgeneral-regs-only.
libgcc/
	* config/arm/pr-support.c: Add #pragma GCC target("general-regs-only").
	* config/arm/unwind-arm.c: Likewise.
	* unwind-c.c (PERSONALITY_FUNCTION): Add general-regs-only target
	attribute for ARM.
libobjc/
	* exception.c (PERSONALITY_FUNCTION): Add general-regs-only target
	attribute for ARM.
libphobos/
	* libdruntime/gcc/deh.d: Import gcc.attribute.
	(personality_fn_attributes): New enum.
	(scanLSDA, CONTINUE_UNWINDING, gdc_personality, __gdc_personality):
	Add @personality_fn_attributes.
libstdc++-v3/
	* libsupc++/eh_personality.cc (PERSONALITY_FUNCTION): Add
	general-regs-only target attribute for ARM.

Co-Authored-By: Bernd Edlinger <bernd.edlinger@hotmail.de>
Co-Authored-By: Jakub Jelinek <jakub@redhat.com>

From-SVN: r270504
2019-04-23 12:03:41 +02:00
Bin Cheng 4b5689aa6c re PR tree-optimization/90078 (ICE with deep templates caused by overflow)
PR tree-optimization/90078
	* tree-ssa-loop-ivopts.c (comp_cost::operator +,-,+=,-+,/=,*=): Add
	checks for infinite_cost overflow.

	gcc/testsuite
	* gcc/testsuite/g++.dg/tree-ssa/pr90078.C: New test.

	Also fix typo in ChangeLog entry for revision 270499.

From-SVN: r270500
2019-04-23 04:07:46 +00:00
Bin Cheng 9e14603dfe re PR tree-optimization/90021 (ICE in index_in_loop_nest, at tree-data-ref.h:587 since r270203)
PR tree-optimization/92001
	* tree-chrec.c (evolution_function_is_univariate_p): New parameter
	and check univariate against it.
	* tree-chrec.h (evolution_function_is_univariate_p): New parameter.
	* tree-data-ref.c (add_other_self_distances): Pass new argument.

	gcc/testsuite
	* gcc/testsuite/gfortran.dg/pr90021.f90: New test.

From-SVN: r270499
2019-04-23 03:54:59 +00:00
H.J. Lu f94302e90b LRA: Revert "Remove useless move insns"
Useless move insn removal was added to LRA just to avoid wasting CPU
cycles on such insn processing afterwards.  Such insns are removed
anyway later in the pass pipeline.  The CPU time savings are tiny but
the removal creates too many problems including PR target/90178.
Vladimir pre-approved the patch to remove the code:

https://gcc.gnu.org/ml/gcc-patches/2019-04/msg00834.html

gcc/

	PR target/90178
	Revert:
	2018-11-21  Uros Bizjak  <ubizjak@gmail.com>

	Revert the revert:
	2013-10-26  Vladimir Makarov  <vmakarov@redhat.com>

	Revert:
	2013-10-25  Vladimir Makarov  <vmakarov@redhat.com>

	* lra-spills.c (lra_final_code_change): Remove useless move insns.

gcc/testsuite/

	PR target/90178
	* gcc.target/i386/pr90178.c: New test.

From-SVN: r270484
2019-04-21 11:23:00 -07:00
Iain Sandoe befa871199 Fix test fails on powerpc-darwin.
The current implementation of “speculation_barrier”
and “group_end_nop” insns emit hard-wired register
names which causes tests using them to fail on Darwin,
at least, which uses “rNN” instead of “NN”.

The patch makes the register names for these insns use
the operand output mechanism to substitute the
appropriate variant when needed.

gcc/

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

	* config/rs6000/rs6000.md (group_end_nop): Emit insn register
	names using operand format, rather than hard-wired.
	(speculation_barrier): Likewise.

From-SVN: r270480
2019-04-21 08:25:44 +00:00
Segher Boessenkool c5c4d431e0 tree-call-cdce: If !HONOR_NANS do not make code with NaNs (PR88055)
If we don't HONOR_NANS we should not try to use any unordered
comparison results.  Best case those will just be optimized away;
realistically, they ICE.  For example, the rs6000 backend has some
code that specifically checks we never do this.


	PR tree-optimization/88055
	* tree-call-cdce.c (comparison_code_if_no_nans): New function.
	(gen_one_condition): Use it if !HONOR_NANS.

From-SVN: r270460
2019-04-19 18:58:01 +02:00
Jakub Jelinek a7bfaee58f re PR middle-end/90139 (ICE in emit_block_move_hints, at expr.c:1601)
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: r270457
2019-04-19 13:58:11 +02:00
Christophe Lyon 4180490732 PR translation/90118 Missing space between words
2019-04-19  Christophe Lyon  <christophe.lyon@linaro.org>

	PR translation/90118

	contrib/
	* check-internal-format-escaping.py: Check that %< is not next to
	a word.

	gcc/
	* config/aarch64/aarch64.c (aarch64_override_options_internal):
	Add missing space before %<.

From-SVN: r270454
2019-04-19 11:08:49 +02:00
Peter Bergner 8503f963b0 re PR rtl-optimization/87871 (testcases fail after r265398 on arm)
PR rtl-optimization/87871
	* ira-lives.c (make_object_dead): Don't add conflicts to
	TOTAL_CONFLICT_HARD_REGS for register ignore_reg_for_conflicts.

From-SVN: r270448
2019-04-18 17:14:17 -05:00
Martin Sebor 6c76c0e408 PR middle-end/89797 - ICE on a vector_size (1LU << 33) int variable
gcc/ChangeLog:
	* tree.h (TYPE_VECTOR_SUBPARTS): Use HOST_WIDE_INT_1U.
	* config/aarch64/aarch64.c (aarch64_simd_vector_alignment): Avoid
	assuming type size fits in SHWI.

From-SVN: r270447
2019-04-18 14:26:07 -06:00
Jan Hubicka f6e809c849 re PR ipa/85051 (ICE: in edge_badness, at ipa-inline.c:1035 with flattening recursive calls)
PR ipa/85051
	* ipa-inline.c (flatten_function): New parameter UPDATE.
	(ipa_inline, early_inliner): Use it.

From-SVN: r270446
2019-04-18 17:03:00 +00:00
Segher Boessenkool 5f864b980a move ChangeLog entry to the correct file
From-SVN: r270444
2019-04-18 15:38:55 +02:00
Richard Sandiford 714996e2c2 Fix UB in int_const_binop
When testing PR 85164, the baseline bootstrap-ubsan results had
a lot of failures from int_const_binop.  This is because with the
new overflow handling we can sometimes do:

      poly_res = res;

on an uninitialised res.

2019-04-18  Richard Sandiford  <richard.sandiford@arm.com>

gcc/
	* fold-const.c (int_const_binop): Return early on failure.

From-SVN: r270443
2019-04-18 12:30:36 +00:00
Richard Sandiford cd7f7c54a4 Fix two ubsan failures (PR85164)
Two fixes for UB when handling very large offsets.  The calculation in
force_int_to_mode would have been correct if signed integers used modulo
arithmetic, so just switch to unsigned types.  The calculation in
rtx_addr_can_trap_p_1 didn't handle overflow properly, so switch to
known_subrange_p instead (which is supposed to handle all cases).

2019-04-18  Richard Sandiford  <richard.sandiford@arm.com>

gcc/
	PR middle-end/85164
	* combine.c (force_int_to_mode): Cast the argument rather than
	the result of known_alignment.
	* rtlanal.c (rtx_addr_can_trap_p_1): Use known_subrange_p.

gcc/testsuite/
	PR middle-end/85164
	* gcc.dg/pr85164-1.c, gcc.dg/pr85164-2.c: New tests.

From-SVN: r270442
2019-04-18 12:29:56 +00:00
Richard Biener e62817edae re PR debug/90131 (wrong debug info at -O3)
2019-04-18  Richard Biener  <rguenther@suse.de>

	PR debug/90131
	* tree-cfgcleanup.c (move_debug_stmts_from_forwarder): Split
	out from ...
	(remove_forwarder_block): ... here.
	(remove_forwarder_block_with_phi): Also move debug stmts here.

	* gcc.dg/guality/pr90131.c: New testcase.

From-SVN: r270441
2019-04-18 12:02:40 +00:00
Jakub Jelinek ff146a59dd re PR translation/79183 (Hard coded plurals in gimple-ssa-sprintf.c:2050)
PR translation/79183
	* gimple-ssa-sprintf.c (format_directive): Use inform_n instead of
	inform where appropriate.

From-SVN: r270438
2019-04-18 12:28:21 +02:00
Richard Biener 1b73c7ef7c tree.c (get_qualified_type): Put found type variants at the head of the variant list.
2019-04-18  Richard Biener  <rguenther@suse.de>

	* tree.c (get_qualified_type): Put found type variants at the
	head of the variant list.

From-SVN: r270437
2019-04-18 07:40:35 +00:00
Segher Boessenkool 2ad37a09fa rs6000: Remove a comma in a debug string
It is a bit confusing, it looks as if the compiler tried to print
something there.


	* config/rs6000/rs6000.c (rs6000_register_move_cost): Fix typo.

From-SVN: r270426
2019-04-17 23:11:00 +02:00
Jakub Jelinek aadd9a6e26 re PR target/90125 (Typo of AVX512 intrinsics)
PR target/90125
	* config/i386/avx512fintrin.h (_mm_maskz_fmadd_round_sd,
	_mm_maskz_fmadd_round_ss, _mm_maskz_fmsub_round_sd,
	_mm_maskz_fmsub_round_ss, _mm_maskz_fnmadd_round_sd,
	_mm_maskz_fnmadd_round_ss, _mm_maskz_fnmsub_round_sd,
	_mm_maskz_fnmsub_round_ss): Use _maskz builtin instead of _mask3.

	PR target/90125
	* gcc.target/i386/avx512f-vfmsubXXXss-2.c (avx512f_test): Adjust
	constants to ensure precise result even when not using fma.
	* gcc.target/i386/avx512f-vfnmaddXXXss-2.c (avx512f_test): Likewise.
	* gcc.target/i386/avx512f-vfmaddXXXsd-3.c: New test.
	* gcc.target/i386/avx512f-vfmaddXXXss-3.c: New test.
	* gcc.target/i386/avx512f-vfmsubXXXsd-3.c: New test.
	* gcc.target/i386/avx512f-vfmsubXXXss-3.c: New test.
	* gcc.target/i386/avx512f-vfnmaddXXXsd-3.c: New test.
	* gcc.target/i386/avx512f-vfnmaddXXXss-3.c: New test.
	* gcc.target/i386/avx512f-vfnmsubXXXsd-3.c: New test.
	* gcc.target/i386/avx512f-vfnmsubXXXss-3.c: New test.

From-SVN: r270421
2019-04-17 21:23:45 +02:00
Peter Bergner 38de8b39ef ira-conflicts.c (print_allocno_conflicts): Always print something, even for allocno's with no conflicts.
gcc/
	* ira-conflicts.c (print_allocno_conflicts): Always print something,
	even for allocno's with no conflicts.
	(print_conflicts): Print an extra newline.

From-SVN: r270420
2019-04-17 14:22:15 -05:00
Segher Boessenkool 46786144dd auto-inc-dec: Set alignment properly
When auto-inc-dec creates a new mem to compute the cost of doing some
transform, it forgets to copy over the alignment of the original mem.
This gives wrong costs, for example, for rs6000 a floating point load
or store is hugely expensive if unaligned.  This patch fixes it.


	* auto-inc-dec.c (attempt_change): Set the alignment of the
	temporary memory to that of the original.

From-SVN: r270419
2019-04-17 20:49:50 +02:00
Joao Moreira 62a64d0af1 targhooks.c (default_print_patchable_function_entry): Emit __patchable_function_entries section with writable flags to allow...
* targhooks.c (default_print_patchable_function_entry): Emit
	__patchable_function_entries section with writable flags to allow
	relocation resolution.

From-SVN: r270417
2019-04-17 12:24:23 -06:00
Jonny Grant e050689bb8 * collect2.c (main): Change gcc.gnu.org URL to HTTPS.
From-SVN: r270416
2019-04-17 12:11:06 -06:00
Jakub Jelinek 0764a0d275 re PR middle-end/90095 (wrong code with -Os -fno-tree-bit-ccp)
PR middle-end/90095
	* internal-fn.c (expand_mul_overflow): Don't set SUBREG_PROMOTED_VAR_P
	on lowpart SUBREGs.

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

From-SVN: r270410
2019-04-17 15:28:39 +02:00
Claudiu Zissulescu 2fa9c1f65f [ARC][COMMITTED] Fix diagnostic messages.
Apply upper/dot rule on diagnostic messages.

gcc/
xxxx-xx-xx  Claudiu Zissulescu  <claziss@synopsys.com>

	* config/arc/arc.c (arc_init): Format diagnostic string.
	(arc_override_options): Likewise.
	(check_if_valid_regno_const): Likewise.
	(arc_reorg): Likewise.

From-SVN: r270408
2019-04-17 13:09:59 +02:00
Segher Boessenkool 61943f94a0 rs6000: Improve the load/store-with-update patterns (PR17108)
Many of these patterns only worked in 32-bit mode, and some only worked
in 64-bit mode.  This patch makes these use Pmode, fixing the PR.  On
the other hand, the stack updates have to use the same mode for the
stack pointer as for the value stored, so let's simplify that a bit.

Many of these patterns pass the wrong mode to
avoiding_indexed_address_p (it should be the mode of the datum
accessed, not the mode of the pointer).

Finally, I merge some patterns into one (using iterators).


	PR target/17108
	* config/rs6000/rs6000.c (rs6000_split_multireg_move): Adjust pattern
	name.
	(rs6000_emit_allocate_stack_1): Simplify condition.  Adjust pattern
	name.
	* config/rs6000/rs6000.md (bits): Add entries for SF and DF.
	(*movdi_update1): Use Pmode.
	(movdi_<mode>_update): Fix argument to avoiding_indexed_address_p.
	(movdi_<mode>_update_stack): Rename to ...
	(movdi_update_stack): ... this.  Fix comment.  Change condition. Don't
	use Pmode.
	(*movsi_update1): Use Pmode.
	(*movsi_update2): Use Pmode.
	(movsi_update): Rename to ...
	(movsi_<mode>_update): ... this.  Use Pmode.
	(movsi_update_stack): Fix condition.
	(*movhi_update1): Use Pmode.  Fix argument to
	avoiding_indexed_address_p.
	(*movhi_update2): Ditto.
	(*movhi_update3): Ditto.
	(*movhi_update4): Ditto.
	(*movqi_update1): Ditto.
	(*movqi_update2): Ditto.
	(*movqi_update3): Ditto.
	(*movsf_update1, *movdf_update1): Merge, rename to...
	(*mov<mode>_update1): This.  Use Pmode.  Fix argument to
	avoiding_indexed_address_p.  Add "size" attribute.
	(*movsf_update2, *movdf_update2): Merge, rename to...
	(*mov<mode>_update2): This.  Ditto.
	(*movsf_update3): Use Pmode.  Fix argument to
	avoiding_indexed_address_p.
	(*movsf_update4): Ditto.
	(allocate_stack): Simplify condition.  Adjust pattern names.

From-SVN: r270407
2019-04-17 11:45:57 +02:00
Jakub Jelinek fc2b685884 re PR target/89093 (C++ exception handling clobbers d8 VFP register)
PR target/89093
	* config/arm/arm.c (arm_valid_target_attribute_rec): Don't skip
	whitespace at the start of target attribute string.

	* gcc.target/arm/pr89093-2.c: New test.

From-SVN: r270404
2019-04-17 10:30:44 +02:00
Pat Haugen 590df85d1c re PR target/84369 (test case gcc.dg/sms-10.c fails on power9)
PR target/84369
	* config/rs6000/power9.md: Add store forwarding bypass.

From-SVN: r270394
2019-04-16 15:58:02 +00:00
Alexandre Oliva 2689fcc80e [PR89528] reset debug uses of return value when dropping dead RTL call
When we remove an RTL call, we wouldn't clean up references to the
return value of the call in debug insns.  Make it so that we do.


for  gcc/ChangeLog

	PR debug/89528
	* valtrack.c (dead_debug_insert_temp): Reset debug references
	to the return value of a call being removed.

for  gcc/testsuite/ChangeLog

	PR debug/89528
	* gcc.dg/guality/pr89528.c: New.

From-SVN: r270389
2019-04-16 12:44:57 +00:00
Claudiu Zissulescu b9bc3b128c [ARC] Refactor deprecated macros.
xxxx-xx-xx  Claudiu Zissulescu  <claziss@synopsys.com>

	* config/arc/arc-protos.h (arc_register_move_cost): Remove.
	* config/arc/arc.c (arc_register_move_cost): Re-purpose it to
	implement target hook.
	(arc_memory_move_cost): New function.
	(TARGET_REGISTER_MOVE_COST): Define.
	(TARGET_MEMORY_MOVE_COST): Likewise.
	* config/arc/arc.h (REGISTER_MOVE_COST): Remove.
	(MEMORY_MOVE_COST): Likewise.

fix

From-SVN: r270387
2019-04-16 12:21:15 +02:00
Claudiu Zissulescu fa27cbfeb3 [ARC] Remove Rs5 constraint.
New LRA algorithms require the all the register constraints to be
defined using define_register_constraint keyword. However, Rs5
constraint was not LRA proof. Remove it and replace it by equivalent
Rcd constraint.

gcc/
xxxx-xx-xx  Claudiu Zissulescu  <claziss@synopsys.com>

	* config/arc/arc.md (sibcall_insn): Use Rcd constraint.
	(sibcall_value_insn): Likewise.
	* config/arc/constraints.md (Rs5): Remove.

From-SVN: r270386
2019-04-16 12:21:03 +02:00
Claudiu Zissulescu 47d8cb2384 [ARC] Refurb eliminate regs.
gcc/
xxxx-xx-xx  Claudiu Zissulescu  <claziss@synopsys.com>

        * config/arc/arc.c (arc_hard_regno_modes): Add two missing modes
        for last two fake registers.
        (arc_conditional_register_usage): Make sure fake frame and arg
        pointer regs are in general regs class.
        (FRAME_POINTER_MASK): Remove.
        (RETURN_ADDR_MASK): Remove.
        (arc_must_save_register): Use hard frame regnum.
        (frame_restore_reg): Use hard_frame_pointer_rtx.
        (arc_save_callee_saves): Likewise.
        (arc_restore_callee_saves): Likewise.
        (arc_save_callee_enter): Likewise.
        (arc_restore_callee_leave): Likewise.
        (arc_save_callee_milli): Likewise.
        (arc_eh_return_address_location): Likewise.
        (arc_check_multi): Use hard frame regnum.
        (arc_can_eliminate): Likewise.
        * config/arc/arc.h (FIXED_REGISTERS): Make FP register available
        for register allocator.
        (REG_CLASS_CONTENTS): Update GENERAL_REGS.
        (REGNO_OK_FOR_BASE_P): Consider FRAME_POINTER_REGNUM.
        (FRAME_POINTER_REGNUM): Change it to a fake register.
        (HARD_FRAME_POINTER_REGNUM): Defined.
        (ARG_POINTER_REGNUM): Change it to a new fake register.
        (ELIMINABLE_REGS): Update.
        (REGISTER_NAMES): Update names.
        * config/arc/arc.md (LP_START): Remove.
        (LP_END): Likewise.
        (shift_si3_loop): Update pattern.

From-SVN: r270385
2019-04-16 12:20:52 +02:00
Claudiu Zissulescu 1ec86e1eaa [ARC] Emit blockage regardless to avoid delay slot scheduling.
1.The delay slot scheduler can reschedule some of the frame related
instructions resulting in having incorect CFI information. This patch
introduces a schedule blockage to avoid this problem.

2.There are cases when an interrupt may happen and not all the current
function stack operations are done, which may result in stack
corruption. Such an example is accessing an returning a local
structure members, which members are allocated on stack. The stack
adjustment and the accessing of the struct member can be reorder as
they may not use both the SP register for the access.

3.Also, do not save/restore SP when in interrupt. The SP is switch by
the core IRQ machinery.

gcc/
xxxx-xx-xx  Claudiu Zissulescu  <claziss@synopsys.com>

	* config/arc/arc.c (arc_expand_prologue): Emit blockage regardless
	to avoid delay slot scheduling.
	(arc_must_save_register): Don't save SP.
	* config/arc/arc.md (stack_tie): Remove.
	(UNSPEC_ARC_STKTIE): Likewise.

From-SVN: r270384
2019-04-16 12:20:40 +02:00
Kito Cheng 85b242968b [NDS32] Fix nds32_split_ashiftdi3 with large shift amount.
gcc/
	* config/nds32/nds32-md-auxiliary.c (nds32_split_ashiftdi3): Fix wrong
	code gen with large shift amount.

Co-Authored-By: Shiva Chen <shiva0217@gmail.com>

From-SVN: r270383
2019-04-16 09:27:31 +00:00
Chung-Ju Wu 7f85e52c40 [NDS32] Handle subreg correctly in wext_odd_dep_p.
gcc/
	* config/nds32/nds32-pipelines-auxiliary.c (wext_odd_dep_p): Handle
	subreg.

From-SVN: r270382
2019-04-16 09:22:26 +00:00
Jakub Jelinek 8feb61a3c5 re PR target/90096 (Misleading option hint for AVX intrinsics)
PR target/90096
	* config/i386/i386.c (ix86_target_string): Add ADD_ABI_P argument, only
	print -m64/-mx32/-m32 if it is true.
	(ix86_debug_options, ix86_function_specific_print): Pass true as
	ADD_ABI_P to ix86_target_string.
	(ix86_expand_builtin): Adjust ix86_target_string caller, pass true as
	ADD_ABI_P only if OPTION_MASK_ISA_64BIT is set in bisa and in that case
	or into it OPTION_MASK_ISA_ABI_64 or OPTION_MASK_ISA_ABI_X32.

	* gcc.target/i386/pr90096.c: New test.
	* gcc.target/i386/pr69255-1.c: Adjust expected diagnostics.
	* gcc.target/i386/pr69255-2.c: Likewise.
	* gcc.target/i386/pr69255-3.c: Likewise.

From-SVN: r270381
2019-04-16 10:40:58 +02:00
Jakub Jelinek 234b5365c5 re PR rtl-optimization/90082 (ICE in delete_unmarked_insns, at dce.c:653)
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: r270380
2019-04-16 10:26:26 +02:00
Jakub Jelinek 41b5808d56 re PR tree-optimization/90090 (ICE in mark_reachable_handlers, at tree-eh.c:3938 since r219202)
PR tree-optimization/90090
	* tree-ssa-math-opts.c (is_division_by): Ignore divisions that can
	throw internally.
	(is_division_by_square): Likewise.  Formatting fix.

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

From-SVN: r270379
2019-04-16 10:24:47 +02:00
Richard Biener 8c996ec644 re PR tree-optimization/56049 (Simplification to constants not done)
2019-04-16  Richard Biener  <rguenther@suse.de>

	PR tree-optimization/56049
	* tree-ssa-loop-im.c (mem_ref_hasher::equal): Elide alias-set
	equality check if alias-set zero will prevail.

	* gfortran.dg/pr56049.f90: New testcase.

From-SVN: r270378
2019-04-16 07:55:41 +00:00
Jeff Law afe9b7c5e6 microblaze.c (microblaze_expand_block_move): Treat size and alignment as unsigned.
* config/microblaze/microblaze.c (microblaze_expand_block_move): Treat
	size and alignment as unsigned.

From-SVN: r270373
2019-04-15 15:19:21 -06:00
Richard Biener b7a9e9f4a2 re PR debug/90074 (wrong debug info at -O3)
2019-04-15  Richard Biener  <rguenther@suse.de>

	PR debug/90074
	* tree-loop-distribution.c (destroy_loop): Preserve correct
	debug info.

	* gcc.dg/guality/pr90074.c: New testcase.

From-SVN: r270370
2019-04-15 12:26:11 +00:00
Richard Biener 98dc565ef0 re PR tree-optimization/90071 (internal compiler error: SSA corruption)
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.

From-SVN: r270369
2019-04-15 11:59:02 +00:00
Richard Biener 869032b176 re PR ipa/88936 (-fipa-pta breaks bash (incorrect optimisation of recursive static function))
2019-04-15  Richard Biener  <rguenther@suse.de>

	PR ipa/88936
	* tree.h (auto_var_p): Declare.
	* tree.c (auto_var_p): New function, split out from ...
	(auto_var_in_fn_p): ... here.
	* tree-ssa-structalias.c (struct variable_info): Add shadow_var_uid
	member.
	(new_var_info): Initialize it.
	(set_uids_in_ptset): Also set the shadow variable uid if required.
	(ipa_pta_execute): Postprocess points-to solutions assigning
	shadow variable uids for locals that may reach their containing
	function recursively.
	* tree-ssa-ccp.c (fold_builtin_alloca_with_align): Do not
	assert but instead check whether the points-to solution is
	a singleton.

	* gcc.dg/torture/pr88936-1.c: New testcase.
	* gcc.dg/torture/pr88936-2.c: Likewise.
	* gcc.dg/torture/pr88936-3.c: Likewise.

From-SVN: r270366
2019-04-15 10:09:08 +00:00
Martin Jambor 79a1870200 Reorganize cgraph_node::clone_of_p
2019-04-15  Martin Jambor  <mjambor@suse.cz>

	PR ipa/pr89693
	* cgraph.c (clone_of_p): Loop over clone chain for each step in
	the thunk chain.

	testsuite/
	* g++.dg/ipa/pr89693.C: New test.

From-SVN: r270364
2019-04-15 10:30:36 +02:00
Monk Chiang 3da4a68a3e [NDS32] nds32*-*-linux* target using init_array/finit_array for ctor/dtor.
gcc/
	* config.gcc (nds32*-*-linux*): Set gcc_cv_initfini_array to yes.

From-SVN: r270362
2019-04-15 08:05:03 +00:00
Monk Chiang 0398ae783a [NDS32] Rewrite PIC/TLS patterns.
gcc/
	* config/nds32/nds32-md-auxiliary.c
	(nds32_legitimize_pic_address): Use new PIC pattern.
	(nds32_legitimize_tls_address): Use new TLS pattern.
	(nds32_output_symrel): New.
	* config/nds32/nds32-protos.h (nds32_output_symrel): Declare.
	(nds32_alloc_relax_group_id): Ditto.
	* config/nds32/nds32-relax-opt.c (nds32_alloc_relax_group_id): New.
	(nds32_group_insns): Use nds32_alloc_relax_group_id instead of use
	relax_group_id.
	(nds32_group_tls_insn): Ditto.
	(nds32_group_float_insns): Ditto.
	* config/nds32/nds32.md (tls_le): New.
	(sym_got): Ditto.

Co-Authored-By: Kito Cheng <kito.cheng@gmail.com>
Co-Authored-By: Shiva Chen <shiva0217@gmail.com>

From-SVN: r270361
2019-04-15 07:59:01 +00:00
Chung-Ju Wu 303ebdaf6c [NDS32] Provide one valid nds32 assembly instruction to check assembler debugging options and features.
gcc/
	* configure: Add nds32 target for dwarf2 debug_line checking.
	* configure.ac: Regenerated.

From-SVN: r270359
2019-04-15 07:39:20 +00:00
Jan Hubicka d2a0371d26 re PR lto/89358 (Combining -std=c++14 and -std=c++17 objects gives ODR warnings)
PR lto/89358
	* g++.dg/lto/pr89358_0.C: New testcase.
	* g++.dg/lto/pr89358_1.C: New testcase.
	* ipa-devirt.c (skip_in_fields_list_p): New.
	(odr_types_equivalent_p): Use it.

From-SVN: r270355
2019-04-14 20:56:45 +00:00
Jakub Jelinek 6cf5881044 re PR target/89093 (C++ exception handling clobbers d8 VFP register)
PR target/89093
	* config/arm/arm.c (arm_valid_target_attribute_rec): Use strcmp
	instead of strncmp when checking for thumb and arm.  Formatting fixes.

	* gcc.target/arm/pr89093.c: New test.

From-SVN: r270339
2019-04-13 17:20:46 +02:00
Iain Buclaw bb50312e02 libphobos: Add target-zlib to top-level configure
Removes the building of zlib from within libphobos, using instead the
libz_convenience.a library.

ChangeLog:

2019-04-12  Iain Buclaw  <ibuclaw@gdcproject.org>

	* configure.ac: Add target-zlib to target_libraries.
	* configure: Regenerate.

gcc/ChangeLog:

2019-04-12  Iain Buclaw  <ibuclaw@gdcproject.org>

	* doc/install.texi: Document --with-target-system-zlib.

libphobos/ChangeLog:

2019-04-12  Iain Buclaw  <ibuclaw@gdcproject.org>

	* m4/druntime/libraries.m4 (DRUNTIME_LIBRARIES_ZLIB): Use
	libz_convenience.a if not using system zlib.
	* Makefile.in: Regenerate.
	* configure: Regenerate.
	* libdruntime/Makefile.in: Regenerate.
	* src/Makefile.am: Remove ZLIB_CSOURCES and AM_CFLAGS.
	* src/Makefile.in: Regenerate.
	* testsuite/Makefile.in: Regenerate.

From-SVN: r270328
2019-04-12 20:13:34 +00:00
Martin Sebor 3fb82380dc PR c/88383 - ICE calling __builtin_has_attribute on a reference
PR c/88383 - ICE calling __builtin_has_attribute on a reference
PR c/89288 - ICE in tree_code_size, at tree.c:865
PR c/89798 - excessive vector_size silently accepted and truncated
PR c/89797 - ICE on a vector_size (1LU << 33) int variable

gcc/ChangeLog:

	PR c/89797
	* targhooks.c (default_vector_alignment): Avoid assuming
	argument fits in SHWI.
	* tree.h (TYPE_VECTOR_SUBPARTS): Avoid sign overflow in
	a shift expression.
	* doc/extend.texi (__builtin_has_attribute): Add a clarifying note.

gcc/c-family/ChangeLog:

	PR c/88383
	PR c/89288
	PR c/89798
	PR c/89797
	* c-attribs.c (type_valid_for_vector_size): Detect excessively
	large sizes.
	(validate_attribute): Handle DECLs and expressions.
	(has_attribute): Handle types referenced by expressions.
	Avoid considering array attributes in ARRAY_REF expressions .

gcc/cp/ChangeLog:

	PR c/88383
	PR c/89288
	* parser.c (cp_parser_has_attribute_expression): Handle assignment
	expressions.

gcc/testsuite/ChangeLog:

	PR c/88383
	PR c/89288
	PR c/89798
	PR c/89797
	* c-c++-common/attributes-1.c: Adjust.
	* c-c++-common/builtin-has-attribute-6.c: New test.
	* c-c++-common/builtin-has-attribute-7.c: New test.
	* c-c++-common/builtin-has-attribute-4.c: Adjust expectations.
	* c-c++-common/builtin-has-attribute-6.c: New test.
	* c-c++-common/pr71574.c: Adjust.
	* gcc.dg/pr25559.c: Adjust.
	* gcc.dg/attr-vector_size.c: New test.

From-SVN: r270326
2019-04-12 13:01:17 -06:00
Jakub Jelinek 76416d899c re PR rtl-optimization/89965 (wrong code with -O -mtune=nano-x2 -fcaller-saves -fexpensive-optimizations -fno-tree-dce -fno-tree-ter)
PR rtl-optimization/89965
	* dce.c: Include rtl-iter.h.
	(struct check_argument_load_data): New type.
	(check_argument_load): New function.
	(find_call_stack_args): Check for loads from stack slots still tracked
	in sp_bytes and punt if any is found.

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

From-SVN: r270323
2019-04-12 18:20:21 +02:00
Jakub Jelinek b2e77a37a2 * config/mips/loongson-mmiintrin.h: Fix up #error message.
From-SVN: r270322
2019-04-12 18:16:35 +02:00
Jan Hubicka 0c7f51e401 params.def (PARAM_MAX_LTO_STREAMING_PARALLELISM): New parameter.
* params.def (PARAM_MAX_LTO_STREAMING_PARALLELISM): New parameter.
	* lto.c (do_stream_out): rename to ...
	(stream_out): ... this one; move original code to ...
	(stream_out_partitions_1, stream_out_partitions): ... these new
	functions.
	(lto_wpa_write_files): Honnor lto_parallelism

From-SVN: r270317
2019-04-12 14:35:48 +00:00
Martin Liska a164374ef1 Handle multiple 'default' in target attribute (PR middle-end/89970).
2019-04-12  Martin Liska  <mliska@suse.cz>

	PR middle-end/89970
	* multiple_target.c (create_dispatcher_calls): Wrap ifunc
	in error message.
	(separate_attrs): Handle multiple 'default's.
	(expand_target_clones): Rework error handling code.
2019-04-12  Martin Liska  <mliska@suse.cz>

	PR middle-end/89970
	* gcc.target/i386/mvc15.c: New test.
	* gcc.target/i386/mvc3.c: Quote target in error pattern.
	* gcc.target/i386/mvc4.c: Remove duplicit 'default'.

From-SVN: r270314
2019-04-12 12:54:00 +00:00
Kelvin Nilsen 34f02c07fb re PR target/87532 (bad results from vec_extract(unsigned char, foo) dependent upon function inline)
gcc/ChangeLog:

2019-04-12  Kelvin Nilsen  <kelvin@gcc.gnu.org>

	PR target/87532
	* config/rs6000/rs6000.c (rs6000_split_vec_extract_var): Use inner
	mode of vector rather than mode of destination for move instruction.
	* config/rs6000/vsx.md (*vsx_extract_<mode>_<VS_scalar>mode_var):
	Use QI inner mode with V16QI vector mode.

gcc/testsuite/ChangeLog:

2019-04-12  Kelvin Nilsen  <kelvin@gcc.gnu.org>

	PR target/87532
	* gcc.target/powerpc/fold-vec-extract-char.p8.c: Adjust expected
	instruction counts.
	* gcc.target/powerpc/fold-vec-extract-int.p8.c: Likewise.
	* gcc.target/powerpc/fold-vec-extract-short.p8.c: Likewise.

From-SVN: r270313
2019-04-12 12:51:58 +00:00
Jakub Jelinek 0ef88b2031 re PR target/52726 (Composed error message will not get translated)
PR target/52726
	* config/tilepro/tilepro.c (tilepro_print_operand): Use just
	"invalid %%t operand" in output_operand_lossage message.

From-SVN: r270308
2019-04-12 10:10:51 +02:00
Andreas Krebbel 2541c40f06 S/390: Fix a problem with the bswap vector pattern
arch13 introduced instructions to perform vector element-wise byte
swaps on the way from or to memory.  For a byte swap between vector
registers the vector permute instruction is required which needs a
permute pattern to be loaded into a vector register first.

With the current implementation there is a potential problem when the
decision for the reg-reg variant is made very late.  This patch is
supposed to fix that.

With the patch the required permute pattern is generated already in
the expander and attached to the bswap pattern as USE operand.  The
predicate in the insn_and_split pattern accepts it although the
permute constant as such is not a valid constant.  For the reg-reg
variant only the vector register constraint is used for the permute
constant forcing LRA to a) push the constant into literal pool and b)
load the literal pool constant into a vector register.

gcc/ChangeLog:

2019-04-12  Andreas Krebbel  <krebbel@linux.ibm.com>

	* config/s390/predicates.md (permute_pattern_operand): New
	predicate.
	* config/s390/vector.md ("*vec_splats_bswap_vec<mode>"): Add USE
	operand for the permute pattern.
	("*vec_perm<mode>"): New insn definition.
	("bswap<mode>"): Generate the permute pattern operand in the
	expander and perform the operand reloads for pre arch13 level
	already.
	("*bswap<mode>_emu"): Rename to ...
	("*bswap<mode>"): ... this. And make the splitter vxe2 only.
	* config/s390/vx-builtins.md ("*vec_insert_and_zero_bswap<mode>"):
	Add the USE operand for the permute pattern.
	("*vec_set_bswap_vec<mode>"): Likewise.

From-SVN: r270306
2019-04-12 07:41:51 +00:00
Jakub Jelinek 8e8225e69d re PR c/89946 (ICE in assemble_start_function, at varasm.c:1871)
PR c/89946
	* varasm.c (assemble_start_function): Don't use tree_fits_uhwi_p
	and gcc_unreachable if it fails, just call tree_to_uhwi which
	verifies that too.  Test TREE_CHAIN instead of list_length > 1.
	Start warning message with a lower-case letter.  Formatting fixes.
c-family/
	* c-attribs.c (handle_patchable_function_entry_attribute): Add
	function comment.  Warn if arguments of the attribute are not positive
	integer constants.
testsuite/
	* c-c++-common/pr89946.c: New test.

From-SVN: r270305
2019-04-12 09:28:35 +02:00
Jakub Jelinek c758576acc re PR rtl-optimization/90026 (ICE: verify_flow_info failed (error: missing barrier after block 2))
PR rtl-optimization/90026
	* cfgcleanup.c (try_optimize_cfg): When removing empty bb with no
	successors, look for BARRIERs inside of the whole BB_FOOTER chain
	rather than just at the start of it.  If e->src BB_FOOTER is not NULL
	in cfglayout mode, use emit_barrier_after_bb.

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

From-SVN: r270304
2019-04-12 09:27:25 +02:00
Steve Ellcey f0a8f6bcb0 re PR rtl-optimization/87763 (aarch64 target testcases fail after r265398)
2018-04-11  Steve Ellcey  <sellcey@marvell.com>

	PR rtl-optimization/87763
	* config/aarch64/aarch64.md (*aarch64_bfi<GPI:mode>4_noshift_alt):
	New Instruction.

From-SVN: r270288
2019-04-11 18:02:41 +00:00
Tom de Vries cd7ffd8a93 [doc] Note variable shadowing at max macro using statement expression
When suggesting to rewrite the unsafe (with respect to multiple evaluation of
arguments) macro definition:
...
  #define max(a,b) ((a) > (b) ? (a) : (b))
...
into the safe macro definition:
...
  #define maxint(a,b) \
    ({int _a = (a), _b = (b); _a > _b ? _a : _b; })
...
mention the variable shadowing problem for:
...
  #define maxint3(a, b, c) \
    ({int _a = (a), _b = (b), _c = (c); maxint (maxint (_a, _b), _c); })
...

2019-04-11  Tom de Vries  <tdevries@suse.de>

	* doc/extend.texi (@node Statement Exprs): Note variable shadowing at
	max macro using statement expression.

From-SVN: r270287
2019-04-11 15:36:59 +00:00
David Edelsohn 8f1d8deb29 xcoffout.h (xcoff_private_rodata_section_name): Declare.
* xcoffout.h (xcoff_private_rodata_section_name): Declare.
        * xcoffout.c (xcoff_private_rodata_section_name): Define.
        * config/rs6000/rs6000.c (rs6000_xcoff_asm_init_sections): Create
        read_only_private_data_section using xcoff_private_rodata_section_name.
        (rs6000_xcoff_file_start): Generate xcoff_private_rodata_section_name.

From-SVN: r270284
2019-04-11 10:14:35 -04:00
Christophe Lyon f499726a00 [aarch64] PR90016 - aarch64: reference to undeclared N in help for command line option
2019-04-11  Christophe Lyon  <christophe.lyon@linaro.org>

	PR target/90016
	* config/aarch64/aarch64.opt (msve-vector-bits): Add missing final '.'.

From-SVN: r270280
2019-04-11 12:56:08 +02:00
Jakub Jelinek 1b4d15e855 re PR rtl-optimization/89965 (wrong code with -O -mtune=nano-x2 -fcaller-saves -fexpensive-optimizations -fno-tree-dce -fno-tree-ter)
PR rtl-optimization/89965
	* dce.c (sp_based_mem_offset): New function.
	(find_call_stack_args): Use sp_based_mem_offset.

From-SVN: r270278
2019-04-11 11:02:47 +02:00
Jonathan Wakely ecb3e9a46e Clarify documentation for -flive-patching
* doc/invoke.texi (Optimize Options): Clarify -flive-patching docs.

From-SVN: r270276
2019-04-11 09:52:22 +01:00
Richard Biener 3bab738598 re PR tree-optimization/90020 (-O2 -Os x86-64 wrong code generated for GNU Emacs)
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: r270275
2019-04-11 07:34:20 +00:00
Richard Biener 2fd579ab53 re PR tree-optimization/90018 (r265453 miscompiled 527.cam4_r in SPEC CPU 2017)
2019-04-11  Richard Biener  <rguenther@suse.de>

	PR tree-optimization/90018
	* tree-vect-data-refs.c (vect_preserves_scalar_order_p):
	Test both SLP and interleaving variants.

	* gcc.dg/vect/pr90018.c: New testcase.

From-SVN: r270273
2019-04-11 07:30:59 +00:00
Robin Dapp 375a6bc674 S/390: Add arch13 pipeline and model number
This patch adds the pipeline description and the CPU model number for
arch13.

From-SVN: r270272
2019-04-11 07:04:03 +00:00
Steve Ellcey 6a0d393901 re PR rtl-optimization/87763 (aarch64 target testcases fail after r265398)
2018-04-10  Steve Ellcey  <sellcey@marvell.com>

	PR rtl-optimization/87763
	* config/aarch64/aarch64-protos.h (aarch64_masks_and_shift_for_bfi_p):
	New prototype.
	* config/aarch64/aarch64.c (aarch64_masks_and_shift_for_bfi_p):
	New function.
	* config/aarch64/aarch64.md (*aarch64_bfi<GPI:mode>5_shift):
	New instruction.
	(*aarch64_bfi<GPI:mode>5_shift_alt): Ditto.
	(*aarch64_bfi<GPI:mode>4_noand): Ditto.
	(*aarch64_bfi<GPI:mode>4_noand_alt): Ditto.
	(*aarch64_bfi<GPI:mode>4_noshift): Ditto.

From-SVN: r270266
2019-04-10 20:28:19 +00:00
Jonathan Wakely a7f8aa3ee7 Change wording of -fipa-icf documentation
* doc/invoke.texi (Optimize Options): Change "Nevertheless" to
	"Although" in -fipa-icf documentation.

From-SVN: r270260
2019-04-10 15:55:01 +01:00
Jonathan Wakely 07c2fa4665 Clearly document behaviour of multiple -g options
This copies the wording from the -O options to clearly state what
happens if more than one -g option is used.

	* doc/invoke.texi (Debugging Options): Explicitly state the semantics
	of using multiple -g options.

From-SVN: r270257
2019-04-10 15:39:59 +01:00
Martin Liska 620626daa5 Make gcov docs more precise (PR gcov-profile/89959).
2019-04-10  Martin Liska  <mliska@suse.cz>

	PR gcov-profile/89959
	* doc/gcov.texi: Make documentation of -x option
	more precise.

From-SVN: r270251
2019-04-10 11:44:08 +00:00
Richard Biener f95b759770 tree-vectorizer.h (_stmt_vec_info): Remove same_dr_stmt member.
2019-04-10  Richard Biener  <rguenther@suse.de>

	* tree-vectorizer.h (_stmt_vec_info): Remove same_dr_stmt
	member.
	(DR_GROUP_SAME_DR_STMT): Remove.
	* tree-vect-stmts.c (vectorizable_load): Remove unreachable code.
	* tree-vect-data-refs.c (vect_analyze_group_access_1): Likewise,
	replace with assert.
	(vect_analyze_data_ref_accesses): Fix INTEGER_CST comparison.
	(vect_record_grouped_load_vectors): Remove unreachable code.

From-SVN: r270250
2019-04-10 11:25:10 +00:00
Richard Earnshaw 1feb075a76 [aarch64] PR90016 - aarch64: reference to undeclared N in help for command line option
'to N' is now redundant and misleading given the earlier change to use
<number>.

Removed.

	PR target/90016
	* config/aarch64/aarch64.opt (msve-vector-bits): Remove redundant and
	obsolete reference to N.

From-SVN: r270248
2019-04-10 09:51:16 +00:00
Jakub Jelinek 9d40923511 re PR middle-end/90025 (botan2 miscompilation on s390x-linux since r268957)
PR middle-end/90025
	* expr.c (store_expr): Set properly size on the MEM passed to
	clear_storage.

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

From-SVN: r270247
2019-04-10 09:28:05 +02:00
Jakub Jelinek c9c5e18883 re PR c++/90010 (valgrind error with snprintf and -Wall)
PR c++/90010
	* gimple-ssa-sprintf.c (target_to_host): Fix handling of targstr
	with strlen in between hostsz-3 and hostsz-1 inclusive when no
	translation is needed, and when translation is needed, only append
	... if the string length is hostsz or more bytes long.  Avoid using
	strncpy or strcat.

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

From-SVN: r270246
2019-04-10 09:27:20 +02:00
Matthew Malcomson e009dfb320 Hi there,
The "*neon_mov<mode>" patterns for 128 bit sized quantities uses the "Dn"
constraint to match vmov.f32 and vmov.i<vec-width> patterns.
This constraint boils down to using the `neon_immediate_valid` function.
Once the constraint has matched, the output C statement asserts that function
passes.

The output C statement calls `neon_immediate_valid` with the mode taken from the
iterator, while the constraint takes the mode from the operand.
This can cause a discrepency when the operand is a CONST_INT, as the constraint
passes VOIDmode which `neon_immediate_valid` treats as DImode, while the C
statement passes the mode of the iterator which can be TImode.
When this happens, the `neon_immediate_valid` can fail in the second call (if
e.g. the CONST_INT is a valid immediate in DImode but not TImode) which would
trigger the assertion.

The testcase added with this patch triggers this when compiled with an arm cross
compiler using the command line below.
gcc -march=armv8-a -c neon-immediate-timode.c -O1 -mfloat-abi=hard -mfpu=neon-fp-armv8

This patch splits the original "Dn" constraint into three new constraints, "DN"
for TImode CONST_INT, "Dn" for DImode CONST_INT, and "Dm" for CONST_VECTOR.
Splitting things up this way requires using one extra alternative in the
"*neon_mov<mode>" patterns, but makes it clear from the constraint what mode is
being used.

We also remove the behaviour of treating VOIDmode as DImode in
`neon_valid_immediate` since the original "Dn" constraint was the only place
that functionality was used.  VOIDmode is now never passed to that function.
An assertion has been added to the function to ensure this problem is caught
earlier on.

Bootstrapped on arm-none-linux-gnueabihf
Regtested on cross-compiler arm-none-eabi

gcc/ChangeLog:

2019-04-09  Matthew Malcomson  <matthew.malcomson@arm.com>

	PR target/90024
	* config/arm/arm.c (neon_valid_immediate): Disallow VOIDmode parameter.
	* config/arm/constraints.md (Dm, DN, Dn): Split previous Dn constraint
	into three.
	* config/arm/neon.md (*neon_mov<mode>): Account for TImode and DImode
	differences directly.
	(*smax<mode>3_neon, vashl<mode>3, vashr<mode>3_imm): Use Dm constraint.

gcc/testsuite/ChangeLog:

2019-04-09  Matthew Malcomson  <matthew.malcomson@arm.com>

	PR target/90024
	* gcc.dg/torture/neon-immediate-timode.c: New test.

From-SVN: r270226
2019-04-09 11:39:59 +00:00
Jakub Jelinek 765f8786cf re PR translation/90011 (trailing space in diagnostic)
PR translation/90011
	* ipa-devirt.c (compare_virtual_tables): Remove two trailing spaces
	from diagnostics.
	* config/arm/freebsd.h (LINK_SPEC): Remove trailing space from -p
	diagnostics.
	* config/riscv/freebsd.h (LINK_SPEC): Likewise.
	* config/aarch64/aarch64-freebsd.h (FBSD_TARGET_LINK_SPEC): Likewise.
	* config/darwin.h (DRIVER_SELF_SPECS, ASM_FINAL_SPEC): Remove
	trailing space from -gsplit-dwarf diagnostics.

From-SVN: r270225
2019-04-09 12:27:14 +02:00
Jakub Jelinek a73468e8c7 re PR middle-end/89998 (ICE: verify_gimple failed in printf-return-value)
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: r270224
2019-04-09 12:26:13 +02:00
Martin Liska 1c67e69c0d Come up with bootstrap-lto-lean config.
2019-04-09  Martin Liska  <mliska@suse.cz>

	* Makefile.in: Regenerate.
	* Makefile.tpl: Pass GENERATOR_CFLAGS
	in all stages.
2019-04-09  Martin Liska  <mliska@suse.cz>

	* bootstrap-lto-lean.mk: New file.
2019-04-09  Martin Liska  <mliska@suse.cz>

	* Makefile.in: Use GENERATOR_CFLAGS for all generators.
	* doc/install.texi: Document the new config.

From-SVN: r270223
2019-04-09 08:49:14 +00:00
Richard Sandiford 6c0b8df123 SVE fallout from PR90006
2019-04-08  Richard Sandiford  <richard.sandiford@arm.com>

gcc/
	* 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.

From-SVN: r270222
2019-04-09 07:50:51 +00:00
Jakub Jelinek 31215daa9b re PR target/90015 (riscv: typo "intterupt" in diagnostic)
PR target/90015
	* config/riscv/riscv.c (riscv_get_interrupt_type): Fix comment typo.
	(riscv_merge_decl_attributes): Fix typo in diagnostics.  Remove
	trailing period from it too.

	* gcc.target/riscv/interrupt-conflict-mode.c (foo): Adjust expected
	diagnostics.

From-SVN: r270221
2019-04-09 08:38:07 +02:00
wu yuan 8108dfde82 [AArch64] Add tsv110 pipeline scheduling
Committed on behalf of Wu Yuan:

2019-04-04  wu yuan <wuyuan5@huawei.com>

	* config/aarch64/aarch64-cores.def (tsv1100): Change scheduling model.
	* config/aarch64/aarch64.md : Add "tsv110.md"
	* config/aarch64/tsv110.md: New file.

From-SVN: r270212
2019-04-08 17:08:32 +00:00
Richard Biener a265c9a929 re PR tree-optimization/90006 (gcc loops indefinitely around vect_get_constant_vectors on -O2 -ftree-slp-vectorize -fno-math-errno)
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.

From-SVN: r270210
2019-04-08 13:54:02 +00:00
Andrea Corallo 450dd8b3ab The fma_forest, fma_root_node and func_fma_steering classes lack a copy constructor.
The fma_forest, fma_root_node and func_fma_steering classes lack a
copy constructor.  However, they contain pointers to allocated memory
so this omission can be regarded as poor style.  We don't need to copy
such objects, so declare the copy constructor private to inhibit
accidental copying.

2019-04-08  Andrea Corallo  <andrea.corallo@arm.com>

	PR target/83033
	* config/aarch64/cortex-a57-fma-steering.c (fma_forest): Prohibit copy
	construction.
	(fma_root_node): Likewise.
	(func_fma_steering): Likewise.

From-SVN: r270207
2019-04-08 12:59:24 +00:00
Jakub Jelinek 0d0f212a51 re PR rtl-optimization/89865 (FAIL: gcc.target/i386/pr49095.c scan-assembler-times \\\\), % 45)
PR rtl-optimization/89865
	* config/i386/i386.md: Add peepholes for z = x; x ^= y; x != z.

	* gcc.target/i386/pr49095.c: Don't expect any RMW sequences.

From-SVN: r270206
2019-04-08 14:36:58 +02:00
Jakub Jelinek 8ad68a6d87 re PR rtl-optimization/89865 (FAIL: gcc.target/i386/pr49095.c scan-assembler-times \\\\), % 45)
PR rtl-optimization/89865
	* config/i386/i386.md
	(SWI12 peephole for mem {+,-,&,|,^}= x; mem != 0): Fix up operand
	numbers not to clash with the additional operands[4].
	(peepholes for mem {+,-,&,|,^}= x; mem != 0): New peephole2s
	with extra register copy in the middle.

	* gcc.target/i386/pr49095.c: Adjust number of expected RMW spots
	on ia32.

From-SVN: r270205
2019-04-08 14:35:22 +02:00
Martin Liska 99603e9044 Add data_file to GCOV interm. format (PR gcov-profile/89961).
2019-04-08  Martin Liska  <mliska@suse.cz>

	PR gcov-profile/89961
	* doc/gcov.texi: Document data_file.
	* gcov.c (generate_results): Add data_info into JSON output.

From-SVN: r270204
2019-04-08 12:16:15 +00:00
Bin Cheng d6366157de re PR middle-end/89725 (ICE in get_fnname_from_decl, at varasm.c:1723)
2019-04-01  Bin Cheng  <bin.cheng@linux.alibaba.com>

	PR tree-optimization/89725
	* tree-chrec.c (chrec_contains_symbols): New parameter.  Handle outer
	loop's chrec as invariant symbol.
	* tree-chrec.h (chrec_contains_symbols): New parameter.
	* tree-data-ref.c (analyze_miv_subscript): Pass new argument.
	(build_classic_dist_vector_1, add_other_self_distances): Bypass access
	function of loops not in DDR's loop_nest.
	* tree-data-ref.h (index_in_loop_nest): Add unreachable check.

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

From-SVN: r270203
2019-04-08 11:52:18 +00:00
Chenghua Xu 636349faba re PR target/89623 (Can't build mips-wrs-vxworks cross-compiler)
2019-04-08  Chenghua Xu  <paul.hua.gm@gmail.com>

	gcc/
	PR target/89623
	* config/mips/mips.opt (LOONGSON_EXT2): Use Var instead of
	Mask.

From-SVN: r270198
2019-04-08 06:37:00 +00:00
Uros Bizjak 1e157fa312 ChangeLog: Fix whitespace.
* ChangeLog: Fix whitespace.
	* testsuite/ChangeLog: Ditto.

From-SVN: r270191
2019-04-07 21:30:22 +02:00
Uros Bizjak 45acde2fe0 re PR target/89945 (ICE in gen_lowpart_general, at rtlhooks.c:63)
PR target/89945
	* config/i386/i386.md (anddi_1 to andsi_1_zext splitter):
	Avoid calling gen_lowpart with SYMBOL_REF and LABEL_REF operand.

testsuite/ChangeLog:

	PR target/89945
	* gcc.target/i386/pr89945.c: New test.

From-SVN: r270190
2019-04-07 21:19:08 +02:00
Joern Rennecke e36710207c sched-deps.c (sched_macro_fuse_insns): Check return value of targetm.fixed_condition_code_regs.
* sched-deps.c (sched_macro_fuse_insns): Check return value of
        targetm.fixed_condition_code_regs.

From-SVN: r270167
2019-04-05 16:01:01 +01:00
Richard Biener 25eafae67f re PR debug/89892 (gcc generates wrong debug information at -O2)
2019-04-05  Richard Biener  <rguenther@suse.de>

	PR debug/89892
	PR debug/89905
	* tree-cfgcleanup.c (remove_forwarder_block): Always move
	debug bind stmts but reset them if they are not valid at the
	destination.

	* gcc.dg/guality/pr89892.c: New testcase.
	* gcc.dg/guality/pr89905.c: Likewise.
	* gcc.dg/guality/loop-1.c: Likewise.

From-SVN: r270165
2019-04-05 11:55:45 +00:00
Martin Liska 2723350fc6 Fix ChangeLog entries.
contrib/ChangeLog:

2019-04-03  Martin Liska  <mliska@suse.cz>

	PR translation/89936
	* check-internal-format-escaping.py: Properly detect wrong
	apostrophes.

gcc/ChangeLog:

2019-04-03  Martin Liska  <mliska@suse.cz>

	PR translation/89936
	* collect-utils.c (collect_execute): Use %< and %>, or %qs in
	order to wrap keywords or arguments.
	* collect2.c (main): Likewise.
	(scan_prog_file): Likewise.
	(scan_libraries): Likewise.
	* common/config/riscv/riscv-common.c (riscv_subset_list::parsing_subset_version): Likewise.
	(riscv_subset_list::parse_std_ext): Likewise.
	* config/aarch64/aarch64.c (aarch64_override_options_internal): Likewise.
	* config/arm/arm.c (arm_option_override): Likewise.
	* config/cris/cris.c (cris_print_operand): Likewise.
	* config/darwin-c.c (darwin_pragma_options): Likewise.
	(darwin_pragma_unused): Likewise.
	(darwin_pragma_ms_struct): Likewise.
	* config/ft32/ft32.c (ft32_print_operand): Likewise.
	* config/i386/i386.c (print_reg): Likewise.
	(ix86_print_operand): Likewise.
	* config/i386/xm-djgpp.h: Likewise.
	* config/iq2000/iq2000.c (iq2000_print_operand): Likewise.
	* config/m32c/m32c.c (m32c_option_override): Likewise.
	* config/msp430/msp430.c (msp430_option_override): Likewise.
	* config/nds32/nds32.c (nds32_option_override): Likewise.
	* config/nvptx/mkoffload.c (main): Likewise.
	* config/rx/rx.c (rx_print_operand): Likewise.
	(valid_psw_flag): Likewise.
	* config/vms/vms-c.c (vms_pragma_member_alignment): Likewise.
	(vms_pragma_nomember_alignment): Likewise.
	(vms_pragma_extern_model): Likewise.
	* lto-wrapper.c (compile_offload_image): Likewise.
	* omp-offload.c (oacc_parse_default_dims): Likewise.
	* symtab.c (symtab_node::verify_base): Likewise.
	* tlink.c (recompile_files): Likewise.
	(start_tweaking): Likewise.
	* tree-profile.c (parse_profile_filter): Likewise.

gcc/objc/ChangeLog:

2019-04-03  Martin Liska  <mliska@suse.cz>

	PR translation/89936
	* objc-act.c (objc_add_property_declaration): Use %< and %>, or %qs in
	order to wrap keywords or arguments.
	(objc_add_synthesize_declaration_for_property): Likewise.

From-SVN: r270164
2019-04-05 09:04:41 +00:00
Martin Liska 904f3daa02 Remove usage of apostrophes in error and warning messages (PR translation/89935).
2019-04-05  Martin Liska  <mliska@suse.cz>

	PR translation/89935
	* check-internal-format-escaping.py: Properly detect wrong
	apostrophes.
2019-04-05  Martin Liska  <mliska@suse.cz>

	PR translation/89935
	* collect-utils.c (collect_execute): Use %< and %>, or %qs in
	order to wrap keywords or arguments.
	* collect2.c (main): Likewise.
	(scan_prog_file): Likewise.
	(scan_libraries): Likewise.
	* common/config/riscv/riscv-common.c (riscv_subset_list::parsing_subset_version): Likewise.
	(riscv_subset_list::parse_std_ext): Likewise.
	* config/aarch64/aarch64.c (aarch64_override_options_internal): Likewise.
	* config/arm/arm.c (arm_option_override): Likewise.
	* config/cris/cris.c (cris_print_operand): Likewise.
	* config/darwin-c.c (darwin_pragma_options): Likewise.
	(darwin_pragma_unused): Likewise.
	(darwin_pragma_ms_struct): Likewise.
	* config/ft32/ft32.c (ft32_print_operand): Likewise.
	* config/i386/i386.c (print_reg): Likewise.
	(ix86_print_operand): Likewise.
	* config/i386/xm-djgpp.h: Likewise.
	* config/iq2000/iq2000.c (iq2000_print_operand): Likewise.
	* config/m32c/m32c.c (m32c_option_override): Likewise.
	* config/msp430/msp430.c (msp430_option_override): Likewise.
	* config/nds32/nds32.c (nds32_option_override): Likewise.
	* config/nvptx/mkoffload.c (main): Likewise.
	* config/rx/rx.c (rx_print_operand): Likewise.
	(valid_psw_flag): Likewise.
	* config/vms/vms-c.c (vms_pragma_member_alignment): Likewise.
	(vms_pragma_nomember_alignment): Likewise.
	(vms_pragma_extern_model): Likewise.
	* lto-wrapper.c (compile_offload_image): Likewise.
	* omp-offload.c (oacc_parse_default_dims): Likewise.
	* symtab.c (symtab_node::verify_base): Likewise.
	* tlink.c (recompile_files): Likewise.
	(start_tweaking): Likewise.
	* tree-profile.c (parse_profile_filter): Likewise.
2019-04-05  Martin Liska  <mliska@suse.cz>

	PR translation/89935
	* objc-act.c (objc_add_property_declaration): Use %< and %>, or %qs in
	order to wrap keywords or arguments.
	(objc_add_synthesize_declaration_for_property): Likewise.

From-SVN: r270163
2019-04-05 08:37:44 +00:00
Richard Sandiford 8d6b13da61 Make FMA code cope with redundant negates (PR89956)
This patch fixes a case in which, due to forced missed optimisations
in earlier passes, we have:

    _1 = a * b
    _2 = -_1
    _3 = -_1
    _4 = _2 + _3

and treated _4 as two FNMA candidates, once via _2 and once via _3.

2019-04-05  Richard Sandiford  <richard.sandiford@arm.com>

gcc/
	PR tree-optimization/89956
	* tree-ssa-math-opts.c (convert_mult_to_fma): Protect against
	multiple negates of the same value.

gcc/testsuite/
	PR tree-optimization/89956
	* gfortran.dg/pr89956.f90: New test.

From-SVN: r270162
2019-04-05 07:31:12 +00:00
Martin Sebor 1a9b15a7d7 PR middle-end/89957 - ICE calling strnlen with an int128_t bound in a known range
PR middle-end/89957 - ICE calling strnlen with an int128_t bound in a known range
PR middle-end/89911 - [9 Regression] ICE in get_attr_nonstring_decl

gcc/ChangeLog:

	PR middle-end/89957
	PR middle-end/89911
	* builtins.c (expand_builtin_strnlen): Make sure wi::ltu_p operands
	have the same precision since the function crashes otherwise.
	* calls.c (maybe_warn_nonstring_arg): Avoid assuming strnlen() call
	has non-zero arguments.

gcc/testsuite/ChangeLog:

	PR middle-end/89957
	PR middle-end/89911
	* gcc.dg/Wstringop-overflow-13.c: New test.

From-SVN: r270154
2019-04-04 16:38:10 -06:00
Martin Sebor 9a0cbb60d2 PR middle-end/89934 - ICE on a call with fewer arguments to strncpy declared without prototype
gcc/ChangeLog:

	PR middle-end/89934
	* gimple-ssa-warn-restrict.c (builtin_access::builtin_access): Bail
	out if the number of arguments is less than expected.

gcc/testsuite/ChangeLog:

	PR middle-end/89934
	* gcc.dg/Wrestrict-19.c: New test.
	* gcc.dg/Wrestrict-5.c: Add comment.  Remove unused code.

From-SVN: r270152
2019-04-04 15:59:49 -06:00
Jeff Law c2457887ea re PR target/89399 (ICE: RTL check: expected code 'set', 'clobber' or 'clobber_high', have 'parallel' in combine_reaching_defs, at ree.c:783)
PR rtl-optimization/89399
	* ree.c (combine_set_extension): Use single_set rather than
	digging into PATTERN for items on the candidate list.
	(combine_reaching_defs): Likewise.

	PR rtl-optimization/89399
	* gcc.c-torture/compile/pr89399.c: New test.

From-SVN: r270151
2019-04-04 14:52:16 -06:00
Richard Sandiford 6541e97d4d DF usage in loop-invariant.c (PR46590)
- df_live is already present at -O2, so we only need to add it and
  mark all blocks dirty for -O

- df_process_deferred_rescans should be enough to force a rescan of
  blocks affected by moving invariants, but calling it in find_defs
  means that we don't do any rescans for the final loop

2019-04-04  Richard Sandiford  <richard.sandiford@arm.com>

gcc/
	PR rtl-optimization/46590
	* loop-invariant.c (find_defs): Move df_remove_problem and
	df_process_deferred_rescans to move_invariants.
	Move df_live_add_problem and df_live_set_all_dirty calls
	to move_invariants.
	(move_invariants): Likewise.
	(move_loop_invariants): Likewise, making the df_live calls
	conditional on -O.  Remove the problem again if we added it
	locally.

From-SVN: r270142
2019-04-04 07:35:34 +00:00
Qing Zhao bc53dee0ba re PR tree-optimization/89730 (-flive-patching=inline-only-static should grant always_inline attribute for extern function)
2019-04-03  qing zhao  <qing.zhao@oracle.com>

	PR tree-optimization/89730
	* ipa-inline.c (can_inline_edge_p): Delete the checking for
	-flive-patching=inline-only-static.
	(can_inline_edge_by_limits_p): Add the checking for 
	-flive-patching=inline-only-static and grant always_inline
	even when -flive-patching=inline-only-static is specified. 

	* gcc.dg/live-patching-4.c: New test.

From-SVN: r270134
2019-04-03 19:00:25 +00:00
Jeff Law 9427422dda re PR rtl-optimization/81025 (gcc ICE while building glibc for MIPS soft-float multi-lib variant)
PR rtl-optimization/81025
        * reorg.c (skip_consecutive_labels): Do not skip past a BARRIER.

From-SVN: r270129
2019-04-03 10:03:37 -06:00
Richard Biener c51b04ec33 re PR rtl-optimization/84101 (-O3 and -ftree-vectorize trying too hard for function returning trivial pair-of-uint64_t-structure)
2019-04-03  Richard Biener  <rguenther@suse.de>

	PR tree-optimization/84101
	* tree-vect-stmts.c: Include explow.h for hard_function_value,
	regs.h for hard_regno_nregs.
	(cfun_returns): New helper.
	(vect_model_store_cost): When vectorizing a store to a decl
	we return and the function ABI returns in a multi-reg location
	account for the possible spilling that will happen.

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

From-SVN: r270123
2019-04-03 12:30:16 +00:00