Commit Graph

66464 Commits

Author SHA1 Message Date
GCC Administrator 303f81ad7e Update ChangeLog and version files for release
From-SVN: r247493
2017-05-02 12:42:24 +00:00
Richard Biener cdd7941640 re PR tree-optimization/80591 (AArch64 kernel miscompilation starting with r246809)
2017-05-02  Richard Biener  <rguenther@suse.de>

	PR tree-optimization/80591
	Revert
	2017-04-10  Richard Biener  <rguenther@suse.de>

	* tree-ssa-structalias.c (find_func_aliases): Properly handle
	asm inputs.

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

From-SVN: r247487
2017-05-02 11:26:25 +00:00
Jakub Jelinek 82052c2822 re PR bootstrap/80531 (RC1 bootstrap comparison failure)
PR bootstrap/80531
	* cgraph.h (symtab_node::debug_symtab): No longer inline.
	* symtab.c (symtab_node::debug_symtab): Move definition here.

From-SVN: r247368
2017-04-28 13:42:14 +02:00
Richard Earnshaw c2f36c35da [AArch64] Fix for gcc-7 regression PR 80530
This patch fixes the regression caused by the changes to add square root
estimation when compiling for xgene-1 or exynos-m1 targets.

The issue is that the expand path for the reciprocal estimate square
root pattern assumes that pattern cannot fail once it has been decided
that this expansion path is available, but because the logic deep inside
aarch64_emit_approx_sqrt() differs from use_rsqrt_p() the two disagree
as to what is safe.

This patch refactors the logic to ensure that we cannot unknowingly make
different choices here.

	PR target/80530
	* config/aarch64/aarch64.c (aarch64_emit_approx_sqrt): Ensure
	that the logic for permitting reciprocal estimates matches that
	in use_rsqrt_p.

From-SVN: r247341
2017-04-27 14:11:47 +00:00
Jakub Jelinek a240da2d3a re PR c++/80534 (7.1 RC - internal compiler error: in finish_member_declaration, at cp/semantics.c:2963)
PR c++/80534
	* tree.c (type_cache_hasher::equal): Only compare
	TYPE_TYPELESS_STORAGE flag on non-aggregate element types.
	(build_array_type_1): Only hash TYPE_TYPELESS_STORAGE flag on
	non-aggregate element types.
	* tree.h (TYPE_TYPELESS_STORAGE): Fix comment typo, add more details
	about the flag on ARRAY_TYPEs in the comment, formatting fix.
c-family/
	* c-common.c (complete_array_type): Only hash TYPE_TYPELESS_STORAGE
	flag on non-aggregate element types.
testsuite/
	* g++.dg/other/pr80534-1.C: New test.
	* g++.dg/other/pr80534-2.C: New test.

From-SVN: r247337
2017-04-27 15:47:54 +02:00
Jakub Jelinek e469603e97 re PR target/79430 (action of statement incorrectly optimised away)
PR target/79430
	* reg-stack.c (emit_swap_insn): If i1src mentions the stack pointer,
	punt if tmp contains autoinc of stack pointer.

From-SVN: r247308
2017-04-27 11:58:43 +02:00
Jakub Jelinek a22d92795b re PR target/77728 (Miscompilation multiple vector iteration on ARM)
PR target/77728
	* config/aarch64/aarch64.c (struct aarch64_fn_arg_alignment): Remove.
	(aarch64_function_arg_alignment): Return unsigned int again, but still
	ignore TYPE_FIELDS chain decls other than FIELD_DECLs.
	(aarch64_layout_arg): Adjust aarch64_function_arg_alignment caller.
	Don't emit -Wpsabi note.
	(aarch64_function_arg_boundary): Likewise.
	(aarch64_gimplify_va_arg_expr): Adjust aarch64_function_arg_alignment
	caller.
testsuite/
	* g++.dg/abi/pr77728-2.C: Don't expect -Wpsabi notes.

From-SVN: r247293
2017-04-27 09:14:24 +02:00
Martin Sebor 8550e48ac4 PR tree-optimization/80497 - ICE at -O1 and above on valid code on x86_64-linux-gnu in tree_to_uhwi
gcc/ChangeLog:

	PR tree-optimization/80497
	* gimple-ssa-sprintf.c (get_int_range): Avoid assuming all integer
	constants are representable in HOST_WIDE_INT.
	(parse_directive): Ditto.

gcc/testsuite/ChangeLog:

	PR tree-optimization/80497
	* gcc.dg/tree-ssa/builtin-sprintf-warn-17.c: New test.

From-SVN: r247264
2017-04-25 11:58:32 -06:00
Marek Polacek 8ef2085d4c re PR sanitizer/80349 (UBSAN: compile time crash with "type mismatch in binary expression" message)
PR sanitizer/80349
	* fold-const.c (fold_binary_loc) <case BIT_IOR_EXPR>: Convert arg0's
	first argument to type.

	* g++.dg/ubsan/pr80349-2.C: New test.

From-SVN: r247260
2017-04-25 17:02:27 +00:00
Ramana Radhakrishnan 6bcf239ec5 re PR target/77728 (Miscompilation multiple vector iteration on ARM)
PR target/77728
	* config/arm/arm.c: Include gimple.h.
	(aapcs_layout_arg): Emit -Wpsabi note if arm_needs_doubleword_align
	returns negative, increment ncrn only if it returned positive.
	(arm_needs_doubleword_align): Return int instead of bool,
	ignore DECL_ALIGN of non-FIELD_DECL TYPE_FIELDS chain
	members, but if there is any such non-FIELD_DECL
	> PARM_BOUNDARY aligned decl, return -1 instead of false.
	(arm_function_arg): Emit -Wpsabi note if arm_needs_doubleword_align
	returns negative, increment nregs only if it returned positive.
	(arm_setup_incoming_varargs): Likewise.
	(arm_function_arg_boundary): Emit -Wpsabi note if
	arm_needs_doubleword_align returns negative, return
	DOUBLEWORD_ALIGNMENT only if it returned positive.
testsuite/
	* g++.dg/abi/pr77728-1.C: New test.

Co-Authored-By: Jakub Jelinek <jakub@redhat.com>

From-SVN: r247259
2017-04-25 18:47:32 +02:00
Bill Seurer d3de3474fc [PATCH, rs6000] pr80482 Relax vector builtin parameter checks
PR target/80482
Backport from mainline

This patch changes the parameter testing for powerpc vector builtins to relax
the existing requirement that the parameters be identical to instead that they
be compatible.  This allows for mixing parameters with differing qualified
(const, volatile, etc.) types.

See https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80482 for more information.

Bootstrapped and tested on powerpc64le-unknown-linux-gnu and
powerpc64be-unknown-linux-gnu with no regressions.  Is this ok for trunk?

[gcc]

2017-04-25  Bill Seurer  <seurer@linux.vnet.ibm.com>

	Backport from mainline
	PR target/80482
	* config/rs6000/rs6000-c.c (altivec_resolve_overloaded_builtin): Change
	type checks to test for compatibility instead of equality.

[gcc/testsuite]

2017-04-25  Bill Seurer  <seurer@linux.vnet.ibm.com>

	Backport from mainline
	PR target/80482
	* gcc.target/powerpc/vec-constvolatile.c: New test.

From-SVN: r247256
2017-04-25 16:16:13 +00:00
Ramana Radhakrishnan fd8de490a7 re PR target/77728 (Miscompilation multiple vector iteration on ARM)
PR target/77728
	* config/aarch64/aarch64.c (struct aarch64_fn_arg_alignment): New
	type.
	(aarch64_function_arg_alignment): Return aarch64_fn_arg_alignment
	struct.  Ignore DECL_ALIGN of decls other than FIELD_DECL for
	the alignment computation, but return their maximum in warn_alignment.
	(aarch64_layout_arg): Adjust aarch64_function_arg_alignment caller.
	Emit a -Wpsabi note if warn_alignment is 16 bytes, but alignment
	is smaller.
	(aarch64_function_arg_boundary): Likewise.  Simplify using MIN/MAX.
	(aarch64_gimplify_va_arg_expr): Adjust aarch64_function_arg_alignment
	caller.
testsuite/
	* g++.dg/abi/pr77728-2.C: New test.

Co-Authored-By: Jakub Jelinek <jakub@redhat.com>

From-SVN: r247241
2017-04-25 15:56:10 +02:00
Andreas Krebbel 1ab303de18 S/390: PR80464: Split MEM->GPR vector moves
We do this already for TImode values but it was missing for vector
modes.

gcc/ChangeLog:

2017-04-25  Andreas Krebbel  <krebbel@linux.vnet.ibm.com>

	Backport from mainline
	2017-04-25  Andreas Krebbel  <krebbel@linux.vnet.ibm.com>

	PR target/80464
	* config/s390/vector.md: Split MEM->GPR vector moves for
	non-s_operand addresses.

gcc/testsuite/ChangeLog:

2017-04-25  Andreas Krebbel  <krebbel@linux.vnet.ibm.com>

	Backport from mainline
	2017-04-25  Andreas Krebbel  <krebbel@linux.vnet.ibm.com>

	PR target/80464
	* gfortran.fortran-torture/compile/pr80464.f90: New test.

From-SVN: r247191
2017-04-25 11:18:52 +00:00
Andreas Krebbel e898f963a6 S/390: PR79895: Fix TImode constant handling
The P constraint letter is supposed to match every constant which is
acceptable during reload.  However, constraints do not appear to be
able to handle const_wide_int yet.  It works with predicates so the
alternative is modelled with a new predicate now.

gcc/ChangeLog:

2017-04-25  Andreas Krebbel  <krebbel@linux.vnet.ibm.com>

	Backport from mainline
	2017-04-25  Andreas Krebbel  <krebbel@linux.vnet.ibm.com>

	PR target/79895
	* config/s390/predicates.md (reload_const_wide_int_operand): New
	predicate.
	* config/s390/s390.md ("movti"): Remove d/P alternative.
	("movti_bigconst"): New pattern definition.

gcc/testsuite/ChangeLog:

2017-04-25  Andreas Krebbel  <krebbel@linux.vnet.ibm.com>

	Backport from mainline
	2017-04-25  Andreas Krebbel  <krebbel@linux.vnet.ibm.com>

	PR target/79895
	* gcc.target/s390/pr79895.c: New test.

From-SVN: r247190
2017-04-25 11:15:44 +00:00
Dominik Vogt d2780ff270 S/390: PR80080: Optimize atomic patterns.
The attached patch optimizes the atomic_exchange and atomic_compare
patterns on s390 and s390x (mostly limited to SImode and DImode).
Among general optimizaation, the changes fix most of the problems
reported in PR 80080:
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80080

gcc/ChangeLog:

2017-04-25  Dominik Vogt  <vogt@linux.vnet.ibm.com>

	Backport from mainline
	2017-04-25  Dominik Vogt  <vogt@linux.vnet.ibm.com>

	PR target/80080
	* s390-protos.h (s390_expand_cs_hqi): Removed.
	(s390_expand_cs, s390_expand_atomic_exchange_tdsi): New prototypes.
	* config/s390/s390.c (s390_emit_compare_and_swap): Handle all integer
	modes as well as CCZ1mode and CCZmode.
	(s390_expand_atomic_exchange_tdsi, s390_expand_atomic): Adapt to new
	signature of s390_emit_compare_and_swap.
	(s390_expand_cs_hqi): Likewise, make static.
	(s390_expand_cs_tdsi): Generate an explicit compare before trying
	compare-and-swap, in some cases.
	(s390_expand_cs): Wrapper function.
	(s390_expand_atomic_exchange_tdsi): New backend specific expander for
	atomic_exchange.
	(s390_match_ccmode_set): Allow CCZmode <-> CCZ1 mode.
	* config/s390/s390.md ("atomic_compare_and_swap<mode>"): Merge the
	patterns for small and large integers.  Forbid symref memory operands.
	Move expander to s390.c.  Require cc register.
	("atomic_compare_and_swap<DGPR:mode><CCZZ1:mode>_internal")
	("*atomic_compare_and_swap<TDI:mode><CCZZ1:mode>_1")
	("*atomic_compare_and_swapdi<CCZZ1:mode>_2")
	("*atomic_compare_and_swapsi<CCZZ1:mode>_3"): Use s_operand to forbid
	symref memory operands.  Remove CC mode and call s390_match_ccmode
	instead.
	("atomic_exchange<mode>"): Allow and implement all integer modes.

gcc/testsuite/ChangeLog:

2017-04-25  Dominik Vogt  <vogt@linux.vnet.ibm.com>

	Backport from mainline
	2017-04-25  Dominik Vogt  <vogt@linux.vnet.ibm.com>

	PR target/80080
	* gcc.target/s390/md/atomic_compare_exchange-1.c: New test.
	* gcc.target/s390/md/atomic_compare_exchange-1.inc: New test.
	* gcc.target/s390/md/atomic_exchange-1.inc: New test.

From-SVN: r247189
2017-04-25 11:11:48 +00:00
Dominik Vogt 009c145997 S/390: Load and test peephole.
gcc/ChangeLog:

2017-04-25  Dominik Vogt  <vogt@linux.vnet.ibm.com>

	Backport from mainline
	2017-04-25  Dominik Vogt  <vogt@linux.vnet.ibm.com>

        * config/s390/s390.md (define_peephole2): New peephole to help
        combining the load-and-test pattern with volatile memory.

From-SVN: r247188
2017-04-25 11:08:06 +00:00
Dominik Vogt 16fce46b16 S/390: Load and test peephole.
gcc/ChangeLog:

2017-04-25  Dominik Vogt  <vogt@linux.vnet.ibm.com>

	Backport from mainline
	2017-04-25  Dominik Vogt  <vogt@linux.vnet.ibm.com>

        * config/s390/s390.md (define_peephole2): New peephole to help
        combining the load-and-test pattern with volatile memory.

From-SVN: r247187
2017-04-25 11:04:42 +00:00
Jakub Jelinek 31a66be10f re PR rtl-optimization/80501 (Wrong code w/ a signed char, a shift, and a conversion to int)
PR rtl-optimization/80501
	* combine.c (make_compound_operation_int): Set subreg_code to SET
	even for AND with mask of the sign bit of mode.

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

From-SVN: r247129
2017-04-25 09:29:21 +02:00
Jakub Jelinek 75092192da re PR rtl-optimization/80500 (ICE: internal consistency failure (error: invalid rtl sharing found in the insn))
PR rtl-optimization/80500
	* loop-unroll.c (combine_var_copies_in_loop_exit): Call copy_rtx on
	sum's initial value.

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

From-SVN: r247127
2017-04-25 09:27:47 +02:00
Martin Liska 84341de847 Subject: Backport r247097
2017-04-24  Martin Liska  <mliska@suse.cz>

	Backport from mainline
	2017-04-24  Jan Hubicka  <hubicka@ucw.cz>

	PR middle-end/79931
	* ipa-devirt.c (dump_possible_polymorphic_call_targets): Fix ICE.
2017-04-24  Martin Liska  <mliska@suse.cz>

	Backport from mainline
	2017-04-24  Martin Liska  <mliska@suse.cz>

	PR middle-end/79931
	* g++.dg/ipa/pr79931.C: New test.

From-SVN: r247102
2017-04-24 14:48:43 +00:00
Alexander Monakov 70cae6302a omp-low: fix lastprivate/linear lowering for SIMT
Backport from mainline r247029
gcc/
	* omp-low.c (lower_lastprivate_clauses): Correct handling of linear and
	lastprivate clauses in SIMT case.

libgomp/
	* testsuite/libgomp.c/target-36.c: New testcase.

From-SVN: r247032
2017-04-20 20:59:25 +03:00
Matthew Fortune 120fbfd0ee MIPS: Prevent buffer overrun in uninitialised variable fix
Backport from mainline
2017-04-20  Matthew Fortune  <matthew.fortune@imgtec.com>

gcc/
	* config/mips/mips.c (mips_expand_vec_perm_const): Re-fix
	uninitialized variable warning to avoid buffer overrun.

From-SVN: r247023
2017-04-20 13:39:50 +00:00
Jakub Jelinek 6eceeed7af * DEV-PHASE: Set to prerelease.
From-SVN: r247019
2017-04-20 12:48:41 +02:00
Thomas Preud'homme 633c65dda8 [ARM] Fix type for .init_array.* and .fini_array.* sections
2017-04-20  Thomas Preud'homme  <thomas.preudhomme@arm.com>

    gcc/
    * config/arm/arm.c (arm_elf_asm_cdtor): Create non-default
    priority .init_array and .fini_array section with SECTION_NOTYPE
    flag.

From-SVN: r247015
2017-04-20 09:44:18 +00:00
Jakub Jelinek 8a59d4660c re PR middle-end/80423 (GC related -fcompare-debug failure)
PR middle-end/80423
	* tree.h (build_array_type): Add typeless_storage default argument.
	* tree.c (type_cache_hasher::equal): Also compare
	TYPE_TYPELESS_STORAGE flag for ARRAY_TYPEs.
	(build_array_type): Add typeless_storage argument, set
	TYPE_TYPELESS_STORAGE to it, if shared also hash it, and pass to
	recursive call.
	(build_nonshared_array_type): Adjust build_array_type_1 caller.
	(build_array_type): Likewise.  Add typeless_storage argument.
c-family/
	* c-common.c (complete_array_type): Preserve TYPE_TYPELESS_STORAGE.
cp/
	* tree.c (build_cplus_array_type): Call build_array_type
	with the intended TYPE_TYPELESS_STORAGE flag value, instead
	of calling build_array_type and modifying later TYPE_TYPELESS_STORAGE
	on the shared type.
testsuite/
	* g++.dg/other/pr80423.C: New test.

From-SVN: r247014
2017-04-20 11:18:02 +02:00
Eric Botcazou fe1e7d0e9b re PR tree-optimization/80426 (wrong manipulation of range based on INT_MIN)
PR tree-optimization/80426
	* tree-vrp.c (extract_range_from_binary_expr_1): For an additive
	operation on symbolic operands, also compute the overflow for the
	invariant part when the operation degenerates into a negation.

	PR tree-optimization/80426
	* gcc.c-torture/execute/20170419-1.c: New test.

Co-Authored-By: Jakub Jelinek <jakub@redhat.com>

From-SVN: r247007
2017-04-19 13:27:09 -06:00
Jakub Jelinek f19e6a9c0b re PR debug/80461 (ICE in modified_type_die, at dwarf2out.c:12566)
PR debug/80461
	* dwarf2out.c (modified_type_die, gen_type_die_with_usage):
	Check for t with zero TYPE_QUALS_NO_ADDR_SPACE.

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

From-SVN: r247002
2017-04-19 18:32:02 +02:00
Jakub Jelinek 48d811eb1c re PR debug/80436 (-fcompare-debug failure)
PR debug/80436
	* tree-ssa-loop-manip.c (find_uses_to_rename_def): Ignore debug uses.

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

From-SVN: r247000
2017-04-19 18:29:45 +02:00
Georg-Johann Lay 8264e6c39c re PR target/80462 ([avr] Incorrect "warning: uninitialized variable 'xxx' put into program memory area" for identical strings)
PR target/80462
	* config/avr/avr.c (tree.h): Include it.
	(cgraph.h): Include it.
	(avr_encode_section_info): Don't warn for uninitialized progmem
	variable if it's just an alias.

From-SVN: r246997
2017-04-19 12:20:57 +00:00
Richard Biener 664306b9d8 Update SSA after AutoPGO early inlining (PR ipa/65972).
2017-04-19  Richard Biener  <rguenther@suse.de>

	PR ipa/65972
	* auto-profile.c (afdo_vpt_for_early_inline): Update SSA
	when needed by AutoPGO.

From-SVN: r246996
2017-04-19 12:06:35 +00:00
Paulo Matos 0f605f729e Fix typo in LTO documentation (PR lto/50345).
2017-04-19  Paulo J. Matos  <paulo@matos-sorge.com>

	PR lto/50345
	* doc/lto.texi: Remove an extra 'that'.

From-SVN: r246995
2017-04-19 12:00:47 +00:00
Segher Boessenkool fd1ca3fe77 IRA: Don't create new regs for debug insns (PR80429)
In split_live_ranges_for_shrink_wrap IRA also splits regs that are
only used in debug insns, leading to -fcompare-debug failures.


	PR rtl-optimization/80429
	* ira.c (split_live_ranges_for_shrink_wrap): Don't split regs that
	are only used in debug insns.

From-SVN: r246991
2017-04-19 12:03:35 +02:00
Eric Botcazou a16c8d8b61 predicates.md (input_operand): Add comment.
* config/sparc/predicates.md (input_operand): Add comment.  Return
	true for any memory operand when LRA is in progress.
	* config/sparc/sparc.c (sparc_expand_move): Minor formatting fix.

Co-Authored-By: Jeff Law <law@redhat.com>
Co-Authored-By: Vladimir Makarov <vmakarov@redhat.com>

From-SVN: r246989
2017-04-19 08:05:36 +00:00
Jeff Law d904a98328 re PR target/74563 (Classic MIPS16 (non-MIPS16e) function return broken)
PR target/74563
	* mips.md ({return,simple_return}_internal): Do not overwrite
	operands[0].

	PR target/74563
	* gcc.target/mips/pr74563: New test.

From-SVN: r246987
2017-04-18 22:52:54 -06:00
Jakub Jelinek 0155ed56af re PR tree-optimization/80443 (ICE on valid code at -O2 on x86_64-linux-gnu: in set_value_range, at tree-vrp.c:367)
PR tree-optimization/80443
	* tree-vrp.c (intersect_ranges): For signed 1-bit precision type,
	instead of adding 1, subtract -1 and similarly instead of subtracting
	1 add -1.

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

From-SVN: r246981
2017-04-18 21:17:32 +02:00
Richard Sandiford f380f60822 re PR rtl-optimization/80357 (ICE in model_update_limit_points_in_group, at haifa-sched.c:1982 on powerpc64le-linux-gnu)
gcc/
	PR rtl-optimization/80357
	* haifa-sched.c (tmp_bitmap): New variable.
	(model_recompute): Handle duplicate use records.
	(alloc_global_sched_pressure_data): Initialize tmp_bitmap.
	(free_global_sched_pressure_data): Free it.

gcc/testsuite/
	PR rtl-optimization/80357
	* gcc.c-torture/compile/pr80357.c: New test.

From-SVN: r246980
2017-04-18 12:49:19 -06:00
Bernd Edlinger 7754ee3577 revert: Makefile.in (BUILD_SYSTEM_HEADER_DIR): New make variabe.
2017-04-18  Bernd Edlinger  <bernd.edlinger@hotmail.de>

        Revert:
        2017-02-20  Bernd Edlinger  <bernd.edlinger@hotmail.de>
        * Makefile.in (BUILD_SYSTEM_HEADER_DIR): New make variabe.
        (LIMITS_H_TEST, if_multiarch, stmp-fixinc): Use BUILD_SYSTEM_HEADER_DIR
        instead of SYSTEM_HEADER_DIR.

From-SVN: r246979
2017-04-18 18:10:27 +00:00
Jeff Law dd68669b66 re PR middle-end/80422 (ICE on valid code at -O3 in 32-bit mode on x86_64-linux-gnu: in operator[], at vec.h:732)
PR middle-end/80422
	* cfgcleanup.c (try_crossjump_to_edge): Verify SRC1 and SRC2 have
	predecessors after walking up the insn chain.

	PR middle-end/80422
	* gcc.c-torture/compile/pr80422.c: New test.

From-SVN: r246975
2017-04-18 11:31:30 -06:00
Jakub Jelinek 1cda61fc28 re PR debug/80263 (gcc's internal type "sizetype" leaks out as base type name in the DWARF info)
PR debug/80263
	* dwarf2out.c (modified_type_die): Try harder not to emit internal
	sizetype type into debug info.

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

From-SVN: r246973
2017-04-18 18:58:48 +02:00
Michael Meissner 1997025337 re PR target/80099 (ICE in rs6000_expand_vector_extract, at config/rs6000/rs6000.c:7450)
[gcc]
2017-04-18  Michael Meissner  <meissner@linux.vnet.ibm.com>

	PR target/80099
	* config/rs6000/rs6000.c (rs6000_expand_vector_extract): Eliminate
	unneeded test for TARGET_UPPER_REGS_SF.
	* config/rs6000/vsx.md (vsx_extract_v4sf_var): Likewise.

[gcc/testsuite]
2017-04-18  Michael Meissner  <meissner@linux.vnet.ibm.com>

	PR target/80099
	* gcc.target/powerpc/pr80099-1.c: New test.
	* gcc.target/powerpc/pr80099-2.c: Likewise.
	* gcc.target/powerpc/pr80099-3.c: Likewise.
	* gcc.target/powerpc/pr80099-4.c: Likewise.
	* gcc.target/powerpc/pr80099-5.c: Likewise.

From-SVN: r246972
2017-04-18 16:41:06 +00:00
Jakub Jelinek 3b5fb3cb5b re PR sanitizer/80444 (-fcompare-debug failures with -fsanitize-coverage=trace-pc)
PR sanitizer/80444
	* sancov.c (sancov_pass): Use gsi_start_nondebug_after_labels_bb
	instead of gsi_after_labels.

	* gcc.dg/sancov/pr80444.c: New test.

From-SVN: r246971
2017-04-18 17:02:06 +02:00
Jeff Law d1446456c3 regcprop.c (maybe_mode_change): Avoid creating copies of the stack pointer.
* regcprop.c (maybe_mode_change): Avoid creating copies of the
	stack pointer.

	Revert:
	2017-04-13  Jeff Law  <law@redhat.com>
	* config/mips.mips.md (zero_extendsidi2): Do not allow SP to appear
	in operands[1] if it is a MEM and TARGET_MIPS16 is active.

From-SVN: r246970
2017-04-18 09:00:43 -06:00
Georg-Johann Lay 8c468e1dcd Typo.
From-SVN: r246969
2017-04-18 13:25:42 +00:00
Georg-Johann Lay dddc273f0e re PR c++/79435 (ICE on invalid C++ code (with member access into an incomplete type) on x86_64-linux-gnu: Segmentation fault)
gcc/
	PR target/79435
	* config/avr/avr.c (intl.h): Include it.
	(avr_pgm_check_var_decl) [reason]: Wrap	diagnostic snippets into _().

From-SVN: r246966
2017-04-18 13:15:47 +00:00
Martin Liska 6397118495 Validate that destination gcov file does not exist for gcov-tool (PR gcov-profile/78783).
2017-04-18  Martin Liska  <mliska@suse.cz>

	PR gcov-profile/78783
	* libgcov-driver.c (gcov_get_filename): New function.
2017-04-18  Martin Liska  <mliska@suse.cz>

	PR gcov-profile/78783
	* gcov-tool.c (gcov_output_files): Validate that destination
	file is either removed by the tool or by a user.

From-SVN: r246961
2017-04-18 07:24:20 +00:00
Andrew Burgess dd3d6a42fc arc: Fix for loop end detection
We use a negative ID number to link together the doloop_begin and
doloop_end instructions.  This negative ID number is setup within
doloop_begin, at this point the ID is stored into the loop end
instruction (doloop_end_i) and placed into the doloop_begin_i
instruction.

In arc.c (arc_reorg) we extract the ID from the doloop_end_i
instruction in order to find the matching doloop_begin_i instruction,
though the ID is only used in some cases.

Currently in arc_reorg when we extract the ID we negate it.  This
negation is invalid.  The ID stored in both doloop_end_i and
doloop_begin_i is already negative, the negation in arc_reorg means
that if we need to use the ID to find the doloop_begin_i then we will
never find it (as the IDs will never match).

This commit removes the unneeded negation, moves the extraction of the
ID into a more appropriately scoped block and adds a new test for this
issue.

gcc/ChangeLog:

	* config/arc/arc.c (arc_reorg): Move loop_end_id into a more local
	block, and do not negate it, the stored id is already negative.

gcc/testsuite/ChangeLog:

	* gcc.target/arc/loop-1.c: New file.


Co-Authored-By: Guy Benyei <guybe@mellanox.com>

From-SVN: r246933
2017-04-14 22:14:34 +01:00
Andrew Burgess 8c1d6b64e3 arc: Use @pcl assembler syntax instead of invalid expressions
The old ARC assembler would accept expressions like 'LABEL-(.&-4)'
which would calculate the offset from the PCL to LABEL.  The new ARC
assembler does not accept these expressions, instead there's an @pcl
synax, used like LABEL@pcl which gives the offset from PCL to LABEL.

Most of the use of the old expression syntax have been removed,
however, this one got missed.

gcc/ChangeLog:

	* config/arc/arc.md (doloop_begin_i): Use @pcl assembler syntax.

From-SVN: r246932
2017-04-14 22:08:35 +01:00
Michael Meissner 31a07c8102 re PR target/80098 (ICE in curr_insn_transform, at lra-constraints.c:3816 on ppc64le)
[gcc]
2017-04-14  Michael Meissner  <meissner@linux.vnet.ibm.com>

	PR target/80098
	* config/rs6000/rs6000-cpus.def (OTHER_P9_VECTOR_MASKS): Define
	masks of options that should be turned off if the VSX vector
	options are turned off.
	(OTHER_P8_VECTOR_MASKS): Likewise.
	(OTHER_VSX_VECTOR_MASKS): Likewise.
	* config/rs6000/rs6000.c (rs6000_option_override_internal): Call
	rs6000_disable_incompatible_switches to validate no type switches
	like -mvsx.
	(rs6000_incompatible_switch): New function to disallow turning on
	other vector options if -mno-vsx, -mno-power8-vector, or
	-mno-power9-vector are specified.

[gcc/testsuite]
2017-04-14  Michael Meissner  <meissner@linux.vnet.ibm.com>

	PR target/80098
	* gcc.target/powerpc/pr80098-1.c: New test.
	* gcc.target/powerpc/pr80098-2.c: Likewise.
	* gcc.target/powerpc/pr80098-3.c: Likewise.
	* gcc.target/powerpc/pr80098-4.c: Likewise.

From-SVN: r246930
2017-04-14 20:27:18 +00:00
Claudiu Zissulescu 19b250c43a [ARC] Use long jumps for CRT calls
gcc/
2017-04-17  Claudiu Zissulescu  <claziss@synopsys.com>

	* config/arc/arc.h (CRT_CALL_STATIC_FUNCTION): Use long calls.

From-SVN: r246927
2017-04-14 13:41:04 +02:00
Claudiu Zissulescu 213c9bf121 [ARC] DWARF emitting cleanup.
The use of CFA_FRAME_BASE_OFFSET and ARG_POINTER_CFA_OFFSET macros
leads to wrong offset calculation for DW_OP_fbreg constructions.
Remove them.

gcc/
2017-04-14  Claudiu Zissulescu  <claziss@synopsys.com>

	* config/arc/arc-protos.h (arc_decl_pretend_args): Remove.
	* config/arc/arc.c (arc_decl_pretend_args): Likewise.
	* config/arc/arc.h (CFA_FRAME_BASE_OFFSET): Likewise.
	(ARG_POINTER_CFA_OFFSET): Likewise.

From-SVN: r246926
2017-04-14 13:40:54 +02:00