Commit Graph

30339 Commits

Author SHA1 Message Date
Jerry DeLisle 90d2abbe74 backport: re PR fortran/80741 ([Regression 7/8] DTIO wrong code causes incorrect behaviour of namelist READ)
2017-05-23  Jerry DeLisle  <jvdelisle@gcc.gnu.org>

	Backport from trunk
	PR libgfortran/80741
	* transfer.c (finalize_transfer): Reset last_char to 'empty'.
	* file_pos.c (formatted_backspace): Likewise.
	(st_endfile): Likewise.
	(st_rewind): Likewise.
	(st_flush): Likewise.

	* trans-io.c (transfer_namelist_element): Change check from
	NULL_TREE to null_pointer_node.

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

From-SVN: r248390
2017-05-23 22:05:56 +00:00
Jerry DeLisle 70e971cc61 backport: re PR fortran/80333 (Namelist dtio write of array of class does not traverse the array)
2017-05-23  Paul Thomas  <pault@gcc.gnu.org>

	Backport from trunk
	PR fortran/80333
	* trans-io.c (nml_get_addr_expr): If we are dealing with class
	type data set tmp tree to get that address.
	(transfer_namelist_element): Set the array spec to point to the
	the class data.

	* gfortran.dg/dtio_30.f03: New test.

	* list_read.c (nml_read_obj): Compute pointer into class/type
	arrays from the nl->dim information. Update it for each iteration
	of the loop for the given object.

From-SVN: r248388
2017-05-23 21:39:41 +00:00
Sheldon Lobo 112eba68ad backport: sparc.c (sparc_option_override): Set function alignment for -mcpu=niagara7 to 64 to match the I$ line.
Backport from mainline
	2017-05-18  Sheldon Lobo  <sheldon.lobo@oracle.com>

	* config/sparc/sparc.c (sparc_option_override): Set function
	alignment for -mcpu=niagara7 to 64 to match the I$ line.
	* config/sparc/sparc.h (BRANCH_COST): Set the SPARC M7 branch
	latency to 1.
	* config/sparc/sparc.h (BRANCH_COST): Set the SPARC T4 branch
	latency to 2.
	* config/sparc/sol2.h: Fix a ASM_CPU32_DEFAULT_SPEC typo.

	Backport from mainline
	2017-05-18  Sheldon Lobo  <sheldon.lobo@oracle.com>

	* gcc.target/sparc/niagara7-align.c: New test.

From-SVN: r248380
2017-05-23 18:39:44 +00:00
Bill Schmidt 69c3fc333a backport: p8-vec-xl-xst.c: Fix target string to LE-only.
2017-05-22  Bill Schmidt  <wschmidt@linux.vnet.ibm.com>

	Backport from mainline
	2017-05-22  Bill Schmidt  <wschmidt@linux.vnet.ibm.com>

	* gcc.target/powerpc/p8-vec-xl-xst.c: Fix target string to
	LE-only.

From-SVN: r248349
2017-05-22 19:47:43 +00:00
Eric Botcazou 3e193b8b8f decl.c (gnat_to_gnu_entity): Skip regular processing for Itypes that are E_Access_Subtype.
* gcc-interface/decl.c (gnat_to_gnu_entity): Skip regular processing
	for Itypes that are E_Access_Subtype.
	<E_Access_Subtype>: Use the DECL of the base type directly.

From-SVN: r248324
2017-05-22 09:39:46 +00:00
Uros Bizjak a40583fba8 backport: re PR target/80799 (x86-32 bits generates MMX without EMMS)
Backport from mainline
	2017-05-18  Uros Bizjak  <ubizjak@gmail.com>

	PR target/80799
	* config/i386/mmx.md (*mov<mode>_internal): Enable
	alternatives 11, 12, 13 and 14 also for 32bit targets.
	Remove alternatives 15, 16, 17 and 18.
	* config/i386/sse.md (vec_concatv2di): Change
	alternative (!x, *y) to (x, ?!*Yn).

testsuite/ChangeLog:

	Backport from mainline
	2017-05-18  Uros Bizjak  <ubizjak@gmail.com>

	PR target/80799
	* g++.dg/other/i386-11.C: New test.

From-SVN: r248284
2017-05-19 16:09:45 +02:00
Jerry DeLisle 6b8977c377 backport: re PR libfortran/80727 (Crash of runtime gfortran library during integer transformation)
2017-05-17  Jerry DeLisle  <jvdelisle@gcc.gnu.org>

	Backport from trunk
	PR libgfortran/80727
	* transfer.c (read_sf_internal): Remove bogus code to detect EOR.
	(read_block_form): For internal units, generate EOR if no more
	bytes left in unit and we are trying to read with ADVANCE='NO'.

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

From-SVN: r248167
2017-05-17 20:00:53 +00:00
Jerry DeLisle d96f3d3658 backport: re PR fortran/78659 ([F03] Spurious "requires DTIO" reported against namelist statement)
2017-05-17  Jerry DeLisle  <jvdelisle@gcc.gnu.org>

	Backport from trunk
	PR fortran/78659
	* io.c (dtio_procs_present): Add new function to check for DTIO
	procedures relative to I/O statement READ or WRITE.
	(gfc_resolve_dt): Add namelist checks using the new function.
	* resolve.c (dtio_procs_present): Remove function and related
	namelist checks. (resolve_fl_namelist): Add check specific to
	Fortran 95 restriction on namelist objects.

	* gfortran.dg/namelist_91.f90: New test.
	* gfortran.dg/namelist_92.f90: New test.
	* gfortran.dg/namelist_93.f90: New test.
	* gfortran.dg/namelist_94.f90: New test.

From-SVN: r248166
2017-05-17 18:09:48 +00:00
Steven G. Kargl 4fc88affeb re PR fortran/80752 (ICE with wrong type initialization)
2017-05-15  Steven G. Kargl  <kargl@gcc.gnu.org>

	PR fortran/80752
	* expr.c (gfc_generate_initializer):  If type conversion fails,
	check for error and return NULL.

2017-05-15  Steven G. Kargl  <kargl@gcc.gnu.org>

	PR fortran/80752
	gfortran.dg/pr80752.f90: New test.

From-SVN: r248076
2017-05-15 20:43:25 +00:00
Uros Bizjak 52e00e00b2 backport: re PR target/80706 (peephole2 uses uninitialized stack variables on i686)
Backport from mainline
	2017-05-11  Uros Bizjak  <ubizjak@gmail.com>

	PR target/80706
	* config/i386/sync.md (UNSPEC_LDX_ATOMIC): New unspec.
	(UNSPEC_STX_ATOMIC): Ditto.
	(loaddi_via_sse): New insn.
	(storedi_via_sse): Ditto.
	(atomic_loaddi_fpu): Emit loaddi_via_sse and storedi_via_sse.
	Update corresponding peephole2 patterns.
	(atomic_storedi_fpu): Ditto.

testsuite/ChangeLog:

	Backport from mainline
	2017-05-11  Uros Bizjak  <ubizjak@gmail.com>
		    Jakub Jelinek  <jakub@redhat.com>

	PR target/80706
	* gcc.target/i386/pr80706.c: New test.

	2017-05-11  Uros Bizjak  <ubizjak@gmail.com>

	* gcc.target/i386/pr22152.c: Fix undefined testcase.
	Remove unnecessary loop.  Run on 32-bit targets only.

From-SVN: r248032
2017-05-14 14:49:55 +02:00
Bill Schmidt 7b5a39f069 backport: rs6000.c (rs6000_vect_nonmem): New static var.
[gcc]

2017-05-13  Bill Schmidt  <wschmidt@linux.vnet.ibm.com>

	Backport from mainline
	2017-05-05  Bill Schmidt  <wschmidt@linux.vnet.ibm.com>

	* config/rs6000/rs6000.c (rs6000_vect_nonmem): New static var.
	(rs6000_init_cost): Initialize rs6000_vect_nonmem.
	(rs6000_add_stmt_cost): Update rs6000_vect_nonmem.
	(rs6000_finish_cost): Avoid vectorizing simple copy loops with
	VF=2 that require versioning.

[gcc/testsuite]

2017-05-13  Bill Schmidt  <wschmidt@linux.vnet.ibm.com>

	Backport from mainline
	2017-05-05  Bill Schmidt  <wschmidt@linux.vnet.ibm.com>

	* gcc.target/powerpc/versioned-copy-loop.c: New file.

From-SVN: r248010
2017-05-13 21:35:44 +00:00
Bill Schmidt 26c3c343d7 backport: rs6000.c (altivec_init_builtins): Define POWER8 built-ins for vec_xl and vec_xst with short and char pointer...
[gcc]

2017-05-12  Bill Schmidt  <wschmidt@linux.vnet.ibm.com>

	Backport from mainline
	2017-05-10  Bill Schmidt  <wschmidt@linux.vnet.ibm.com>

	* config/rs6000/rs6000.c (altivec_init_builtins): Define POWER8
	built-ins for vec_xl and vec_xst with short and char pointer
	arguments.

[gcc/testsuite]

2017-05-12  Bill Schmidt  <wschmidt@linux.vnet.ibm.com>

	Backport from mainline
	2017-05-10  Bill Schmidt  <wschmidt@linux.vnet.ibm.com>

	* gcc.target/powerpc/p8-vec-xl-xst.c: New file.

From-SVN: r247999
2017-05-12 21:50:51 +00:00
Michael Meissner 560e3ca7cd backport: re PR target/79038 (Improve PowerPC ISA 3.0 conversion between integers and hardware _Float128)
[gcc]
2017-05-09  Michael Meissner  <meissner@linux.vnet.ibm.com>

	Back port from mainline
	2017-05-05  Michael Meissner  <meissner@linux.vnet.ibm.com>

	PR target/79038
	PR target/79202
	PR target/79203
	* config/rs6000/rs6000.md (u code attribute): Add FIX and
	UNSIGNED_FIX.
	(extendsi<mode>2): Add support for doing sign extension via
	VUPKHSW and XXPERMDI if the value is in Altivec registers and we
	don't have ISA 3.0 instructions.
	(extendsi<mode>2 splitter): Likewise.
	(fix_trunc<mode>si2): If we are at ISA 2.07 (VSX small integer),
	generate the normal insns since SImode can now go in vector
	registers.  Disallow the special UNSPECs needed for previous
	machines to hide SImode being used.  Add new insns
	fctiw{,w}_<mode>_smallint if SImode can go in vector registers.
	(fix_trunc<mode>si2_stfiwx): Likewise.
	(fix_trunc<mode>si2_internal): Likewise.
	(fixuns_trunc<mode>si2): Likewise.
	(fixuns_trunc<mode>si2_stfiwx): Likewise.
	(fctiw<u>z_<mode>_smallint): Likewise.
	(fctiw<u>z_<mode>_mem): New combiner pattern to prevent conversion
	of floating point to 32-bit integer from doing a direct move to
	the GPR registers to do a store.
	(fctiwz_<mode>): Break long line.

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

	Back port from mainline
	2017-05-05  Michael Meissner  <meissner@linux.vnet.ibm.com>

	PR target/79038
	PR target/79202
	PR target/79203
	* gcc.target/powerpc/ppc-round3.c: New test.
	* gcc.target/powerpc/ppc-round2.c: Update expected code.

From-SVN: r247820
2017-05-09 23:49:37 +00:00
Janus Weil 533a17774d backport: re PR fortran/80121 (Memory leak with derived-type intent(out) argument)
2017-05-05  Janus Weil  <janus@gcc.gnu.org>

	Backport from trunk
	PR fortran/80121
	* trans-expr.c (gfc_conv_procedure_call): Deallocate the components
	of allocatable intent(out) arguments.


2017-05-05  Janus Weil  <janus@gcc.gnu.org>

	Backport from trunk
	PR fortran/80121
	* gfortran.dg/intent_out_9.f90: New test case.

From-SVN: r247662
2017-05-05 23:00:53 +02:00
Janus Weil 52637de8cc backport: re PR fortran/80392 ([OOP] ICE with allocatable polymorphic function result in a procedure pointer component)
2017-05-05  Janus Weil  <janus@gcc.gnu.org>

	Backport from trunk
	PR fortran/80392
	* trans-types.c (gfc_get_derived_type): Prevent an infinite loop when
	building a derived type that includes a procedure pointer component
	with a polymorphic result.

2017-05-05  Janus Weil  <janus@gcc.gnu.org>

	Backport from trunk
	PR fortran/80392
	* gfortran.dg/proc_ptr_comp_49.f90: New test case.

From-SVN: r247655
2017-05-05 22:09:20 +02:00
Jerry DeLisle 9bf7f47385 backport: re PR fortran/80484 (Three syntax errors involving derived-type I/O)
2017-05-04  Jerry DeLisle  <jvdelisle@gcc.gnu.org>

	Backport from trunk.
	PR fortran/80484
	* io.c (format_lex): Check for '/' and set token to FMT_SLASH.
	(check_format): Move FMT_DT checking code to data_desc section.
	* module.c (gfc_match_use): Include the case of INTERFACE_DTIO.
	Backport from mainline
	PR fortran/80484
	* gfortran.dg/dtio_29.f03: New test.

From-SVN: r247615
2017-05-04 18:45:50 +00:00
Richard Biener 6987b50fcc backport: [multiple changes]
2017-05-03  Richard Biener  <rguenther@suse.de>

	Backport from mainline
	2017-04-20  Richard Biener  <rguenther@suse.de>

	PR tree-optimization/80453
	* tree-ssa-sccvn.h (struct vn_phi_s): Add cclhs and ccrhs members.
	* tree-ssa-sccvn.c (cond_stmts_equal_p): Use recorded lhs and rhs
	from the conditions.
	(vn_phi_eq): Pass them down.
	(vn_phi_lookup): Record them.
	(vn_phi_insert): Likewise.

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

	PR tree-optimization/80492
	* alias.c (compare_base_decls): Handle registers with asm
	specification conservatively.

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

	2017-04-27  Richard Biener  <rguenther@suse.de>

	PR middle-end/80539
	* tree-chrec.c (chrec_fold_plus_poly_poly): Deal with not
	being in loop-closed SSA form conservatively.
	(chrec_fold_multiply_poly_poly): Likewise.

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

From-SVN: r247545
2017-05-03 11:22:34 +00:00
Jakub Jelinek 4041b42a3b backport: re PR c/80468 (ICE on invalid AVX512 code with -m32)
Backported from mainline
	2017-04-21  Jakub Jelinek  <jakub@redhat.com>

	PR c/80468
	* c-decl.c (finish_declspecs) <case cts_int_n>: If int_n_idx is not
	enabled, set specs->type to integer_type_node.

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

From-SVN: r247534
2017-05-03 08:45:29 +02:00
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 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 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
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
Eric Botcazou 989ac84fcf re PR tree-optimization/80426 (wrong manipulation of range based on INT_MIN)
PR tree-optimization/80426
	* gcc.c-torture/execute/20170429-1.c: Rename into...
	* gcc.c-torture/execute/20170419-1.c: ...this.

From-SVN: r247047
2017-04-21 08:08:03 +00:00
Jonathan Wakely e9dcea2ae3 PR c++/80473 allow suppressing notes about over-aligned new
Backport from mainline r247033
gcc/cp:

	PR c++/80473
	* init.c (build_new_1): Suppress notes about over-aligned new when
	the warning is suppressed.

gcc/testsuite:

	PR c++/80473
	* g++.dg/diagnostic/pr80473.C: New test.

From-SVN: r247035
2017-04-20 19:36:27 +01: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
Senthil Kumar Selvaraj a4bb5c57c9 Skip pr80170.c for non-ptr32plus targets
The testcase uses 32 bit or bigger pointer offsets, and
that triggers an ptrofftype_p assert in tree.c.

gcc/testsuite

2017-04-19  Senthil Kumar Selvaraj  <senthil_kumar.selvaraj@atmel.com>

	* gcc.dg/pr80170.c: Require ptr32plus.

From-SVN: r247011
2017-04-20 05:46:02 +00: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 541035a63b re PR c++/80459 (c-c++-common/opaque-vector.c FAILs)
PR c++/80459
	* c-c++-common/opaque-vector.c (SIZEOF_MAXINT): Define.
	(f): Don't test long double vectors if __SIZEOF_LONG_DOUBLE__
	is not power of 2, or is more than 16 or more than SIZEOF_MAXINT.

From-SVN: r247001
2017-04-19 18:31:11 +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
Senthil Kumar Selvaraj 5249994efa Fix broken gcc.dg/torture/pr80341.c for avr
This patch skips pr80341.c for targets with int size less than 32 bits.
The assertion in the testcase holds only if sizeof(int) > sizeof(short), 
which isn't true for smaller int size targets like the avr.

gcc/testsuite

2017-04-19  Senthil Kumar Selvaraj  <senthil_kumar.selvaraj@atmel.com>

	* gcc.dg/torture/pr80341.c: Require int32plus.

From-SVN: r246994
2017-04-19 11:27:05 +00: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
Tom de Vries 6143c99823 Use relative line number for subsequent dg directives
2017-04-19  Tom de Vries  <tom@codesourcery.com>

	PR testsuite/80221
	* c-c++-common/Wimplicit-fallthrough-6.c: Use relative line number for
	subsequent dg directives.
	* c-c++-common/Wimplicit-fallthrough-7.c: Same.
	* c-c++-common/Wint-to-pointer-cast-3.c: Same.
	* c-c++-common/attr-fallthrough-2.c: Same.
	* c-c++-common/cilk-plus/AN/parser_errors2.c: Same.
	* c-c++-common/cilk-plus/AN/parser_errors3.c: Same.
	* c-c++-common/cilk-plus/AN/pr61191.c: Same.
	* c-c++-common/cilk-plus/AN/pr61963.c: Same.
	* c-c++-common/cilk-plus/AN/pr62008.c: Same.
	* c-c++-common/cilk-plus/AN/rank_mismatch.c: Same.
	* c-c++-common/cilk-plus/CK/cilk_for_errors.c: Same.
	* c-c++-common/cilk-plus/CK/errors.c: Same.
	* c-c++-common/cilk-plus/CK/no_args_error.c: Same.
	* c-c++-common/cilk-plus/PS/clauses1.c: Same.
	* c-c++-common/cilk-plus/SE/vlength_errors.c: Same.
	* c-c++-common/cpp/pr57580.c: Same.
	* c-c++-common/goacc/asyncwait-1.c: Same.
	* c-c++-common/goacc/cache-2.c: Same.
	* c-c++-common/goacc/declare-2.c: Same.
	* c-c++-common/goacc/deviceptr-1.c: Same.
	* c-c++-common/goacc/routine-5.c: Same.
	* c-c++-common/gomp/clauses-2.c: Same.
	* c-c++-common/gomp/ordered-3.c: Same.
	* c-c++-common/gomp/pr67501.c: Same.
	* c-c++-common/pr20000.c: Same.
	* c-c++-common/pr43395.c: Same.
	* c-c++-common/pr49706.c: Same.
	* c-c++-common/pr77624-1.c: Same.
	* c-c++-common/pr77624-2.c: Same.
	* c-c++-common/raw-string-14.c: Same.
	* c-c++-common/raw-string-16.c: Same.
	* c-c++-common/raw-string-3.c: Same.
	* c-c++-common/raw-string-4.c: Same.
	* c-c++-common/raw-string-5.c: Same.
	* c-c++-common/raw-string-6.c: Same.
	* g++.dg/abi/mangle41.C: Same.
	* g++.dg/conversion/nullptr1.C: Same.
	* g++.dg/cpp0x/alias-decl-80296.C: Same.
	* g++.dg/cpp0x/auto27.C: Same.
	* g++.dg/cpp0x/constexpr-98.C: Same.
	* g++.dg/cpp0x/constexpr-diag2.C: Same.
	* g++.dg/cpp0x/diag2.C: Same.
	* g++.dg/cpp0x/lambda/lambda-syntax1.C: Same.
	* g++.dg/cpp0x/nullptr15.C: Same.
	* g++.dg/cpp0x/pr31431-2.C: Same.
	* g++.dg/cpp0x/pr31431.C: Same.
	* g++.dg/cpp0x/pr79118.C: Same.
	* g++.dg/cpp0x/static_assert3.C: Same.
	* g++.dg/cpp0x/temp_default2.C: Same.
	* g++.dg/cpp0x/trailing4.C: Same.
	* g++.dg/cpp0x/variadic-ex10.C: Same.
	* g++.dg/cpp0x/variadic-ex13.C: Same.
	* g++.dg/cpp0x/variadic-ex14.C: Same.
	* g++.dg/cpp0x/variadic-ex3.C: Same.
	* g++.dg/cpp0x/variadic-ex4.C: Same.
	* g++.dg/cpp0x/variadic59.C: Same.
	* g++.dg/cpp0x/vt-37737-2.C: Same.
	* g++.dg/cpp0x/vt-57397-1.C: Same.
	* g++.dg/cpp0x/vt-57397-2.C: Same.
	* g++.dg/cpp1z/constexpr-lambda8.C: Same.
	* g++.dg/cpp1z/gen-attrs1.C: Same.
	* g++.dg/diagnostic/pr71075.C: Same.
	* g++.dg/eh/goto2.C: Same.
	* g++.dg/eh/goto3.C: Same.
	* g++.dg/expr/bitfield4.C: Same.
	* g++.dg/expr/bitfield5.C: Same.
	* g++.dg/expr/bitfield6.C: Same.
	* g++.dg/expr/bool1.C: Same.
	* g++.dg/expr/bool3.C: Same.
	* g++.dg/expr/cond10.C: Same.
	* g++.dg/expr/cond11.C: Same.
	* g++.dg/expr/lval3.C: Same.
	* g++.dg/expr/lval4.C: Same.
	* g++.dg/ext/anon-struct4.C: Same.
	* g++.dg/ext/attrib44.C: Same.
	* g++.dg/ext/builtin3.C: Same.
	* g++.dg/ext/dllimport7.C: Same.
	* g++.dg/ext/label5.C: Same.
	* g++.dg/ext/no-asm-1.C: Same.
	* g++.dg/ext/utf16-4.C: Same.
	* g++.dg/ext/vla2.C: Same.
	* g++.dg/gomp/block-1.C: Same.
	* g++.dg/gomp/block-2.C: Same.
	* g++.dg/gomp/block-3.C: Same.
	* g++.dg/gomp/block-5.C: Same.
	* g++.dg/gomp/linear-2.C: Same.
	* g++.dg/gomp/target-1.C: Same.
	* g++.dg/gomp/target-2.C: Same.
	* g++.dg/gomp/taskgroup-1.C: Same.
	* g++.dg/gomp/teams-1.C: Same.
	* g++.dg/inherit/pure1.C: Same.
	* g++.dg/init/array43.C: Same.
	* g++.dg/init/array46.C: Same.
	* g++.dg/init/const10.C: Same.
	* g++.dg/init/ctor4-1.C: Same.
	* g++.dg/init/ctor4.C: Same.
	* g++.dg/init/new37.C: Same.
	* g++.dg/init/pr25811.C: Same.
	* g++.dg/init/pr29043.C: Same.
	* g++.dg/init/pr29571.C: Same.
	* g++.dg/lookup/duperr1.C: Same.
	* g++.dg/lookup/error1.C: Same.
	* g++.dg/lookup/koenig5.C: Same.
	* g++.dg/lookup/pr77549.C: Same.
	* g++.dg/lookup/suggestions1.C: Same.
	* g++.dg/lookup/using16.C: Same.
	* g++.dg/lookup/using7.C: Same.
	* g++.dg/other/anon-union3.C: Same.
	* g++.dg/other/array2.C: Same.
	* g++.dg/other/error13.C: Same.
	* g++.dg/other/error34.C: Same.
	* g++.dg/overload/builtin1.C: Same.
	* g++.dg/overload/conv-op1.C: Same.
	* g++.dg/overload/error3.C: Same.
	* g++.dg/overload/koenig1.C: Same.
	* g++.dg/overload/operator5.C: Same.
	* g++.dg/overload/template5.C: Same.
	* g++.dg/overload/unknown1.C: Same.
	* g++.dg/overload/using2.C: Same.
	* g++.dg/parse/constructor1.C: Same.
	* g++.dg/parse/crash36.C: Same.
	* g++.dg/parse/crash63.C: Same.
	* g++.dg/parse/error11.C: Same.
	* g++.dg/parse/error12.C: Same.
	* g++.dg/parse/error14.C: Same.
	* g++.dg/parse/error2.C: Same.
	* g++.dg/parse/error21.C: Same.
	* g++.dg/parse/error26.C: Same.
	* g++.dg/parse/error36.C: Same.
	* g++.dg/parse/friend12.C: Same.
	* g++.dg/parse/invalid-op1.C: Same.
	* g++.dg/parse/missing-template1.C: Same.
	* g++.dg/parse/parser-pr28152-2.C: Same.
	* g++.dg/parse/parser-pr28152.C: Same.
	* g++.dg/parse/pr16696-permissive.C: Same.
	* g++.dg/parse/pr16696.C: Same.
	* g++.dg/parse/pr69628.C: Same.
	* g++.dg/parse/ret-type2.C: Same.
	* g++.dg/parse/specialization1.C: Same.
	* g++.dg/parse/template3.C: Same.
	* g++.dg/parse/template9.C: Same.
	* g++.dg/parse/typename11.C: Same.
	* g++.dg/plugin/attribute_plugin-test-1.C: Same.
	* g++.dg/pr45330.C: Same.
	* g++.dg/rtti/typeid6.C: Same.
	* g++.dg/spellcheck-fields.C: Same.
	* g++.dg/spellcheck-typenames.C: Same.
	* g++.dg/tc1/dr108.C: Same.
	* g++.dg/tc1/dr147.C: Same.
	* g++.dg/template/arg7.C: Same.
	* g++.dg/template/conv11.C: Same.
	* g++.dg/template/crash13.C: Same.
	* g++.dg/template/crash55.C: Same.
	* g++.dg/template/dependent-expr5.C: Same.
	* g++.dg/template/error17.C: Same.
	* g++.dg/template/error33.C: Same.
	* g++.dg/template/error4.C: Same.
	* g++.dg/template/error50.C: Same.
	* g++.dg/template/error53.C: Same.
	* g++.dg/template/friend.C: Same.
	* g++.dg/template/func2.C: Same.
	* g++.dg/template/local6.C: Same.
	* g++.dg/template/member5.C: Same.
	* g++.dg/template/meminit1.C: Same.
	* g++.dg/template/nested3.C: Same.
	* g++.dg/template/nontype6.C: Same.
	* g++.dg/template/overload12.C: Same.
	* g++.dg/template/ptrmem8.C: Same.
	* g++.dg/template/qualified-id1.C: Same.
	* g++.dg/template/spec15.C: Same.
	* g++.dg/template/static1.C: Same.
	* g++.dg/template/static10.C: Same.
	* g++.dg/template/static2.C: Same.
	* g++.dg/template/ttp25.C: Same.
	* g++.dg/template/typedef2.C: Same.
	* g++.dg/template/typename2.C: Same.
	* g++.dg/template/unify10.C: Same.
	* g++.dg/template/unify6.C: Same.
	* g++.dg/template/unify7.C: Same.
	* g++.dg/template/unify9.C: Same.
	* g++.dg/template/varmod1.C: Same.
	* g++.dg/ubsan/div-by-zero-1.C: Same.
	* g++.dg/ubsan/pr63956.C: Same.
	* g++.dg/warn/Waddress-1.C: Same.
	* g++.dg/warn/Wconversion2.C: Same.
	* g++.dg/warn/Wnull-conversion-1.C: Same.
	* g++.dg/warn/Wsubobject-linkage-1.C: Same.
	* g++.dg/warn/Wsubobject-linkage-3.C: Same.
	* g++.dg/warn/Wswitch-1.C: Same.
	* g++.dg/warn/Wtype-limits-Wextra.C: Same.
	* g++.dg/warn/Wtype-limits.C: Same.
	* g++.dg/warn/Wunused-parm-5.C: Same.
	* g++.dg/warn/deprecated-6.C: Same.
	* g++.dg/warn/deprecated.C: Same.
	* g++.dg/warn/incomplete1.C: Same.
	* g++.dg/warn/multiple-overflow-warn-1.C: Same.
	* g++.dg/warn/multiple-overflow-warn-2.C: Same.
	* g++.dg/warn/multiple-overflow-warn-3.C: Same.
	* g++.dg/warn/overflow-warn-1.C: Same.
	* g++.dg/warn/overflow-warn-3.C: Same.
	* g++.dg/warn/overflow-warn-4.C: Same.
	* g++.dg/warn/pr12242.C: Same.
	* g++.dg/warn/pr30551-2.C: Same.
	* g++.dg/warn/pr30551.C: Same.
	* g++.old-deja/g++.benjamin/16077.C: Same.
	* g++.old-deja/g++.bob/inherit1.C: Same.
	* g++.old-deja/g++.brendan/crash56.C: Same.
	* g++.old-deja/g++.brendan/template17.C: Same.
	* g++.old-deja/g++.eh/ctor1.C: Same.
	* g++.old-deja/g++.jason/bool5.C: Same.
	* g++.old-deja/g++.jason/cond.C: Same.
	* g++.old-deja/g++.jason/operator.C: Same.
	* g++.old-deja/g++.jason/pmf5.C: Same.
	* g++.old-deja/g++.law/ctors5.C: Same.
	* g++.old-deja/g++.law/missed-error2.C: Same.
	* g++.old-deja/g++.law/operators9.C: Same.
	* g++.old-deja/g++.law/temps1.C: Same.
	* g++.old-deja/g++.mike/for2.C: Same.
	* g++.old-deja/g++.mike/ns5.C: Same.
	* g++.old-deja/g++.mike/ns7.C: Same.
	* g++.old-deja/g++.mike/p10769b.C: Same.
	* g++.old-deja/g++.niklas/t120.C: Same.
	* g++.old-deja/g++.niklas/t121.C: Same.
	* g++.old-deja/g++.ns/koenig5.C: Same.
	* g++.old-deja/g++.oliva/overload1.C: Same.
	* g++.old-deja/g++.other/crash24.C: Same.
	* g++.old-deja/g++.other/crash25.C: Same.
	* g++.old-deja/g++.other/decl5.C: Same.
	* g++.old-deja/g++.other/lineno5.C: Same.
	* g++.old-deja/g++.other/null3.C: Same.
	* g++.old-deja/g++.other/overcnv2.C: Same.
	* g++.old-deja/g++.other/ptrmem7.C: Same.
	* g++.old-deja/g++.other/typename1.C: Same.
	* g++.old-deja/g++.other/vaarg3.C: Same.
	* g++.old-deja/g++.pt/crash10.C: Same.
	* g++.old-deja/g++.pt/crash28.C: Same.
	* g++.old-deja/g++.pt/crash38.C: Same.
	* g++.old-deja/g++.pt/explicit70.C: Same.
	* g++.old-deja/g++.pt/explicit77.C: Same.
	* g++.old-deja/g++.pt/expr2.C: Same.
	* g++.old-deja/g++.pt/spec5.C: Same.
	* g++.old-deja/g++.pt/spec6.C: Same.
	* g++.old-deja/g++.pt/typename3.C: Same.
	* g++.old-deja/g++.pt/typename5.C: Same.
	* g++.old-deja/g++.pt/typename6.C: Same.
	* g++.old-deja/g++.pt/typename7.C: Same.
	* g++.old-deja/g++.pt/unify4.C: Same.
	* g++.old-deja/g++.pt/unify8.C: Same.
	* g++.old-deja/g++.pt/vaarg3.C: Same.
	* g++.old-deja/g++.robertl/eb22.C: Same.
	* g++.old-deja/g++.robertl/eb4.C: Same.
	* g++.old-deja/g++.robertl/eb44.C: Same.
	* g++.old-deja/g++.robertl/eb69.C: Same.
	* g++.old-deja/g++.robertl/eb98.C: Same.
	* gcc.dg/20031223-1.c: Same.
	* gcc.dg/940510-1.c: Same.
	* gcc.dg/990506-0.c: Same.
	* gcc.dg/Walloca-1.c: Same.
	* gcc.dg/Walloca-2.c: Same.
	* gcc.dg/Wconversion-integer.c: Same.
	* gcc.dg/Wcxx-compat-8.c: Same.
	* gcc.dg/Wimplicit-int-1.c: Same.
	* gcc.dg/Wimplicit-int-2.c: Same.
	* gcc.dg/Wimplicit-int-4.c: Same.
	* gcc.dg/Wpointer-sign-Wall.c: Same.
	* gcc.dg/Wpointer-sign-pedantic.c: Same.
	* gcc.dg/Wshadow-1.c: Same.
	* gcc.dg/Wshadow-3.c: Same.
	* gcc.dg/Wswitch-enum-error.c: Same.
	* gcc.dg/Wswitch-enum.c: Same.
	* gcc.dg/Wswitch-error.c: Same.
	* gcc.dg/Wswitch.c: Same.
	* gcc.dg/Wtype-limits-Wextra.c: Same.
	* gcc.dg/Wtype-limits.c: Same.
	* gcc.dg/Wvla-larger-than-2.c: Same.
	* gcc.dg/anon-struct-5.c: Same.
	* gcc.dg/array-10.c: Same.
	* gcc.dg/array-11.c: Same.
	* gcc.dg/array-15.c: Same.
	* gcc.dg/array-2.c: Same.
	* gcc.dg/array-8.c: Same.
	* gcc.dg/array-const-2.c: Same.
	* gcc.dg/array-const-3.c: Same.
	* gcc.dg/bitfld-1.c: Same.
	* gcc.dg/bitfld-8.c: Same.
	* gcc.dg/builtin-redefine.c: Same.
	* gcc.dg/c11-noreturn-1.c: Same.
	* gcc.dg/c11-noreturn-2.c: Same.
	* gcc.dg/c11-static-assert-3.c: Same.
	* gcc.dg/c90-arraydecl-1.c: Same.
	* gcc.dg/c90-complex-1.c: Same.
	* gcc.dg/c90-complit-1.c: Same.
	* gcc.dg/c90-const-expr-11.c: Same.
	* gcc.dg/c90-const-expr-7.c: Same.
	* gcc.dg/c90-const-expr-8.c: Same.
	* gcc.dg/c90-enum-comma-1.c: Same.
	* gcc.dg/c90-flex-array-1.c: Same.
	* gcc.dg/c90-hexfloat-1.c: Same.
	* gcc.dg/c90-idem-qual-1.c: Same.
	* gcc.dg/c90-idem-qual-2.c: Same.
	* gcc.dg/c90-idem-qual-3.c: Same.
	* gcc.dg/c90-mixdecl-1.c: Same.
	* gcc.dg/c90-restrict-1.c: Same.
	* gcc.dg/c90-return-1.c: Same.
	* gcc.dg/c99-array-nonobj-1.c: Same.
	* gcc.dg/c99-arraydecl-1.c: Same.
	* gcc.dg/c99-complex-1.c: Same.
	* gcc.dg/c99-complex-2.c: Same.
	* gcc.dg/c99-complit-2.c: Same.
	* gcc.dg/c99-const-expr-7.c: Same.
	* gcc.dg/c99-const-expr-8.c: Same.
	* gcc.dg/c99-flex-array-3.c: Same.
	* gcc.dg/c99-flex-array-7.c: Same.
	* gcc.dg/c99-flex-array-typedef-7.c: Same.
	* gcc.dg/c99-impl-decl-1.c: Same.
	* gcc.dg/c99-impl-int-1.c: Same.
	* gcc.dg/c99-impl-int-2.c: Same.
	* gcc.dg/c99-init-3.c: Same.
	* gcc.dg/c99-restrict-1.c: Same.
	* gcc.dg/c99-return-1.c: Same.
	* gcc.dg/c99-tag-1.c: Same.
	* gcc.dg/c99-tag-3.c: Same.
	* gcc.dg/call-diag-2.c: Same.
	* gcc.dg/cpp/19940712-1.c: Same.
	* gcc.dg/cpp/19951025-1.c: Same.
	* gcc.dg/cpp/19990413-1.c: Same.
	* gcc.dg/cpp/direct2.c: Same.
	* gcc.dg/cpp/direct2s.c: Same.
	* gcc.dg/cpp/pr28709.c: Same.
	* gcc.dg/cpp/pr61854-c90.c: Same.
	* gcc.dg/cpp/pr61854-c94.c: Same.
	* gcc.dg/cpp/pragma-1.c: Same.
	* gcc.dg/cpp/pragma-2.c: Same.
	* gcc.dg/cpp/trad/escaped-eof.c: Same.
	* gcc.dg/cpp/trad/literals-2.c: Same.
	* gcc.dg/cpp/warn-comments-2.c: Same.
	* gcc.dg/cpp/warn-comments-3.c: Same.
	* gcc.dg/cpp/warn-comments.c: Same.
	* gcc.dg/cpp/warn-long-long-2.c: Same.
	* gcc.dg/cpp/warn-long-long.c: Same.
	* gcc.dg/cpp/warn-redefined-2.c: Same.
	* gcc.dg/cpp/warn-redefined.c: Same.
	* gcc.dg/darwin-cfstring-2.c: Same.
	* gcc.dg/darwin-cfstring-format-1.c: Same.
	* gcc.dg/decl-9.c: Same.
	* gcc.dg/declspec-1.c: Same.
	* gcc.dg/declspec-10.c: Same.
	* gcc.dg/declspec-11.c: Same.
	* gcc.dg/declspec-13.c: Same.
	* gcc.dg/declspec-18.c: Same.
	* gcc.dg/declspec-4.c: Same.
	* gcc.dg/declspec-5.c: Same.
	* gcc.dg/declspec-6.c: Same.
	* gcc.dg/declspec-8.c: Same.
	* gcc.dg/deprecated-4.c: Same.
	* gcc.dg/deprecated.c: Same.
	* gcc.dg/dfp/composite-type.c: Same.
	* gcc.dg/empty-source-2.c: Same.
	* gcc.dg/empty-source-3.c: Same.
	* gcc.dg/format/attr-6.c: Same.
	* gcc.dg/format/branch-1.c: Same.
	* gcc.dg/format/c90-printf-1.c: Same.
	* gcc.dg/format/c90-strftime-2.c: Same.
	* gcc.dg/format/c99-strftime-1.c: Same.
	* gcc.dg/format/cmn-err-1.c: Same.
	* gcc.dg/format/few-1.c: Same.
	* gcc.dg/format/ms_branch-1.c: Same.
	* gcc.dg/format/ms_unnamed-1.c: Same.
	* gcc.dg/format/ms_va-1.c: Same.
	* gcc.dg/format/unnamed-1.c: Same.
	* gcc.dg/format/va-1.c: Same.
	* gcc.dg/format/xopen-1.c: Same.
	* gcc.dg/funcdef-var-1.c: Same.
	* gcc.dg/funcdef-var-2.c: Same.
	* gcc.dg/gnu89-const-expr-1.c: Same.
	* gcc.dg/gnu89-const-expr-2.c: Same.
	* gcc.dg/gnu90-const-expr-1.c: Same.
	* gcc.dg/gnu99-const-expr-1.c: Same.
	* gcc.dg/gnu99-const-expr-2.c: Same.
	* gcc.dg/gnu99-init-2.c: Same.
	* gcc.dg/gomp/_Atomic-5.c: Same.
	* gcc.dg/gomp/appendix-a/a.24.1.c: Same.
	* gcc.dg/gomp/atomic-5.c: Same.
	* gcc.dg/gomp/linear-1.c: Same.
	* gcc.dg/gomp/pr67500.c: Same.
	* gcc.dg/init-bad-1.c: Same.
	* gcc.dg/init-bad-2.c: Same.
	* gcc.dg/init-bad-3.c: Same.
	* gcc.dg/init-string-1.c: Same.
	* gcc.dg/label-compound-stmt-1.c: Same.
	* gcc.dg/label-decl-2.c: Same.
	* gcc.dg/label-decl-4.c: Same.
	* gcc.dg/large-size-array-2.c: Same.
	* gcc.dg/large-size-array-4.c: Same.
	* gcc.dg/lvalue-6.c: Same.
	* gcc.dg/m-un-2.c: Same.
	* gcc.dg/multiple-overflow-warn-1.c: Same.
	* gcc.dg/multiple-overflow-warn-2.c: Same.
	* gcc.dg/multiple-overflow-warn-3.c: Same.
	* gcc.dg/nested-redef-1.c: Same.
	* gcc.dg/no-asm-1.c: Same.
	* gcc.dg/no-asm-3.c: Same.
	* gcc.dg/no-asm-4.c: Same.
	* gcc.dg/noncompile/20010524-1.c: Same.
	* gcc.dg/noncompile/incomplete-5.c: Same.
	* gcc.dg/noncompile/pr44517.c: Same.
	* gcc.dg/noncompile/pr52290.c: Same.
	* gcc.dg/noreturn-1.c: Same.
	* gcc.dg/overflow-warn-1.c: Same.
	* gcc.dg/overflow-warn-2.c: Same.
	* gcc.dg/overflow-warn-3.c: Same.
	* gcc.dg/overflow-warn-4.c: Same.
	* gcc.dg/parm-mismatch-1.c: Same.
	* gcc.dg/parser-pr28152-2.c: Same.
	* gcc.dg/parser-pr28152.c: Same.
	* gcc.dg/pedwarn-init.c: Same.
	* gcc.dg/pointer-arith-2.c: Same.
	* gcc.dg/pointer-arith-3.c: Same.
	* gcc.dg/pointer-arith-4.c: Same.
	* gcc.dg/pr14475.c: Same.
	* gcc.dg/pr18596-3.c: Same.
	* gcc.dg/pr18809-1.c: Same.
	* gcc.dg/pr27953.c: Same.
	* gcc.dg/pr30457.c: Same.
	* gcc.dg/pr30551-2.c: Same.
	* gcc.dg/pr30551-3.c: Same.
	* gcc.dg/pr30551-4.c: Same.
	* gcc.dg/pr30551-5.c: Same.
	* gcc.dg/pr30551-6.c: Same.
	* gcc.dg/pr30551.c: Same.
	* gcc.dg/pr36997.c: Same.
	* gcc.dg/pr41842.c: Same.
	* gcc.dg/pr48552-1.c: Same.
	* gcc.dg/pr48552-2.c: Same.
	* gcc.dg/pr59717.c: Same.
	* gcc.dg/pr61077.c: Same.
	* gcc.dg/pr61096-1.c: Same.
	* gcc.dg/pr63626.c: Same.
	* gcc.dg/pr64223-1.c: Same.
	* gcc.dg/pr64223-2.c: Same.
	* gcc.dg/pr8788-1.c: Same.
	* gcc.dg/pr8927-1.c: Same.
	* gcc.dg/pragma-darwin.c: Same.
	* gcc.dg/pragma-diag-5.c: Same.
	* gcc.dg/pragma-message.c: Same.
	* gcc.dg/redecl-1.c: Same.
	* gcc.dg/simd-1.c: Same.
	* gcc.dg/simd-5.c: Same.
	* gcc.dg/simd-6.c: Same.
	* gcc.dg/spellcheck-fields.c: Same.
	* gcc.dg/spellcheck-typenames.c: Same.
	* gcc.dg/struct-semi-2.c: Same.
	* gcc.dg/struct-semi-3.c: Same.
	* gcc.dg/transparent-union-3.c: Same.
	* gcc.dg/ucnid-8.c: Same.
	* gcc.dg/uninit-pr19430-O0.c: Same.
	* gcc.dg/uninit-pr19430.c: Same.
	* gcc.dg/uninit-pr20644-O0.c: Same.
	* gcc.dg/utf-dflt.c: Same.
	* gcc.dg/utf-dflt2.c: Same.
	* gcc.dg/utf16-4.c: Same.
	* gcc.dg/vla-11.c: Same.
	* gcc.dg/vla-20.c: Same.
	* gcc.dg/vla-init-1.c: Same.
	* gcc.dg/vla-init-2.c: Same.
	* gcc.dg/vla-init-3.c: Same.
	* gcc.dg/weak/weak-6.c: Same.
	* gcc.dg/weak/weak-7.c: Same.
	* gcc.dg/wtr-int-type-1.c: Same.
	* gcc.target/aarch64/mgeneral-regs_1.c: Same.
	* gcc.target/arm/polytypes.c: Same.
	* gcc.target/i386/spellcheck-options-4.c: Same.
	* gcc.target/powerpc/20030218-1.c: Same.
	* gcc.target/sh/pr21255-4.c: Same.
	* gcc.test-framework/dg-error-exp-XP.c: Same.
	* gfortran.dg/array_constructor_30.f03: Same.
	* gfortran.dg/class_30.f90: Same.
	* gfortran.dg/goacc/subarrays.f95: Same.
	* gfortran.dg/gomp/appendix-a/a.23.5.f90: Same.
	* gfortran.dg/gomp/appendix-a/a.24.1.f90: Same.
	* gfortran.dg/intrinsic_std_1.f90: Same.
	* gfortran.dg/pr70006.f90: Same.
	* gfortran.dg/warning-directive-1.F90: Same.
	* gfortran.dg/warning-directive-2.F90: Same.
	* gfortran.dg/warning-directive-3.F90: Same.
	* gfortran.dg/warning-directive-4.F90: Same.
	* obj-c++.dg/attributes/method-noreturn-1.mm: Same.
	* obj-c++.dg/class-extension-1.mm: Same.
	* obj-c++.dg/class-extension-2.mm: Same.
	* obj-c++.dg/class-protocol-1.mm: Same.
	* obj-c++.dg/cxx-ivars-1.mm: Same.
	* obj-c++.dg/duplicate-class-1.mm: Same.
	* obj-c++.dg/exceptions-3.mm: Same.
	* obj-c++.dg/exceptions-4.mm: Same.
	* obj-c++.dg/exceptions-5.mm: Same.
	* obj-c++.dg/fsf-nsstring-format-1.mm: Same.
	* obj-c++.dg/fsf-package-0.m: Same.
	* obj-c++.dg/invalid-type-1.mm: Same.
	* obj-c++.dg/method-12.mm: Same.
	* obj-c++.dg/method-13.mm: Same.
	* obj-c++.dg/method-15.mm: Same.
	* obj-c++.dg/method-16.mm: Same.
	* obj-c++.dg/method-6.mm: Same.
	* obj-c++.dg/method-7.mm: Same.
	* obj-c++.dg/property/at-property-1.mm: Same.
	* obj-c++.dg/property/at-property-14.mm: Same.
	* obj-c++.dg/property/at-property-17.mm: Same.
	* obj-c++.dg/property/at-property-21.mm: Same.
	* obj-c++.dg/property/at-property-5.mm: Same.
	* obj-c++.dg/property/dotsyntax-4.mm: Same.
	* obj-c++.dg/property/dynamic-3.mm: Same.
	* obj-c++.dg/property/dynamic-4.mm: Same.
	* obj-c++.dg/property/property-neg-1.mm: Same.
	* obj-c++.dg/property/property-neg-6.mm: Same.
	* obj-c++.dg/property/synthesize-11.mm: Same.
	* obj-c++.dg/property/synthesize-5.mm: Same.
	* obj-c++.dg/property/synthesize-6.mm: Same.
	* obj-c++.dg/proto-lossage-4.mm: Same.
	* obj-c++.dg/protocol-qualifier-2.mm: Same.
	* obj-c++.dg/strings/strings-1.mm: Same.
	* obj-c++.dg/super-class-1.mm: Same.
	* obj-c++.dg/syntax-error-6.mm: Same.
	* obj-c++.dg/syntax-error-7.mm: Same.
	* obj-c++.dg/syntax-error-9.mm: Same.
	* obj-c++.dg/try-catch-13.mm: Same.
	* objc.dg/attributes/method-noreturn-1.m: Same.
	* objc.dg/bad-receiver-type-2.m: Same.
	* objc.dg/bad-receiver-type.m: Same.
	* objc.dg/call-super-2.m: Same.
	* objc.dg/class-2.m: Same.
	* objc.dg/class-extension-1.m: Same.
	* objc.dg/class-extension-2.m: Same.
	* objc.dg/class-protocol-1.m: Same.
	* objc.dg/desig-init-1.m: Same.
	* objc.dg/duplicate-class-1.m: Same.
	* objc.dg/exceptions-3.m: Same.
	* objc.dg/exceptions-4.m: Same.
	* objc.dg/exceptions-5.m: Same.
	* objc.dg/foreach-6.m: Same.
	* objc.dg/foreach-7.m: Same.
	* objc.dg/fsf-nsstring-format-1.m: Same.
	* objc.dg/fsf-package-0.m: Same.
	* objc.dg/invalid-type-1.m: Same.
	* objc.dg/method-11.m: Same.
	* objc.dg/method-19.m: Same.
	* objc.dg/method-2.m: Same.
	* objc.dg/method-20.m: Same.
	* objc.dg/method-5.m: Same.
	* objc.dg/method-6.m: Same.
	* objc.dg/method-7.m: Same.
	* objc.dg/method-9.m: Same.
	* objc.dg/missing-proto-3.m: Same.
	* objc.dg/private-1.m: Same.
	* objc.dg/property/at-property-1.m: Same.
	* objc.dg/property/at-property-14.m: Same.
	* objc.dg/property/at-property-17.m: Same.
	* objc.dg/property/at-property-21.m: Same.
	* objc.dg/property/at-property-5.m: Same.
	* objc.dg/property/dynamic-3.m: Same.
	* objc.dg/property/dynamic-4.m: Same.
	* objc.dg/property/property-neg-1.m: Same.
	* objc.dg/property/property-neg-6.m: Same.
	* objc.dg/property/synthesize-11.m: Same.
	* objc.dg/property/synthesize-5.m: Same.
	* objc.dg/property/synthesize-6.m: Same.
	* objc.dg/proto-hier-1.m: Same.
	* objc.dg/proto-lossage-4.m: Same.
	* objc.dg/protocol-qualifier-2.m: Same.
	* objc.dg/strings/strings-1.m: Same.
	* objc.dg/type-size-1.m: Same.

From-SVN: r246988
2017-04-19 06:55:33 +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
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
Jakub Jelinek 8487c9a550 re PR middle-end/79788 (ICE in expand_expr_real_2, at expr.c:9557)
PR middle-end/79788
	PR middle-end/80375
	* c-common.c (c_common_type_for_mode): Don't handle
	widest_*_literal_type_node here.
	c_common_signed_or_unsigned_type): Likewise.
	(c_common_nodes_and_builtins): Set widest_*_literal_type_node
	to *intTI_type_node or *intDI_type_node depending on whether
	TImode is supported by the target or not.

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

From-SVN: r246965
2017-04-18 15:15:46 +02:00
Marek Polacek d6e3e8a54c PR c++/80241 - ICE with alignas pack expansion.
* error.c (dump_expr): Handle TREE_LIST.
	* parser.c (cp_parser_std_attribute_list): Return error_mark if
	make_pack_expansion returns an error.

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

From-SVN: r246963
2017-04-18 09:38:55 +00:00
Marek Polacek be7c73ae35 PR c++/80244 - ICE with attribute in template alias.
* tree.c (strip_typedefs): Handle UNDERLYING_TYPE.

	* g++.dg/cpp0x/alias-decl-59.C: New test.

From-SVN: r246962
2017-04-18 09:34:10 +00:00
Bernd Edlinger 1adb82e117 017-04-17 Bernd Edlinger <bernd.edlinger@hotmail.de>
PR c++/80287
        * class.c (fixup_may_alias): Fix all type variants.

gcc/testsuite
2017-04-17  Bernd Edlinger  <bernd.edlinger@hotmail.de> 

        PR c++/80287
        * g++.dg/lto/pr80287_0.C: New test.

From-SVN: r246955
2017-04-17 20:41:40 +00:00
Kelvin Nilsen fb5e562100 re PR target/80315 (Calling __builtin_crypto_vshasigmaw with argument 3 out of range creates an unrecognizable insn)
gcc/testsuite/ChangeLog:

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

	PR target/80315
	* gcc.target/powerpc/pr80315-1.c: New test.
	* gcc.target/powerpc/pr80315-2.c: New test.
	* gcc.target/powerpc/pr80315-3.c: New test.
	* gcc.target/powerpc/pr80315-4.c: New test.

From-SVN: r246949
2017-04-17 16:16:43 +00:00
Tom de Vries afeaeb708e Remove braces around line number in dejagnu directive
2017-04-16  Tom de Vries  <tom@codesourcery.com>

	* g++.dg/parse/error11.C: Remove braces around line number in dejagnu
	  directive.
	* g++.dg/parse/error3.C: Same.
	* g++.old-deja/g++.pt/niklas01a.C: Same.
	* gcc.dg/990506-0.c: Same.
	* gcc.dg/cpp/19990413-1.c: Same.
	* gcc.dg/cpp/pragma-1.c: Same.
	* gcc.dg/cpp/pragma-2.c: Same.
	* gcc.dg/m-un-2.c: Same.
	* objc.dg/private-1.m: Same.

From-SVN: r246945
2017-04-16 08:17:14 +00:00
Uros Bizjak 604f37cde8 pr54669.c: Fix dg-do directive.
* gcc.dg/pr54669.c: Fix dg-do directive.
	* gcc.dg/pr78582.c: Ditto.
	* gcc.dg/pr80020.c: Ditto.
	* gcc.dg/torture/pr57993-2.cpp: Ditto.
	* gcc.dg/tree-ssa/builtin-sprintf-3.c: Ditto.
	* gcc.dg/tree-ssa/builtin-sprintf-4.c: Ditto.
	* gcc.dg/tree-ssa/builtin-sprintf-5.c: Ditto.
	* gcc.dg/tree-ssa/builtin-sprintf-6.c: Ditto.
	* gcc.dg/tree-ssa/builtin-sprintf-warn-5.c: Ditto.
	* gcc.dg/tree-ssa/pr79327-2.c: Ditto.
	* gcc.dg/tree-ssa/pr79352.c: Ditto.
	* gcc.dg/tree-ssa/pr79376.c: Ditto.
	* gcc.dg/tree-ssa/pr79691.c: Ditto.

From-SVN: r246941
2017-04-15 22:07:47 +02:00
Dominique d'Humieres 35cfdb17fa deferred_character_3.f90: Fix dg directive.
2017-04-15  Dominique d'Humieres  <dominiq@lps.ens.fr>

	* gfortran.dg/deferred_character_3.f90: Fix dg directive.
	* gfortran.dg/generic_29.f90: Likewise.
	* gfortran.dg/goacc/multi-clause.f90: Likewise.
	* gfortran.dg/pr41922.f90: Likewise.
	* gfortran.dg/pr70006.f90: Likewise.

From-SVN: r246940
2017-04-15 20:17:11 +02:00
Segher Boessenkool f378be388e rs6000: Testcase 20050830-1.c no longer fails (PR66612)
Bin's commit r246810, for PR80153, fixes 20050830-1.c for -m64 (it
already passed for -m32).  So, this patch removes the remaining xfail.


gcc/testsuite/
	PR tree-optimization/66612
	* gcc.target/powerpc/20050830-1.c: Remove xfail.

From-SVN: r246939
2017-04-15 06:11:35 +02:00
Janus Weil 4307649214 re PR fortran/80361 ([OOP] bogus recursive call to nonrecursive procedure with -fcheck=recursion)
2017-04-14  Janus Weil  <janus@gcc.gnu.org>

	PR fortran/80361
	* class.c (generate_finalization_wrapper): Give the finalization wrapper
	the recursive attribute.

2017-04-14  Janus Weil  <janus@gcc.gnu.org>

	PR fortran/80361
	* gfortran.dg/class_62.f90: New test case.

From-SVN: r246934
2017-04-14 23:17:52 +02: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
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
Jakub Jelinek 099560172f re PR sanitizer/80403 (UBSAN: compile time crash with "type mismatch in binary expression" message in / and % expr)
PR sanitizer/80403
	* fold-const.c (fold_ternary_loc): Revert
	use op0 instead of fold_convert_loc (loc, type, arg0) part of
	2017-04-12 change.

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

From-SVN: r246917
2017-04-13 21:52:58 +02:00
Vladimir Makarov bc04239603 re PR rtl-optimization/80343 (ICE in extract_constrain_insn, at recog.c:2213 (error: insn does not satisfy its constraints))
2017-04-13  Vladimir Makarov  <vmakarov@redhat.com>

	PR rtl-optimization/80343
	* lra-remat.c (update_scratch_ops): Assign original hard reg to
	new scratch pseudo.

2017-04-13  Vladimir Makarov  <vmakarov@redhat.com>

	PR rtl-optimization/80343
	* gcc.target/powerpc/pr80343.c: New.

From-SVN: r246914
2017-04-13 18:08:51 +00:00
Denis Khalikov abac4c3400 re PR sanitizer/80414 ([UBSAN] segfault with -fsanitize=undefined)
PR sanitizer/80414
	* ubsan.c (ubsan_expand_bounds_ifn): Pass original index
	to ubsan_encode_value.

	* c-c++-common/ubsan/bounds-15.c: New test.

From-SVN: r246909
2017-04-13 17:52:23 +03:00
Richard Biener 43a3aa03ac re PR testsuite/80416 (FAIL: g++.dg/torture/pr79671.C -O2 execution test)
2017-04-13  Richard Biener  <rguenther@suse.de>

	PR testsuite/80416
	* g++.dg/torture/pr79671.C: Fix asm constraints.

From-SVN: r246902
2017-04-13 11:17:38 +00:00
Jakub Jelinek 031fbdb9c9 re PR debug/80321 (infinite recursion with inlining of nested function and debug info)
PR debug/80321
	* dwarf2out.c (decls_for_scope): Ignore declarations of
	current_function_decl in BLOCK_NONLOCALIZED_VARS.

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

2017-04-13  Eric Botcazou  <ebotcazou@adacore.com>

	* gnat.dg/debug10.adb: New test.
	* gnat.dg/debug10_pkg.ads: New helper.

From-SVN: r246900
2017-04-13 13:05:09 +02:00
Jakub Jelinek deed3da9af re PR tree-optimization/79390 (10% performance drop in SciMark2 LU after r242550)
PR tree-optimization/79390
	* optabs.c (emit_conditional_move): If the preferred op2/op3 operand
	order does not result in usable sequence, retry with reversed operand
	order.

	* gcc.target/i386/pr70465-2.c: Xfail the scan-assembler-not test.

From-SVN: r246882
2017-04-12 20:09:47 +02:00
Jakub Jelinek b96a3e1157 re PR sanitizer/80403 (UBSAN: compile time crash with "type mismatch in binary expression" message in / and % expr)
PR sanitizer/80403
	PR sanitizer/80404
	PR sanitizer/80405
	* fold-const.c (fold_ternary_loc): Use op1 instead of arg1 as argument
	to fold_build2_loc.  Convert TREE_OPERAND (tem, 0) to type.  Use
	op0 instead of fold_convert_loc (loc, type, arg0).

	* g++.dg/ubsan/pr80403.C: New test.
	* g++.dg/ubsan/pr80404.C: New test.
	* g++.dg/ubsan/pr80405.C: New test.

From-SVN: r246881
2017-04-12 20:08:29 +02:00
Jakub Jelinek 7687375840 re PR middle-end/80163 (ICE on hopefully valid code)
PR c/80163
	* expr.c <CASE_CONVERT>: For EXPAND_INITIALIZER determine SIGN_EXTEND
	vs. ZERO_EXTEND based on signedness of treeop0's type rather than
	signedness of the result type.

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

From-SVN: r246876
2017-04-12 15:57:45 +02:00
Richard Biener 940c9a7c2c re PR tree-optimization/80359 (DSE causes error: invalid reference prefix)
2017-04-12  Richard Biener  <rguenther@suse.de>
	Jeff Law  <law@redhat.com>

	PR tree-optimization/80359
	* tree-ssa-dse.c (maybe_trim_partially_dead_store): Do not
	trim stores to TARGET_MEM_REFs.

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

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

From-SVN: r246875
2017-04-12 13:47:26 +00:00
Richard Biener 350792ffae re PR target/79671 (mapnik miscompilation on armv7hl since r235622)
2017-04-12  Richard Biener  <rguenther@suse.de>
	Bernd Edlinger  <bernd.edlinger@hotmail.de>

	PR middle-end/79671
	* alias.c (component_uses_parent_alias_set_from): Handle
	TYPE_TYPELESS_STORAGE.
	(get_alias_set): Likewise.
	* tree-core.h (tree_type_common): Add typeless_storage flag.
	* tree.h (TYPE_TYPELESS_STORAGE): New macro.
	* stor-layout.c (place_union_field): Set TYPE_TYPELESS_STORAGE
	for types containing members with TYPE_TYPELESS_STORAGE.
	(place_field): Likewise.
	(layout_type): Likewise for ARRAY_TYPE.
	* lto-streamer-out.c (hash_tree): Hash TYPE_TYPELESS_STORAGE.
	* tree-streamer-in.c (unpack_ts_type_common_value_fields): Stream
	TYPE_TYPELESS_STORAGE.
	* tree-streamer-out.c (pack_ts_type_common_value_fields): Likewise.

	lto/
	* lto.c (compare_tree_sccs_1): Compare TYPE_TYPELESS_STORAGE.

	cp/
	* tree.c (build_cplus_array_type): Set TYPE_TYPELESS_STORAGE
	for arrays of character or std::byte type.

	* g++.dg/torture/pr79671.C: New testcase.
	* g++.dg/lto/pr79671_0.C: Likewise.
	* g++.dg/lto/pr79671_1.c: Likewise.

Co-Authored-By: Bernd Edlinger <bernd.edlinger@hotmail.de>

From-SVN: r246866
2017-04-12 07:35:49 +00:00
Jakub Jelinek d62e6f1078 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.C: New test.

From-SVN: r246865
2017-04-12 08:12:26 +02:00
Jakub Jelinek 347e1f7769 re PR c++/80370 (ICE when using structured bindings and nested generic lambdas (tsubst_decomp_names))
PR c++/80370
	* decl.c (cp_finish_decomp): If processing_template_decl on
	non-dependent decl, only set TREE_TYPE on the v[i] decls, but don't
	change their DECL_VALUE_EXPR nor cp_finish_decl them.  Instead make
	sure DECL_VALUE_EXPR is the canonical NULL type ARRAY_REF for tsubst
	processing.
	* pt.c (value_dependent_expression_p) <case VAR_DECL>: For variables
	with DECL_VALUE_EXPR, return true if DECL_VALUE_EXPR is type
	dependent.

	* g++.dg/cpp1z/decomp28.C: New test.

From-SVN: r246857
2017-04-11 22:51:16 +02:00
Jakub Jelinek df1c878ec2 re PR middle-end/80100 (simplify-rtx.c sanitizer detects undefined behaviour with optimization)
PR middle-end/80100
	* simplify-rtx.c (simplify_binary_operation_1) <case IOR>: Perform
	left shift in unsigned HOST_WIDE_INT type.

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

From-SVN: r246851
2017-04-11 19:21:51 +02:00
Jakub Jelinek 8585103f05 re PR rtl-optimization/80385 (Segfault in commutative_operand_precedence() rtlanal.c:3373)
PR rtl-optimization/80385
	* simplify-rtx.c (simplify_unary_operation_1): Don't transform
	(not (neg X)) into (plus X -1) for complex or non-integral modes.

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

From-SVN: r246850
2017-04-11 19:19:56 +02:00
Martin Liska c6cf6ef7c0 Add function part to a same comdat group (PR ipa/80212).
2017-04-11  Martin Liska  <mliska@suse.cz>

	PR ipa/80212
	* cgraph.c (cgraph_node::dump): Dump calls_comdat_local.
	* ipa-split.c (split_function): Create a local comdat symbol
	if caller is in a comdat group.
2017-04-11  Martin Liska  <mliska@suse.cz>

	PR ipa/80212
	* g++.dg/ipa/pr80212.C: New test.

From-SVN: r246848
2017-04-11 16:38:19 +00:00
Martin Sebor 3812f46046 PR middle-end/80364 - sanitizer detects signed integer overflow in gimple-ssa-sprintf.c
gcc/ChangeLog:
	PR middle-end/80364
	* gimple-ssa-sprintf.c (get_int_range): Remove second argument and
	always use the int type.  Use INTEGRAL_TYPE_P() rather than testing
	for INTEGER_TYPE.
	(directive::set_width, directive::set_precision, format_character):
	Adjust.
	(parse_directive): Use INTEGRAL_TYPE_P() rather than testing for
	INTEGER_TYPE.

gcc/testsuite/ChangeLog:
	PR middle-end/80364
	* gcc.dg/tree-ssa/builtin-sprintf-warn-16.c: New test.

From-SVN: r246846
2017-04-11 10:35:34 -06:00
Martin Liska 9f67937000 Do not instrument register variables in object-size sanitizer (PR sanitizer/70878).
2017-04-11  Martin Liska  <mliska@suse.cz>

	PR sanitizer/70878
	* ubsan.c (instrument_object_size): Do not instrument register
	variables.
2017-04-11  Martin Liska  <mliska@suse.cz>

	PR sanitizer/70878
	* gcc.dg/ubsan/pr70878.c: New test.

From-SVN: r246837
2017-04-11 13:08:08 +00:00
Jakub Jelinek cb278caa18 re PR target/80381 (AVX512: -O3, _mm512_srai_epi32, the last argument must be an 8-bit immediate)
PR target/80381
	* config/i386/i386-builtin-types.def
	(V16HI_FTYPE_V16HI_INT_V16HI_UHI_COUNT,
	V16HI_FTYPE_V16HI_V8HI_V16HI_UHI_COUNT,
	V16SI_FTYPE_V16SI_INT_V16SI_UHI_COUNT,
	V16SI_FTYPE_V16SI_V4SI_V16SI_UHI_COUNT,
	V2DI_FTYPE_V2DI_INT_V2DI_UQI_COUNT,
	V2DI_FTYPE_V2DI_V2DI_V2DI_UQI_COUNT,
	V32HI_FTYPE_V32HI_INT_V32HI_USI_COUNT,
	V32HI_FTYPE_V32HI_V8HI_V32HI_USI_COUNT,
	V4DI_FTYPE_V4DI_INT_V4DI_UQI_COUNT,
	V4DI_FTYPE_V4DI_V2DI_V4DI_UQI_COUNT,
	V4SI_FTYPE_V4SI_INT_V4SI_UQI_COUNT,
	V4SI_FTYPE_V4SI_V4SI_V4SI_UQI_COUNT,
	V8DI_FTYPE_V8DI_INT_V8DI_UQI_COUNT,
	V8DI_FTYPE_V8DI_V2DI_V8DI_UQI_COUNT,
	V8HI_FTYPE_V8HI_INT_V8HI_UQI_COUNT,
	V8HI_FTYPE_V8HI_V8HI_V8HI_UQI_COUNT,
	V8SI_FTYPE_V8SI_INT_V8SI_UQI_COUNT,
	V8SI_FTYPE_V8SI_V4SI_V8SI_UQI_COUNT): New function type aliases.
	* config/i386/i386-builtin.def (__builtin_ia32_pslld512_mask,
	__builtin_ia32_pslldi512_mask, __builtin_ia32_psllq512_mask,
	__builtin_ia32_psllqi512_mask, __builtin_ia32_psrad512_mask,
	__builtin_ia32_psradi512_mask, __builtin_ia32_psraq512_mask,
	__builtin_ia32_psraqi512_mask, __builtin_ia32_psrld512_mask,
	__builtin_ia32_psrldi512_mask, __builtin_ia32_psrlq512_mask,
	__builtin_ia32_psrlqi512_mask, __builtin_ia32_psllwi128_mask,
	__builtin_ia32_pslldi128_mask, __builtin_ia32_psllqi128_mask,
	__builtin_ia32_psllw128_mask, __builtin_ia32_pslld128_mask,
	__builtin_ia32_psllq128_mask, __builtin_ia32_psllwi256_mask,
	__builtin_ia32_psllw256_mask, __builtin_ia32_pslldi256_mask,
	__builtin_ia32_pslld256_mask, __builtin_ia32_psllqi256_mask,
	__builtin_ia32_psllq256_mask, __builtin_ia32_psradi128_mask,
	__builtin_ia32_psrad128_mask, __builtin_ia32_psradi256_mask,
	__builtin_ia32_psrad256_mask, __builtin_ia32_psraqi128_mask,
	__builtin_ia32_psraq128_mask, __builtin_ia32_psraqi256_mask,
	__builtin_ia32_psraq256_mask, __builtin_ia32_psrldi128_mask,
	__builtin_ia32_psrld128_mask, __builtin_ia32_psrldi256_mask,
	__builtin_ia32_psrld256_mask, __builtin_ia32_psrlqi128_mask,
	__builtin_ia32_psrlq128_mask, __builtin_ia32_psrlqi256_mask,
	__builtin_ia32_psrlq256_mask, __builtin_ia32_psrawi256_mask,
	__builtin_ia32_psraw256_mask, __builtin_ia32_psrawi128_mask,
	__builtin_ia32_psraw128_mask, __builtin_ia32_psrlwi256_mask,
	__builtin_ia32_psrlw256_mask, __builtin_ia32_psrlwi128_mask,
	__builtin_ia32_psrlw128_mask, __builtin_ia32_psllwi512_mask,
	__builtin_ia32_psllw512_mask, __builtin_ia32_psrawi512_mask,
	__builtin_ia32_psraw512_mask, __builtin_ia32_psrlwi512_mask,
	__builtin_ia32_psrlw512_mask): Use _COUNT suffixed function type
	aliases.
	* config/i386/i386.c (ix86_expand_args_builtin): Rename last_arg_count
	flag to second_arg_count, handle 4 argument function type _COUNT
	aliases, handle second_arg_count on second argument rather than last.

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

From-SVN: r246835
2017-04-11 10:54:54 +02:00
Jakub Jelinek 82665822b1 re PR c++/80363 (#'vec_cond_expr' not supported by dump_expr#<expression error>)
PR c++/80363
	* error.c (dump_expr): Handle VEC_COND_EXPR like COND_EXPR.

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

From-SVN: r246834
2017-04-11 10:51:40 +02:00
Senthil Kumar Selvaraj abde687ac3 Fix bogus builtin-sprintf-warn-{3,10}.c failures for avr.
This patch fixes a whole bunch of failures reported for
gcc.dg/tree-ssa/builtin-sprintf-warn-{3,10}.c for the avr target.

builtin-sprintf-warn-10.c fails because the bounds in the warning
messages expect 4 digit wide exponents i.e. __DBL_MAX_EXP__ > 999.
For the avr, floats and doubles are both 32 bits wide, __DBL_MAX_EXP__
== 128, and the max number of exponent digits can only be 3 .
The computed size thus ends up one short of the value the test
expects. The patch makes the test run only for targets with double64plus.

builtin-sprintf-warn-3.c fails because the test appears to assume all
non lp64 targets to be ilp32. For the avr, pointer size and int size
are equal, but both are 16 bits, not 32. The patch fixes this by
explicitly adding avr to the dejagnu selector.

gcc/testsuite

2017-04-06  Senthil Kumar Selvaraj  <senthil_kumar.selvaraj@atmel.com>

	* gcc.dg/tree-ssa/builtin-sprintf-warn-10.c: Require double64plus.
	* gcc.dg/tree-ssa/builtin-sprintf-warn-3.c (void test_too_large): 
	Add avr-*-* to non-lp64 selector.

From-SVN: r246831
2017-04-11 05:09:41 +00:00
Martin Sebor 13e6ec34a8 Adjust dg-bogus pattern to match the text of the changed diagnostic.
gcc/testsuite:
	* gcc.dg/pr40340-3.c: Adjust directive pattern.
	* gcc.dg/pr40340-4.c: Same.

From-SVN: r246827
2017-04-10 17:26:17 -06:00
Nicolas Koenig a2cb1196cf re PR fortran/69498 (ICE on disjunct cases with displaced or incomplete embedded statement)
2017-04-10  Nicolas Koenig  <koenigni@student.ethz.ch>
            Paul Thomas  <pault@gcc.gnu.org>

	PR fortran/69498 
	* module.c (gfc_match_submodule): Add error
	if function is called in the wrong state.

2017-04-10  Nicolas Koenig  <koenigni@student.ethz.ch>

	PR fortran/69498 
	* gfortran.dg/submodule_unexp.f90: Modified test
	to account for new error.
	* gfortran.dg/submodule_twice.f90: New Test


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

From-SVN: r246826
2017-04-10 20:58:21 +00:00
Jakub Jelinek b447b28c5e re PR c++/80176 (cannot bind reference to static member function using object access expression)
PR c++/80176
	* tree.c (lvalue_kind): For COMPONENT_REF with BASELINK second
	operand, if it is a static member function, recurse on the
	BASELINK.

	* g++.dg/init/ref23.C: New test.

From-SVN: r246825
2017-04-10 22:49:11 +02:00
Thomas Koenig 3bbd6768bd re PR tree-optimization/80304 (Wrong result with do concurrent)
2017-04-10  Thomas Koenig  <tkoenig@gcc.gnu.org>

	PR tree-optimization/80304
	* gfortran.dg/do_concurrent_4.f90:  New test case.

From-SVN: r246824
2017-04-10 20:40:48 +00:00
Janus Weil 99827b5ca0 re PR fortran/80046 ([F03] Explicit interface required: pointer argument)
2017-04-10  Janus Weil  <janus@gcc.gnu.org>

	PR fortran/80046
	* expr.c (gfc_check_pointer_assign): Check if procedure pointer
	components in a pointer assignment need an explicit interface.

2017-04-10  Janus Weil  <janus@gcc.gnu.org>

	PR fortran/80046
	* gfortran.dg/proc_ptr_comp_48.f90: New test case.

From-SVN: r246823
2017-04-10 22:28:23 +02:00
David Edelsohn 7db31bc20c * g++.dg/torture/pr79905.C: Add -maltivec option.
From-SVN: r246820
2017-04-10 15:50:33 -04:00
Jeff Law 9058a2c5c5 re PR tree-optimization/80374 (ICE in fold_convert_loc, at fold-const.c:2384)
PR tree-optimization/80374
	* tree-ssa-dom.c (derive_equivalences_from_bit_ior): Do not try to
	record anything if we can not convert integer_zero_node to the
	desired type.

	PR tree-optimization/80374
	* g++.dg/pr80374.c: New test.

From-SVN: r246819
2017-04-10 13:19:42 -06:00
Kelvin Nilsen bd8f86429e re PR target/80108 (ICE in aggregate_value_p at function.c:2028)
gcc/ChangeLog:

2017-04-10  Kelvin Nilsen  <kelvin@gcc.gnu.org>

	PR target/80108
	* config/rs6000/rs6000.c (rs6000_option_override_internal):
	Enhance special handling given to the TARGET_P9_MINMAX option in
	relation to certain other options.

gcc/testsuite/ChangeLog:

2017-04-10  Kelvin Nilsen  <kelvin@gcc.gnu.org>

	PR target/80108
	* gcc.target/powerpc/ppc-fortran/ppc-fortran.exp: New file.
	* gcc.target/powerpc/ppc-fortran/pr80108-1.f90: New test.

From-SVN: r246818
2017-04-10 19:01:37 +00:00
Uros Bizjak f634dd47d6 unroll-7.c: Declare "a" as a pointer to external array.
* gcc.dg/unroll-7.c: Declare "a" as a pointer to external array.

From-SVN: r246817
2017-04-10 20:58:34 +02:00
Uros Bizjak 065ba17919 re PR testsuite/79356 (XPASS in attr-alloc_size-11.c)
PR testsuite/79356
	* gcc.dg/attr-alloc_size-11.c: Don't xfail on alpha.

From-SVN: r246816
2017-04-10 20:51:42 +02:00
Daniel Santos 71b838d035 re PR testsuite/79867 ([cygwin] LD_LIBRARY_PATH ignored, contaminating (nearly?) all test results)
2017-04-10  Daniel Santos <daniel.santos@pobox.com>

	PR testsuite/79867
	* lib/target-libpath.exp: Merge in cygwin fix from libffi.

From-SVN: r246813
2017-04-10 17:45:35 +00:00
Marek Polacek 98a7a34e26 re PR sanitizer/80348 (UBSAN: compile time crash in ubsan_instrument_division)
PR sanitizer/80348
	* typeck.c (cp_build_binary_op): Use NULL_TREE instead of NULL.  Set
	ORIG_TYPE earlier and not only when shortening.

	* g++.dg/ubsan/div-by-zero-3.C: New test.

From-SVN: r246812
2017-04-10 17:18:15 +00:00
Bin Cheng aac69a62a1 re PR tree-optimization/80153 (ivopt generate wrong code)
PR tree-optimization/80153
	* tree-affine.c (aff_combination_to_tree): Get base pointer from
	the first element of pointer type aff_tree.  Build result expr in
	aff_tree's type.
	(add_elt_to_tree): Convert to type unconditionally.  Remove other
	fold_convert calls.
	* tree-ssa-loop-ivopts.c (alloc_iv): Pass in consistent types.
	(rewrite_use_nonlinear_expr): Check invariant using iv information.
	gcc/testsuite
	PR tree-optimization/80153
	* gcc.c-torture/execute/pr80153.c: New.

From-SVN: r246810
2017-04-10 16:51:44 +00:00
Richard Biener 737237c9b8 re PR middle-end/80362 (gcc miscompiles arithmetic with signed char)
2017-04-10  Richard Biener  <rguenther@suse.de>

	PR middle-end/80362
	* fold-const.c (fold_binary_loc): Look at unstripped ops when
	looking for NEGATE_EXPR in -A / -B to A / B folding.

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

From-SVN: r246805
2017-04-10 13:02:12 +00:00
Richard Biener ba6ee9fc83 re PR tree-optimization/80304 (Wrong result with do concurrent)
2017-04-10  Richard Biener  <rguenther@suse.de>

	PR tree-optimization/80304
	* tree-ssa-loop-im.c (ref_indep_loop_p_1): Also recurse
	for safelen.

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

From-SVN: r246803
2017-04-10 11:27:05 +00:00
Nathan Sidwell 4d1a05f138 re PR target/79905 (ICE in canonical types differ for identical types __vector(4) int and V4i {aka __vector(4) int})
PR target/79905
	* config/rs6000/rs6000.c (rs6000_vector_type): New.
	(rs6000_init_builtins): Use it.

	PR target/79905
	* g++.dg/torture/pr79905.C: New.

From-SVN: r246802
2017-04-10 11:25:44 +00:00
Martin Liska 3ee0fb02bb Evaluate a SAVE_EXPR before an UBSAN check (PR sanitizer/80350).
2017-04-10  Martin Liska  <mliska@suse.cz>

	PR sanitizer/80350
	* c-ubsan.c (ubsan_instrument_shift): Evaluate RHS before
	doing an UBSAN check.
2017-04-10  Martin Liska  <mliska@suse.cz>

	PR sanitizer/80350
	* c-c++-common/ubsan/pr80350.c: New test.

From-SVN: r246799
2017-04-10 07:29:29 +00:00
Jakub Jelinek 167a5b7797 re PR target/80324 (_mm512_reduce_xxx type instrinsics are missing)
PR target/80324
	* config/i386/avx512fintrin.h (_mm512_reduce_add_epi32,
	_mm512_reduce_mul_epi32, _mm512_reduce_and_epi32,
	_mm512_reduce_or_epi32, _mm512_mask_reduce_add_epi32,
	_mm512_mask_reduce_mul_epi32, _mm512_mask_reduce_and_epi32,
	_mm512_mask_reduce_or_epi32, _mm512_reduce_min_epi32,
	_mm512_reduce_max_epi32, _mm512_reduce_min_epu32,
	_mm512_reduce_max_epu32, _mm512_mask_reduce_min_epi32,
	_mm512_mask_reduce_max_epi32, _mm512_mask_reduce_min_epu32,
	_mm512_mask_reduce_max_epu32, _mm512_reduce_add_ps,
	_mm512_reduce_mul_ps, _mm512_mask_reduce_add_ps,
	_mm512_mask_reduce_mul_ps, _mm512_reduce_min_ps, _mm512_reduce_max_ps,
	_mm512_mask_reduce_min_ps, _mm512_mask_reduce_max_ps,
	_mm512_reduce_add_epi64, _mm512_reduce_mul_epi64,
	_mm512_reduce_and_epi64, _mm512_reduce_or_epi64,
	_mm512_mask_reduce_add_epi64, _mm512_mask_reduce_mul_epi64,
	_mm512_mask_reduce_and_epi64, _mm512_mask_reduce_or_epi64,
	_mm512_reduce_min_epi64, _mm512_reduce_max_epi64,
	_mm512_mask_reduce_min_epi64, _mm512_mask_reduce_max_epi64,
	_mm512_reduce_min_epu64, _mm512_reduce_max_epu64,
	_mm512_mask_reduce_min_epu64, _mm512_mask_reduce_max_epu64,
	_mm512_reduce_add_pd, _mm512_reduce_mul_pd, _mm512_mask_reduce_add_pd,
	_mm512_mask_reduce_mul_pd, _mm512_reduce_min_pd, _mm512_reduce_max_pd,
	_mm512_mask_reduce_min_pd, _mm512_mask_reduce_max_pd): New intrinsics.

	* gcc.target/i386/avx512f-reduce-op-1.c: New test.

From-SVN: r246798
2017-04-10 08:53:28 +02:00
Martin Liska d691b7e406 Revert r246759.
From-SVN: r246785
2017-04-08 17:09:58 +00:00
Jakub Jelinek c98b00166a avx512f-vgetmantps-2.c: Add -mfpmath=sse to dg-options.
* gcc.target/i386/avx512f-vgetmantps-2.c: Add -mfpmath=sse to
	dg-options.
	* gcc.target/i386/avx512f-vgetmantpd-2.c: Likewise.

From-SVN: r246775
2017-04-07 21:23:24 +02:00
Jakub Jelinek dcb2c52718 re PR target/80322 (convert intrinsics missing)
PR target/80322
	PR target/80323
	PR target/80325
	PR target/80326
	* config/i386/avxintrin.h (_mm256_cvtsd_f64, _mm256_cvtss_f32): New
	intrinsics.
	* config/i386/avx512fintrin.h (_mm512_int2mask, _mm512_mask2int,
	_mm512_abs_ps, _mm512_mask_abs_ps, _mm512_abs_pd, _mm512_mask_abs_pd,
	_mm512_cvtsd_f64, _mm512_cvtss_f32): Likewise.

	* gcc.target/i386/avx512f-undefined-1.c: New test.
	* gcc.target/i386/avx512f-cvtsd-1.c: New test.
	* gcc.target/i386/avx-cvtsd-1.c: New test.
	* gcc.target/i386/avx512f-cvtss-1.c: New test.
	* gcc.target/i386/avx512f-abspd-1.c: New test.
	* gcc.target/i386/avx-cvtss-1.c: New test.
	* gcc.target/i386/avx512f-absps-1.c: New test.
	* gcc.target/i386/avx512f-int2mask-1.c: New test.
	* gcc.target/i386/avx512f-mask2int-1.c: New test.

From-SVN: r246774
2017-04-07 21:22:00 +02:00
Marek Polacek 2166aeb3ab re PR c++/80095 (ICE with this pointer in NSDMI)
PR c++/80095
	* call.c (build_over_call): Don't check cxx_dialect.
	* cp-gimplify.c (cp_gimplify_init_expr): Don't check cxx_dialect nor
	whether SUB is a CONSTRUCTOR.
	* init.c (build_new_1): Don't check cxx_dialect.
	* tree.c (replace_placeholders): Add a function comment.  Return if
	not in C++14, or if the object isn't a (member of a) class.
	* typeck2.c (store_init_value): Don't check cxx_dialect nor whether
	TYPE is CLASS_TYPE_P.

	* g++.dg/cpp1y/nsdmi-aggr8.C: New test.

From-SVN: r246772
2017-04-07 18:09:55 +00:00
Marek Polacek 1ef532f452 re PR sanitizer/80348 (UBSAN: compile time crash in ubsan_instrument_division)
PR sanitizer/80348
	* typeck.c (cp_build_binary_op): Convert COP[01] to ORIG_TYPE.

	* g++.dg/ubsan/div-by-zero-2.C: New test.

From-SVN: r246770
2017-04-07 17:51:55 +00:00
Vladimir Makarov 057da7af80 re PR rtl-optimization/70478 ([LRA] S/390: Performance regression - superfluous stack frame)
2017-04-07  Vladimir Makarov  <vmakarov@redhat.com>

	PR rtl-optimization/70478
	* lra-constraints.c (process_alt_operands): Disfavor alternative
	insn memory operands.

2017-04-07  Vladimir Makarov  <vmakarov@redhat.com>

	PR rtl-optimization/70478
	* gcc.target/s390/pr70478.c: New.

From-SVN: r246764
2017-04-07 16:01:50 +00:00
Martin Liska 3b6cb9e37e Error message on target attribute on aarch64 target (PR target/79889).
2017-04-07  Martin Liska  <mliska@suse.cz>

	PR target/79889
	* g++.dg/ext/mv8.C: Add aarch64* targets.
2017-04-07  Martin Liska  <mliska@suse.cz>

	PR target/79889
	* config/aarch64/aarch64.c (aarch64_process_target_attr):
	Show error message instead of an ICE.

From-SVN: r246760
2017-04-07 11:20:01 +00:00
Martin Liska 70cd23c019 Add function part to a same comdat group (PR ipa/80212).
2017-04-07  Martin Liska  <mliska@suse.cz>

	PR ipa/80212
	* g++.dg/ipa/pr80212.C: New test.
2017-04-07  Martin Liska  <mliska@suse.cz>

	PR ipa/80212
	* ipa-split.c (split_function): Add function part to a same comdat
	group.

From-SVN: r246759
2017-04-07 10:36:21 +00:00
Thomas Preud'homme fe6bb25f9e [testsuite] Require c99_runtime for pr79800.c
2017-04-07  Thomas Preud'homme  <thomas.preudhomme@arm.com>

    gcc/testsuite/
    * gcc.dg/tree-ssa/pr79800.c: Require c99_runtime.

From-SVN: r246758
2017-04-07 09:44:33 +00:00
Richard Biener bf7b869abb re PR tree-optimization/80334 (Segfault when taking address of copy of unaligned struct)
2017-04-07  Richard Biener  <rguenther@suse.de>

	PR tree-optimization/80334
	* g++.dg/torture/pr80334.C: Use __BIGGEST_ALIGNMENT__ for
	alignas on stack.

From-SVN: r246757
2017-04-07 08:47:43 +00:00
Richard Biener 2d143ba8cf re PR middle-end/80341 (gcc miscompiles division of signed char)
2017-04-07  Richard Biener  <rguenther@suse.de>

	PR middle-end/80341
	* tree.c (get_unwidened): Also handle ! for_type case for
	INTEGER_CSTs.
	* convert.c (do_narrow): Split out from ...
	(convert_to_integer_1): ... here.  Do not pass final truncation
	type to get_unwidened for TRUNC_DIV_EXPR.

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

From-SVN: r246756
2017-04-07 08:20:24 +00:00
Jakub Jelinek ed3cd38d63 re PR debug/80234 (ICE in splice_child_die at dwarfout.c:5265)
PR debug/80234
	* dwarf2out.c (gen_member_die): Handle C++17 inline static data
	members with redundant out-of-class redeclaration.

	* g++.dg/debug/dwarf2/pr80234-1.C: New test.
	* g++.dg/debug/dwarf2/pr80234-2.C: New test.

From-SVN: r246743
2017-04-06 22:46:29 +02:00
Uros Bizjak e5f5658166 re PR target/79733 (ICE in int_mode_for_mode, at stor-layout.c:406)
PR target/79733
	* config/i386/i386.c (ix86_expand_builtin)
	<case IX86_BUILTIN_K{,OR}TEST{C,Z}{8,16,32,64}>: Determine insn operand
	mode from insn data. Convert operands to insn operand mode.
	Copy operands that don't satisfy insn predicate to a register.

testsuite/ChangeLog:

	PR target/79733
	* gcc.target/i386/pr79733.c: New test.

From-SVN: r246739
2017-04-06 20:49:43 +02:00
Uros Bizjak a5211c800e re PR target/80298 (<x86intrin.h> incompatible with -mno-sse)
PR target/80298
	* gcc.target/i386/pr80298-1.c: New test.
	* gcc.target/i386/pr80298-2.c: Ditto.

From-SVN: r246737
2017-04-06 20:34:18 +02:00
Thomas Preud'homme db086c9685 [ARM] Compile atomic_loaddi_11 for Cortex-R5
2017-04-06  Thomas Preud'homme  <thomas.preudhomme@arm.com

    gcc/testsuite/
    PR target/80082
    * gcc.target/arm/atomic_loaddi_11.c: Target Cortex-R5 instead of
    ARMv7-R.

From-SVN: r246733
2017-04-06 14:53:22 +00:00
Richard Biener 09b63f67a1 re PR tree-optimization/80334 (Segfault when taking address of copy of unaligned struct)
2017-04-06  Richard Biener  <rguenther@suse.de>

	PR tree-optimization/80334
	* tree-ssa-loop-ivopts.c (rewrite_use_address): Properly
	preserve alignment of accesses.

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

From-SVN: r246731
2017-04-06 13:56:35 +00:00
Martin Liska d9f8c5af8b Cherry-pick upstream r299036 from libsanitizer (PR sanitizer/80166).
2017-04-06  Martin Liska  <mliska@suse.cz>

	PR sanitizer/80166
	* sanitizer_common/sanitizer_common_interceptors.inc (INTERCEPTOR):
	Cherry-pick upstream r299036.
2017-04-06  Martin Liska  <mliska@suse.cz>

	PR sanitizer/80166
	* gcc.dg/asan/pr80166.c: New test.

From-SVN: r246730
2017-04-06 13:42:24 +00:00
Rainer Orth 1b68991f4d Fix gcc.target/i386/pr79390.c for Solaris as
PR tree-optimization/79390
	* gcc.target/i386/pr79390.c: Allow for cmovl.a.

From-SVN: r246729
2017-04-06 13:11:21 +00:00
Richard Biener 0f78434635 re PR middle-end/80262 (address space gets lost in memory access)
2017-04-06  Richard Biener  <rguenther@suse.de>

	PR tree-optimization/80262
	* tree-sra.c (build_ref_for_offset): Preserve address-space
	information.
	* tree-ssa-sccvn.c (vn_reference_maybe_forwprop_address):
	Drop useless address-space information on MEM_REF offsets.

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

From-SVN: r246728
2017-04-06 12:31:05 +00:00
Richard Biener 23a429c2b2 re PR tree-optimization/80281 (Wrong constant folding)
2017-04-06  Richard Biener  <rguenther@suse.de>

	PR middle-end/80281
	* gcc.dg/tree-ssa/pr40921.c: Add -fp-contract=off.

From-SVN: r246726
2017-04-06 11:25:35 +00:00
Vladimir Makarov e2323a2b77 re PR rtl-optimization/70703 (Regression in register usage on x86)
2017-04-05  Vladimir Makarov  <vmakarov@redhat.com>

	PR rtl-optimization/70703
	* ira-color.c (update_costs_from_allocno): Use the smallest mode.
	(update_conflict_hard_regno_costs): Use long instead of unsigned
	arithmetic for cost calculation.

2017-04-05  Vladimir Makarov  <vmakarov@redhat.com>

	PR rtl-optimization/70703
	* gcc.target/i386/pr70703.c: New.

From-SVN: r246707
2017-04-05 15:07:51 +00:00
Jakub Jelinek 47a113429b re PR sanitizer/80308 (asan crash on big-endian powerpc-linux target)
PR sanitizer/80308
	* asan.c (asan_store_shadow_bytes): Fix location of last_chunk_value
	for big endian.

	* c-c++-common/asan/pr80308.c: New test.

Co-Authored-By: Bernd Edlinger <bernd.edlinger@hotmail.de>

From-SVN: r246703
2017-04-05 15:17:15 +02:00
Dominik Vogt d0ee17a526 PR target/79890: S/390: Fix crash.
builtin_eh_return requires the return address to be saved on the
stack.  The patch prevents using an FPR for that.

gcc/ChangeLog:

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

	PR target/79890
	* config/s390/s390.c (s390_register_info_gprtofpr): Return if
	call_eh_return is true.

gcc/testsuite/ChangeLog:

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

	PR target/79890
	* gcc.target/s390/pr79890.c: New test case.

From-SVN: r246701
2017-04-05 08:28:18 +00:00
Jakub Jelinek 36f896c772 re PR target/80310 (Bogus -Wpsabi warning with -fsanitize=signed-integer-overflow)
PR target/80310
	* tree-nvr.c: Include internal-fn.h.
	(pass_return_slot::execute): Ignore internal calls without
	direct optab.

	* c-c++-common/ubsan/pr80310.c: New test.

From-SVN: r246699
2017-04-05 07:25:18 +02:00
Jakub Jelinek e1201dff2f re PR c++/80297 (Compiler time crash: type mismatch in binary expression)
PR c++/80297
	* genmatch.c (capture::gen_transform): For GENERIC unshare_expr
	captures used multiple times, except for the last use.
	* generic-match-head.c: Include gimplify.h.

	* g++.dg/torture/pr80297.C: New test.

Co-Authored-By: Richard Biener <rguenther@suse.de>

From-SVN: r246693
2017-04-04 21:14:47 +02:00
Jakub Jelinek d16e2ddd26 re PR tree-optimization/79390 (10% performance drop in SciMark2 LU after r242550)
PR tree-optimization/79390
	* target.h (struct noce_if_info): Declare.
	* targhooks.h (default_noce_conversion_profitable_p): Declare.
	* target.def (noce_conversion_profitable_p): New target hook.
	* ifcvt.h (struct noce_if_info): New type, moved from ...
	* ifcvt.c (struct noce_if_info): ... here.
	(noce_conversion_profitable_p): Renamed to ...
	(default_noce_conversion_profitable_p): ... this.  No longer
	static nor inline.
	(noce_try_store_flag_constants, noce_try_addcc,
	noce_try_store_flag_mask, noce_try_cmove, noce_try_cmove_arith,
	noce_convert_multiple_sets): Use targetm.noce_conversion_profitable_p
	instead of noce_conversion_profitable_p.
	* config/i386/i386.c: Include ifcvt.h.
	(ix86_option_override_internal): Don't override
	PARAM_MAX_RTL_IF_CONVERSION_INSNS default.
	(ix86_noce_conversion_profitable_p): New function.
	(TARGET_NOCE_CONVERSION_PROFITABLE_P): Redefine.
	* config/i386/x86-tune.def (X86_TUNE_ONE_IF_CONV_INSN): Adjust comment.
	* doc/tm.texi.in (TARGET_NOCE_CONVERSION_PROFITABLE_P): Add.
	* doc/tm.texi: Regenerated.

	* gcc.target/i386/pr79390.c: New test.
	* gcc.dg/ifcvt-4.c: Use -mtune-ctrl=^one_if_conv_insn for i?86/x86_64.

From-SVN: r246686
2017-04-04 19:52:27 +02:00
Volker Reichelt c0ea338bd2 re PR c++/80296 (Broken diagnostic 'unary_plus_expr' not supported by expression)
PR c++/80296
        * cxx-pretty-print.c (cxx_pretty_printer::expression): Add
        UNARY_PLUS_EXPR case.

        * g++.dg/cpp0x/alias-decl-80296.C: New test.

From-SVN: r246683
2017-04-04 16:30:44 +00:00
Thomas Preud'homme a1527a93a6 [ARM] Fix small multiply feature
2017-04-03  Thomas Preud'homme  <thomas.preudhomme@arm.com>

    gcc/
    PR target/80307
    * config/arm/arm.c (thumb1_rtx_costs): Give a cost of 32
    instructions for small multiply cores.

    gcc/testsuite/
    PR target/80307
    * gcc.target/arm/small-multiply-m0-1.c: Do not skip test if not
    targeting any CPU or architecture.
    * gcc.target/arm/small-multiply-m0-2.c: Likewise.
    * gcc.target/arm/small-multiply-m0-3.c: Likewise.
    * gcc.target/arm/small-multiply-m0plus-1.c: Likewise.
    * gcc.target/arm/small-multiply-m0plus-2.c: Likewise.
    * gcc.target/arm/small-multiply-m0plus-3.c: Likewise.
    * gcc.target/arm/small-multiply-m1-1.c: Likewise.
    * gcc.target/arm/small-multiply-m1-2.c: Likewise.
    * gcc.target/arm/small-multiply-m1-3.c: Likewise.

From-SVN: r246682
2017-04-04 16:24:18 +00:00
Nicolas Koenig 15f12d9677 [multiple changes]
2017-03-18  Nicolas Koenig  <koenigni@student.ethz.ch> 
		PR fortran/69498
		* symbol.c (gfc_delete_symtree): If there is a period in the name, ignore
		everything before it.

2017-03-18  Nicolas Koenig  <koenigni@student.ethz.ch>
		PR fortran/69498
		* gfortran.dg/submodule_unexp.f90: New test.

From-SVN: r246679
2017-04-04 13:41:41 +00:00
Jakub Jelinek b1fd967c2c re PR target/80286 (AVX2 _mm_cvtsi128_si32 doesn't return a proper 32bits int)
PR target/80286
	* config/i386/i386.c (ix86_expand_args_builtin): If op has scalar
	int mode, convert_modes it to mode as unsigned, otherwise use
	lowpart_subreg to mode rather than SImode.
	* config/i386/sse.md (<mask_codefor>ashr<mode>3<mask_name>,
	ashr<mode>3, ashr<mode>3<mask_name>, <shift_insn><mode>3<mask_name>):
	Use DImode instead of SImode for the shift count operand.
	* config/i386/mmx.md (mmx_ashr<mode>3, mmx_<shift_insn><mode>3):
	Likewise.
testsuite/
	* gcc.target/i386/avx-pr80286.c: New test.
	* gcc.dg/pr80286.c: New test.

From-SVN: r246676
2017-04-04 12:45:55 +02:00
Richard Biener 248179b5fc re PR tree-optimization/80281 (Wrong constant folding)
2017-04-04  Richard Biener  <rguenther@suse.de>

	PR middle-end/80281
	* match.pd (A + (-B) -> A - B): Make sure to preserve unsigned
	arithmetic done for the negate or the plus.  Simplify.
	(A - (-B) -> A + B): Likewise.
	* fold-const.c (split_tree): Make sure to not negate pointers.

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

From-SVN: r246674
2017-04-04 09:06:04 +00:00
Richard Biener a577fcf2d5 re PR tree-optimization/80275 (Poor (but valid) code generated by optimizer passing optimizer list to function)
2017-04-04  Richard Biener  <rguenther@suse.de>

	PR tree-optimization/80275
	* g++.dg/opt/pr80275.C: Make g static.

From-SVN: r246671
2017-04-04 06:58:45 +00:00
Segher Boessenkool 833bbf60ce simplify-rtx: Fix compare of comparisons (PR60818)
The function simplify_binary_operation_1 has code that does
/* Convert (compare (gt (flags) 0) (lt (flags) 0)) to (flags).  */
but this transformation is only valid if "flags" has the same machine
mode as the outer compare.  This fixes it.


	PR rtl-optimization/60818
	* simplify-rtx.c (simplify_binary_operation_1): Do not replace
	a compare of comparisons with the thing compared if this results
	in a different machine mode.

gcc/testsuite/
	PR rtl-optimization/60818
	* gcc.c-torture/compile/pr60818.c: New testcase.

From-SVN: r246666
2017-04-04 02:10:02 +02:00
Jonathan Wakely 5764ee3c84 Fix numerous typos in comments
gcc:

	* alias.c (base_alias_check): Fix typo in comment.
	* cgraph.h (class ipa_polymorphic_call_context): Likewise.
	* cgraphunit.c (symbol_table::compile): Likewise.
	* collect2.c (maybe_run_lto_and_relink): Likewise.
	* config/arm/arm.c (arm_thumb1_mi_thunk): Likewise.
	* config/avr/avr-arch.h (avr_arch_info_t): Likewise.
	* config/avr/avr.c (avr_map_op_t): Likewise.
	* config/cr16/cr16.h (DATA_ALIGNMENT): Likewise.
	* config/epiphany/epiphany.c (TARGET_ARG_PARTIAL_BYTES): Likewise.
	* config/epiphany/epiphany.md (movcc): Likewise.
	* config/i386/i386.c (legitimize_pe_coff_extern_decl): Likewise.
	* config/m68k/m68k.c (struct _sched_ib, m68k_sched_variable_issue):
	Likewise.
	* config/mips/mips.c (mips_save_restore_reg): Likewise.
	* config/rx/rx.c (rx_is_restricted_memory_address): Likewise.
	* config/s390/s390.c (Z10_EARLYLOAD_DISTANCE): Likewise.
	* config/sh/sh.c (sh_rtx_costs): Likewise.
	* fold-const.c (fold_truth_andor): Likewise.
	* genautomata.c (collapse_flag): Likewise.
	* gengtype.h (struct type::u::s): Likewise.
	* gensupport.c (has_subst_attribute, add_mnemonic_string): Likewise.
	* input.c (FORMAT_AMOUNT): Likewise.
	* ipa-cp.c (class ipcp_lattice, agg_replacements_to_vector)
	(known_aggs_to_agg_replacement_list): Likewise.
	* ipa-inline-analysis.c: Likewise.
	* ipa-inline.h (estimate_edge_time, estimate_edge_hints): Likewise.
	* ipa-polymorphic-call.c
	(ipa_polymorphic_call_context::restrict_to_inner_class): Likewise.
	* loop-unroll.c (analyze_insn_to_expand_var): Likewise.
	* lra.c (lra_optional_reload_pseudos, lra_subreg_reload_pseudos):
	Likewise.
	* modulo-sched.c (apply_reg_moves): Likewise.
	* omp-expand.c (build_omp_regions_1): Likewise.
	* trans-mem.c (struct tm_wrapper_hasher): Likewise.
	* tree-ssa-loop-ivopts.c (may_eliminate_iv): Likewise.
	* tree-ssa-loop-niter.c (maybe_lower_iteration_bound): Likewise.
	* tree-vect-data-refs.c (vect_enhance_data_refs_alignment): Likewise.
	* value-prof.c: Likewise.
	* var-tracking.c (val_reset): Likewise.

gcc/ada:

	* doc/gnat_ugn/gnat_and_program_execution.rst: Fix typo.
	* g-socket.adb (To_Host_Entry): Fix typo in comment.
	* gnat_ugn.texi: Fix typo.
	* raise.c (_gnat_builtin_longjmp): Fix capitalization in comment.
	* s-stposu.adb (Allocate_Any_Controlled): Fix typo in comment.
	* sem_ch3.adb (Build_Derived_Record_Type): Likewise.
	* sem_util.adb (Mark_Coextensions): Likewise.
	* sem_util.ads (Available_Full_View_Of_Component): Likewise.

gcc/c:

	* c-array-notation.c: Fix typo in comment.

gcc/c-family:

	* c-warn.c (do_warn_double_promotion): Fix typo in comment.

gcc/cp:

        * class.c (update_vtable_entry_for_fn): Fix typo in comment.
	* decl2.c (one_static_initialization_or_destruction): Likewise.
	* name-lookup.c (store_bindings): Likewise.
	* parser.c (make_call_declarator): Likewise.
	* pt.c (check_explicit_specialization): Likewise.

gcc/testsuite:

	* g++.old-deja/g++.benjamin/scope02.C: Fix typo in comment.
	* gcc.dg/20031012-1.c: Likewise.
	* gcc.dg/ipa/ipcp-1.c: Likewise.
	* gcc.dg/torture/matrix-3.c: Likewise.
	* gcc.target/powerpc/ppc-spe.c: Likewise.
	* gcc.target/rx/zero-width-bitfield.c: Likewise.

libcpp:

	* include/line-map.h (LINEMAPS_MACRO_MAPS): Fix typo in comment.
	* lex.c (search_line_fast): Likewise.
	* pch.h (cpp_valid_state): Likewise.

libdecnumber:

	* decCommon.c (decFloatFromPackedChecked): Fix typo in comment.
	* decNumber.c (decNumberPower, decMultiplyOp): Likewise.

libgcc:

	* config/c6x/pr-support.c (__gnu_unwind_execute): Fix typo in comment.

libitm:

	* libitm_i.h (sutrct gtm_thread): Fix typo in comment.

From-SVN: r246664
2017-04-03 23:30:56 +01:00
Peter Bergner bbdf4e8159 re PR target/80246 (Builtin's for POWER's dxex[q] and diex[q] use the wrong types)
PR target/80246
	* gcc.target/powerpc/dfp-builtin-1.c: Require hard_dfp, not
	powerpc_vsx_ok.
	(std, ld): Limit scan-assembler-times check to lp64.
	(stwu, stw, lwz): Add scan-assembler-times check for ilp32.
	* gcc.target/powerpc/dfp-builtin-2.c: Require hard_dfp, not
	powerpc_vsx_ok.

From-SVN: r246654
2017-04-03 12:10:57 -05:00
Peter Bergner 44bc146fcf re PR target/80246 (Builtin's for POWER's dxex[q] and diex[q] use the wrong types)
PR target/80246
	* gcc.target/powerpc/pr80246.c: Require hard_dfp.

From-SVN: r246652
2017-04-03 11:15:00 -05:00
Richard Biener fff80893ba re PR tree-optimization/80275 (Poor (but valid) code generated by optimizer passing optimizer list to function)
2017-04-03  Richard Biener  <rguenther@suse.de>

	PR tree-optimization/80275
	* fold-const.c (split_address_to_core_and_offset): Handle
	POINTER_PLUS_EXPR.

	* g++.dg/opt/pr80275.C: New testcase.

From-SVN: r246648
2017-04-03 12:22:22 +00:00
Dominik Vogt 79f9fc387d Don't xfail on s390.
The attached patch removes the XFAIL in attr-alloc_size-11.c on
s390.  (PR 79356).
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=79356

gcc/testsuite/ChangeLog:

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

	PR testsuite/79356
	* gcc.dg/attr-alloc_size-11.c: Don't xfail on s390.

From-SVN: r246645
2017-04-03 10:57:41 +00:00
Robin Dapp a8e70fd379 Fix s390 testcase vcond-shift
This patch fixes the vcond shift testcase that failed since setting
PARAM_MIN_VECT_LOOP_BOUND in the s390 backend.

gcc/testsuite/ChangeLog:

2017-04-03  Robin Dapp  <rdapp@linux.vnet.ibm.com>

	* gcc.target/s390/vector/vcond-shift.c (foo, foo2, foo3, baz, baf)
	(bal): Increase iteration count and assume alignment.

From-SVN: r246644
2017-04-03 10:54:38 +00:00
Bin Cheng e006186611 pr71347.c: Add predcom and drop XFAILs.
gcc/testsuite
	* gcc.dg/tree-ssa/pr71347.c: Add predcom and drop XFAILs.

From-SVN: r246643
2017-04-03 10:08:46 +00:00
Andrew Pinski c2d4332669 nested-3.c: New testcase.
2017-04-02  Andrew Pinski  <apinski@cavium.com>

        * gcc.c-torture/compile/nested-3.c: New testcase.
        * gcc.c-torture/execute/20170401-1.c: New testcase.
        * gcc.c-torture/execute/20170401-2.c: New testcase.

From-SVN: r246639
2017-04-02 15:13:51 -07:00
Segher Boessenkool a5a9046deb re PR rtl-optimization/79405 (Infinite loop in fwprop)
PR rtl-optimization/79405
	* fwprop.c (propagations_left): New variable.
	(forward_propagate_into): Decrement it.
	(fwprop_init): Initialize it.
	(fw_prop): If the variable has reached zero, stop propagating.
	(fwprop_addr): Ditto.

gcc/testsuite/
	PR rtl-optimization/79405
	gcc.dg/pr79405.c: New testcase.

From-SVN: r246627
2017-03-31 16:49:53 -06:00
Jakub Jelinek eee3756de3 re PR bootstrap/79255 (PGO bootstrap fails on x86_64/ppc64le building Ada)
PR debug/79255
	* dwarf2out.c (decls_for_scope): If BLOCK_NONLOCALIZED_VAR is
	a FUNCTION_DECL, pass it as decl instead of origin to
	process_scope_var.

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

From-SVN: r246622
2017-03-31 20:40:35 +02:00
Jakub Jelinek 6f3af35628 re PR sanitizer/79572 (reference binding to null pointer not reported with -fsanitize=undefined)
PR c++/79572
	* c-ubsan.h (ubsan_maybe_instrument_reference): Change argument to
	tree *.
	* c-ubsan.c (ubsan_maybe_instrument_reference): Likewise.  Handle
	not just NOP_EXPR to REFERENCE_TYPE, but also INTEGER_CST with
	REFERENCE_TYPE.

	* cp-gimplify.c (cp_genericize_r): Sanitize INTEGER_CSTs with
	REFERENCE_TYPE.  Adjust ubsan_maybe_instrument_reference caller
	for NOP_EXPR to REFERENCE_TYPE.

	* g++.dg/ubsan/null-8.C: New test.

From-SVN: r246621
2017-03-31 20:39:25 +02:00
Pat Haugen 99e6cfd6c1 re PR target/80107 (ICE in final_scan_insn, at final.c:2964)
PR target/80107
	* config/rs6000/rs6000.md (extendhi<mode>2): Add test for
	TARGET_VSX_SMALL_INTEGER.
	* gfortran.dg/pr80107.f: New.

From-SVN: r246619
2017-03-31 15:59:46 +00:00
Jeff Law 094e6b7a9d re PR tree-optimization/49498 (gcc.dg/uninit-pred-8_b.c bogus warning (predicate analysis bugs))
PR tree-optimization/49498
	* gcc.dg/uninit-pred-8_b.c: Reenable DOM.

From-SVN: r246618
2017-03-31 09:26:18 -06:00
Richard Biener eceb24097b pr71347.c: Put back XFAIL on sparc.
2017-03-31  Richard Biener  <rguenther@suse.de>
 
	* gcc.dg/tree-ssa/pr71347.c: Put back XFAIL on sparc.

From-SVN: r246612
2017-03-31 09:18:18 +00:00
Richard Biener c412c01a67 pr71347.c: Put back XFAIL.
2017-03-31  Richard Biener  <rguenther@suse.de>
 
	* gcc.dg/tree-ssa/pr71347.c: Put back XFAIL.

From-SVN: r246611
2017-03-31 09:14:52 +00:00
Jakub Jelinek af88f55707 re PR libstdc++/80251 (Is the is_aggregate meta function missing?)
PR libstdc++/80251
c-family/
	* c-common.h (enum rid): Add RID_IS_AGGREGATE.
	* c-common.c (c_common_reswords): Add __is_aggregate trait.
cp/
	* cp-tree.h (enum cp_trait_kind): Add CPTK_IS_AGGREGATE.
	* cxx-pretty-print.c (pp_cxx_trait_expression): Handle
	CPTK_IS_AGGREGATE.
	* semantics.c (trait_expr_value): Handle CPTK_IS_AGGREGATE.
	Remove extraneous parens.
	(finish_trait_expr): Handle CPTK_IS_AGGREGATE.
	* parser.c (cp_parser_primary_expression): Handle RID_IS_AGGREGATE.
	(cp_parser_trait_expr): Likewise.
testsuite/
	* g++.dg/ext/is_aggregate.C: New test.

From-SVN: r246609
2017-03-31 08:40:39 +02:00
Jakub Jelinek 7d79016545 re PR middle-end/80173 (ICE in store_bit_field_1, at expmed.c:787)
PR middle-end/80173
	* expmed.c (store_bit_field_1): Don't attempt to create
	a word subreg out of hard registers wider than word if they
	have HARD_REGNO_NREGS of 1 for their mode.

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

From-SVN: r246608
2017-03-31 08:38:35 +02:00
Jakub Jelinek a7d5515419 re PR middle-end/80163 (ICE on hopefully valid code)
PR middle-end/80163
	* varasm.c (initializer_constant_valid_p_1): Disallow sign-extending
	conversions to integer types wider than word and pointer.

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

From-SVN: r246607
2017-03-31 08:32:46 +02:00
Jakub Jelinek 005f12bf67 re PR debug/80025 (ICE w/ -O2 (-O3, -Ofast) -g -ftracer (infinite recursion in rtx_equal_for_cselib_1))
PR debug/80025
	* cselib.h (rtx_equal_for_cselib_1): Add depth argument.
	(rtx_equal_for_cselib_p): Pass 0 to it.
	* cselib.c (cselib_hasher::equal): Likewise.
	(rtx_equal_for_cselib_1): Add depth argument.  If depth
	is 128, don't look up VALUE locs and punt.  Increment
	depth in recursive calls when walking VALUE locs.

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

From-SVN: r246606
2017-03-31 08:05:47 +02:00
Matthew Fortune c8e0f43f74 Fix pr52125.c test when built as -mno-abicalls -mabi=64
gcc/testsuite/
	* gcc.target/mips/pr52125.c: Add -msym32.

From-SVN: r246600
2017-03-30 21:59:20 +00:00
Jakub Jelinek 724d25f353 re PR translation/80189 (gimplify.c: check whether parallel/task/teams should be translated)
PR translation/80189
	* gimplify.c (omp_default_clause): Use %qs instead of %s in
	diagnostic messages.
testsuite/
	* g++.dg/gomp/predetermined-1.C: Adjust expected diagnostics.
	* g++.dg/gomp/sharing-1.C: Likewise.
	* gfortran.dg/gomp/pr44536.f90: Likewise.
	* gfortran.dg/gomp/pr44036-1.f90: Likewise.
	* gfortran.dg/gomp/sharing-3.f90: Likewise.
	* gfortran.dg/gomp/crayptr3.f90: Likewise.
	* gfortran.dg/gomp/pr33439.f90: Likewise.
	* gfortran.dg/gomp/appendix-a/a.24.1.f90: Likewise.
	* gfortran.dg/gomp/sharing-1.f90: Likewise.
	* gfortran.dg/gomp/sharing-2.f90: Likewise.
	* gcc.dg/gomp/appendix-a/a.24.1.c: Likewise.
	* gcc.dg/gomp/sharing-1.c: Likewise.

From-SVN: r246599
2017-03-30 22:31:40 +02:00
Peter Bergner 05dc406d7a re PR target/80246 (Builtin's for POWER's dxex[q] and diex[q] use the wrong types)
gcc/
	PR target/80246
	* config/rs6000/dfp.md (dfp_dxex_<mode>): Update mode of operand 0.
	(dfp_diex_<mode>): Update mode of operand 1.
	* doc/extend.texi (dxex, dxexq): Document change to return type.
	(diex, diexq): Document change to argument type.

gcc/testsuite/
	PR target/80246
	* gcc.target/powerpc/dfp-builtin-1.c: Remove unneeded dg-skip-if for
	Darwin and SPE.
	(dxex, dxexq): Update return type.
	(diex, diexq): Update argument type.
	* gcc.target/powerpc/pr80246.c: New test.

From-SVN: r246594
2017-03-30 14:57:20 -05:00
Martin Jambor b0fd4d7e32 [PR 77333] Fixup fntypes of gimple calls of clones
2017-03-30  Martin Jambor  <mjambor@suse.cz>

	PR ipa/77333
	* cgraph.h (cgraph_build_function_type_skip_args): Declare.
	* cgraph.c (redirect_call_stmt_to_callee): Set gimple fntype so that
	it reflects the signature changes performed at the callee side.
	* cgraphclones.c (build_function_type_skip_args): Make public, renamed
	to cgraph_build_function_type_skip_args.
	(build_function_decl_skip_args): Adjust call to the above function.

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

From-SVN: r246589
2017-03-30 15:51:02 +02:00
Jakub Jelinek de008ec4d6 re PR target/80206 (ICE in extract_insn, at recog.c:2327)
PR target/80206
	* config/i386/sse.md
	(<extract_type>_vextract<shuffletype><extract_suf>_mask): Use
	register as dest whenever it is a MEM not rtx_equal_p to the
	corresponding dup operand, and when forcing into reg move the
	reg into the memory afterwards.
	(<extract_type_2>_vextract<shuffletype><extract_suf_2>_mask):
	Likewise.  Use <ssehalfvecmode> instead of <ssequartermode>
	for the force_reg mode.
	(avx512vl_vextractf128<mode>): Use register as dest either
	always when a MEM, or when it is a MEM not rtx_equal_p to the
	corresponding dup operand, or even not when it is a CONST_VECTOR
	depending on the mode and lo vs. hi.
	(avx512dq_vextract<shuffletype>64x2_1_maskm): Remove extraneous
	parens.
	(avx512f_vextract<shuffletype>32x4_1_maskm): Likewise.
	(<mask_codefor>avx512dq_vextract<shuffletype>64x2_1<mask_name>):
	Likewise.  Require that operands[2] is even.
	(<mask_codefor>avx512f_vextract<shuffletype>32x4_1<mask_name>):
	Remove extraneous parens.  Require that operands[2] is a multiple
	of 4.
	(vec_extract_lo_<mode><mask_name>): Don't bother testing if
	operands[0] is a MEM if <mask_applied>, the predicates/constraints
	disallow memory then.

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

From-SVN: r246588
2017-03-30 15:29:28 +02:00
Richard Biener 28c0240778 re PR tree-optimization/77498 (Performance drop after r239414 on spec2000/172mgrid)
2017-03-30  Richard Biener  <rguenther@suse.de>

	PR tree-optimization/77498
	* tree-ssa-pre.c (phi_translate_1): Do not allow simplifications
	to non-constants over backedges.

	* gfortran.dg/pr77498.f: New testcase.

From-SVN: r246583
2017-03-30 07:15:39 +00:00
Marek Polacek 10fa8dfb3a re PR c/79730 (ICE tree check: expected var_decl, have function_decl in finish_decl, at c/c-decl.c:5063)
PR c/79730
	* c-decl.c (finish_decl): Check VAR_P.

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

From-SVN: r246578
2017-03-29 23:40:36 +00:00
Jerry DeLisle fdc54f39c1 re PR fortran/78670 ([F03] Incorrect file position with namelist read under DTIO)
2017-03-29  Jerry DeLisle  <jvdelisle@gcc.gnu.org>

	PR libgfortran/78670
	* io/list_read.c (nml_get_obj_data): Delete code which calls the
	child read procedure. (nml_read_obj): Insert the code which
	calls the child procedure. Don't need to touch nodes if using
	dtio since parent will not be traversing the components.

	PR libgfortran/78670
	* gfortran.dg/dtio_25.f90: Use 'a1' format when trying to read
	a character of length 1. Update test for success.
	* gfortran.dg/dtio_28.f03: New test.
	* gfortran.dg/dtio_4.f90: Update to open test file with status =
	'scratch' to delete the file when done.

From-SVN: r246576
2017-03-29 21:37:45 +00:00
Segher Boessenkool 533c0b6943 combine: Fix PR80233
If combine has added an unconditional trap there will be a new basic
block as well.  It will then end up considering the NOTE_INSN_BASIC_BLOCK
as the last_combined_insn, but then it tries to take the DF_INSN_LUID
of that and that dereferences a NULL pointer (since such a note is not
an INSN_P).

This fixes it by not taking non-insns as last_combined_insn.


	PR rtl-optimization/80233
	* combine.c (combine_instructions): Only take NONDEBUG_INSN_P insns
	as last_combined_insn.  Do not test for BARRIER_P separately.

gcc/testsuite/
	PR rtl-optimization/80233
	* gcc.c-torture/compile/pr80233.c: New testcase.

From-SVN: r246575
2017-03-29 22:53:59 +02:00
Thomas Koenig e35229f83e re PR fortran/80254 (Windows test failure: dec_io_2.f90)
2017-03-28  Thomas Koenig  <tkoenig@gcc.gnu.org>

	PR fortran/80254
	* gfortran.dg/dec_io_2.f90:  Do not run on MINGW, run
	* gfortran.dg/dec_io_2a.f90:  instead (new test).

From-SVN: r246573
2017-03-29 17:30:58 +00:00
Jiong Wang 5c0a28d4c5 [g++, testsuite] XFAIL thread_local-order2.C on newlib
testsuite/
	* g++.dg/tls/thread_local-order2.C: XFAIL on newlib.

As commented by Mike, it's better that newlib support this feature, tracked by

  https://sourceware.org/bugzilla/show_bug.cgi?id=21325

From-SVN: r246563
2017-03-29 10:33:04 +00:00
Segher Boessenkool 1984661922 rs6000: Fix gcc.target/powerpc/gcse-1.c for PIC (PR43496)
With PIC a @ha relocation isn't generated, so skip that test then.


	PR testsuite/43496
	* gcc.target/powerpc/gcse-1.c: Skip scan-assembler-times "@ha" if
	generating PIC code.

From-SVN: r246555
2017-03-29 00:26:17 +02:00
Vladimir Makarov e5119fab4f re PR rtl-optimization/80193 (ICE on valid (but hairy) C code at -O3 on x86_64-linux-gnu: in check_allocation, at ira.c:2563)
2017-03-28  Vladimir Makarov  <vmakarov@redhat.com>

	PR rtl-optimization/80193
	* ira.c (ira): Do not check allocation for LRA.

2017-03-28  Vladimir Makarov  <vmakarov@redhat.com>

	PR rtl-optimization/80193
	* gcc.target/i386/pr80193.c: New.

From-SVN: r246554
2017-03-28 20:55:38 +00:00
Janus Weil cf47453061 re PR fortran/78661 ([OOP] Namelist output missing object designator under DTIO)
2017-03-28  Janus Weil  <janus@gcc.gnu.org>

	PR fortran/78661
	* trans-io.c (transfer_namelist_element): Perform a polymorphic call
	to a DTIO procedure if necessary.

2017-03-28  Janus Weil  <janus@gcc.gnu.org>

	PR fortran/78661
	* gfortran.dg/dtio_25.f90: Modified test case.
	* gfortran.dg/dtio_27.f90: New test case.

2017-03-28  Janus Weil  <janus@gcc.gnu.org>

	PR fortran/78661
	* io/write.c (nml_write_obj): Build a class container only if necessary.

From-SVN: r246546
2017-03-28 19:01:05 +02:00
Uros Bizjak 34fac449e1 re PR target/53383 (Allow -mpreferred-stack-boundary=3 on x86-64)
PR target/53383
	* config/i386/i386.c (ix86_option_override_internal): Always
	allow -mincoming-stack-boundary=3 for 64-bit targets.

testsuite/ChangeLog:

	PR target/53383
	* gcc.target/i386/pr53383-1.c (dg-options): Remove -mno-sse.
	* gcc.target/i386/pr53383-2.c (dg-options): Ditto.
	* gcc.target/i386/pr53383-3.c (dg-options): Ditto.

From-SVN: r246543
2017-03-28 18:51:00 +02:00
Bin Cheng 3e907b9056 tree-vect-loop-manip.c (slpeel_add_loop_guard): New param and mark new edge's irreducible flag accordign to it.
* tree-vect-loop-manip.c (slpeel_add_loop_guard): New param and
	mark new edge's irreducible flag accordign to it.
	(vect_do_peeling): Check loop preheader edge's irreducible flag
	and pass it to function slpeel_add_loop_guard.
	gcc/testsuite
	* gcc.c-torture/compile/irreducible-loop.c: New.

From-SVN: r246540
2017-03-28 15:32:29 +00:00
Richard Sandiford 522818b971 re PR tree-optimization/80218 (tree-call-cdce does not update block frequencies)
gcc/
	PR tree-optimization/80218
	* tree-call-cdce.c (shrink_wrap_one_built_in_call_with_conds):
	Update block frequencies and counts.

gcc/testsuite/
	PR tree-optimization/80218
	* gcc.dg/pr80218.c: New test.

From-SVN: r246538
2017-03-28 09:14:36 -06:00
Richard Biener ea7d7da886 re PR ipa/78644 (ICE: SIGSEGV in is_gimple_reg_type with -Og -fipa-cp)
2017-03-28  Richard Biener  <rguenther@suse.de>

	PR tree-optimization/78644
	* tree-ssa-ccp.c (evaluate_stmt): When we may not use the value
	of a simplification result we may not use it at all.

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

From-SVN: r246534
2017-03-28 13:57:43 +00:00
Toma Tabacu 498173ef33 Skip pic-3,4.c and pie-3,4.c for mips*-*-linux-*.
gcc/testsuite/

	* gcc.dg/pic-3.c: Skip for mips*-*-linux-*.
	* gcc.dg/pic-4.c: Likewise.
	* gcc.dg/pie-3.c: Likewise.
	* gcc.dg/pie-4.c: Likewise.

From-SVN: r246533
2017-03-28 12:43:33 +00:00
Martin Liska c5ad243343 Handle PHI nodes w/o a argument (PR ipa/80205).
2017-03-28  Martin Liska  <mliska@suse.cz>

	PR ipa/80205
	* g++.dg/ipa/pr80205.C: New test.
2017-03-28  Richard Biener  <rguenther@suse.de>

	PR ipa/80205
	* tree-inline.c (copy_phis_for_bb): Do not create PHI node
	without arguments, generate default definition of a SSA name.

From-SVN: r246530
2017-03-28 11:37:22 +00:00
Senthil Kumar Selvaraj 17722fb9e6 Fix broken tests for avr target
These tests assume {unsigned,} ints are 32 bits or wider. Explicitly
specify __{U}INT32_TYPE__ for targets with __SIZEOF_INT__ < 4.

gcc/testsuite/

2017-03-28  Senthil Kumar Selvaraj  <senthil_kumar.selvaraj@atmel.com>

	* gcc.c-torture/execute/pr79121.c:Use __{U}INT32_TYPE__ for targets
	with sizeof(int) < 4.
	* gcc.c-torture/execute/pr79737-1.c (struct S): Likewise.
	* gcc.c-torture/execute/pr79737-2.c: Likewise.
	* gcc.dg/torture/pr79777.c: Likewise.
	* gcc.dg/torture/pr79910.c: Likewise.

From-SVN: r246529
2017-03-28 10:55:18 +00:00
Richard Biener 737f500a0b re PR middle-end/80222 (may_alias folded away)
2017-03-28  Richard Biener  <rguenther@suse.de>

	PR middle-end/80222
	* gimple-fold.c (gimple_fold_indirect_ref): Do not touch
	TYPE_REF_CAN_ALIAS_ALL references.
	* fold-const.c (fold_indirect_ref_1): Likewise.

	* g++.dg/pr80222.C: New testcase.

From-SVN: r246527
2017-03-28 10:10:01 +00:00
Martin Liska 62f96a79f1 Fix calls.c for a _complex type (PR ipa/80104).
2017-03-28  Martin Liska  <mliska@suse.cz>

	PR ipa/80104
	* cgraphunit.c (cgraph_node::expand_thunk): Mark argument of a
	thunk call as DECL_GIMPLE_REG_P when vector or complex type.
2017-03-28  Martin Liska  <mliska@suse.cz>

	PR ipa/80104
	* gcc.dg/ipa/pr80104.c: New test.

From-SVN: r246525
2017-03-28 09:01:57 +00:00
Marek Polacek 72785f2660 re PR sanitizer/80067 (ICE in fold_comparison with -fsanitize=undefined)
PR sanitizer/80067
	* fold-const.c (fold_comparison): Use protected_set_expr_location
	instead of SET_EXPR_LOCATION.

	* c-c++-common/ubsan/shift-10.c: New test.

From-SVN: r246521
2017-03-28 08:13:04 +00:00
Jeff Law 4dbf1eeeb6 Fix PR# in last commit
From-SVN: r246518
2017-03-27 21:30:35 -06:00
Jeff Law 865169874b re PR target/80162 (ICE on invalid code (address of register variable))
PR tree-optimization/80162
	* tree-ssa-dom.c (derive_equivalences_from_bit_ior): Fix typo in
	function name.  Limit recursion depth.
	(record_temporary_equivalences): Corresponding changes.

	PR tree-optimization/80162
	* gcc.c-torture/compile/pr80216.c: New test.

From-SVN: r246517
2017-03-27 21:22:25 -06:00
Jakub Jelinek a9e4a1a56f re PR target/80162 (ICE on invalid code (address of register variable))
PR middle-end/80162
c-family/
	* c-common.c (c_common_mark_addressable_vec): Don't set
	TREE_ADDRESSABLE on DECL_HARD_REGISTER.
c/
	* c-tree.h (c_mark_addressable): Add array_ref_p argument.
	* c-typeck.c (c_mark_addressable): Likewise.  Look through
	VIEW_CONVERT_EXPR unless array_ref_p and VCE is from VECTOR_TYPE
	to ARRAY_TYPE.
	(build_array_ref): Pass true as array_ref_p to c_mark_addressable.
cp/
	* cp-tree.h (cxx_mark_addressable): Add array_ref_p argument.
	* typeck.c (cxx_mark_addressable): Likewise.  Look through
	VIEW_CONVERT_EXPR unless array_ref_p and VCE is from VECTOR_TYPE
	to ARRAY_TYPE.
	(cp_build_array_ref): Pass true as array_ref_p to cxx_mark_addressable.
testsuite/
	* c-c++-common/pr80162-1.c: New test.
	* c-c++-common/pr80162-2.c: New test.
	* c-c++-common/pr80162-3.c: New test.

From-SVN: r246512
2017-03-27 23:07:21 +02:00
Jakub Jelinek aade772d8a re PR target/80102 (ICE in maybe_record_trace_start, at dwarf2cfi.c:2330)
PR target/80102
	* reg-notes.def (REG_CFA_NOTE): Define.  Use it for CFA related
	notes.
	* cfgcleanup.c (reg_note_cfa_p): New array.
	(insns_have_identical_cfa_notes): New function.
	(old_insns_match_p): Don't cross-jump in between /f
	and non-/f instructions.  If both i1 and i2 are frame related,
	verify all CFA notes, their order and content.

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

From-SVN: r246511
2017-03-27 23:00:35 +02:00
Michael Meissner d89f355e2d re PR target/78543 (ICE in push_reload, at reload.c:1349 on powerpc64le-linux-gnu)
[gcc]
2017-03-27  Michael Meissner  <meissner@linux.vnet.ibm.com>

	PR target/78543
	* config/rs6000/rs6000.md (bswaphi2_extenddi): Combine bswap
	HImode and SImode with zero extend to DImode to one insn.
	(bswap<mode>2_extenddi): Likewise.
	(bswapsi2_extenddi): Likewise.
	(bswaphi2_extendsi): Likewise.
	(bswaphi2): Combine bswap HImode and SImode into one insn.
	Separate memory insns from swapping register.
	(bswapsi2): Likewise.
	(bswap<mode>2): Likewise.
	(bswaphi2_internal): Delete, no longer used.
	(bswapsi2_internal): Likewise.
	(bswap<mode>2_load): Split bswap HImode/SImode into separate load,
	store, and gpr<-gpr swap insns.
	(bswap<mode>2_store): Likewise.
	(bswaphi2_reg): Register only splitter, combine with the splitter.
	(bswaphi2 splitter): Likewise.
	(bswapsi2_reg): Likewise.
	(bswapsi2 splitter): Likewise.
	(bswapdi2): If we have the LDBRX and STDBRX instructions, split
	the insns into load, store, and register/register insns.
	(bswapdi2_ldbrx): Likewise.
	(bswapdi2_load): Likewise.
	(bswapdi2_store): Likewise.
	(bswapdi2_reg): Likewise.

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

	PR target/78543
	* gcc.target/powerpc/pr78543.c: New test.

From-SVN: r246508
2017-03-27 19:19:00 +00:00
Kelvin Nilsen 79c4d73bdd re PR target/80103 (ICE in output_1144, at config/rs6000/vsx.md:2298)
gcc/testsuite/ChangeLog:

2017-03-27  Kelvin Nilsen  <kelvin@gcc.gnu.org>

	PR target/80103
	* gcc.target/powerpc/pr80103-1.c: New test.

gcc/ChangeLog:

2017-03-27  Kelvin Nilsen  <kelvin@gcc.gnu.org>

	PR target/80103
	* config/rs6000/rs6000-c.c (rs6000_target_modify_macros): Edit and
	add comments.
	* config/rs6000/rs6000.c (rs6000_option_override_internal): Add
	special handling for target option conflicts between dform
	options (-mpower9-dform, -mpower9-dform-vector,
	-mpower9-dform-scalar) and -mno-direct-move.

From-SVN: r246505
2017-03-27 17:04:07 +00:00
Richard Biener 819df78156 re PR tree-optimization/80181 (ICE in set_lattice_value, at tree-ssa-ccp.c:505)
2017-03-27  Richard Biener  <rguenther@suse.de>

	PR tree-optimization/80181
	* tree-ssa-ccp.c (likely_value): UNDEFINED ^ X is UNDEFINED.

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

From-SVN: r246500
2017-03-27 12:52:13 +00:00
Claudiu Zissulescu 84804c5b47 [ARC] Save/restore blink when in ISR.
gcc/
2017-03-27  Claudiu Zissulescu  <claziss@synopsys.com>

	* config/arc/arc.c (arc_epilogue_uses): BLINK should be also
	restored when in interrupt.
	* config/arc/arc.md (simple_return): ARCv2 rtie instruction
	doesn't have delay slot.

2017-03-27  Claudiu Zissulescu  <claziss@synopsys.com>

	* testsuite/gcc.target/arc/interrupt-4.c: New file.

From-SVN: r246495
2017-03-27 12:56:04 +02:00
Richard Biener c5e5f5f642 re PR ipa/79776 (ICE on valid code in insert_vi_for_tree, at tree-ssa-structalias.c:2807)
2017-03-27  Richard Biener  <rguenther@suse.de>

	PR ipa/79776
	* tree-ssa-structalias.c (associate_varinfo_to_alias): Skip
	inlined thunk clones.

	* g++.dg/ipa/pr79776.C: New testcase.

From-SVN: r246494
2017-03-27 10:50:55 +00:00
Jakub Jelinek 7cd200f63f re PR sanitizer/80168 (ICE in make_decl_rtl, at varasm.c:1311 w/ VLA and -fsanitize=address)
PR sanitizer/80168
	* asan.c (instrument_derefs): Copy over last operand from
	original COMPONENT_REF to the new COMPONENT_REF with
	DECL_BIT_FIELD_REPRESENTATIVE.
	* ubsan.c (instrument_object_size): Likewise.

	* gcc.dg/asan/pr80168.c: New test.

From-SVN: r246492
2017-03-27 10:25:01 +02:00
Richard Biener 79f512ffeb re PR tree-optimization/80170 (SLP vectorization creates aligned access)
2017-03-27  Richard Biener  <rguenther@suse.de>

	PR tree-optimization/80170
	* tree-vect-data-refs.c (vect_compute_data_ref_alignment): Make
	sure DR/SCEV didnt fold in constants we do not see when looking
	at the reference base alignment.

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

From-SVN: r246491
2017-03-27 08:07:49 +00:00
Richard Biener 672d9f8eab re PR tree-optimization/80171 (ICE (Segmentation fault) with optimization)
2017-03-27  Richard Biener  <rguenther@suse.de>

	PR middle-end/80171
	* gimple-fold.c (fold_ctor_reference): Properly guard against
	NULL return value from canonicalize_constructor_val.

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

From-SVN: r246490
2017-03-27 07:35:44 +00:00
John David Anglin 431d78821b pr79732.c: Require alias support.
* gcc.dg/torture/pr79732.c: Require alias support.
	* gcc.dg/tree-ssa/pr56727.c: Move dg-require-alias after dg-do compile.

From-SVN: r246485
2017-03-26 15:40:29 +00:00
John David Anglin 978fcba391 coarray_failed_images_1.f08: Add "-latomic" option if libatomic_available.
* gfortran.dg/coarray_failed_images_1.f08: Add "-latomic" option if
	libatomic_available.
	* gfortran.dg/coarray_image_status_1.f08: Likewise.
	* gfortran.dg/coarray_stopped_images_1.f08: Likewise.

From-SVN: r246484
2017-03-26 15:19:40 +00:00
Jerry DeLisle 1f10d710e3 re PR fortran/78881 ([F03] reading from string with DTIO procedure does not work properly)
2017-03-25  Jerry DeLisle  <jvdelisle@gcc.gnu.org>

	PR libgfortran/78881
	* io/io.h (st_parameter_dt): Rename unused component last_char to
	child_saved_iostat. Move comment to gfc_unit.
	* io/list_read.c (list_formatted_read_scalar): After call to
	child READ procedure, save the returned iostat value for later
	check. (finish_list_read): Only finish READ if child_saved_iostat
	was OK.
	* io/transfer.c (read_sf_internal): If there is a saved character
	in last character, seek back one. Add a new check for EOR
	condition. (read_sf): If there is a saved character
	in last character, seek back one. (formatted_transfer_scalar_read):
	Initialize last character before invoking child procedure.
	(data_transfer_init): If child dtio, set advance
	status to nonadvancing. Move update of size and check for EOR
	condition to before child dtio return.

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

From-SVN: r246478
2017-03-25 18:48:01 +00:00
Paul Thomas 4103668640 re PR fortran/80156 (Generic DTIO interface reported missing if public statement preceeds the interface block)
2017-03-25  Paul Thomas  <pault@gcc.gnu.org>

	PR fortran/80156
	PR fortran/79382
	* decl.c (access_attr_decl): Remove the error for an absent
	generic DTIO interface and ensure that symbol has the flavor
	FL_PROCEDURE.

2017-03-25  Paul Thomas  <pault@gcc.gnu.org>

	PR fortran/80156
	PR fortran/79382
	* gfortran.dg/dtio_23.f90 : Remove the dg-error and add the
	testcase for PR80156. Add a main programme that tests that
	the typebound generic is accessible.

From-SVN: r246476
2017-03-25 17:38:17 +00:00
Bernd Schmidt 5da906ca43 re PR target/80160 (operand has impossible constraints)
PR rtl-optimization/80160
	PR rtl-optimization/80159
	* lra-assigns.c (must_not_spill_p): Tighten new test to also take
	reg_alternate_class into account.

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

From-SVN: r246473
2017-03-25 01:12:04 +00:00
Jakub Jelinek 7dabefa0a6 re PR target/79904 (ICE in annotate_constant_pool_refs, at config/s390/s390.c:7909)
PR sanitizer/79904
	* gcc.dg/ubsan/pr79904-2.c: Add -Wno-psabi to dg-options.

From-SVN: r246468
2017-03-24 22:43:08 +01:00
Marek Polacek c8b1fbc12a re PR c++/80119 (-Wmaybe-uninitialized wrongly flags the body of a short-circuited if-clause)
PR c++/80119
	* cp-gimplify.c (cp_fold): Strip CLEANUP_POINT_EXPR if the expression
	doesn't have side effects.

	* g++.dg/warn/Wuninitialized-9.C: New test.

From-SVN: r246461
2017-03-24 14:22:01 +00:00
Andreas Krebbel 76794c5221 S/390: arch12: New builtins.
This patch implements a set of low-level builtins for instruction
which would otherwise not be emitted by the compiler plus a set of
high-level builtins as defined by the IBM XL compiler.  The high-level
builtins will be described in a future revision of the z/OS XL C/C++
Programming Guide.

I'll try to come up with a documentation appropriate for the GCC
manual as well (sometimes in the future).

gcc/ChangeLog:

2017-03-24  Andreas Krebbel  <krebbel@linux.vnet.ibm.com>

	* config/s390/s390-builtins.def: Add VXE builtins.  Add a flags
	argument to the overloaded builtin variants.  Use the new flag to
	deprecate certain builtin variants.
	* config/s390/s390-builtin-types.def: Add new builtin types.
	* config/s390/s390-builtins.h: Support new flags field for
	overloaded builtins.
	* config/s390/s390-c.c (OB_DEF_VAR): New flags field.
	(s390_macro_to_expand): Enable vector float data type.
	(s390_cpu_cpp_builtins_internal): Indicate support of the new
	builtins by incrementing the __VEC__ version number.
	(s390_expand_overloaded_builtin): Support expansion of vec_xl and
	vec_xst.
	(s390_resolve_overloaded_builtin): Emit error messages depending
	on the builtin flags.
	* config/s390/s390.c (s390_expand_builtin): Support additional
	flags argument.  Change error message to match the messages
	emitted in s390-c.c.
	* config/s390/s390.md: New UNSPEC_* constants.
	(op_type): Add new instruction types.
	* config/s390/vecintrin.h: Add new builtins and test data class
	constants.
	* config/s390/vx-builtins.md (V_HW_32_64): Add V4SF.
	(V_HW_4, VEC_HW, VECF_HW): New mode iterators.
	(VEC_INEXACT, VEC_NOINEXACT): New constants.
	("vec_splats<mode>", "vec_insert<mode>", "vec_promote<mode>")
	("vec_insert_and_zero<mode>", "vec_mergeh<mode>")
	("vec_mergel<mode>"): V_HW -> VEC_HW.

	("vlrlrv16qi", "vstrlrv16qi", "vbpermv16qi", "vec_msumv2di")
	("vmslg", "*vftci<mode>_cconly", "vftci<mode>_intcconly")
	("*vftci<mode>", "vftci<mode>_intcc", "vec_double_s64")
	("vec_double_u64", "vfmin<mode>", "vfmax<mode>"): New definition.

	("and_av2df3", "and_cv2df3", "vec_andc_av2df3")
	("vec_andc_cv2df3", "xor_av2df3", "xor_cv2df3", "vec_nor_av2df3")
	("vec_nor_cv2df3", "ior_av2df3", "ior_cv2df3", "vec_nabs")
	("*vftcidb", "*vftcidb_cconly", "vftcidb"): Remove definition.

	("vec_all_<fpcmpcc:code>v2df", "vec_any_<fpcmpcc:code>v2df")
	("vec_scatter_elementv4si_DI", "vec_cmp<fpcmp:code>v2df")
	("vec_di_to_df_s64", "vec_di_to_df_u64", "vec_df_to_di_u64")
	("vfidb", "*vldeb", "*vledb", "*vec_cmp<insn_cmp>v2df_cconly")
	("vec_cmpeqv2df_cc", "vec_cmpeqv2df_cc", "vec_cmphv2df_cc")
	("vec_cmphev2df_cc", "*vec_cmpeqv2df_cc")
	("*vec_cmphv2df_cc", "*vec_cmphev2df_cc"): Enable new modes as ...

	("vec_all_<fpcmpcc:code><mode>", "vec_any_<fpcmpcc:code><mode>")
	("vec_scatter_element<V_HW_4:mode>_DI")
	("vec_cmp<fpcmp:code><mode>", "vcdgb", "vcdlgb", "vclgdb")
	("vec_fpint<mode>", "vflls")
	("vflrd", "*vec_cmp<insn_cmp><mode>_cconly", "vec_cmpeq<mode>_cc")
	("vec_cmpeq<mode>_cc", "vec_cmph<mode>_cc", "vec_cmphe<mode>_cc")
	("*vec_cmpeq<mode>_cc", "*vec_cmph<mode>_cc")
	("*vec_cmphe<mode>_cc"): ... these.

	("vec_ctd_s64", "vec_ctsl", "vec_ctul", "vec_st2f"): Use rounding
	mode constant instead of magic value.

gcc/testsuite/ChangeLog:

2017-03-24  Andreas Krebbel  <krebbel@linux.vnet.ibm.com>

	* gcc.target/s390/target-attribute/tattr-3.c: Adjust error message
	and remove the high-level builtin.  The error message for the
	would prevent compilation from reaching the second.
	* gcc.target/s390/target-attribute/tattr-4.c: Likewise.

From-SVN: r246459
2017-03-24 14:04:12 +00:00
Andreas Krebbel 2de2b3f93b S/390: arch12: Support new vector floating point modes.
This patch adds support for the new floating point vector elements (SF
and TF) introduced with arch12.

gcc/ChangeLog:

2017-03-24  Andreas Krebbel  <krebbel@linux.vnet.ibm.com>

	* config/s390/s390.c (s390_expand_vec_compare): Support other
	vector floating point modes than just V2DF.
	(s390_expand_vcond): Likewise.
	(s390_hard_regno_mode_ok): Allow SFmode values in VRs.
	(s390_cannot_change_mode_class): Prevent mode changes between TF
	and V1TF in vector registers.
	* config/s390/s390.md (DF, SF): New mode attributes.
	("*cmp<mode>_ccs", "add<mode>3", "sub<mode>3", "mul<mode>3")
	("fma<mode>4", "fms<mode>4", "div<mode>3", "*neg<mode>2"): Add
	SFmode support for VRs.
	* config/s390/vector.md (V_HW, V_HW2, VT_HW, ti*, nonvec): Add new
	vector fp modes.
	(VFT, VF_HW): New mode iterators.
	(vw, sdx): New mode attributes.
	("addv2df3", "subv2df3", "mulv2df3", "divv2df3", "sqrtv2df2")
	("fmav2df4","fmsv2df4", "negv2df2", "absv2df2", "*negabsv2df2")
	("smaxv2df3", "sminv2df3", "*vec_cmp<VFCMP_HW_OP:code>v2df_nocc")
	("vec_cmpuneqv2df", "vec_cmpltgtv2df", "vec_orderedv2df")
	("vec_unorderedv2df"): Adjust the v2df only patterns to support
	also the new vector floating point modes.  Renaming to ...

	("add<mode>3", "sub<mode>3", "mul<mode>3", "div<mode>3")
	("sqrt<mode>2", "fma<mode>4", "fms<mode>4", "neg<mode>2")
	("abs<mode>2", "negabs<mode>2", "smax<mode>3")
	("smin<mode>3", "*vec_cmp<VFCMP_HW_OP:code><mode>_nocc")
	("vec_cmpuneq<mode>", "vec_cmpltgt<mode>", "vec_ordered<mode>")
	("vec_unordered<mode>"): ... these.

	("neg_fma<mode>4", "neg_fms<mode>4", "*smax<mode>3_vxe")
	("*smin<mode>3_vxe", "*sminv2df3_vx", "*vec_extendv4sf")
	("*vec_extendv2df"): New insn definitions.

gcc/testsuite/ChangeLog:

2017-03-24  Andreas Krebbel  <krebbel@linux.vnet.ibm.com>

	* gcc.target/s390/vxe/negfma-1.c: New test.

From-SVN: r246458
2017-03-24 14:03:24 +00:00
Andreas Krebbel 7d2fd07577 S/390: arch12: Support the mul/add/subtract
instructions.

gcc/ChangeLog:

2017-03-24  Andreas Krebbel  <krebbel@linux.vnet.ibm.com>

	* config/s390/s390.md ("*adddi3_sign", "*subdi3_sign", "mulditi3")
	("mulditi3_2", "*muldi3_sign"): New patterns.
	("muldi3", "*muldi3", "mulsi3", "*mulsi3"): Add an expander and
	rename the pattern definition.

gcc/testsuite/ChangeLog:

2017-03-24  Andreas Krebbel  <krebbel@linux.vnet.ibm.com>

	* gcc.target/s390/arch12/aghsghmgh-1.c: New test.
	* gcc.target/s390/arch12/mul-1.c: New test.
	* gcc.target/s390/arch12/mul-2.c: New test.

From-SVN: r246457
2017-03-24 14:02:51 +00:00
Andreas Krebbel 72612e4e9e S/390: arch12: Add vllezlf instruction.
This adds support for the vector load element and zero instruction and
makes sure it is used when initializing vectors with elements while
setting the rest to 0.

gcc/ChangeLog:

2017-03-24  Andreas Krebbel  <krebbel@linux.vnet.ibm.com>

	* config/s390/s390.c (s390_expand_vec_init): Use vllezl
	instruction if possible.
	* config/s390/vector.md (vec_halfnumelts): New mode
	attribute.
	("*vec_vllezlf<mode>"): New pattern.

gcc/testsuite/ChangeLog:

2017-03-24  Andreas Krebbel  <krebbel@linux.vnet.ibm.com>

	* gcc.target/s390/vxe/vllezlf-1.c: New test.

From-SVN: r246455
2017-03-24 14:01:54 +00:00
Andreas Krebbel 6c7774d15e S/390: arch12: New vector popcount variants
arch12 provides pop count vector instructions for bigger elements than
just chars.

gcc/testsuite/ChangeLog:

2017-03-24  Andreas Krebbel  <krebbel@linux.vnet.ibm.com>

	* gcc.target/s390/vxe/popcount-1.c: New test.

gcc/ChangeLog:

2017-03-24  Andreas Krebbel  <krebbel@linux.vnet.ibm.com>

	* config/s390/vector.md ("popcountv16qi2", "popcountv8hi2")
	("popcountv4si2", "popcountv2di2"): Rename to ...
	("popcount<mode>2", "popcountv8hi2_vx", "popcountv4si2_vx")
	("popcountv2di2_vx"): ... these and add !TARGET_VXE to the
	condition.
	("popcount<mode>2_vxe"): New pattern.

From-SVN: r246454
2017-03-24 14:01:18 +00:00
Andreas Krebbel 9ec988605d S/390: arch12: Add support for new vector bit
operations.

This patch adds support for the new bit operations introduced with
arch12.

The patch also renames the one complement pattern to the proper RTL
standard name.

2017-03-24  Andreas Krebbel  <krebbel@linux.vnet.ibm.com>

	* config/s390/s390.c (s390_rtx_costs): Return low costs for the
	canonical form of ~AND to make sure the new instruction will be
	used.
	* config/s390/vector.md ("notand<mode>3", "ior_not<mode>3")
	("notxor<mode>3"): Add new pattern definitions.
	("*not<mode>"): Rename to ...
	("one_cmpl<mode>2"): ... this.

gcc/testsuite/ChangeLog:

2017-03-24  Andreas Krebbel  <krebbel@linux.vnet.ibm.com>

	* gcc.target/s390/vxe/bitops-1.c: New test.

From-SVN: r246453
2017-03-24 14:00:43 +00:00
Andreas Krebbel 6654e96fc8 S/390: arch12: Add arch12 option.
This patch covers the mechanical work of making the new architecture
option arch12 available wherever it will be needed later.

gcc/testsuite/ChangeLog:

2017-03-24  Andreas Krebbel  <krebbel@linux.vnet.ibm.com>

	* gcc.target/s390/s390.exp: Run tests in arch12 and vxe dirs.
	* lib/target-supports.exp: Add effective target check s390_vxe.

gcc/ChangeLog:

2017-03-24  Andreas Krebbel  <krebbel@linux.vnet.ibm.com>

	* common/config/s390/s390-common.c (processor_flags_table): Add
	arch12.
	* config.gcc: Add arch12.
	* config/s390/driver-native.c (s390_host_detect_local_cpu):
	Default to arch12 for unknown CPU model numbers.
	* config/s390/s390-builtins.def: Add B_VXE builtin flag.
	* config/s390/s390-c.c (s390_cpu_cpp_builtins_internal): Adjust
	PROCESSOR_max sanity check.
	* config/s390/s390-opts.h (enum processor_type): Add
	PROCESSOR_ARCH12.
	* config/s390/s390.c (processor_table): Add arch12.
	(s390_expand_builtin): Add check for B_VXE flag.
	(s390_issue_rate): Add PROCESSOR_ARCH12.
	(s390_get_sched_attrmask): Likewise.
	(s390_get_unit_mask): Likewise.
	(s390_sched_score): Enable z13 scheduling for arch12.
	(s390_sched_reorder): Likewise.
	(s390_sched_variable_issue): Likewise.
	* config/s390/s390.h (enum processor_flags): Add PF_ARCH12 and
	PF_VXE.
	(s390_tune_attr): Use z13 scheduling also for arch12.
	(TARGET_CPU_ARCH12, TARGET_CPU_ARCH12_P, TARGET_CPU_VXE)
	(TARGET_CPU_VXE_P, TARGET_ARCH12, TARGET_ARCH12_P, TARGET_VXE)
	(TARGET_VXE_P): New macros.
	* config/s390/s390.md: Add arch12 to cpu attribute.  Add arch12
	and vxe to cpu_facility.  Add arch12 and vxe to enabled attribute.
	* config/s390/s390.opt: Add arch12 as processor_type.

From-SVN: r246452
2017-03-24 13:59:51 +00:00
Andreas Krebbel 77c585ca57 S/390: Use wfc for scalar vector compares
The z13 vector support used the vector style comparison instructions
also for the scalar compares in vector registers.  However, it is much
more convenient to just use the compare scalar instruction for that
purpose.  The advantage is that this instruction generates a CC result
as our compares usually do.  So this results in quite some code to be
removed from the backend.

Regression tested on s390x.

gcc/ChangeLog:

2017-03-24  Andreas Krebbel  <krebbel@linux.vnet.ibm.com>

	* config/s390/2964.md: Remove the single element vector compare
	instructions which are no longer used.
	* config/s390/s390.c (s390_select_ccmode): Remove handling of
	vector CCmodes.
	(s390_canonicalize_comparison): Remove handling of DFmode
	compares.
	(s390_expand_vec_compare_scalar): Remove function.
	(s390_emit_compare): Don't call s390_expand_vec_compare_scalar.
	* config/s390/s390.md ("*vec_cmp<insn_cmp>df_cconly"): Remove
	pattern.
	("*cmp<mode>_ccs"): Add wfcdb instruction.

gcc/testsuite/ChangeLog:

2017-03-24  Andreas Krebbel  <krebbel@linux.vnet.ibm.com>

	* gcc.target/s390/vector/vec-scalar-cmp-1.c: Adjust for the
	comparison instructions used from now on.

From-SVN: r246450
2017-03-24 13:58:41 +00:00
Andreas Krebbel b5de6e84a5 S/390: Move and rename vector check.
Move the target support routine for the vector facility to the common
code file.  This is required to enable the generic vectorization tests
on S/390.  While doing this the too generic name for the check (vector)
is changed to s390_vx.  The renaming required to modify all the
testcases currently using that check.

gcc/testsuite/ChangeLog:

2017-03-24  Andreas Krebbel  <krebbel@linux.vnet.ibm.com>

	* gcc.target/s390/s390.exp (check_effective_target_vector):
	Include target-supports.exp and move target_vector check routine
	...
	* lib/target-supports.exp (check_effective_target_s390_vx): ... to
	here and rename it.
	* gcc.target/s390/htm-builtins-z13-1.c: Rename effective target
	check from vector to s390_vx.
	* gcc.target/s390/target-attribute/tpragma-struct-vx-1.c: Likewise.
	* gcc.target/s390/target-attribute/tpragma-struct-vx-2.c: Likewise.
	* gcc.target/s390/vector/stpcpy-1.c: Likewise.
	* gcc.target/s390/vector/vec-abi-vararg-1.c: Likewise.
	* gcc.target/s390/vector/vec-clobber-1.c: Likewise.
	* gcc.target/s390/vector/vec-genbytemask-1.c: Likewise.
	* gcc.target/s390/vector/vec-genmask-1.c: Likewise.
	* gcc.target/s390/vector/vec-nopeel-1.c: Likewise.
	* gcc.target/s390/vector/vec-vrepi-1.c: Likewise.

From-SVN: r246449
2017-03-24 13:57:58 +00:00
Andreas Krebbel a602f98516 S/390: vec_init improvements
This enables the vec_init pattern also for V4SF, V1TI, and V1TF.

gcc/testsuite/ChangeLog:

2017-03-24  Andreas Krebbel  <krebbel@linux.vnet.ibm.com>

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

gcc/ChangeLog:

2017-03-24  Andreas Krebbel  <krebbel@linux.vnet.ibm.com>

	* config/s390/s390.c (s390_expand_vec_init): Enable vector load
	pair for all vector types with 64 bit elements.
	* config/s390/vx-builtins.md (V_HW_64): Move mode iterator to ...
	* config/s390/vector.md (V_HW_64): ... here.
	(V_128_NOSINGLE): New mode iterator.
	("vec_init<V_HW:mode>"): Use V_128 as mode iterator.
	("*vec_splat<mode>"): Use V_128_NOSINGLE mode iterator.
	("*vec_tf_to_v1tf", "*vec_ti_to_v1ti"): New pattern definitions.
	("*vec_load_pairv2di"): Change to ...
	("*vec_load_pair<mode>"): ... this one.

From-SVN: r246446
2017-03-24 13:54:23 +00:00
Andreas Krebbel 085db63d58 S/390: PR79904: Disallow reg + sym_ref literal pool addresses.
We accept reg + sym_ref as valid address if sym_ref is a literal pool
reference knowing that it will be rewritten as r13 + reg + offset.
However, annotate_constant_pool_refs was never able to handle that.

With the patch only single sym_refs are accepted.

Regression tested on s390x.

2017-03-24  Andreas Krebbel  <krebbel@linux.vnet.ibm.com>

	PR target/79904
	* config/s390/s390.c (s390_decompose_address): Reject reg +
	sym_ref literal pool references.

gcc/testsuite/ChangeLog:

2017-03-24  Andreas Krebbel  <krebbel@linux.vnet.ibm.com>

	* gcc.dg/ubsan/pr79904-2.c: New test.

From-SVN: r246443
2017-03-24 13:52:30 +00:00
Andreas Krebbel dc4f29bc9a S/390: PR79893: Add diagnostics vec_load_bndry builtin.
The boundary argument of the vec_load_bndry builtin needs to be
rewritten.  At that point it must be constant already.  The current
diagnostics in s390_expand_builtins is too late for this.  The patch
adds an additional check for that builtin which will be triggered
already during preprocessing.

Regression tested on s390x.

gcc/testsuite/ChangeLog:

2017-03-24  Andreas Krebbel  <krebbel@linux.vnet.ibm.com>

	PR target/79893
	* gcc.target/s390/zvector/pr79893.c: New test.

gcc/ChangeLog:

2017-03-24  Andreas Krebbel  <krebbel@linux.vnet.ibm.com>

	PR target/79893
	* config/s390/s390-c.c (s390_adjust_builtin_arglist): Issue an
	error if the boundary argument is not constant.

From-SVN: r246442
2017-03-24 13:51:32 +00:00
Jakub Jelinek 5601068416 re PR rtl-optimization/80112 (ICE in doloop_condition_get at loop-doloop.c:158)
PR rtl-optimization/80112
	* loop-doloop.c (doloop_condition_get): Don't check condition
	if cmp isn't SET with IF_THEN_ELSE src.

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

From-SVN: r246441
2017-03-24 14:37:01 +01:00
Rainer Orth f0d7b52d4f Adjust c-c++-common/Wimplicit-fallthrough-7.c etc. line numbers
* c-c++-common/Wimplicit-fallthrough-7.c: Adjust dg-warning
	etc. line numbers.
	* gcc.dg/Walloca-1.c: Likewise.
	* gcc.dg/Walloca-2.c: Likewise.
	* gcc.dg/Wvla-larger-than-2.c: Likewise.

From-SVN: r246440
2017-03-24 12:57:14 +00:00
Bill Schmidt 635684c4cf re PR tree-optimization/80158 (ICE in all_phi_incrs_profitable)
2017-03-24  Bill Schmidt  <wschmidt@linux.vnet.ibm.com>

	PR tree-optimization/80158
	* gimple-ssa-strength-reduction.c (replace_mult_candidate): When
	replacing a candidate statement, also replace it for the
	candidate's alternate interpretation.
	(replace_rhs_if_not_dup): Likewise.
	(replace_one_candidate): Likewise.

	* gfortran.fortran-torture/compile/pr80158.f: New file.

From-SVN: r246439
2017-03-24 12:34:19 +00:00
Richard Biener 76afddf36b re PR tree-optimization/80167 (ICE in translate_isl_ast_to_gimple::is_valid_rename at gcc/graphite-isl-ast-to-gimple.c:1139)
2017-03-24  Richard Biener  <rguenther@suse.de>

	PR tree-optimization/80167
	* graphite-isl-ast-to-gimple.c
	(translate_isl_ast_to_gimple::is_valid_rename): Handle default-defs
	properly.
	(translate_isl_ast_to_gimple::get_rename): Likewise.

	* gcc.dg/graphite/pr80167.c: New testcase.

From-SVN: r246438
2017-03-24 12:16:43 +00:00
Tom de Vries c2e389bf38 Require effective target global_constructor for two testcases
2017-03-24  Tom de Vries  <tom@codesourcery.com>

	PR testsuite/80092
	* gcc.dg/no_profile_instrument_function-attr-1.c: Add
	dg-require-effective-target global_constructor.
	* gcc.dg/tls/emutls-2.c: Same.

From-SVN: r246436
2017-03-24 06:29:06 +00:00
Tom de Vries a72821b44f Require effective target indirect_jump in Wimplicit-fallthrough-34.c
2017-03-24  Tom de Vries  <tom@codesourcery.com>

	PR testsuite/80092
	* c-c++-common/Wimplicit-fallthrough-34.c: Add
	dg-require-effective-target indirect_jumps.

From-SVN: r246435
2017-03-24 06:28:53 +00:00
Tom de Vries 1658def9bd Require effective target nonlocal_goto in pr79244.c
2017-03-24  Tom de Vries  <tom@codesourcery.com>

	PR testsuite/80092
	* gcc.dg/torture/pr79244.c: Add dg-require-effective-target
	nonlocal_goto.

From-SVN: r246434
2017-03-24 06:28:42 +00:00
Tom de Vries 90e0269253 Add missing dg-require-effective-target alloca in gcc testsuite
2017-03-24  Tom de Vries  <tom@codesourcery.com>

	PR testsuite/80092
	* gcc.dg/Walloca-7.c: Add dg-require-effective-target alloca.
	* gcc.dg/Walloca-12.c: Same.
	* gcc.dg/attr-alloc_size-8.c: Same.
	* gcc.dg/Walloca-4.c: Same.
	* gcc.dg/Walloca-8.c: Same.
	* gcc.dg/Walloca-13.c: Same.
	* gcc.dg/Walloca-14.c: Same.
	* gcc.dg/attr-alloc_size-9.c: Same.
	* gcc.dg/Walloca-1.c: Same.
	* gcc.dg/tree-ssa/builtin-sprintf-warn-3.c: Same.
	* gcc.dg/Walloca-5.c: Same.
	* gcc.dg/Walloca-10.c: Same.
	* gcc.dg/Walloca-9.c: Same.
	* gcc.dg/attr-alloc_size-6.c: Same.
	* gcc.dg/Wvla-larger-than-1.c: Same.
	* gcc.dg/torture/pr71881.c: Same.
	* gcc.dg/torture/pr71901.c: Same.
	* gcc.dg/torture/pr78742.c: Same.
	* gcc.dg/builtin-alloc-size.c: Same.
	* gcc.dg/Walloca-2.c: Same.
	* gcc.dg/Walloca-6.c: Same.
	* gcc.dg/Walloca-11.c: Same.
	* gcc.dg/attr-alloc_size-7.c: Same.
	* gcc.dg/Wvla-larger-than-2.c: Same.
	* gcc.dg/Walloca-3.c: Same.
	* c-c++-common/Wimplicit-fallthrough-7.c: Same.
	* gcc.c-torture/compile/pr79413.c: Same.
	* gcc.c-torture/compile/pr78439.c: Same.

From-SVN: r246433
2017-03-24 06:28:12 +00:00
Kelvin Nilsen 842392c856 p9-options-1.c: New test.
gcc/testsuite/ChangeLog:

2017-03-23  Kelvin Nilsen  <kelvin@gcc.gnu.org>

	* gcc.target/powerpc/p9-options-1.c: New test.

gcc/ChangeLog:

2017-03-23  Kelvin Nilsen  <kelvin@gcc.gnu.org>

	* config/rs6000/rs6000.c (rs6000_option_override_internal): Change
	handling of certain combinations of target options, including the
	combinations -mpower8-vector vs. -mno-vsx, -mpower9-vector vs.
	-mno-power8-vector, and -mpower9_dform vs. -mno-power9-vector.

From-SVN: r246428
2017-03-23 22:12:06 +00:00
Kyrylo Tkachov de2b3f5ca9 [ARM] PR target/71436: Restrict *load_multiple pattern till after LRA
PR target/71436
	* config/arm/arm.md (*load_multiple): Add reload_completed to
	matching condition.

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

From-SVN: r246419
2017-03-23 14:55:48 +00:00
William Schmidt 2e6315ef8c re PR tree-optimization/79908 (ICE in gimplify_expr (gimplify.c:12155) gimplification failed)
[gcc]

2017-03-23  Bill Schmidt  <wschmidt@linux.vnet.ibm.com>
            Richard Biener  <rguenth@suse.com>

	PR tree-optimization/79908
	PR tree-optimization/80136
	* tree-stdarg.c (expand_ifn_va_arg_1): For a VA_ARG whose LHS has
	been cast away, gimplify_and_add suffices.

[gcc/testsuite]

2017-03-23  Bill Schmidt  <wschmidt@linux.vnet.ibm.com>
            Richard Biener  <rguenther@suse.de>

	PR tree-optimization/79908
	PR tree-optimization/80136
	* gcc.dg/torture/pr79908.c: New file.

From-SVN: r246418
2017-03-23 13:13:44 +00:00
Nicolas Koenig 9cdf036303 re PR fortran/39239 (Reject SAVEd variables EQUIVALENCEd to a COMMON)
2017-03-22 Nicolas Koenig <koenigni@student.ethz.ch>

	PR fortran/39239
	* gfortran.dg/equiv_constraint_bind_c.f90: New test.

From-SVN: r246405
2017-03-22 19:08:36 +00:00
Nicolas Koenig e59a225fe0 ChangeLog: Add forgotten entry for r246322.
2017-03-21  Nicolas Koenig  <koenigni@student.ethz.ch>

	* fortran/ChangeLog: Add forgotten entry for r246322.
	* testsuite/ChangeLog: Likewise.

From-SVN: r246404
2017-03-22 19:03:50 +00:00
Jakub Jelinek f13e9cd513 re PR c++/80141 (ICE with pragma omp declare)
PR c++/80141
	* semantics.c (finish_omp_clause) <case OMP_CLAUSE_SIMDLEN,
	case OMP_CLAUSE_ALIGNED>: Call maybe_constant_value only when not
	processing_template_decl.

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

From-SVN: r246403
2017-03-22 19:53:47 +01:00
Jakub Jelinek 68ed2ba0a7 re PR c++/80129 (wrong code with ternary struct assignment to const)
PR c++/80129
	* gimplify.c (gimplify_modify_expr_rhs) <case COND_EXPR>: Clear
	TREE_READONLY on result if writing it more than once.

	* g++.dg/torture/pr80129.C: New test.

From-SVN: r246401
2017-03-22 19:45:48 +01:00
Jakub Jelinek f3dd574e54 re PR sanitizer/80110 (error: statement marked for throw, but doesn’t w/ -fsanitize=thread)
PR sanitizer/80110
	* tsan.c: Include tree-eh.h.
	(instrument_builtin_call): Call maybe_clean_eh_stmt or
	maybe_clean_or_replace_eh_stmt where needed.
	(instrument_memory_accesses): Add cfg_changed argument.
	Call gimple_purge_dead_eh_edges on each block and set *cfg_changed
	if it returned true.
	(tsan_pass): Adjust caller.  Return TODO_cleanup_cfg if cfg_changed.

	* g++.dg/tsan/pr80110.C: New test.

From-SVN: r246399
2017-03-22 19:34:44 +01:00
Thomas Koenig 918b6c9ec2 re PR fortran/80142 (Warning: No location in expression ... with -O / -ffrontend-optimize)
2017-03-22  Thomas Koenig  <tkoenig@gcc.gnu.org>

	PR fortran/80142
	* frontend-passes.c (combine_array_constructor): Take
	location of new expression from constructor expression instead
	of constructor.

2017-03-22  Thomas Koenig  <tkoenig@gcc.gnu.org>

	PR fortran/80142
	* gfortran.dg/any_loc.f90: New test case.

From-SVN: r246388
2017-03-22 15:20:17 +00:00
Thomas Preud'homme bf634d1c4c Fix PR80082: LDRD erronously used for 64bit load on ARMv7-R
2017-03-22  Thomas Preud'homme  <thomas.preudhomme@arm.com>

    gcc/
    PR target/80082
    * config/arm/arm-isa.h (isa_bit_lpae): New feature bit.
    (ISA_ARMv7ve): Add isa_bit_lpae to the definition.
    * config/arm/arm-protos.h (arm_arch7ve): Rename into ...
    (arm_arch_lpae): This.
    * config/arm/arm.c (arm_arch7ve): Rename into ...
    (arm_arch_lpae): This.  Define it in term of isa_bit_lpae.
    * config/arm/arm.h (TARGET_HAVE_LPAE): Redefine in term of
    arm_arch_lpae.

    gcc/testsuite/
    PR target/80082
    * gcc.target/arm/atomic_loaddi_10.c: New testcase.
    * gcc.target/arm/atomic_loaddi_11.c: Likewise.

From-SVN: r246365
2017-03-22 11:35:15 +00:00
Martin Liska f7325b95de Error message on target attribute on power target (PR target/79906)
2017-03-22  Martin Liska  <mliska@suse.cz>

	PR target/79906
	* config/rs6000/rs6000.c (rs6000_inner_target_options): Show
	error message instead of an ICE.
2017-03-22  Martin Liska  <mliska@suse.cz>

	PR target/79906
	* g++.dg/ext/mv8.C: Add power* targets.

From-SVN: r246345
2017-03-22 09:21:56 +00:00
Martin Sebor 3f01b620a7 PR c++/79548 - missing -Wunused-variable on a typedef'd variable in a function template
gcc/c-family/ChangeLog:

	PR c++/79548
	* c-common.c (set_underlying_type): Mark type used only when
	original del is declared unused.

gcc/testsuite/ChangeLog:

	PR c++/79548
	* g++.dg/warn/Wunused-var-26.C: New test.

From-SVN: r246335
2017-03-21 16:33:39 -06:00
Bill Schmidt 1cefb0511e re PR tree-optimization/79908 (ICE in gimplify_expr (gimplify.c:12155) gimplification failed)
[gcc]

2017-03-21  Bill Schmidt  <wschmidt@linux.vnet.ibm.com>

	PR tree-optimization/79908
	* tree-stdarg.c (expand_ifn_va_arg_1): Revert the following
	change: For a VA_ARG whose LHS has been cast away, use
	force_gimple_operand to construct the side effects.

[gcc/testsuite]

2017-03-21  Bill Schmidt  <wschmidt@linux.vnet.ibm.com>

	PR tree-optimization/79908
	* gcc.dg/torture/pr79908.c: Revert addition of new file.

From-SVN: r246330
2017-03-21 18:14:42 +00:00
Marek Polacek edc1747f1f re PR tree-optimization/80109 (ICE in get_range_info, at tree-ssanames.c:375)
PR tree-optimization/80109
	* gimple-ssa-warn-alloca.c (alloca_call_type): Only call get_range_info
	on INTEGRAL_TYPE_P.

	* gcc.dg/Walloca-14.c: New test.

Co-Authored-By: Martin Sebor <msebor@redhat.com>

From-SVN: r246325
2017-03-21 16:21:14 +00:00
Jakub Jelinek 85106b8757 re PR target/80125 (r246297 causes segfault in reg_used_between_p())
PR target/80125
	* combine.c (can_combine_p): Revert the 2017-03-20 change, only
	check reg_used_between_p between insn and one of succ or succ2
	depending on if succ is artificial insn not inserted into insn
	stream.

	* gcc.target/powerpc/pr80125.c: New test.

Co-Authored-By: Segher Boessenkool <segher@kernel.crashing.org>

From-SVN: r246323
2017-03-21 15:49:51 +01:00
Bill Schmidt 0ffe60b505 re PR tree-optimization/79908 (ICE in gimplify_expr (gimplify.c:12155) gimplification failed)
[gcc]

2017-03-21  Bill Schmidt  <wschmidt@linux.vnet.ibm.com>
            Richard Biener  <rguenth@suse.com>

	PR tree-optimization/79908
	* tree-stdarg.c (expand_ifn_va_arg_1): For a VA_ARG whose LHS has
	been cast away, use force_gimple_operand to construct the side
	effects.

[gcc/testsuite]

2017-03-21  Bill Schmidt  <wschmidt@linux.vnet.ibm.com>
            Richard Biener  <rguenther@suse.de>

	PR tree-optimization/79908
	* gcc.dg/torture/pr79908.c: New file.


Co-Authored-By: Richard Biener <rguenth@suse.com>
Co-Authored-By: Richard Biener <rguenther@suse.de>

From-SVN: r246319
2017-03-21 13:57:20 +00:00
Senthil Kumar Selvaraj 54eb90fe8a Fix failing overflow-1.c for avr
The test assumes 32 bit ints, and expects a constant in the
dump that is only valid for 32 bit ints. Fix by explicitly
specifying __UINT32_TYPE__.

gcc/testsuite/

2017-03-21  Senthil Kumar Selvaraj  <senthil_kumar.selvaraj@atmel.com>

	* gcc.dg/tree-ssa/overflow-1.c: Use __UINT32_TYPE__ for targets
	with sizeof(int) < 4.

From-SVN: r246318
2017-03-21 12:05:09 +00:00
Martin Liska 5611c45690 Fix dg-error for a test
2017-03-21  Martin Liska  <mliska@suse.cz>

	* gcc.target/i386/pr65044.c: Add '.' in order to catch
	apostrophes.

From-SVN: r246316
2017-03-21 12:01:40 +00:00
Richard Biener e650ea2a5e re PR tree-optimization/80032 (C++ excessive stack usage (no stack reuse))
2017-03-21  Richard Biener  <rguenther@suse.de>

	PR tree-optimization/80032
	* gimplify.c (gimple_push_cleanup): Add force_uncond parameter,
	if set force the cleanup to happen unconditionally.
	(gimplify_target_expr): Push inserted clobbers with force_uncond
	to avoid them being removed by control-dependent DCE.

	* g++.dg/opt/pr80032.C: New testcase.

From-SVN: r246314
2017-03-21 11:43:45 +00:00
Richard Biener da2ce5f993 re PR tree-optimization/80122 (__builtin_va_arg_pack() and __builtin_va_arg_pack_len() does not work correctly)
2017-03-21  Richard Biener  <rguenther@suse.de>

	PR tree-optimization/80122
	* tree-inline.c (copy_bb): Do not expans va-arg packs or
	va_arg_pack_len when the inlined call stmt requires pack
	expansion itself.
	* tree-inline.h (struct copy_body_data): Make call_stmt a gcall *.

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

From-SVN: r246313
2017-03-21 11:42:22 +00:00
Toma Tabacu 9d60683aa0 Skip gcc.dg/pic-2.c and gcc.dg/pie-2.c for MIPS.
gcc/testsuite/

	* gcc.dg/pic-2.c: Skip for MIPS.
	* gcc.dg/pie-2.c: Skip for MIPS.

From-SVN: r246311
2017-03-21 11:07:19 +00:00
Paolo Carlini d3e19c2c97 re PR c++/77752 (ICE on C++ code on x86_64-linux-gnu (internal compiler error: Segmentation fault, build_list_conv, implicit_conversion))
/cp
2017-03-21  Paolo Carlini  <paolo.carlini@oracle.com>

	PR c++/77752
	* name-lookup.c (pushtag_1): Add check for bogus, non template,
	std::initializer_list.

/testsuite
2017-03-21  Paolo Carlini  <paolo.carlini@oracle.com>

	PR c++/77752
	* g++.dg/cpp0x/initlist97.C: New.
	* g++.dg/cpp0x/initlist85.C: Update.

From-SVN: r246310
2017-03-21 10:18:51 +00:00
Jakub Jelinek 9f30dff0ee re PR middle-end/67338 (fold-const sanitizer runtime error in roundup_loc)
PR c/67338
	* fold-const.c (round_up_loc): Negate divisor in unsigned type to
	avoid UB.

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

From-SVN: r246305
2017-03-21 09:10:30 +01:00
Jakub Jelinek 8bee092e7f re PR c++/35878 ([LWG 2302] Useless NULL pointer check when constructing object)
PR c++/35878
	* init.c (std_placement_new_fn_p, build_new_1): Formatting fixes.

	* g++.dg/init/pr35878_1.C: Rewrite directives to scan optimized
	dump instead of assembler.
	* g++.dg/init/pr35878_2.C: Likewise.
	* g++.dg/init/pr35878_3.C: Likewise.

From-SVN: r246303
2017-03-21 08:30:48 +01:00
Jakub Jelinek 4d1b8e70fa re PR c/80097 (internal compiler error in c_fully_fold_internal with std=c89 and -fsanitize=float-divide-by-zero)
PR c/80097
	* c-typeck.c (build_binary_op): Add EXCESS_PRECISION_EXPR only around
	optional COMPOUND_EXPR with ubsan instrumentation.

	* gcc.dg/ubsan/pr80097.c: New test.

From-SVN: r246302
2017-03-21 08:01:05 +01:00
Bill Schmidt c34923c44c re PR tree-optimization/80054 (ICE in verify_ssa with -O3 -march=broadwell/skylake-avx512)
[gcc]

2017-03-20  Bill Schmidt  <wschmidt@linux.vnet.ibm.com>

	PR tree-optimization/80054
	* gimple-ssa-strength-reduction.c (all_phi_incrs_profitable): Fail
	the optimization if a PHI or any of its arguments is not dominated
	by the candidate's basis.  Use gphi* rather than gimple* as
	appropriate.
	(replace_profitable_candidates): Clean up a gimple* variable that
	should be a gphi* variable.

[gcc/testsuite]

2017-03-20  Bill Schmidt  <wschmidt@linux.vnet.ibm.com>

	PR tree-optimization/80054
	* g++.dg/torture/pr80054.C: New file.

From-SVN: r246290
2017-03-20 20:04:25 +00:00
Kelvin Nilsen b0ba96c2f1 re PR target/79963 (vec_eq_any extracts wrong CR bit when compiling with -mcpu=power9)
gcc/testsuite/ChangeLog:

2017-03-20  Kelvin Nilsen  <kelvin@gcc.gnu.org>

	PR target/79963
	* gcc.target/powerpc/vsu/vec-any-eq-10.c: Add scan-assembler
	directive to assure selection of proper bit using rlwinm insn.
	* gcc.target/powerpc/vsu/vec-any-eq-14.c: Likewise.
	* gcc.target/powerpc/vsu/vec-any-eq-7.c: Likewise.
	* gcc.target/powerpc/vsu/vec-any-eq-8.c: Likewise.
	* gcc.target/powerpc/vsu/vec-any-eq-9.c: Likewise.

gcc/ChangeLog:

2017-03-20  Kelvin Nilsen  <kelvin@gcc.gnu.org>

	PR target/79963
	* config/rs6000/altivec.h (vec_all_ne): Under __cplusplus__ and
	__POWER9_VECTOR__ #ifdef control, change template definition to
	use Power9-specific built-in function.
	(vec_any_eq): Likewise.
	* config/rs6000/vector.md (vector_ae_v2di_p): Change the flag used
	to control outcomes from this test.
	(vector_ae_<mode>p): For VEC_F modes, likewise.

From-SVN: r246287
2017-03-20 18:05:00 +00:00
Marek Polacek 92377255c1 PR c++/80059 - ICE with noexcept and __transaction_atomic
PR c++/80059 - ICE with noexcept and __transaction_atomic
	* except.c (build_must_not_throw_expr): Call
	instantiate_non_dependent_expr_sfinae.

	* g++.dg/tm/pr80059-2.C: New test.
	* g++.dg/tm/pr80059.C: New test.

Co-Authored-By: Paolo Carlini <paolo.carlini@oracle.com>

From-SVN: r246279
2017-03-20 15:02:09 +00:00
Martin Liska 243e28bfb9 MPX: fix PR middle-end/79753
2017-03-20  Martin Liska  <mliska@suse.cz>

	PR middle-end/79753
	* tree-chkp.c (chkp_build_returned_bound): Do not build
	returned bounds for a LHS that's not a BOUNDED_P type.
2017-03-20  Martin Liska  <mliska@suse.cz>

	PR middle-end/79753
	* gcc.target/i386/mpx/pr79753.c: New test.

From-SVN: r246276
2017-03-20 10:06:00 +00:00
Martin Liska 918112d378 Fix *_CST ICEs connected to MPX.
2017-03-20  Martin Liska  <mliska@suse.cz>

	PR target/79769
	PR target/79770
	* tree-chkp.c (chkp_find_bounds_1): Handle REAL_CST,
	COMPLEX_CST and VECTOR_CST.
2017-03-20  Martin Liska  <mliska@suse.cz>

	PR target/79769
	PR target/79770
	* g++.dg/pr79769.C: New test.
	* gcc.target/i386/mpx/pr79770.c: New test.

From-SVN: r246275
2017-03-20 10:04:06 +00:00
Andreas Krebbel e325aba2a7 S/390: PR78857: Don't use load and test if result is live.
The FP load and test instruction should not be used for a comparison
if the target operand is being used afterwards.  It unfortunately
turns SNaNs into QNaNs.

gcc/ChangeLog:

2017-03-20  Andreas Krebbel  <krebbel@linux.vnet.ibm.com>

	PR target/78857
	* config/s390/s390.md ("cmp<mode>_ccs_0"): Add a clobber of the
	target operand.  A new splitter adds the clobber statement in case
	the target operand is dead anyway.

gcc/testsuite/ChangeLog:

2017-03-20  Andreas Krebbel  <krebbel@linux.vnet.ibm.com>

	PR target/78857
	* gcc.target/s390/load-and-test-fp-1.c: New test.
	* gcc.target/s390/load-and-test-fp-2.c: New test.

From-SVN: r246274
2017-03-20 09:33:11 +00:00
Paul Thomas 91d2c04ced re PR fortran/79676 ([submodules] Compilation/linking error when module procedures PRIVATE)
2017-03-18  Paul Thomas  <pault@gcc.gnu.org>

	PR fortran/79676
	* module.c (mio_symbol_attribute): Remove reset of the flag
	'no_module_procedures'.
	(check_for_module_procedures): New function. Move declaration
	of 'no_module_procedures' to above it.
	(gfc_dump_module): Traverse namespace calling new function.

2017-03-18  Paul Thomas  <pault@gcc.gnu.org>

	PR fortran/79676
	* gfortran.dg/submodule_28.f08 : New test.

From-SVN: r246256
2017-03-18 12:38:02 +00:00
Paul Thomas c7e4107b53 re PR fortran/71838 (ICE with OpenCoarrays on submodule)
2017-03-18  Paul Thomas  <pault@gcc.gnu.org>

	PR fortran/71838
	* symbol.c (check_conflict): A dummy procedure in a submodule,
	module procedure is not an error.
	(gfc_add_flavor): Ditto.

2017-03-18  Paul Thomas  <pault@gcc.gnu.org>

	PR fortran/71838
	* gfortran.dg/submodule_26.f08 : New test.
	* gfortran.dg/submodule_27.f08 : New test.

From-SVN: r246255
2017-03-18 11:53:53 +00:00
Pat Haugen d8fe28be76 re PR target/79951 (ICE in extract_insn, at recog.c:2311 on ppc64le with -mno-cmpb)
PR target/79951
	* config/rs6000/rs6000.md (copysign<mode>3_fcpsgn): Test
	for VECTOR_UNIT_VSX_P (<MODE>mode) too.
	* gcc.target/powerpc/pr79951.c: New.

From-SVN: r246228
2017-03-17 16:42:29 +00:00