150708 Commits

Author SHA1 Message Date
Uros Bizjak
cc99421ec4 re PR target/59874 (Missing builtin (__builtin_clzs) when compiling with g++)
PR target/59874
	* config/i386/i386-builtin.def: Add __builtin_clzs and __builtin_ctzs.
	(ix86_fold_builtin): Handle IX86_BUILTIN_CTZS and IX86_BUILTIN_CLZS.
	* config/i386/i386.md (*ctzhi2): New insn_and_split pattern.
	(*clzhi2): Ditto.

testsuite/ChangeLog

	PR target/59874
	* gcc.target/i386/pr59874-1.c: New test.
	* gcc.target/i386/pr59874-2.c: Ditto.

From-SVN: r243668
2016-12-14 21:27:06 +01:00
David Edelsohn
d3cab14ab3 pr78515.c: Add -Wno-psabi for AIX.
* gcc.dg/torture/pr78515.c: Add -Wno-psabi for AIX.
        * gcc.dg/tree-ssa/forwprop-35.c: Add -Wno-psabi for AIX.
        * gcc.dg/pr69634.c: Add -Wno-psabi for AIX.

From-SVN: r243666
2016-12-14 14:53:51 -05:00
Jakub Jelinek
53cfcb2e28 re PR debug/77844 (Compilation of simple C++ example exhaust memory)
PR debug/77844
	* valtrack.c: Include rtl-iter.h.
	(struct rtx_subst_pair): Add insn field.
	(propagate_for_debug_subst): If pair->to contains at least 2
	regs, create a DEBUG_INSN with a debug temp before pair->insn
	and replace from with the debug temp instead of pair->to.
	(propagate_for_debug): Initialize p.insn.
	* combine.c (insn_uid_check): New inline function.
	(INSN_COST, LOG_LINKS): Use it instead of INSN_UID.
	(find_single_use, combine_instructions,
	cant_combine_insn_p, try_combine): Use NONDEBUG_INSN_P instead of
	INSN_P.

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

From-SVN: r243662
2016-12-14 20:40:05 +01:00
Martin Sebor
474da67ef9 PR c/78673 - sprintf missing attribute nonnull on destination argument
PR c/78673 - sprintf missing attribute nonnull on destination argument
PR c/17308 - nonnull attribute not as useful as it could be

gcc/ChangeLog:

	PR c/17308
	* builtin-attrs.def (ATTR_NONNULL_1_1, ATTR_NONNULL_1_2): Defined.
	(ATTR_NONNULL_1_3, ATTR_NONNULL_1_4, ATTR_NONNULL_1_5): Same.
	(ATTR_NOTHROW_NONNULL_1_1, ATTR_NOTHROW_NONNULL_1_2): Same.
	(ATTR_NOTHROW_NONNULL_1_3, ATTR_NOTHROW_NONNULL_1_4): Same.
	(ATTR_NOTHROW_NONNULL_1_5): Same.
	(ATTR_NONNULL_1_FORMAT_PRINTF_1_2): Same.
	(ATTR_NONNULL_1_FORMAT_PRINTF_2_0): Same.
	(ATTR_NONNULL_1_FORMAT_PRINTF_2_3): Same.
	(ATTR_NONNULL_1_FORMAT_PRINTF_3_0): Same.
	(ATTR_NONNULL_1_FORMAT_PRINTF_3_4): Same.
	(ATTR_NONNULL_1_FORMAT_PRINTF_4_0): Same.
	(ATTR_NONNULL_1_FORMAT_PRINTF_4_5): Same.
	* builtins.c (validate_arg): Add argument.  Treat null pointers
	passed to nonnull arguments as invalid.
	(validate_arglist): Same.
	* builtins.def (fprintf, fprintf_unlocked): Add nonnull attribute.
	(printf, printf_unlocked, sprintf. vfprintf, vsprintf): Same.
	(__sprintf_chk, __vsprintf_chk, __fprintf_chk, __vfprintf_chk): Same.
	* calls.c (get_nonnull_ags, maybe_warn_null_arg): New functions.
	(initialize_argument_information): Diagnose null pointers passed to
	arguments declared nonnull.
	* calls.h (get_nonnull_args): Declared.

gcc/c-family/ChangeLog:

	PR c/17308
	* c-common.c (check_nonnull_arg): Disable when optimization
	is enabled.

gcc/testsuite/ChangeLog:

	PR c/17308
	* gcc.dg/builtins-nonnull.c: New test.
	* gcc.dg/nonnull-4.c: New test.

From-SVN: r243661
2016-12-14 10:23:16 -07:00
Nathan Sidwell
b4ba085209 re PR c++/78701 (ICE: unexpected expression N of kind template_parm_index)
PR c++/78701
	* pt.c (type_unification_real): Check tsubst arg doesn't have
	remaining template parms before converting it.

	PR c++/78701
	* g++.dg/cpp0x/pr78701.C: New.

From-SVN: r243657
2016-12-14 16:45:33 +00:00
Nathan Sidwell
fa0c02c38c re PR c++/69481 (ICE with C++11 alias using with templates)
PR c++/69481
	* cp-tree.h (TYPE_TEMPLATE_INFO_MAYBE_ALIAS): Always use
	TYPE_ALIAS_TEMPLATE_INFO for aliases.

From-SVN: r243656
2016-12-14 16:43:07 +00:00
Michael Meissner
16370e798c rs6000.c (rs6000_split_vec_extract_var): On ISA 3.0/power9, add support to use the VEXTU{B,H,W}{L,R}X extract instructions.
[gcc]
2016-12-14  Michael Meissner  <meissner@linux.vnet.ibm.com>

	* config/rs6000/rs6000.c (rs6000_split_vec_extract_var): On ISA
	3.0/power9, add support to use the VEXTU{B,H,W}{L,R}X extract
	instructions.
	* config/rs6000/vsx.md (VSr2): Add IEEE 128-bit floating point
	type constraint registers.
	(VSr3): Likewise.
	(FL_CONV): New mode iterator for binary floating types that have a
	direct conversion from 64-bit integer to floating point.
	(vsx_extract_<mode>_p9): Add support for the ISA 3.0/power9
	VEXTU{B,H,W}{L,R}X extract instructions.
	(vsx_extract_<mode>_p9 splitter): Add splitter to load up the
	extract byte position into the GPR if we are using the
	VEXTU{B,H,W}{L,R}X extract instructions.
	(vsx_extract_<mode>_di_p9): Support extracts to GPRs.
	(vsx_extract_<mode>_store_p9): Support extracting to GPRs so that
	we can use reg+offset address instructions.
	(vsx_extract_<mode>_var): Support extracts to GPRs.
	(vsx_extract_<VSX_EXTRACT_I:mode>_<SDI:mode>_var): New combiner
	insn to combine vector extracts with zero_extend.
	(vsx_ext_<VSX_EXTRACT_I:VS_scalar>_fl_<FL_CONV:mode>): Optimize
	extracting a small integer vector element and converting it to a
	floating point type.
	(vsx_ext_<VSX_EXTRACT_I:VS_scalar>_ufl_<FL_CONV:mode>): Likewise.
	(UNSPEC_XXEXTRACTUW): New unspec.
	(UNSPEC_XXINSERTW): Likewise.
	(vextract4b): Add support for the vec_vextract4b built-in
	function.
	(vextract4b_internal): Likewise.
	(vinsert4b): Add support for the vec_insert4b built-in function.
	Include both a version that inserts element 1 from a V4SI object
	and one that inserts a DI object.
	(vinsert4b_internal): Likewise.
	(vinsert4b_di): Likewise.
	(vinsert4b_di_internal): Likewise.
	* config/rs6000/predicates.md (const_0_to_11_operand): New
	predicate, match 0..11.
	* config/rs6000/rs6000-builtin.def (BU_P9V_VSX_3): Set built-in
	type to ternary, not binary.
	(BU_P9V_64BIT_VSX_3): Likewise.
	(P9V_BUILTIN_VEXTRACT4B): Add support for vec_vinsert4b and
	vec_extract4b non-overloaded built-in functions.
	(P9V_BUILTIN_VINSERT4B): Likewise.
	(P9V_BUILTIN_VINSERT4B_DI): Likewise.
	(P9V_BUILTIN_VEC_VEXTULX): Move to section that adds 2 operand ISA
	3.0 built-in functions.
	(P9V_BUILTIN_VEC_VEXTURX): Likewise.
	(P9V_BUILTIN_VEC_VEXTRACT4B): Add support for overloaded
	vec_insert4b and vec_extract4 built-in functions.
	(P9V_BUILTIN_VEC_VINSERT4B): Likewise.
	* config/rs6000/rs6000-c.c (altivec_overloaded_builtins): Add
	overloaded support for vec_vinsert4b and vec_extract4b.
	* config/rs6000/rs6000.c (altivec_expand_builtin): Add checks for
	the vec_insert4b and vec_extract4b byte number being a constant in
	the range 0..11.
	* config/rs6000/altivec.h (vec_vinsert4b): Support vec_vinsert4b
	and vec_extract4b built-in functions.
	* doc/extend.doc (PowerPC VSX built-in functions): Document
	vec_insert4b and vec_extract4b.

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

	* gcc/testsuite/gcc.target/powerpc/vec-extract.h: If DO_TRACE is
	defined, add tracing of the various extracts to stderr.  Add
	support for tests that convert the result to another type.
	* gcc/testsuite/gcc.target/powerpc/vec-extract-v2df.c: Likewise.
	* gcc/testsuite/gcc.target/powerpc/vec-extract-v4sf.c: Likewise.
	* gcc/testsuite/gcc.target/powerpc/vec-extract-v4si-df.c: Add new
	tests that do an extract and then convert the values double.
	* gcc/testsuite/gcc.target/powerpc/vec-extract-v4siu-df.c: Likewise.
	* gcc/testsuite/gcc.target/powerpc/vec-extract-v16qiu-df.c: Likewise.
	* gcc/testsuite/gcc.target/powerpc/vec-extract-v16qi-df.c: Likewise.
	* gcc/testsuite/gcc.target/powerpc/vec-extract-v8hiu-df.c: Likewise.
	* gcc/testsuite/gcc.target/powerpc/vec-extract-v8hi-df.c: Likewise.
	* gcc.target/powerpc/p9-extract-1.c: Update test to check for
	VEXTU{B,H,W}{L,R}X instructions being generated by default instead
	of VEXTRACTU{B,H} and XXEXTRACTUW.
	* gcc.target/powerpc/p9-extract-3.c: New test for combination of
	vec_extract and convert to floating point.
	* gcc.target/powerpc/p9-vinsert4b-1.c: New test for vec_vinsert4b
	and vec_extract4b.
	* gcc.target/powerpc/p9-vinsert4b-2.c: Likewise.

From-SVN: r243653
2016-12-14 16:08:07 +00:00
Jonathan Wakely
d33c00e1ce Make printers use singular noun for a single element
* python/libstdcxx/v6/printers.py (num_elements): New function.
	(StdMapPrinter.to_string, StdSetPrinter.to_string)
	(StdDequePrinter.to_string, Tr1UnorderedSetPrinter.to_string)
	(Tr1UnorderedMapPrinter.to_string): Use num_elements.
	* testsuite/libstdc++-prettyprinters/cxx11.cc: Adjust expected results
	to use singular noun when there is only one element.
	* testsuite/libstdc++-prettyprinters/debug.cc: Likewise.
	* testsuite/libstdc++-prettyprinters/debug_cxx11.cc: Likewise.
	* testsuite/libstdc++-prettyprinters/simple.cc: Likewise.
	* testsuite/libstdc++-prettyprinters/simple11.cc: Likewise.
	* testsuite/libstdc++-prettyprinters/tr1.cc: Likewise.

From-SVN: r243652
2016-12-14 16:07:29 +00:00
Jonathan Wakely
3c760f4a79 Make printers detect invalid debug mode iterators
PR libstdc++/59170
	* python/libstdcxx/v6/printers.py (StdDebugIteratorPrinter): Use
	_M_sequence and _M_version to detect invalid iterators.
	* testsuite/libstdc++-prettyprinters/debug.cc: Test debug mode vector
	and test invalid iterators.
	* testsuite/libstdc++-prettyprinters/debug_cxx11.cc: New test.

From-SVN: r243650
2016-12-14 15:17:57 +00:00
Toma Tabacu
54601417ce MIPS: Remove redundant dg-skip-if from mips16-attributes.c.
gcc/testsuite

	* gcc.target/mips/mips16-attributes.c: Remove dg-skip-if for
	-mmicromips.

From-SVN: r243649
2016-12-14 14:44:14 +00:00
Andre Vehreschild
8c92e4522d re PR fortran/78780 ([Coarray] ICE in conv_caf_send, at fortran/trans-intrinsic.c:1936)
gcc/testsuite/ChangeLog:

2016-12-14  Andre Vehreschild  <vehre@gcc.gnu.org>

	PR fortran/78780
	* gfortran.dg/coarray/alloc_comp_5.f90: New test.
	* gfortran.dg/coarray_42.f90: New test.


gcc/fortran/ChangeLog:

2016-12-14  Andre Vehreschild  <vehre@gcc.gnu.org>

	PR fortran/78780
	* trans-expr.c (gfc_trans_assignment_1): Improve check whether detour
	caf-runtime routines is needed.

From-SVN: r243648
2016-12-14 13:49:45 +01:00
Andre Vehreschild
eb401400f5 re PR fortran/78672 (Gfortran test suite failures with a sanitized compiler)
gcc/fortran/ChangeLog:

2016-12-14  Andre Vehreschild  <vehre@gcc.gnu.org>

	PR fortran/78672
	* array.c (gfc_find_array_ref): Add flag to return NULL when no ref is
	found instead of erroring out.
	* data.c (gfc_assign_data_value): Only constant expressions are valid
	for initializers.
	* gfortran.h: Reflect change of gfc_find_array_ref's signature.
	* interface.c (compare_actual_formal): Access the non-elemental
	array-ref.  Prevent taking a REF_COMPONENT for a REF_ARRAY.  Correct
	indentation.
	* module.c (load_omp_udrs): Clear typespec before reading into it.
	* trans-decl.c (gfc_build_qualified_array): Prevent accessing the array
	when it is a coarray.
	* trans-expr.c (gfc_conv_cst_int_power): Use wi::abs()-function instead
	of crutch preventing sanitizer's bickering here.
	* trans-stmt.c (gfc_trans_deallocate): Only get data-component when it
	is a descriptor-array here.

From-SVN: r243647
2016-12-14 12:52:09 +01:00
Jakub Jelinek
e397febfb8 re PR target/78796 (TLS fails to link on aarch64 with -mcmodel=large)
PR target/78796
	* gcc.dg/tls/pr78796.c: New test.

From-SVN: r243645
2016-12-14 11:39:36 +01:00
Richard Biener
007e18eb1f re PR tree-optimization/78731 (Possible bug with switch when optimization is turned on.)
2016-12-14  Richard Biener  <rguenther@suse.de>

	PR tree-optimization/78731
	* gcc.dg/torture/pr78731.c: New testcase.

From-SVN: r243644
2016-12-14 10:35:11 +00:00
Martin Liska
e19ef86d01 Print 2 digits after decimal delimiter for BB frequencies
* gimple-pretty-print.c (dump_probability): New function.
	(dump_edge_probability): Use the function.
	(dump_gimple_label): Likewise.
	(dump_gimple_bb_header): Likewise.
	* gcc.dg/tree-ssa/20040703-1.c: Update scanned pattern.
	* gcc.dg/tree-ssa/dump-2.c: Likewise.

From-SVN: r243643
2016-12-14 10:33:10 +00:00
Martin Liska
ca3b607159 Enhance analyze_brprob script
* analyze_brprob.py: Add new column to output and new sorting
	option. Fix coding style to not exceed 80 characters.
	* analyze_brprob_spec.py: Add new sorting
	option. Fix coding style to not exceed 80 characters.

From-SVN: r243640
2016-12-14 10:30:24 +00:00
Toma Tabacu
998f4f30ea MIPS: Force assembly output for msa-builtins-err.c.
gcc/testsuite

	* gcc.target/mips/msa-builtins-err.c (dg-options): Add 
	-ffat-lto-objects option.

From-SVN: r243639
2016-12-14 10:19:01 +00:00
Prathamesh Kulkarni
3b1970cb3c tree-ssa-strlen.c (fold_strstr_to_memcmp): New function.
2016-12-14  Prathamesh Kulkarni  <prathamesh.kulkarni@linaro.org>
	    Jakub Jelinek  <jakub@redhat.com>

	* tree-ssa-strlen.c (fold_strstr_to_memcmp): New function.
	(strlen_optimize_stmt): Call fold_strstr_to_memcmp.

testsuite/
	* gcc.dg/strlenopt-30.c: New test-case.

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

From-SVN: r243633
2016-12-14 09:10:31 +00:00
Eric Botcazou
164f063463 lra-constraints.c (process_address_1): Do not attempt to decompose addresses for MEMs that satisfy fixed-form constraints.
* lra-constraints.c (process_address_1): Do not attempt to decompose
	addresses for MEMs that satisfy fixed-form constraints.

From-SVN: r243632
2016-12-14 08:34:15 +00:00
Richard Biener
253c0172bb re PR tree-optimization/78788 (ICE (segfault) on s390x-linux-gnu)
2016-12-14  Richard Biener  <rguenther@suse.de>

	PR tree-optimization/78788
	* tree-vrp.c (set_value_range): Allow [-INF(OVF), +INF(OVF)].
	(set_and_canonicalize_value_range): Do not drop the above to
	VARYING.

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

From-SVN: r243631
2016-12-14 08:33:12 +00:00
GCC Administrator
803312a760 Daily bump.
From-SVN: r243629
2016-12-14 00:16:15 +00:00
Nathan Sidwell
5bfd81e715 re PR c++/69481 (ICE with C++11 alias using with templates)
cp/
	PR c++/69481
	* cp-tree.h (TYPE_TEMPLATE_INFO): Remove alias type checking.
	(TYPE_ALIAS_TEMPLATE_INFO): New.
	(TYPE_TEMPLATE_INFO_MAYBE_ALIAS): New.  Use those macros.
	* error.c (dump_alias_template_specialization): Adjust.
	* pt.c (maybe_process_partial_specialization)
	iterative_has_template_arg, find_parameter_packs_r,
	alias_template_specialization_p, dependent_alias_template_spec_p,
	get_underlying_template, lookup_template_class_1, unify): Adjust
	template using decl access.

	testsuite/
	PR c++/69481
	* g++.dg/cpp0x/pr69481.C: New.
(--This line, and those below, will be ignored--

M    gcc/testsuite/ChangeLog
A    gcc/testsuite/g++.dg/cpp0x/pr69481.C
M    gcc/cp/cp-tree.h
M    gcc/cp/error.c
M    gcc/cp/ChangeLog
M    gcc/cp/pt.c

From-SVN: r243624
2016-12-13 20:43:08 +00:00
Bill Schmidt
2de1796a6b rs600.c (rs6000_builtin_vectorization_cost): Adjust unaligned load cost.
2016-12-13  Bill Schmidt  <wschmidt@linux.vnet.ibm.com>

	* config/rs6000/rs600.c (rs6000_builtin_vectorization_cost):
	Adjust unaligned load cost.

From-SVN: r243623
2016-12-13 20:05:10 +00:00
Janus Weil
7a28353e36 re PR fortran/78798 ([cleanup] some int-valued functions should be bool)
2016-12-13  Janus Weil  <janus@gcc.gnu.org>

	PR fortran/78798
	* gfortran.h (gfc_is_constant_expr, gfc_is_formal_arg,
	gfc_is_compile_time_shape): Return bool instead of int.
	* array.c (gfc_is_compile_time_shape): Ditto.
	* expr.c (gfc_is_constant_expr): Ditto.
	* resolve.c (gfc_is_formal_arg): Ditto. Make formal_arg_flag bool.

From-SVN: r243621
2016-12-13 19:55:20 +01:00
Ian Lance Taylor
c3c54e0f07 libgo: fixes for Solaris build
Don't put m[0-4] in runtime.inc.
    
    Pass -mclear-hwcap to the linker if supported.
    
    From Rainer Orth.
    
    Reviewed-on: https://go-review.googlesource.com/34331

From-SVN: r243619
2016-12-13 18:03:45 +00:00
Uros Bizjak
80e66af3c8 re PR target/78794 (We noticed ~9% regression in 32-bit mode for 462.libquntum on Avoton after r243202)
PR target/78794
	* config/i386/i386.c (dimode_scalar_chain::compute_convert_gain):
	Calculate additional gain for andnot for targets without BMI.

testsuite/ChangeLog:

	PR target/78794
	* gcc.target/i386/pr78794.c: New test.

From-SVN: r243615
2016-12-13 18:15:35 +01:00
Andre Vehreschild
6479f45b31 re PR fortran/77785 ([Coarray] ICE in gfc_get_caf_token_offset, at fortran/trans-expr.c:1990)
gcc/fortran/ChangeLog:

2016-12-13  Andre Vehreschild  <vehre@gcc.gnu.org>

	PR fortran/77785
	* resolve.c (resolve_symbol): Correct attr lookup to the _data
	component.
	* trans-array.c (gfc_alloc_allocatable_for_assignment): Indirect ref
	pointers and references before retrieving the caf-token.

gcc/testsuite/ChangeLog:

2016-12-13  Andre Vehreschild  <vehre@gcc.gnu.org>

	PR fortran/77785
	* gfortran.dg/coarray_38.f90: Added expecting error message.
	* gfortran.dg/coarray_41.f90: New test.
	* gfortran.dg/coarray_class_2.f90: New test.

From-SVN: r243614
2016-12-13 17:47:48 +01:00
Carl Love
b37a5b979a rs6000-c.c: Add built-in support for vector float vec_pack (vector double...
gcc/ChangeLog:

2016-12-13  Carl Love  <cel@us.ibm.com>

   * config/rs6000/rs6000-c.c: Add built-in support for
   vector float vec_pack (vector double, vector double)
   vector double vec_sld (vector double, vector double)
   * config/rs6000/rs6000.c: Add icode check for vsldoi_v2df to allow
   4-bit unsigned literal.
   * config/rs6000/rs6000-builtin.def: Add definition for VSLDOI_2DF
   * doc/extend.texi: Update the built-in documentation file for the
   new powerpc vec_pack and vec_sld built-ins.

gcc/testsuite/ChangeLog:

2016-12-13 Carl Love  <cel@us.ibm.com>

	* gcc.target/powerpc/builtins-3.c: Add new test of the test suite
	file.
	* gcc.target/powerpc/builtins-3-p8.c: Add new test of the test suite
	file.

From-SVN: r243612
2016-12-13 16:18:36 +00:00
Martin Liska
2f75d6ebf8 Add sanopt for ASAN_MARK poison and unpoison.
* sanopt.c (sanopt_optimize_walker): Set contains_asan_mark.
	(sanopt_optimize): Add new argument.
	(sanitize_asan_mark_unpoison): New function.
	(maybe_contains_asan_check): Likewise.
	(sanitize_asan_mark_poison): Likewise.
	(pass_sanopt::execute): Call the new functions.

From-SVN: r243611
2016-12-13 15:35:14 +00:00
Martin Liska
437df9f9d1 Fill bitregion_{start,end} in store_constructor (PR tree-optimization/78428)
* expr.c (store_constructor_field): Add new arguments to the
	function.
	(store_constructor): Set up bitregion_end and add
	gcc_unreachable to fields that have either non-constant size
	or (and) offset.
	* gcc.dg/tree-ssa/pr78428.c: New test.

From-SVN: r243610
2016-12-13 15:26:14 +00:00
Janus Weil
e4e659b947 re PR fortran/78737 ([OOP] linking error with deferred, undefined user-defined derived-type I/O)
2016-12-13  Janus Weil  <janus@gcc.gnu.org>
	    Paul Thomas  <pault@gcc.gnu.org>

	PR fortran/78737
	* gfortran.h (gfc_find_typebound_dtio_proc): New prototype.
	* interface.c (gfc_compare_interfaces): Whitespace fix.
	(gfc_find_typebound_dtio_proc): New function.
	(gfc_find_specific_dtio_proc): Use it. Improve error recovery.
	* trans-io.c (get_dtio_proc): Implement polymorphic calls to DTIO
	procedures.

2016-12-13  Janus Weil  <janus@gcc.gnu.org>
	    Paul Thomas  <pault@gcc.gnu.org>

	PR fortran/78737
	* gfortran.dg/dtio_19.f90: New test case.

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

From-SVN: r243609
2016-12-13 15:28:17 +01:00
Marek Polacek
68a08b7792 tree-data-ref.c (compute_overlap_steps_for_affine_univar): Change parameters' type from int to HOST_WIDE_INT.
* tree-data-ref.c (compute_overlap_steps_for_affine_univar): Change
	parameters' type from int to HOST_WIDE_INT.
	(compute_overlap_steps_for_affine_1_2): Change parameters' type from
	int to HOST_WIDE_INT.
	(build_classic_dist_vector_1): Likewise.
	(add_multivariate_self_dist): Likewise.

From-SVN: r243607
2016-12-13 14:19:12 +00:00
Michael Matz
9042295c44 Fix pr78725
PR tree-optimization/78725
	* tree-ssa-loop-split.c (split_at_bb_p): Check for overflow and
	at correct use point.

testsuite/
	PR tree-optimization/78725
	* gcc.dg/pr78725.c: New test.
	* gcc.dg/pr78725-2.c: New test.

From-SVN: r243606
2016-12-13 14:14:41 +00:00
Martin Liska
5594a028fe Rename BUILT_IN_ASAN_CLOBBER_N to
* asan.c (asan_expand_mark_ifn): Use renamed
	BUILT_IN_ASAN_{UN}CLOBBER_N to BUILT_IN_ASAN_{UN}POISON_STACK_MEMORY.
	* sanitizer.def: Likewise.

From-SVN: r243605
2016-12-13 13:33:35 +00:00
James Greenhalgh
3ffead7761 [Patch Doc] Update documentation for __fp16 type
gcc/

	* doc/extend.texi (Half-Precision): Update to document current
	compiler behaviour.

From-SVN: r243602
2016-12-13 10:43:02 +00:00
James Greenhalgh
87d5619ead [Patch doc] Document _Float16 availability on ARM/AArch64
gcc/

	* doc/extend.texi (Floating Types): Document availability of
	_Float16 on ARM/AArch64.

From-SVN: r243601
2016-12-13 10:40:32 +00:00
Richard Biener
30fec2f9bf re PR tree-optimization/78699 (ICE (segfault) on powerpc64le-linux-gnu (memory-hog))
2016-12-13  Richard Biener  <rguenther@suse.de>

	PR tree-optimization/78699
	* tree-vect-data-refs.c (vect_analyze_group_access_1): Limit
	group size.

From-SVN: r243599
2016-12-13 09:19:19 +00:00
Richard Biener
6182121c12 re PR tree-optimization/78742 (internal compiler error: in int_cst_value, at tree.c:10782)
2016-12-13  Richard Biener  <rguenther@suse.de>

	PR middle-end/78742
	* tree.c (cst_and_fits_in_hwi): Look if the actual value fits.
	* tree-object-size.c (compute_builtin_object_size): Use
	tree_fits_shwi_p.
	* tree-data-ref.c (initialize_matrix_A): Remove excess assert.

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

From-SVN: r243598
2016-12-13 09:17:42 +00:00
Martin Liska
56b7aede91 Add pretty printer for ASAN_MARK and add a helper fn
* asan.c (asan_mark_poison_p): Remove.
	(asan_mark_p): New function.
	(transform_statements): Use the function.
	(asan_expand_mark_ifn): Do not use masked enum.
	* asan.h (enum asan_mark_flags): Declare it via a macro.
	* gimple-pretty-print.c (dump_gimple_call_args): Dump first
	argument of ASAN_MARK.
	* gimplify.c (build_asan_poison_call_expr): Use new enum values.
	(asan_poison_variable): Likewise.
	* gcc.dg/asan/use-after-scope-goto-1.c: Update first argument of
	scanned pattern ASAN_MARK.
	* gcc.dg/asan/use-after-scope-goto-2.c: Likewise.
	* gcc.dg/asan/use-after-scope-switch-1.c: Likewise.
	* gcc.dg/asan/use-after-scope-switch-2.c: Likewise.
	* gcc.dg/asan/use-after-scope-switch-3.c: Likewise.

From-SVN: r243597
2016-12-13 09:14:47 +00:00
Jakub Jelinek
cd6d518b29 re PR ipa/77905 (ICE at -Os and above in both 32-bit and 64-bit modes on x86_64-linux-gnu (internal compiler error: in ipa_comdats, at ipa-comdats.c:352))
PR ipa/77905
	* ipa-pure-const.c (cdtor_p): Return true for
	DECL_STATIC_{CON,DE}STRUCTOR even when it is
	DECL_LOOPING_CONST_OR_PURE_P.

	* g++.dg/ipa/pr77905.C: New test.

From-SVN: r243596
2016-12-13 09:48:45 +01:00
Jakub Jelinek
816f431440 re PR c++/78761 (C++14, compiler generate mangled name that can not be demangled)
PR c++/78761
	* cp-demangle.c (cplus_demangle_type): Demangle Dc as decltype(auto).
	* testsuite/demangle-expected: Add test for decltype(auto).

From-SVN: r243593
2016-12-13 07:16:05 +01:00
GCC Administrator
4de3788411 Daily bump.
From-SVN: r243588
2016-12-13 00:16:23 +00:00
Jakub Jelinek
1697df8c99 re PR tree-optimization/78777 (ICE in mark_reachable_handlers, at tree-eh.c:3823 (aarch64-linux-gnu))
PR tree-optimization/78777
	* gimple-ssa-strength-reduction.c (create_add_on_incoming_edge,
	insert_initializers): Use stmt_ends_bb_p instead of is_ctrl_stmt.

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

From-SVN: r243584
2016-12-12 23:02:52 +01:00
Jakub Jelinek
27ec22668f re PR other/78766 (GCC Awk scripts use the non-POSIX /^{/ regex)
PR other/78766
	* opt-functions.awk (opt_args): Use [{] instead of { in regexps.
	Formatting fix.

From-SVN: r243583
2016-12-12 23:01:41 +01:00
Martin Sebor
573aa7d4b7 PR middle-end/78622 - -Wformat-length/-fprintf-return-value incorrect with overflow/wrapping
gcc/ChangeLog:

	PR middle-end/78622
	PR middle-end78606
	* gimple-ssa-sprintf.c (min_bytes_remaining): Use res.knownrange
	rather than res.bounded.
	(get_width_and_precision): Set precision to -1 when negative.
	(adjust_range_for_overflow): New function.
	(format_integer): Correct the handling of the space, plus, and pound
	flags, and the special case of zero precision.
	Always set res.bounded to true unless either precision or width
	is specified and unknown.
	Call adjust_range_for_overflow.
	Avoid use zero as the shortest value when precision is specified
	but unknown.
	(format_directive): Remove vestigial quoting.  Always inform of
	argument value or range when it's available.
	(add_bytes): Correct the computation of boundrange used to
	decide whether a warning is of a "maybe" or "defnitely" kind.

gcc/testsuite/ChangeLog:

	PR middle-end/78622
	PR middle-end78606
	* gcc.c-torture/execute/pr78622.c: New test.
	* gcc.dg/tree-ssa/builtin-sprintf-2.c: Remove "benign" undefined
	behavior inadvertently introduced in a previous commit.  Tighten
	up final checking.
	* gcc.dg/tree-ssa/builtin-sprintf-5.c: Rename macros for clarity.
	Add test cases.
	* gcc.dg/tree-ssa/builtin-sprintf-6.c: Add test cases.
	* gcc.dg/tree-ssa/builtin-sprintf-warn-1.c: Same.
	* gcc.dg/tree-ssa/builtin-sprintf-warn-2.c: Same.
	* gcc.dg/tree-ssa/builtin-sprintf-warn-3.c: Same.
	* gcc.dg/tree-ssa/builtin-sprintf-warn-5.c: Same.
	* gcc.dg/tree-ssa/builtin-sprintf-warn-6.c: Remove xfails and
	add a final optimization check.
	* gcc.dg/tree-ssa/builtin-sprintf.c: Add test cases.
	* gcc.dg/tree-ssa/pr78622.c: New test.

From-SVN: r243582
2016-12-12 14:56:22 -07:00
Janus Weil
068b961b6a re PR fortran/78392 (ICE in gfc_trans_auto_array_allocation, at fortran/trans-array.c:5979)
2016-12-12  Janus Weil  <janus@gcc.gnu.org>

	PR fortran/78392
	* expr.c (gfc_is_constant_expr): Specification functions are not
	compile-time constants. Update documentation (add reference to F08
	standard), add a FIXME.
	(external_spec_function): Add reference to F08 standard.
	* resolve.c (resolve_fl_variable): Ditto.

2016-12-12  Janus Weil  <janus@gcc.gnu.org>

	PR fortran/78392
	* gfortran.dg/constant_shape.f90: New test case.

From-SVN: r243580
2016-12-12 19:54:54 +01:00
Dominik Vogt
e4d6040625 combine: Handle mode expanding zero_extracts in change_zero_ext.
Example:

  (zero_extract:DI (reg:SI)
                   (const_int 24)
                   (const_int 0))

-->

  (and:DI (subreg:DI (lshiftrt:SI (reg:SI) (const_int 8))
                     0)
          (const_int 16777215))


2016-12-12  Dominik Vogt  <vogt@linux.vnet.ibm.com>

	* combine.c (change_zero_ext): Handle mode expanding zero_extracts.

From-SVN: r243578
2016-12-12 19:23:48 +01:00
Marek Polacek
fe366b8715 re PR c++/78647 (ICE on invalid C++ code on x86_64-linux-gnu (internal compiler error: tree check: expected tree_list, have error_mark in get_attribute_name, at attribs.c:664))
PR c++/78647
	* c-common.c (attribute_fallthrough_p): Return false for
	error_mark_node.

	* g++.dg/parse/error58.C: New.

From-SVN: r243575
2016-12-12 17:58:00 +00:00
David Malcolm
470a60b2c4 re PR preprocessor/78680 (ICE in get_substring_ranges_for_loc, at input.c:1398)
Fix for PR preprocessor/78680

PR preprocessor/78680 identifies a crash when attempting to issue
a -Wformat warning, where the format string includes a string token
split across multiple physical source lines via backslash-continued
lines.

The issue is that libcpp is generating bogus range information for
such tokens.

For example, in:

void fn1() {
  __builtin_printf("\
     %ld.\n\
        2\n"); };

the range of the string token is printed as:

   __builtin_printf("\
                    ^~

whereas the range ought to be:

  __builtin_printf("\
                   ^~
     %ld.\n\
     ~~~~~~~
        2\n"); };
        ~~~~

The root cause is that the line notes expressing the update
of the buffer in lex.c aren't yet updated when the end-point of
the token is computed

3095	    tok_range.m_finish
3096	      = linemap_position_for_column (pfile->line_table,
3097					     CPP_BUF_COLUMN (buffer, buffer->cur));

so that the physical line is still regarded as that of the start
of the token, and, where CPP_BUF_COLUMN uses (BUF)->line_base,
line_base is still the location of the first physical line in the
and hence the column information is too large (as if it were the
offset in the *logical* line).

(the printed range is somewhat misleading; the actual buggy range
extends beyond the "\ in the line, but within diagnostic-show-locus.c
layout::print_annotation_line only prints up to the xbound set by
layout::print_source_line and so truncates most of the buggy range).

The fix is to ensure that line notes are handled before calculating
the end-point of the token range.

This leads to the range for the string token being correctly
computed, as:

  __builtin_printf("\
                   ^~
     %ld.\n\
     ~~~~~~~
        2\n"); };
        ~~~~

and this leads to get_substring_ranges_for_loc failing gracefully,
rather than crashing.

gcc/testsuite/ChangeLog:
	PR preprocessor/78680
	* gcc.dg/format/pr78680.c: New test case.
	* gcc.dg/plugin/diagnostic-test-expressions-1.c
	(test_multiline_token): New function.
	* gcc.dg/plugin/diagnostic-test-string-literals-1.c
	(test_backslash_continued_logical_lines): New function.

libcpp/ChangeLog:
	PR preprocessor/78680
	* lex.c (_cpp_lex_direct): Ensure line notes are processed before
	computing the end-point of the token.

From-SVN: r243567
2016-12-12 17:37:48 +00:00
Nathan Sidwell
8e09a726e6 re PR other/78252 (C++ demangler crashes with infinite recursion with lambda (auto))
libiberty/
	PR c++/78252
	* cp-demangle.c (struct d_print_info): Add is_lambda_arg field.
	(d_print_init): Initialize it.
	(d_print_comp_inner) <DEMANGLE_COMPONENT_TEMPLATE_PARAM>: Check
	is_lambda_arg for auto.
	<DEMANGLE_COMPONENT_REFERENCE,
	DEMANGLE_COMPONENT_RVALUE_REFERENCE>: Skip smashing check when
	is_lambda_arg.
	<DEMANGLE_COMPONENT_LAMBDA>: Increment is_lambda_arg around arg
	printing.
	* testsuite/demangle-expected: Add lambda auto mangling cases.

	gcc/testsuite/
	PR c++/78252
	* g++.dg/cpp1y/lambda-mangle-1.C: New.

From-SVN: r243566
2016-12-12 17:00:37 +00:00