Commit Graph

30339 Commits

Author SHA1 Message Date
Jakub Jelinek ffaf3bdd97 re PR tree-optimization/81365 (GCC miscompiles swap)
PR tree-optimization/81365
	* tree-ssa-phiprop.c (propagate_with_phi): When considering hoisting
	aggregate moves onto bb predecessor edges, make sure there are no
	loads that could alias the lhs in between the start of bb and the
	loads from *phi.

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

From-SVN: r250288
2017-07-17 21:42:37 +02:00
Jakub Jelinek 96a0e28758 backport: re PR c++/81258 (ICE on C++1z code with invalid decomposition declaration: in cp_finish_decl, at cp/decl.c:6760)
Backported from mainline
	2017-07-04  Jakub Jelinek  <jakub@redhat.com>

	PR c++/81258
	* parser.c (cp_parser_decomposition_declaration): Diagnose invalid
	forms of structured binding initializers.

	* g++.dg/cpp1z/decomp21.C (foo): Adjust expected diagnostics.
	* g++.dg/cpp1z/decomp30.C: New test.

From-SVN: r250286
2017-07-17 21:39:23 +02:00
Jakub Jelinek fc28766c1a backport: re PR target/81225 (ICE with -mavx512ifma -O3 -ffloat-store)
Backported from mainline
	2017-06-30  Jakub Jelinek  <jakub@redhat.com>

	PR target/81225
	* config/i386/sse.md (vec_extract_lo_<mode><mask_name>): For
	V8FI, V16FI and VI8F_256 iterators, use <store_mask_predicate> instead
	of nonimmediate_operand and <store_mask_constraint> instead of m for
	the input operand.  For V8FI iterator, always split if input is a MEM.
	For V16FI and V8SF_256 iterators, don't test if both operands are MEM
	if <mask_applied>.  For VI4F_256 iterator, use <store_mask_predicate>
	instead of register_operand and <store_mask_constraint> instead of v for
	the input operand.  Make sure both operands aren't MEMs for if not
	<mask_applied>.

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

From-SVN: r250285
2017-07-17 21:38:29 +02:00
Eric Botcazou 1fcc5158c5 re PR rtl-optimization/81424 (internal error on GPRbuild with -O2)
PR rtl-optimization/81424
	* optabs.c (prepare_cmp_insn): Use copy_to_reg instead of force_reg
	to remove potential trapping from operands if -fnon-call-exceptions.

From-SVN: r250247
2017-07-16 22:07:15 +00:00
Uros Bizjak b0c4c9f1fb re PR target/81375 (unrecognizable insn)
PR target/81375
	* config/i386/i386.md (divsf3): Add TARGET_SSE to TARGET_SSE_MATH.
	(rcpps): Ditto.
	(*rsqrtsf2_sse): Ditto.
	(rsqrtsf2): Ditto.
	(div<mode>3): Macroize insn from divdf3 and divsf3
	using MODEF mode iterator.

testsuite/ChangeLog:

	PR target/81375
	* gcc.target/i386/pr81375.c: New test.

From-SVN: r250113
2017-07-11 07:32:39 +02:00
Michael Meissner 69115c8c9d backport: re PR target/81348 (PowerPC64: Code built with -mcpu=power9 hits SEGV in RTL split2)
[gcc]
2017-07-07  Michael Meissner  <meissner@linux.vnet.ibm.com>

	Backport from mainline

	PR target/81348
	* config/rs6000/rs6000.md (HI sign_extend splitter): Use the
	correct operand in doing the split.

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

	Backport from mainline
	2017-07-07  Michael Meissner  <meissner@linux.vnet.ibm.com>

	PR target/81348
	* gcc.target/powerpc/pr81348.c: New test.

From-SVN: r250060
2017-07-07 20:47:15 +00:00
Jose E. Marchesi 0316d24f7a Support for the SPARC M8 cpu.
This patch serie adds support for the SPARC M8 processor to GCC.
The SPARC M8 processor implements the Oracle SPARC Architecture 2017.

- bmask* instructions are put in their own instruction type.  It makes
  little sense to have them in the same category than array
  instructions.

- Similarly, VIS compare instructions are put in their own instruction
  type.  This is to better accommodate subtypes, which are not quite
  the same than the subtypes of `visl' instructions.

- The introduction of a new `subtype' insn attribute in sparc.md
  avoids the need for adjusting the instruction scheduler DFAs for
  previous cpu models every time a new cpu is introduced.

- The full set of SPARC instructions used in sparc.md, and their
  position in the type/subtype hierarchy, is documented in a comment.
  This eases the modification of the DFA schedulers, and the addition
  of new cpus.

- The M7 DFA scheduler is reworked:

  + To use the new type/subtype hierarchy.
  + The v3pipe insn attribute is no longer needed.
  + More accurate latencies for instructions.
  + The S4 core pipeline is documented in a comment in niagara7.md.

- Support for -mcpu=m8 (we are thus suggesting to abandon the niagaraN
  denomination for M8 and later processors.)

- Support for a new VIS level, VIS4B, covering the new VIS
  instructions introduced in OSA2017 and implemented in the M8.  Also
  built-ins.

- A M8 DFA scheduler:

  + Also based on the new type/subtype hierarchy.
  + The functional units in the S5 core are explicitly documented in a
    comment in m8.md.


gcc/ChangeLog:

	* config/sparc/m8.md: New file.
	* config/sparc/sparc.md: Include m8.md.

	* config/sparc/sparc.opt: New option -mvis4b.
	* config/sparc/sparc.c (dump_target_flag_bits): Handle MASK_VIS4B.
	(sparc_option_override): Handle VIS4B.
	(enum sparc_builtins): Define
	SPARC_BUILTIN_DICTUNPACK{8,16,32},
	SPARC_BUILTIN_FPCMP{LE,GT,EQ,NE}{8,16,32}SHL,
	SPARC_BUILTIN_FPCMPU{LE,GT}{8,16,32}SHL,
	SPARC_BUILTIN_FPCMPDE{8,16,32}SHL and
	SPARC_BUILTIN_FPCMPUR{8,16,32}SHL.
	(check_constant_argument): New function.
	(sparc_vis_init_builtins): Define builtins
	__builtin_vis_dictunpack{8,16,32},
	__builtin_vis_fpcmp{le,gt,eq,ne}{8,16,32}shl,
	__builtin_vis_fpcmpu{le,gt}{8,16,32}shl,
	__builtin_vis_fpcmpde{8,16,32}shl and
	__builtin_vis_fpcmpur{8,16,32}shl.
	(sparc_expand_builtin): Check that the constant operands to
	__builtin_vis_fpcmp*shl and _builtin_vis_dictunpack* are indeed
	constant and in range.
	* config/sparc/sparc-c.c (sparc_target_macros): Handle
	TARGET_VIS4B.
	* config/sparc/sparc.h (SPARC_IMM2_P): Define.
	(SPARC_IMM5_P): Likewise.
	* config/sparc/sparc.md (cpu_feature): Add new feagure "vis4b".
	(enabled): Handle vis4b.
	(UNSPEC_DICTUNPACK): New unspec.
	(UNSPEC_FPCMPSHL): Likewise.
	(UNSPEC_FPUCMPSHL): Likewise.
	(UNSPEC_FPCMPDESHL): Likewise.
	(UNSPEC_FPCMPURSHL): Likewise.
	(cpu_feature): New CPU feature `vis4b'.
	(dictunpack{8,16,32}): New insns.
	(FPCSMODE): New mode iterator.
	(fpcscond): New code iterator.
	(fpcsucond): Likewise.
	(fpcmp{le,gt,eq,ne}{8,16,32}{si,di}shl): New insns.
	(fpcmpu{le,gt}{8,16,32}{si,di}shl): Likewise.
	(fpcmpde{8,16,32}{si,di}shl): Likewise.
	(fpcmpur{8,16,32}{si,di}shl): Likewise.
	* config/sparc/constraints.md: Define constraints `q' for unsigned
	2-bit integer constants and `t' for unsigned 5-bit integer
	constants.
	* config/sparc/predicates.md (imm5_operand_dictunpack8): New
	predicate.
	(imm5_operand_dictunpack16): Likewise.
	(imm5_operand_dictunpack32): Likewise.
	(imm2_operand): Likewise.
	* doc/invoke.texi (SPARC Options): Document -mvis4b.
	* doc/extend.texi (SPARC VIS Built-in Functions): Document the
	ditunpack* and fpcmp*shl builtins.

	* config.gcc: Handle m8 in --with-{cpu,tune} options.
	* config.in: Add HAVE_AS_SPARC6 define.
	* config/sparc/driver-sparc.c (cpu_names): Add entry for the SPARC
	M8.
	* config/sparc/sol2.h (CPP_CPU64_DEFAULT_SPEC): Define for
	TARGET_CPU_m8.
	(ASM_CPU32_DEFAUILT_SPEC): Likewise.
	(CPP_CPU_SPEC): Handle m8.
	(ASM_CPU_SPEC): Likewise.
	* config/sparc/sparc-opts.h (enum processor_type): Add
	PROCESSOR_M8.
	* config/sparc/sparc.c (m8_costs): New struct.
	(sparc_option_override): Handle TARGET_CPU_m8.
	(sparc32_initialize_trampoline): Likewise.
	(sparc64_initialize_trampoline): Likewise.
	(sparc_issue_rate): Likewise.
	(sparc_register_move_cost): Likewise.
	* config/sparc/sparc.h (TARGET_CPU_m8): Define.
	(CPP_CPU64_DEFAULT_SPEC): Define for M8.
	(ASM_CPU64_DEFAULT_SPEC): Likewise.
	(CPP_CPU_SPEC): Handle M8.
	(ASM_CPU_SPEC): Likewise.
	(AS_M8_FLAG): Define.
	* config/sparc/sparc.md: Add m8 to the cpu attribute.
	* config/sparc/sparc.opt: New option -mcpu=m8 for sparc targets.
	* configure.ac (HAVE_AS_SPARC6): Check for assembler support for
	M8 instructions.
	* configure: Regenerate.
	* doc/invoke.texi (SPARC Options): Document -mcpu=m8 and
	-mtune=m8.

	* config/sparc/niagara7.md: Rework the DFA scheduler to use insn
	subtypes.
	* config/sparc/sparc.md: Remove the `v3pipe' insn attribute.
	("*movdi_insn_sp32"): Do not set v3pipe.
	("*movsi_insn"): Likewise.
	("*movdi_insn_sp64"): Likewise.
	("*movsf_insn"): Likewise.
	("*movdf_insn_sp32"): Likewise.
	("*movdf_insn_sp64"): Likewise.
	("*zero_extendsidi2_insn_sp64"): Likewise.
	("*sign_extendsidi2_insn"): Likewise.
	("*mov<VM32:mode>_insn"): Likewise.
	("*mov<VM64:mode>_insn_sp64"): Likewise.
	("*mov<VM64:mode>_insn_sp32"): Likewise.
	("<plusminus_insn><VADDSUB:mode>3"): Likewise.
	("<vlop:code><VL:mode>3"): Likewise.
	("*not_<vlop:code><VL:mode>3"): Likewise.
	("*nand<VL:mode>_vis"): Likewise.
	("*<vlnotop:code>_not1<VL:mode>_vis"): Likewise.
	("*<vlnotop:code>_not2<VL:mode>_vis"): Likewise.
	("one_cmpl<VL:mode>2"): Likewise.
	("faligndata<VM64:mode>_vis"): Likewise.
	("alignaddrsi_vis"): Likewise.
	("alignaddrdi_vis"): Likweise.
	("alignaddrlsi_vis"): Likewise.
	("alignaddrldi_vis"): Likewise.
	("fcmp<gcond:code><GCM:gcm_name><P:mode>_vis"): Likewise.
	("bmaskdi_vis"): Likewise.
	("bmasksi_vis"): Likewise.
	("bshuffle<VM64:mode>_vis"): Likewise.
	("cmask8<P:mode>_vis"): Likewise.
	("cmask16<P:mode>_vis"): Likewise.
	("cmask32<P:mode>_vis"): Likewise.
	("pdistn<P:mode>_vis"): Likewise.
	("<vis3_addsub_ss_patname><VASS:mode>3"): Likewise.

	* config/sparc/sparc.md ("subtype"): New insn attribute.
	("*wrgsr_sp64"): Set insn subtype.
	("*rdgsr_sp64"): Likewise.
	("alignaddrsi_vis"): Likewise.
	("alignaddrdi_vis"): Likewise.
	("alignaddrlsi_vis"): Likewise.
	("alignaddrldi_vis"): Likewise.
	("<plusminus_insn><VADDSUB:mode>3"): Likewise.
	("fexpand_vis"): Likewise.
	("fpmerge_vis"): Likewise.
	("faligndata<VM64:mode>_vis"): Likewise.
	("bshuffle<VM64:mode>_vis"): Likewise.
	("cmask8<P:mode>_vis"): Likewise.
	("cmask16<P:mode>_vis"): Likewise.
	("cmask32<P:mode>_vis"): Likewise.
	("fchksm16_vis"): Likewise.
	("v<vis3_shift_patname><GCM:mode>3"): Likewise.
	("fmean16_vis"): Likewise.
	("fp<plusminus_insn>64_vis"): Likewise.
	("<plusminus_insn>v8qi3"): Likewise.
	("<vis3_addsub_ss_patname><VASS:mode>3"): Likewise.
	("<vis4_minmax_patname><VMMAX:mode>3"): Likewise.
	("<vis4_uminmax_patname><VMMAX:mode>3"): Likewise.
	("<vis3_addsub_ss_patname>v8qi3"): Likewise.
	("<vis4_addsub_us_patname><VAUS:mode>3"): Likewise.
	("*movqi_insn"): Likewise.
	("*movhi_insn"): Likewise.
	("*movsi_insn"): Likewise.
	("movsi_pic_gotdata_op"): Likewise.
	("*movdi_insn_sp32"): Likewise.
	("*movdi_insn_sp64"): Likewise.
	("movdi_pic_gotdata_op"): Likewise.
	("*movsf_insn"): Likewise.
	("*movdf_insn_sp32"): Likewise.
	("*movdf_insn_sp64"): Likewise.
	("*zero_extendhisi2_insn"): Likewise.
	("*zero_extendqihi2_insn"): Likewise.
	("*zero_extendqisi2_insn"): Likewise.
	("*zero_extendqidi2_insn"): Likewise.
	("*zero_extendhidi2_insn"): Likewise.
	("*zero_extendsidi2_insn_sp64"): Likewise.
	("ldfsr"): Likewise.
	("prefetch_64"): Likewise.
	("prefetch_32"): Likewise.
	("tie_ld32"): Likewise.
	("tie_ld64"): Likewise.
	("*tldo_ldub_sp32"): Likewise.
	("*tldo_ldub1_sp32"): Likewise.
	("*tldo_ldub2_sp32"): Likewise.
	("*tldo_ldub_sp64"): Likewise.
	("*tldo_ldub1_sp64"): Likewise.
	("*tldo_ldub2_sp64"): Likewise.
	("*tldo_ldub3_sp64"): Likewise.
	("*tldo_lduh_sp32"): Likewise.
	("*tldo_lduh1_sp32"): Likewise.
	("*tldo_lduh_sp64"): Likewise.
	("*tldo_lduh1_sp64"): Likewise.
	("*tldo_lduh2_sp64"): Likewise.
	("*tldo_lduw_sp32"): Likewise.
	("*tldo_lduw_sp64"): Likewise.
	("*tldo_lduw1_sp64"): Likewise.
	("*tldo_ldx_sp64"): Likewise.
	("*mov<VM32:mode>_insn"): Likewise.
	("*mov<VM64:mode>_insn_sp64"): Likewise.
	("*mov<VM64:mode>_insn_sp32"): Likewise.

	* config/sparc/sparc.md ("type"): New insn type viscmp.
	("fcmp<gcond:code><GCM:gcm_name><P:mode>_vis"): Set insn type to
	viscmp.
	("fpcmp<gcond:code>8<P:mode>_vis"): Likewise.
	("fucmp<gcond:code>8<P:mode>_vis"): Likewise.
	("fpcmpu<gcond:code><GCM:gcm_name><P:mode>_vis"): Likewise.
	* config/sparc/niagara7.md ("n7_vis_logical_v3pipe"): Handle
	viscmp.
	("n7_vis_logical_11cycle"): Likewise.
	* config/sparc/niagara4.md ("n4_vis_logical"): Likewise.
	* config/sparc/niagara2.md ("niag3_vis": Likewise.
	* config/sparc/niagara.md ("niag_vis"): Likewise.
	* config/sparc/ultra3.md ("us3_fga"): Likewise.
	* config/sparc/ultra1_2.md ("us1_fga_double"): Likewise.

	* config/sparc/sparc.md: New instruction type `bmask'.
	(bmaskdi_vis): Use the `bmask' type.
	(bmasksi_vis): Likewise.
	* config/sparc/ultra3.md (us3_array): Likewise.
	* config/sparc/niagara7.md (n7_array): Likewise.
	* config/sparc/niagara4.md (n4_array): Likewise.
	* config/sparc/niagara2.md (niag2_vis): Likewise.
	(niag3_vis): Likewise.
	* config/sparc/niagara.md (niag_vis): Likewise.

gcc/testsuite/ChangeLog:

	* gcc.target/sparc/dictunpack.c: New file.
	* gcc.target/sparc/fpcmpdeshl.c: Likewise.
	* gcc.target/sparc/fpcmpshl.c: Likewise.
	* gcc.target/sparc/fpcmpurshl.c: Likewise.
	* gcc.target/sparc/fpcmpushl.c: Likewise.

From-SVN: r250050
2017-07-07 17:42:43 +02:00
Georg-Johann Lay edfd992166 backport: re PR target/81305 ([avr] avrtiny uses LDS for SREG in ISR routines which is out of range of LDS.)
gcc/
	Backport from 2017-07-05 trunk r249995.
	PR target/81305
	* config/avr/avr.c (avr_out_movhi_mr_r_xmega) [CONSTANT_ADDRESS_P]:
	Don't depend on "optimize > 0".
	(out_movhi_r_mr, out_movqi_mr_r): Same.
	(out_movhi_mr_r, out_movqi_r_mr): Same.
	(avr_address_cost) [CONSTANT_ADDRESS_P]: Don't depend cost for
	io_address_operand on "optimize > 0".
gcc/testsuite/
	Backport from 2017-07-05 trunk r249995, r249996.
	PR target/81305
	* gcc.target/avr/isr-test.h: New file.
	* gcc.target/avr/torture/isr-01-simple.c: New test.
	* gcc.target/avr/torture/isr-02-call.c: New test.
	* gcc.target/avr/torture/isr-03-fixed.c: New test.

From-SVN: r249998
2017-07-05 12:49:08 +00:00
Uros Bizjak df3f3c4b11 re PR target/81300 (-fpeephole2 breaks __builtin_ia32_sbb_u64, _subborrow_u64 on AMD64)
PR target/81300
	* config/i386/i386.md (setcc + movzbl/and to xor + setcc peepholes):
	Require dead FLAGS_REG at the beginning of a peephole.

	PR target/81294
	* config/i386/adxintrin.h (_subborrow_u32): Swap _X and _Y
	arguments in the call to __builtin_ia32_sbb_u32.
	(_subborrow_u64): Swap _X and _Y arguments in the call to
	__builtin_ia32_sbb_u64.

testsuite/ChangeLog:

	PR target/81300
	* gcc.target/i386/pr81300.c: New test.

	PR target/81294
	* gcc.target/i386/adx-addcarryx32-2.c (adx_test): Swap
	x and y arguments in the call to _subborrow_u32.
	* gcc.target/i386/adx-addcarryx64-2.c (adx_test): Swap
	x and y arguments in the call to _subborrow_u64.
	* gcc.target/i386/pr81294-1.c: New test.
	* gcc.target/i386/pr81294-2.c: Ditto.

From-SVN: r249978
2017-07-04 23:05:17 +02:00
Tom de Vries 3c60c3693d Backport "Fix sigsegv in find_same_succ_bb"
2017-07-03  Tom de Vries  <tom@codesourcery.com>

	backport from mainline:
	2017-07-03  Tom de Vries  <tom@codesourcery.com>

	PR tree-optimization/81192
	* tree-ssa-tail-merge.c (same_succ_flush_bb): Handle
	BB_SAME_SUCC (bb) == NULL.

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

From-SVN: r249898
2017-07-03 08:32:20 +00:00
Michael Meissner 3a202a726d backport: re PR target/80510 (Optimize Power7/power8 Altivec load/stores)
[gcc]
2017-06-29  Michael Meissner  <meissner@linux.vnet.ibm.com>

	Backport from mainline
	2017-06-23  Michael Meissner  <meissner@linux.vnet.ibm.com>

	PR target/80510
	* config/rs6000/rs6000.md (ALTIVEC_DFORM): Do not allow DImode in
	32-bit, since indexed is not valid for DImode.
	(mov<mode>_hardfloat32): Reorder ISA 2.07 load/stores before ISA
	3.0 d-form load/stores to be the same as mov<mode>_hardfloat64.
	(define_peephole2 for Altivec d-form load): Add 32-bit support.
	(define_peephole2 for Altivec d-form store): Likewise.

	Backport from mainline
	2017-06-20  Michael Meissner  <meissner@linux.vnet.ibm.com>

	PR target/79799
	* config/rs6000/rs6000.c (rs6000_expand_vector_init): Add support
	for doing vector set of SFmode on ISA 3.0.
	* config/rs6000/vsx.md (vsx_set_v4sf_p9): Likewise.
	(vsx_set_v4sf_p9_zero): Special case setting 0.0f to a V4SF
	element.
	(vsx_insert_extract_v4sf_p9): Add an optimization for inserting a
	SFmode value into a V4SF variable that was extracted from another
	V4SF variable without converting the element to double precision
	and back to single precision vector format.
	(vsx_insert_extract_v4sf_p9_2): Likewise.

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

	Backport from mainline
	2017-06-23  Michael Meissner  <meissner@linux.vnet.ibm.com>

	PR target/80510
	* gcc.target/powerpc/pr80510-1.c: Allow test to run on 32-bit.
	* gcc.target/powerpc/pr80510-2.c: Likewise.

	Backport from mainline
	2017-06-20  Michael Meissner  <meissner@linux.vnet.ibm.com>

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

From-SVN: r249819
2017-06-29 22:19:29 +00:00
Richard Biener 4d69799530 backport: re PR ipa/81112 (internal compiler error: tree check: expected integer_cst, have range_expr in get_len, at tree.h:5321)
2017-06-29  Richard Biener  <rguenther@suse.de>

	Backport from mainline
	2017-06-19  Richard Biener  <rguenther@suse.de>

	PR ipa/81112
	* ipa-prop.c (find_constructor_constant_at_offset): Handle
	RANGE_EXPR conservatively.

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

From-SVN: r249772
2017-06-29 08:53:27 +00:00
Richard Biener 075a5f6aaf backport: [multiple changes]
2017-06-28  Richard Biener  <rguenther@suse.de>

	Backport from mainline
	2017-06-09  Richard Biener  <rguenther@suse.de>

	PR middle-end/81007
	* ipa-polymorphic-call.c
	(ipa_polymorphic_call_context::restrict_to_inner_class):
	Skip FIELD_DECLs with error_mark_node type.
	* passes.def (all_lowering_passes): Run pass_build_cgraph_edges
	last again.

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

	2017-06-14  Richard Biener  <rguenther@suse.de>

	PR tree-optimization/81083
	* tree-ssa-sccvn.c (vn_reference_lookup_3): Do not use abnormals
	as values.

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

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

	PR gcov-profile/81080
	* configure.ac: Add AC_SYS_LARGEFILE.
	* libgcov.h: Include auto-target.h before tsystem.h to pick
	up _FILE_OFFSET_BITS which might differ for multilibs.
	* config.in: Regenerate.
	* configure: Likewise.

From-SVN: r249738
2017-06-28 13:25:33 +00:00
Eric Botcazou a103487a61 val-profiler-threads-1.c (main): Fix 2nd argument passed to pthread_join.
2017-06-28  Eric Botcazou  <ebotcazou@adacore.com>

	* gcc.dg/tree-prof/val-profiler-threads-1.c (main): Fix 2nd argument
	passed to pthread_join.

From-SVN: r249724
2017-06-28 07:51:51 +00:00
Jerry DeLisle 66c3937325 backport: re PR fortran/53029 (missed optimization in internal read (without implied-do-loop))
2017-06-27  Jerry DeLisle  <jvdelisle@gcc.gnu.org>

	Backport from trunk
	PR libgfortran/53029
	* io/list_read.c(list_formatted_read_scalar: Set the err return
	value to the common.flags error values.

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

From-SVN: r249719
2017-06-28 04:14:32 +00:00
Segher Boessenkool e1ae299417 backports
From-SVN: r249699
2017-06-27 18:43:35 +02:00
Jakub Jelinek 4e365a51f6 re PR sanitizer/81209 (-fsanitize=undefined ICE on darwin)
PR sanitizer/81209
	* ubsan.c (ubsan_encode_value): Initialize DECL_CONTEXT on var.

	* g++.dg/ubsan/pr81209.C: New test.

From-SVN: r249680
2017-06-27 10:18:10 +02:00
Jakub Jelinek b8c5e47875 re PR middle-end/81207 (tree check fail in simplify_builtin_call)
PR middle-end/81207
	* gimple-fold.c (replace_call_with_call_and_fold): Handle
	gimple_vuse copying separately from gimple_vdef copying.

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

From-SVN: r249679
2017-06-27 10:16:10 +02:00
Eric Botcazou e860a3fd7f * c-c++-common/ubsan/sanitize-recover-7.c (dg-options): Add -w.
From-SVN: r249642
2017-06-26 09:49:21 +00:00
Marek Polacek 1ba13896eb re PR tree-optimization/80612 (ICE in get_range_info, at tree-ssanames.c:375)
PR tree-optimization/80612
	* calls.c (get_size_range): Check for INTEGRAL_TYPE_P.

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

From-SVN: r249625
2017-06-24 11:05:12 +00:00
Thomas Preud'homme 4e85f2146a [ARM] Rename FPSCR builtins to correct names
2017-06-23  Thomas Preud'homme  <thomas.preudhomme@arm.com>

    Backport from mainline
    2017-05-04  Prakhar Bahuguna  <prakhar.bahuguna@arm.com>

    gcc/
    * gcc/config/arm/arm-builtins.c (arm_init_builtins): Rename
    __builtin_arm_ldfscr to __builtin_arm_get_fpscr, and rename
    __builtin_arm_stfscr to __builtin_arm_set_fpscr.

    gcc/testsuite/
    * gcc.target/arm/fpscr.c: New file.

From-SVN: r249596
2017-06-23 16:08:40 +00:00
Martin Liska ccefbdd7ef Backport r249368
2017-06-22  Martin Liska  <mliska@suse.cz>

	Backport from mainline
	2017-06-19  Martin Liska  <mliska@suse.cz>

	PR sanitizer/80879
	* gimplify.c (gimplify_switch_expr):
	Initialize live_switch_vars for SWITCH_BODY == STATEMENT_LIST.
2017-06-22  Martin Liska  <mliska@suse.cz>

	Backport from mainline
	2017-06-19  Martin Liska  <mliska@suse.cz>

	PR sanitizer/80879
	* gcc.dg/asan/use-after-scope-switch-4.c: New test.

From-SVN: r249551
2017-06-22 11:41:09 +00:00
Martin Liska 40fbc3ff0c Backport r248489
2017-06-22  Martin Liska  <mliska@suse.cz>

	Backport from mainline
	2017-05-26  Martin Liska  <mliska@suse.cz>

	PR ipa/80663
	* params.def: Bound partial-inlining-entry-probability param.
2017-06-22  Martin Liska  <mliska@suse.cz>

	Backport from mainline
	2017-05-26  Martin Liska  <mliska@suse.cz>

	PR ipa/80663
	* g++.dg/ipa/pr80212.C: Remove the test as it does not longer
	split at the problematic spot.
	* gcc.dg/ipa/pr48195.c: Change 101 to 100 as 101 is no longer
	a valid value of the param.

From-SVN: r249548
2017-06-22 11:40:00 +00:00
Michael Meissner 967348bc04 backport: re PR target/80510 (Optimize Power7/power8 Altivec load/stores)
2017-06-21  Michael Meissner  <meissner@linux.vnet.ibm.com>

	Back port from mainline
	PR target/80510
	* gcc.target/powerpc/pr80510-1.c: Restrict test to 64-bit until
	32-bit support is added.  Change ITYPE size to 64-bit integer.
	* gcc.target/powerpc/pr80510-2.c: Likewise.

From-SVN: r249488
2017-06-21 22:51:15 +00:00
Jakub Jelinek 54a390bed7 re PR c++/81154 (OpenMP with shared variable in a template class crash)
PR c++/81154
	* semantics.c (handle_omp_array_sections_1, finish_omp_clauses):
	Complain about t not being a variable if t is OVERLOAD even
	when processing_template_decl.

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

From-SVN: r249483
2017-06-22 00:22:05 +02:00
Jakub Jelinek 67d4a7232c backport: re PR target/81121 (ICE: in extract_insn, at recog.c:2311)
Backported from mainline
	2017-06-20  Jakub Jelinek  <jakub@redhat.com>

	PR target/81121
	* config/i386/i386.md (TARGET_USE_VECTOR_CONVERTS float si->{sf,df}
	splitter): Require TARGET_SSE2 in the condition.

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

From-SVN: r249481
2017-06-22 00:18:34 +02:00
Jakub Jelinek 34bec96670 backport: re PR sanitizer/81125 (-fsanitize=undefined ICE)
Backported from mainline
	2017-06-20  Jakub Jelinek  <jakub@redhat.com>

	PR sanitizer/81125
	* ubsan.h (ubsan_encode_value): Workaround buggy clang++ parser
	by removing enum keyword.
	(ubsan_type_descriptor): Likewise.  Formatting fix.

	2017-06-19  Jakub Jelinek  <jakub@redhat.com>

	PR sanitizer/81125
	* ubsan.h (enum ubsan_encode_value_phase): New.
	(ubsan_encode_value): Change second argument to
	enum ubsan_encode_value_phase with default value of
	UBSAN_ENCODE_VALUE_GENERIC.
	* ubsan.c (ubsan_encode_value): Change second argument to
	enum ubsan_encode_value_phase PHASE from bool IN_EXPAND_P,
	adjust uses, for UBSAN_ENCODE_VALUE_GENERIC use just
	create_tmp_var_raw instead of create_tmp_var and use a
	TARGET_EXPR.
	(ubsan_expand_bounds_ifn, ubsan_build_overflow_builtin,
	instrument_bool_enum_load, ubsan_instrument_float_cast): Adjust
	ubsan_encode_value callers.

	PR sanitizer/81111
	* ubsan.c (ubsan_encode_value): If current_function_decl is NULL,
	use create_tmp_var_raw instead of create_tmp_var, mark it addressable
	just by setting TREE_ADDRESSABLE on the result and use a TARGET_EXPR.

	PR sanitizer/81125
	* g++.dg/ubsan/pr81125.C: New test.

	PR sanitizer/81111
	* g++.dg/ubsan/pr81111.C: New test.

From-SVN: r249480
2017-06-22 00:17:49 +02:00
Jakub Jelinek 32047dc9b8 backport: re PR sanitizer/80973 (ICE with lambda and -fsanitize=undefined)
Backported from mainline
	2017-06-13  Jakub Jelinek  <jakub@redhat.com>

	PR c++/80973
	* cp-gimplify.c (cp_genericize_r): Don't instrument MEM_REF second
	argument even if it has REFERENCE_TYPE.

	* g++.dg/ubsan/pr80973.C: New test.

From-SVN: r249479
2017-06-22 00:15:55 +02:00
Jakub Jelinek 6bf3d75c40 backport: re PR c++/80984 (ICE with label/variable ambiguity)
Backported from mainline
	2017-06-13  Jakub Jelinek  <jakub@redhat.com>

	PR c++/80984
	* cp-gimplify.c (cp_genericize): Only look for VAR_DECLs in
	BLOCK_VARS (outer) chain.
	(cxx_omp_const_qual_no_mutable): Likewise.

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

From-SVN: r249478
2017-06-22 00:14:23 +02:00
James Greenhalgh b1eff1fcd6 Backport: [Patch ARM] Fix PR71778
gcc/

	PR target/71778
	* config/arm/arm-builtins.c (arm_expand_builtin_args): Return TARGET
	if given a non-constant argument for an intrinsic which requires a
	constant.

gcc/testsuite/

	PR target/71778
	* gcc.target/arm/pr71778.c: New.

From-SVN: r249379
2017-06-19 16:58:03 +00:00
Eric Botcazou d03f4299d3 sparc.h (MASK_ISA): Add MASK_LEON and MASK_LEON3.
* config/sparc/sparc.h (MASK_ISA): Add MASK_LEON and MASK_LEON3.
	(MASK_FEATURES): New macro.
	* config/sparc/sparc.c (sparc_option_override): Remove the special
	handling of -mfpu and generalize it to all MASK_FEATURES switches.

From-SVN: r249190
2017-06-14 11:23:18 +00:00
Janus Weil d4e39c8869 backport: re PR fortran/70601 ([OOP] ICE on procedure pointer component call)
2017-06-09  Janus Weil  <janus@gcc.gnu.org>

	Backport from trunk
	PR fortran/70601
	* trans-expr.c (gfc_conv_procedure_call): Fix detection of allocatable
	function results.


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

	Backport from trunk
	PR fortran/70601
	* gfortran.dg/proc_ptr_comp_50.f90: New test.

From-SVN: r249066
2017-06-09 19:45:53 +02:00
Uros Bizjak 2d4d4a3bc5 re PR target/81015 (Bad codegen for __builtin_clz(unsigned short))
PR target/81015
	Revert:
	2016-12-14  Uros Bizjak  <ubizjak@gmail.com>

	PR target/59874
	* config/i386/i386.md (*ctzhi2): New insn_and_split pattern.
	(*clzhi2): Ditto.

testsuite/ChangeLog:

	PR target/81015
	* gcc.target/i386/pr59874-1.c (foo): Call __builtin_ctzs.
	* gcc.target/i386/pr59874-2.c (foo): Call __builtin_clzs.
	* gcc.target/i386/pr81015.c: New test.

From-SVN: r249039
2017-06-08 21:42:59 +02:00
Jakub Jelinek 7d75cd45a7 re PR c/81006 (ICE with zero-size array and #pragma omp task depend)
PR c/81006
	* c-typeck.c (handle_omp_array_sections_1): Convert TYPE_MAX_VALUE
	to sizetype before size_binop.

	* semantics.c (handle_omp_array_sections_1): Convert TYPE_MAX_VALUE
	to sizetype before size_binop.

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

From-SVN: r249036
2017-06-08 21:12:38 +02:00
Jakub Jelinek d5e8341185 re PR c++/81011 (ICE with #pragma omp task and inaccessible copy-constructor)
PR c++/81011
	* cp-gimplify.c (cxx_omp_finish_clause): When changing clause
	to OMP_CLAUSE_SHARED, also clear OMP_CLAUSE_SHARED_FIRSTPRIVATE
	and OMP_CLAUSE_SHARED_READONLY flags.

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

From-SVN: r249032
2017-06-08 21:02:09 +02:00
Richard Biener ac19d70401 Backport PRs 80549, 80593, 80705, 80842, 80906
2017-06-07  Richard Biener  <rguenther@suse.de>

	Backport from mainline
	2017-05-02  Richard Biener  <rguenther@suse.de>

	PR tree-optimization/80549
	* tree-cfgcleanup.c (mfb_keep_latches): New helper.
	(cleanup_tree_cfg_noloop): Create forwarders to known loop
	headers if they do not have a preheader.

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

	2017-05-19  Richard Biener  <rguenther@suse.de>

	PR c++/80593
	* c-warn.c (strict_aliasing_warning): Do not warn for accesses
	to alias-set zero memory.

	* g++.dg/warn/Wstrict-aliasing-bogus-char-2.C: New testcase.
	* g++.dg/warn/Wstrict-aliasing-6.C: Adjust expected outcome.

	2017-05-26  Richard Biener  <rguenther@suse.de>

	PR tree-optimization/80842
	* tree-ssa-ccp.c (set_lattice_value): Always meet with the old
	value.

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

	2017-05-31  Richard Biener  <rguenther@suse.de>

	PR tree-optimization/80906
	* graphite-isl-ast-to-gimple.c (copy_loop_close_phi_nodes): Get
	and pass through iv_map.
	(copy_bb_and_scalar_dependences): Adjust.
	(translate_pending_phi_nodes): Likewise.
	(copy_loop_close_phi_args): Handle code-generating IVs instead
	of ICEing.

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

	2017-05-11  Richard Biener  <rguenther@suse.de>

	PR tree-optimization/80705
	* tree-vect-data-refs.c (vect_analyze_data_refs): DECL_NONALIASED
	bases are not vectorizable.

	* gcc.dg/vect/bb-slp-pr80705.c: New testcase.

From-SVN: r248970
2017-06-07 13:07:06 +00:00
Marek Polacek 2904f6ac8e re PR c/80919 (ICE: Segmentation fault with -Wall when printing address of size 0 array)
PR c/80919
	* c-format.c (matching_type_p): Return false if any of the types
	requires structural equality.

	* gcc.dg/format/pr80919.c: New test.

From-SVN: r248963
2017-06-07 11:29:34 +00:00
Michael Meissner 5aa0092db2 backport: re PR target/80718 (GCC generates slow code for offsettable vec_duplicate)
Back port from mainline

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

	PR target/80718
	* config/rs6000/vsx.md (vsx_splat_<mode>, VSX_D iterator): Prefer
	VSX registers over GPRs, particularly on ISA 2.07 which does not
	have the MTVSRDD instruction.

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

	PR target/80718
	* gcc.target/powerpc/pr80718.c: New test.

From-SVN: r248936
2017-06-06 22:27:13 +00:00
Thomas Koenig 88c502146c backport: re PR fortran/80975 (matmul for zero-length arrays)
2017-06-06  Thomas Koenig  <tkoenig@gcc.gnu.org>

	Backport from trunk
	PR fortran/80975
	* m4/matmul_internal.m4:  Move zeroing before early return.
	* generated/matmul_c10.c: Regenerated.
	* generated/matmul_c16.c: Regenerated.
	* generated/matmul_c4.c: Regenerated.
	* generated/matmul_c8.c: Regenerated.
	* generated/matmul_i1.c: Regenerated.
	* generated/matmul_i16.c: Regenerated.
	* generated/matmul_i2.c: Regenerated.
	* generated/matmul_i4.c: Regenerated.
	* generated/matmul_i8.c: Regenerated.
	* generated/matmul_r10.c: Regenerated.
	* generated/matmul_r16.c: Regenerated.
	* generated/matmul_r4.c: Regenerated.
	* generated/matmul_r8.c: Regenerated.

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

	Backport from trunk
	PR fortran/80975
	* gfortran.dg/matmul_16.f90: New test.
	* gfortran.dg/inline_matmul_18.f90: New test.

From-SVN: r248935
2017-06-06 22:23:07 +00:00
David S. Miller 3179bb54ce sparc: Fix stack references in return delay slot.
gcc/

	PR target/80968
	* config/sparc/sparc.c (sparc_expand_prologue): Emit frame
	blockage if function uses alloca.

gcc/testsuite/

	* gcc.target/sparc/sparc-ret-3.c: New test.

From-SVN: r248929
2017-06-06 11:42:52 -07:00
Janus Weil 7c74f817f5 backport: re PR fortran/80766 ([OOP] ICE with type-bound procedure returning an array)
2017-06-05  Janus Weil  <janus@gcc.gnu.org>

	Backport from trunk
	PR fortran/80766
	* resolve.c (resolve_fl_derived): Make sure that vtype symbols are
	properly resolved.

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

	Backport from trunk
	PR fortran/80766
	* gfortran.dg/typebound_call_28.f90: New test.

From-SVN: r248873
2017-06-05 11:31:32 +02:00
Thomas Koenig bc21704623 re PR fortran/80904 (Matmul result allocated to wrong size)
2017-06-02  Thomas Koenig  <tkoenig@gcc.gnu.org>

	PR fortran/80904
	* frontend-passes.c (matmul_lhs_realloc):  Correct
	allocation size for case A1B2.

2017-06-02  Thomas Koenig  <tkoenig@gcc.gnu.org>

	PR fortran/80904
	* gfortran.dg/matmul_bounds_12.f90:  New test.

From-SVN: r248842
2017-06-02 17:44:19 +00:00
Prakhar Bahuguna f278c49389 PR71607: Fix ICE when loading constant
2017-06-02  Prakhar Bahuguna  <prakhar.bahuguna@arm.com>

	Backport from mainline
	2017-05-05  Andre Vieira  <andre.simoesdiasvieira@arm.com>
		    Prakhar Bahuguna  <prakhar.bahuguna@arm.com>

	gcc/
	PR target/71607
	* config/arm/arm.md (use_literal_pool): Remove.
	(64-bit immediate split): No longer takes cost into consideration
	if arm_disable_literal_pool is enabled.
	* config/arm/arm.c (arm_tls_referenced_p): Add diagnostic if TLS is
	used when arm_disable_literal_pool is enabled.
	(arm_max_const_double_inline_cost): Remove use of
	arm_disable_literal_pool.
	(push_minipool_fix): Add assert.
	(arm_reorg): Add return if arm_disable_literal_pool is enabled.
	* config/arm/vfp.md (no_literal_pool_df_immediate): New.
	(no_literal_pool_sf_immediate): New.

	2017-05-05  Andre Vieira  <andre.simoesdiasvieira@arm.com>
		    Thomas Preud'homme  <thomas.preudhomme@arm.com>
		    Prakhar Bahuguna  <prakhar.bahuguna@arm.com>

	gcc/testsuite/
	PR target/71607
	* gcc.target/arm/thumb2-slow-flash-data.c: Renamed to ...
	* gcc.target/arm/thumb2-slow-flash-data-1.c: ... this.
	* gcc.target/arm/thumb2-slow-flash-data-2.c: New.
	* gcc.target/arm/thumb2-slow-flash-data-3.c: New.
	* gcc.target/arm/thumb2-slow-flash-data-4.c: New.
	* gcc.target/arm/thumb2-slow-flash-data-5.c: New.
	* gcc.target/arm/tls-disable-literal-pool.c: New.

From-SVN: r248822
2017-06-02 11:19:16 +00:00
Jakub Jelinek a2b8dde6f8 re PR rtl-optimization/80903 (ICE: internal consistency failure (error: invalid rtl sharing found in the insn))
PR rtl-optimization/80903
	* loop-doloop.c (add_test): Unshare sequence.

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

From-SVN: r248817
2017-06-02 10:12:33 +02:00
Jakub Jelinek f829242273 re PR fortran/80918 (Assumed size whole array rejected in depend clause)
PR fortran/80918
	* openmp.c (resolve_omp_clauses): Fix a typo.

	* gfortran.dg/gomp/pr80918.f90: New test.

From-SVN: r248813
2017-06-02 09:10:10 +02:00
Martin Jambor 7a928bc1d7 [PR 80293] Dont totally-scalarize char arrays
2017-05-31  Martin Jambor  <mjambor@suse.cz>

        Backport from mainline
        2017-04-24  Martin Jambor  <mjambor@suse.cz>

        PR tree-optimization/80293
        * tree-sra.c (scalarizable_type_p): New parameter const_decl, make
        char arrays not totally scalarizable if it is false.
        (analyze_all_variable_accesses): Pass correct value in the new
        parameter.  Add a statistics counter.

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

From-SVN: r248724
2017-05-31 10:45:23 +02:00
Andreas Krebbel 8de0f875d0 S/390: Fix PR80725.
gcc/ChangeLog:

2017-05-29  Andreas Krebbel  <krebbel@linux.vnet.ibm.com>

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

	PR target/80725
	* config/s390/s390.c (s390_check_qrst_address): Check incoming
	address against address_operand predicate.
	* config/s390/s390.md ("*indirect_jump"): Swap alternatives.

gcc/testsuite/ChangeLog:

2017-05-29  Andreas Krebbel  <krebbel@linux.vnet.ibm.com>

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

	* gcc.target/s390/pr80725.c: New test.

From-SVN: r248557
2017-05-29 07:54:13 +00:00
Marek Polacek 015cf5d1d1 re PR sanitizer/80659 (-fsanitize=address evokes ICE in in gimplify_switch_expr)
PR sanitizer/80659
	* c-decl.c (build_compound_literal): Set DECL_ARTIFICIAL and
	DECL_IGNORED_P even for non-static compound literals.

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

From-SVN: r248491
2017-05-26 11:17:34 +00:00
Marek Polacek 9e2248e6d3 re PR sanitizer/80875 (UBSAN: compile time crash in fold_binary_loc at fold-const.c:9817)
PR sanitizer/80875
	* fold-const.c (fold_binary_loc) <case MULT_EXPR>: Check if OP1
	can be negated.

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

From-SVN: r248490
2017-05-26 11:15:37 +00:00
Michael Meissner e722c0f728 backport: re PR target/80510 (Optimize Power7/power8 Altivec load/stores)
[gcc]
2017-05-25  Michael Meissner  <meissner@linux.vnet.ibm.com>

	Backport from trunk
	2017-05-18  Michael Meissner  <meissner@linux.vnet.ibm.com>

	PR target/80510
	* config/rs6000/predicates.md (simple_offsettable_mem_operand):
	New predicate.

	* config/rs6000/rs6000.md (ALTIVEC_DFORM): New iterator.
	(define_peephole2 for Altivec d-form load): Add peepholes to catch
	cases where the register allocator uses a move and an offsettable
	memory operation to/from a FPR register on ISA 2.06/2.07.
	(define_peephole2 for Altivec d-form store): Likewise.

	Backport from trunk
	2017-05-09  Michael Meissner  <meissner@linux.vnet.ibm.com>

	PR target/68163
	* config/rs6000/rs6000.md (f32_lr): Delete mode attributes that
	are now unused after splitting mov{sf,sd}_hardfloat.
	(f32_lr2): Likewise.
	(f32_lm): Likewise.
	(f32_lm2): Likewise.
	(f32_li): Likewise.
	(f32_li2): Likewise.
	(f32_lv): Likewise.
	(f32_sr): Likewise.
	(f32_sr2): Likewise.
	(f32_sm): Likewise.
	(f32_sm2): Likewise.
	(f32_si): Likewise.
	(f32_si2): Likewise.
	(f32_sv): Likewise.
	(f32_dm): Likewise.
	(f32_vsx): Likewise.
	(f32_av): Likewise.
	(mov<mode>_hardfloat): Split into separate movsf and movsd pieces.
	For movsf, order stores so the VSX stores occur before the GPR
	store which encourages the register allocator to use a traditional
	FPR instead of a GPR.  For movsd, order the stores so that the GPR
	store comes before the VSX stores to allow the power6 to work.
	This is due to the power6 not having a 32-bit integer store
	instruction from a FPR.
	(movsf_hardfloat): Likewise.
	(movsd_hardfloat): Likewise.

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

	Backport from trunk
	2017-05-18  Michael Meissner  <meissner@linux.vnet.ibm.com>

	PR target/80510
	* gcc.target/powerpc/pr80510-1.c: New test.
	* gcc.target/powerpc/pr80510-2.c: Likewise.

	Backport from trunk
	2017-05-09  Michael Meissner  <meissner@linux.vnet.ibm.com>

	PR target/68163
	* gcc.target/powerpc/pr68163.c: New test.

From-SVN: r248480
2017-05-26 01:52:24 +00:00
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