Commit Graph

148438 Commits

Author SHA1 Message Date
Jonathan Wakely
6fdc74c91b Update pretty printer for std::variant
* python/libstdcxx/v6/printers.py (StdVariantPrinter): Adjust for
	recent change to _Variant_storage.
	* testsuite/libstdc++-prettyprinters/cxx17.cc: Test variant with
	reference type.

From-SVN: r240345
2016-09-22 11:06:41 +01:00
Jonathan Wakely
64626fcaaa Always qualify std::forward in <variant>
* include/bits/uses_allocator.h (__uses_allocator_construct): Qualify
	std::forward and ::new. Cast pointer to void*.
	* include/std/variant (_Variant_storage, _Union, _Variant_base)
	(__access, __visit_invoke, variant, visit): Qualify std::forward.
	* testsuite/20_util/variant/compile.cc: Test for ADL problems.

From-SVN: r240344
2016-09-22 10:56:54 +01:00
Tim Shen
c42bc5d73b variant (variant::operator=): Fix assignment on references.
* libstdc++-v3/include/std/variant (variant::operator=): Fix assignment
	on references.
	* libstdc++-v3/testsuite/20_util/variant/compile.cc: Add test.

From-SVN: r240343
2016-09-22 08:45:55 +00:00
Paul Thomas
a8de3002f1 interface.c (check_dtio_interface1): Introduce errors for alternate returns and incorrect numbers of arguments.
2016-09-22  Paul Thomas  <pault@gcc.gnu.org>

	* interface.c (check_dtio_interface1): Introduce errors for
	alternate returns and incorrect numbers of arguments.
	(gfc_find_specific_dtio_proc): Return cleanly if the derived
	type either doesn't exist or has no namespace.

2016-09-22  Paul Thomas  <pault@gcc.gnu.org>

	* gfortran.dg/dtio_11.f90: Correct for changed error messages.
	* gfortran.dg/dtio_13.f90: New test.

From-SVN: r240342
2016-09-22 07:46:07 +00:00
Louis Krupp
39abef62a1 re PR fortran/66107 (ICE on missing parameter value for initialisation (segfault))
2016-09-21  Louis Krupp  <louis.krupp@zoho.com>

	PR fortran/66107
	* gfortran.dg/pr66107.f90: New test.

2016-09-21  Louis Krupp  <louis.krupp@zoho.com>

	PR fortran/66107
	* decl.c (add_init_expr_to_sym): Catch variable character length
	in parameter array.

From-SVN: r240341
2016-09-22 07:07:53 +00:00
Tim Shen
41501d1ae7 re PR libstdc++/77641 (std::variant copy-initialization fails for type with non-trivial constexpr ctor)
PR libstdc++/77641
	* include/std/variant (_Variant_storage::_Variant_storage):
	Change _Variant_storage's union to be default constructible.
	* testsuite/20_util/variant/compile.cc: New test.

From-SVN: r240340
2016-09-22 03:15:58 +00:00
GCC Administrator
77d7987a0c Daily bump.
From-SVN: r240339
2016-09-22 00:16:15 +00:00
Michael Meissner
ff4bb3b552 re PR target/77670 (PowerPC64 Spec 2006 fails on 453.povray using -mcpu=power9 -mpower9-minmax)
2016-09-21  Michael Meissner  <meissner@linux.vnet.ibm.com>

	PR target/77670
	* config/rs6000/predicates.md (invert_fpmask_comparison_operator):
	New predicate that matches the ISA 3.0 XSCMP{EQ,GT,GE}DP
	instructions when you want to invert the test.
	* config/rs6000/rs6000.md (fpmask<mode>): Use the arguments in the
	correct order for XXSEL.
	(mov<SFDF:mode><SFDF2:mode>cc_invert_p9): Define the inverted test
	for using XSCMP{EQ,GT,GE}DP.

From-SVN: r240336
2016-09-21 22:12:13 +00:00
Michael Meissner
72d1c8dd83 re PR target/77670 (PowerPC64 Spec 2006 fails on 453.povray using -mcpu=power9 -mpower9-minmax)
2016-09-21  Michael Meissner  <meissner@linux.vnet.ibm.com>

	PR target/77670
	* config/rs6000/predicates.md (invert_fpmask_comparison_operator):
	New predicate that matches the ISA 3.0 XSCMP{EQ,GT,GE}DP
	instructions when you want to invert the test.
	* config/rs6000/rs6000.md (fpmask<mode>): Use the arguments in the
	correct order for XXSEL.
	(mov<SFDF:mode><SFDF2:mode>cc_invert_p9): Define the inverted test
	for using XSCMP{EQ,GT,GE}DP.

From-SVN: r240335
2016-09-21 22:11:42 +00:00
Ian Lance Taylor
4a2bb7fcb0 compiler, runtime: replace hashmap code with Go 1.7 hashmap
This change removes the gccgo-specific hashmap code and replaces it with
    the hashmap code from the Go 1.7 runtime.  The Go 1.7 hashmap code is
    more efficient, does a better job on details like when to update a key,
    and provides some support against denial-of-service attacks.
    
    The compiler is changed to call the new hashmap functions instead of the
    old ones.
    
    The compiler now tracks which types are reflexive and which require
    updating when used as a map key, and records the information in map type
    descriptors.
    
    Map_index_expression is simplified.  The special case for a map index on
    the right hand side of a tuple expression has been unnecessary for some
    time, and is removed.  The support for specially marking a map index as
    an lvalue is removed, in favor of lowering an assignment to a map index
    into a function call.  The long-obsolete support for a map index of a
    pointer to a map is removed.
    
    The __go_new_map_big function (known to the compiler as
    Runtime::MAKEMAPBIG) is no longer needed, as the new runtime.makemap
    function takes an int64 hint argument.
    
    The old map descriptor type and supporting expression is removed.
    
    The compiler was still supporting the long-obsolete syntax `m[k] = 0,
    false` to delete a value from a map.  That is now removed, requiring a
    change to one of the gccgo-specific tests.
    
    The builtin len function applied to a map or channel p is now compiled
    as `p == nil ? 0 : *(*int)(p)`.  The __go_chan_len function (known to
    the compiler as Runtime::CHAN_LEN) is removed.
    
    Support for a shared zero value for maps to large value types is
    introduced, along the lines of the gc compiler.  The zero value is
    handled as a common variable.
    
    The hash function is changed to take a seed argument, changing the
    runtime hash functions and the compiler-generated hash functions.
    Unlike the gc compiler, both the hash and equal functions continue to
    take the type length.
    
    Types that can not be compared now store nil for the hash and equal
    functions, rather than pointing to functions that throw.  Interface hash
    and comparison functions now check explicitly for nil.  This matches the
    gc compiler and permits a simple implementation for ismapkey.
    
    The compiler is changed to permit marking struct and array types as
    incomparable, meaning that they have no hash or equal function.  We use
    this for thunk types, removing the existing special code to avoid
    generating hash/equal functions for them.
    
    The C runtime code adds memclr, memequal, and memmove functions.
    
    The hashmap code uses go:linkname comments to make the functions
    visible, as otherwise the compiler would discard them.
    
    The hashmap code comments out the unused reference to the address of the
    first parameter in the race code, as otherwise the compiler thinks that
    the parameter escapes and copies it onto the heap.  This is probably not
    needed when we enable escape analysis.
    
    Several runtime map tests that ere previously skipped for gccgo are now
    run.
    
    The Go runtime picks up type kind information and stubs.  The type kind
    information causes the generated runtime header file to define some
    constants, including `empty`, and the C code is adjusted accordingly.
    
    A Go-callable version of runtime.throw, that takes a Go string, is
    added to be called from the hashmap code.
    
    Reviewed-on: https://go-review.googlesource.com/29447

	* go.go-torture/execute/map-1.go: Replace old map deletion syntax
	with call to builtin delete function.

From-SVN: r240334
2016-09-21 20:58:51 +00:00
David Malcolm
812b1403a8 Introduce class rtx_reader
Bundle up various global variables within gensupport.c into a
class rtx_reader, with a view towards making it easier to run the
code more than once in-process.

gcc/ChangeLog:
	* genconstants.c (main): Introduce noop_reader and convert call
	to read_md_files to a method call.
	* genenums.c (main): Likewise.
	* genmddeps.c (main): Likewise.
	* genpreds.c (write_tm_constrs_h): Replace use of "in_fname" with
	rtx_reader_ptr->get_top_level_filename ().
	(write_tm_preds_h): Likewise.
	(write_insn_preds_c): Likewise.
	* gensupport.c (class gen_reader): New subclass of rtx_reader.
	(rtx_handle_directive): Convert to...
	(gen_reader::handle_unknown_directive): ...this.
	(init_rtx_reader_args_cb): Convert return type from bool to
	rtx_reader *.  Create a gen_reader instance, using it for the
	call to read_md_files.  Return it if no errors occur.
	(init_rtx_reader_args): Convert return type from bool to
	rtx_reader *.
	* gensupport.h (init_rtx_reader_args_cb): Likewise.
	(init_rtx_reader_args_cb): Likewise.
	* read-md.c (struct file_name_list): Move to class rtx_reader.
	(read_md_file): Delete in favor of rtx_reader::m_read_md_file.
	(read_md_filename): Delete in favor of
	rtx_reader::m_read_md_filename.
	(read_md_lineno): Delete in favor of rtx_reader::m_read_md_lineno.
	(in_fname): Delete in favor of rtx_reader::m_toplevel_fname.
	(base_dir): Delete in favor of rtx_reader::m_base_dir.
	(first_dir_md_include): Delete in favor of
	rtx_reader::m_first_dir_md_include.
	(last_dir_md_include_ptr): Delete in favor of
	rtx_reader::m_last_dir_md_include_ptr.
	(max_include_len): Delete.
	(rtx_reader_ptr): New.
	(fatal_with_file_and_line): Use get_filename and get_lineno
	accessors of rtx_reader_ptr.
	(require_char_ws): Likewise.
	(rtx_reader::read_char): New method, based on ::read_char.
	(rtx_reader::unread_char): New method, based on ::unread_char.
	(read_escape): Use get_filename and get_lineno accessors of
	rtx_reader_ptr.
	(read_braced_string): Use get_lineno accessor of rtx_reader_ptr.
	(read_string): Use get_filename and get_lineno accessors of
	rtx_reader_ptr.
	(rtx_reader::rtx_reader): New ctor.
	(rtx_reader::~rtx_reader): New dtor.
	(handle_include): Convert from a function to...
	(rtx_reader::handle_include): ...this method, converting
	handle_directive from a callback to a virtual function.
	(handle_file): Likewise, converting to...
	(rtx_reader::handle_file): ...this method.
	(handle_toplevel_file): Likewise, converting to...
	(rtx_reader::handle_toplevel_file): ...this method.
	(rtx_reader::get_current_location): New method.
	(parse_include): Convert from a function to...
	(rtx_reader::add_include_path): ...this method, dropping redundant
	update to unused max_include_len.
	(read_md_files): Convert from a function to...
	(rtx_reader::read_md_files): ...this method, converting
	handle_directive from a callback to a virtual function.
	(noop_reader::handle_unknown_directive): New method.
	* read-md.h (directive_handler_t): Delete this typedef.
	(in_fname): Delete.
	(read_md_file): Delete.
	(read_md_lineno): Delete.
	(read_md_filename): Delete.
	(class rtx_reader): New class.
	(rtx_reader_ptr): New decl.
	(class noop_reader): New subclass of rtx_reader.
	(read_char): Reimplement in terms of rtx_reader::read_char.
	(unread_char): Reimplement in terms of rtx_reader::unread_char.
	(read_md_files): Delete.
	* read-rtl.c (read_rtx_code): Update for deletion of globals
	read_md_filename and read_md_lineno.

From-SVN: r240333
2016-09-21 20:55:06 +00:00
Michael Meissner
0d7154371d Add PR target/71395 marker to 71395 fix
From-SVN: r240332
2016-09-21 20:17:32 +00:00
Bernd Edlinger
a09e9e35a6 c-common.c (c_common_truthvalue_conversion): Inhibit Wint-in-bool-context warning with from_macro_definition_at.
2016-09-21  Bernd Edlinger  <bernd.edlinger@hotmail.de>

        * c-common.c (c_common_truthvalue_conversion): Inhibit
        Wint-in-bool-context warning with from_macro_definition_at.
        Mention the expression will always evaluate to true.

From-SVN: r240331
2016-09-21 20:14:44 +00:00
Jason Merrill
63cb392608 Add from_macro_definition_at predicate for locations.
gcc/
	* input.h (from_macro_definition_at): New.
libcpp/
	* line-map.c (linemap_location_from_macro_definition_p): New.
	* line-map.h: Declare it.

From-SVN: r240330
2016-09-21 15:59:29 -04:00
Jason Merrill
c67c64efbe Core 903
Core 903
	* call.c (null_ptr_cst_p): Check char_type_p.

From-SVN: r240329
2016-09-21 15:49:32 -04:00
Joseph Myers
5f84cee259 Add _FloatN, _FloatNx tests for __builtin_fpclassify.
This patch adds tests for _FloatN and _FloatNx arguments to the
__builtin_fpclassify type-generic built-in function, omitted from the
original tests for type-generic functions on these types.

Tested for x86_64-pc-linux-gnu; all the supported new tests pass.

	* gcc.dg/torture/float128-tg-3.c, gcc.dg/torture/float128x-tg-3.c,
	gcc.dg/torture/float16-tg-3.c, gcc.dg/torture/float32-tg-3.c,
	gcc.dg/torture/float32x-tg-3.c, gcc.dg/torture/float64-tg-3.c,
	gcc.dg/torture/float64x-tg-3.c, gcc.dg/torture/floatn-tg-3.h: New
	tests.

From-SVN: r240328
2016-09-21 18:52:47 +01:00
Segher Boessenkool
18e15e303a Fix JUMP_LABEL documentation
* doc/rtl.texi (JUMP_LABEL): Document RETURN and SIMPLE_RETURN values.

From-SVN: r240325
2016-09-21 19:48:47 +02:00
Ville Voutilainen
b641f833ba re PR libstdc++/77288 (Std::experimental::optional::operator= implementation is broken in gcc 6.1)
PR libstdc++/77288
	* include/std/optional (__is_optional_impl, __is_optional): Remove.
	(__converts_from_optional, __assigns_from_optional): New.
	(optional(_Up&&)): Use is_same instead of __is_optional.
	(optional(const optional<_Up>&)): Constrain with
	__converts_from_optional.
	(optional(optional<_Up>&&)): Likewise.
	(operator=(_Up&&)): Use is_same instead of __is_optional, check
	is_same and is_scalar.
	(operator=(const optional<_Up>&)): Constrain with
	__converts_from_optional and __assigns_from_optional.
	(operator=(optional<_Up>&&)): Likewise.
	* testsuite/20_util/optional/77288.cc: New.
	* testsuite/20_util/optional/cons/value.cc: Adjust.

From-SVN: r240324
2016-09-21 20:37:17 +03:00
Ville Voutilainen
5578678524 Implement LWG 2729 for tuple.
* include/std/tuple (_Tuple_impl(_Tuple_impl&&)):
	Suppress conditionally.
	(_Tuple_impl(_Tuple_impl<_Idx, _UHead, _UTails...>&&)): Likewise.
	(__is_tuple_impl_trait_impl, __is_tuple_impl_trait): New.
	(_Tuple_impl(const _Head&)): Constrain.
	(_Tuple_impl(_UHead&&)): Likewise.
	(_Tuple_impl(_Tuple_impl&&)): Suppress conditionally.
	(_Tuple_impl(const _Tuple_impl<_Idx, _UHead>&)): Constrain.
	(_Tuple_impl(_Tuple_impl<_Idx, _UHead>&&)): Likewise.
	(operator=(const tuple&)): Enable conditionally.
	(operator=(tuple&&)): Suppress conditionally.
	(operator=(const tuple<_UElements...>&)): Constrain.
	(operator=(tuple<_UElements...>&&)): Likewise.
	(operator=(const tuple&)): Enable conditionally (2-param tuple).
	(operator=(tuple&&)): Suppress conditionally (2-param tuple).
	(operator=(const tuple<_U1, _U2>&)): Constrain.
	(operator=(tuple<_U1, _U2>&&)): Likewise.
	(operator=(const pair<_U1, _U2>&)): Likewise.
	(operator=(pair<_U1, _U2>&&)): Likewise.
	* testsuite/20_util/tuple/element_access/get_neg.cc: Adjust.
	* testsuite/20_util/tuple/tuple_traits.cc: New.

From-SVN: r240323
2016-09-21 20:25:16 +03:00
Ville Voutilainen
f524d5b34a re PR libstdc++/77537 (pair constructors do not properly SFINAE)
PR libstdc++/77537
	Implement LWG 2729 for pair.
	* include/bits/stl_pair.h (_PCC): New.
	(_ConstructiblePair, _ImplicitlyConvertiblePair):
	Turn into static member functions of _PCC.
	(_MoveConstructiblePair, _ImplicitlyMoveConvertiblePair): Likewise.
	(_PCCP): New.
	(pair(const _T1&, const _T2&)): Adjust.
	(_PCCFP): New.
	(pair(const pair<_U1, _U2>&)): Adjust.
	(pair(_U1&&, const _T2&)): Likewise.
	(pair(const _T1&, _U2&&)): Likewise.
	(pair(_U1&&, _U2&&)): Likewise.
	(pair(pair<_U1, _U2>&&)): Likewise.
	(operator=(const pair&)): Make conditionally deleted.
	(operator=(pair&&)): Make conditionally suppressed.
	(operator=(const pair<_U1, _U2>&)): Constrain.
	(operator=(pair<_U1, _U2>&&): Likewise.
	* include/std/type_traits (__nonesuch): New.
	* testsuite/20_util/pair/traits.cc: New.

From-SVN: r240322
2016-09-21 19:48:35 +03:00
Martin Sebor
d43b4ccc37 PR bootstrap/77676 - powerpc64 and powerpc64le stage2 bootstrap fail
* c.opt (fprintf-return-value): Temporarily initialize to zero
	to unblock bootstrap failures.

From-SVN: r240321
2016-09-21 10:13:12 -06:00
Uros Bizjak
fe01a41a4d dump-noaddr.x: Remove debug statements.
* gcc.c-torture/unsorted/dump-noaddr.x: Remove debug statements.

From-SVN: r240318
2016-09-21 17:16:41 +02:00
Jakub Jelinek
2e1c20b144 re PR c++/77651 (c++ -Wno-aligned-new ICEs)
PR c++/77651
c-family/
	* c.opt (Waligned-new=): Add RejectNegative.
	(faligned-new=): Likewise.  Spelling fix - change
	aligned_new_threshhold to aligned_new_threshold.
	* c-cppbuiltin.c (c_cpp_builtins): Change aligned_new_threshhold
	to aligned_new_threshold.
cp/
	* init.c (build_new_1): Don't suggest to use -faligned-new if
	aligned_new_threshold is non-zero.
	(type_has_new_extended_alignment): Change aligned_new_threshhold
	to aligned_new_threshold.
	* call.c (second_parm_is_size_t, aligned_allocation_fn_p,
	aligned_deallocation_fn_p, build_op_delete_call): Likewise.
	* decl.c (cxx_init_decl_processing): Likewise.
testsuite/
	* g++.dg/cpp1z/aligned-new6.C: New test.

From-SVN: r240317
2016-09-21 17:13:46 +02:00
Jakub Jelinek
aef6a97c0e re PR sanitizer/77567 (ASAN: Bugus error "alloc-dealloc-mismatch (malloc vs operator delete [])" with C++17's over-aligned types)
PR sanitizer/77567
	* asan/asan_new_delete.cc: Cherry-pick upstream r282019.

From-SVN: r240316
2016-09-21 16:40:30 +02:00
Matthew Wahab
de4c144ab7 [ARM] FP16 ARM Alternative format variants of AAPCS tests.
testsuite/
2016-09-21  Matthew Wahab  <matthew.wahab@arm.com>

	* gcc.target/arm/fp16-aapcs-3.c: New.
	* gcc.target/arm/fp16-aapcs-4.c: New.
	* gcc.target/arm/aapcs/aapcs/vfp22.c: New.
	* gcc.target/arm/aapcs/aapcs/vfp23.c: New.
	* gcc.target/arm/aapcs/aapcs/vfp24.c: New.
	* gcc.target/arm/aapcs/aapcs/vfp25.c: New.

From-SVN: r240314
2016-09-21 13:28:53 +00:00
Bernd Edlinger
44fc785481 re PR tree-optimization/77550 (std::deque with -O3 has infinite std::distance)
gcc:
2016-09-21  Bernd Edlinger  <bernd.edlinger@hotmail.de>

        PR tree-optimization/77550
        * tree-vect-stmts.c (create_array_ref): Change parameters.
        (get_group_alias_ptr_type): New function.
        (vectorizable_store, vectorizable_load): Use get_group_alias_ptr_type.

testsuite:
2016-09-21  Bernd Edlinger  <bernd.edlinger@hotmail.de>
        
        PR tree-optimization/77550
        * g++.dg/pr77550.C: New test.

From-SVN: r240313
2016-09-21 13:03:59 +00:00
Eric Botcazou
7e02fd1b7b configure.ac: Do not create links, only substitute the filenames.
* configure.ac: Do not create links, only substitute the filenames.
	* configure: Regenerate.
	* Makefile.in: Assign the substitution results to variables.
	(LIBGCC_LINKS): Define.
	(enable-execute-stack.c): New rule.
	(unwind.h): Likewise.
	(md-unwind-support.h): Likewise.
	(sfp-machine.h): Likewise.
	(gthr-default.h): Likewise.
	Add $(LIBGCC_LINKS) to the prerequisites of all object files and
	unwind.h as prerequisite of install-unwind_h-forbuild.

From-SVN: r240312
2016-09-21 12:53:20 +00:00
Marek Polacek
26e7820fcc gimple-ssa-sprintf.c (pass_sprintf_length::compute_format_length): Add falls through comment.
* gimple-ssa-sprintf.c (pass_sprintf_length::compute_format_length):
	Add falls through comment.

From-SVN: r240311
2016-09-21 11:08:11 +00:00
Richard Biener
377e973c62 dwarf2out.c (remove_child_with_prev): Clear child->die_sib.
2016-09-21  Richard Biener  <rguenther@suse.de>

	* dwarf2out.c (remove_child_with_prev): Clear child->die_sib.
	(replace_child): Likewise.
	(remove_child_TAG): Adjust.
	(move_marked_base_types): Likewise.
	(prune_unused_types_prune): Clear die_sib of removed children.

From-SVN: r240310
2016-09-21 11:00:02 +00:00
Janne Blomqvist
9ad5c32a21 Use rand_s on MinGW-w64, fix array bound overflow.
2016-09-21  Janne Blomqvist  <jb@gcc.gnu.org>

	* intrinsics/random.c (getosrandom): Use rand_s() on
	MinGW-w64. Fix bounds overflow in fallback code.

From-SVN: r240309
2016-09-21 13:07:06 +03:00
Georg-Johann Lay
bc084f84b3 re PR target/77326 ([avr] Invalid optimization omits comparison)
gcc/
	PR target/77326
	* config/avr/avr.c (avr_notice_update_cc) [CC_NONE]: If insn
	touches some regs mentioned in cc_status, do CC_STATUS_INIT.
gcc/testsuite/
	PR target/77326
	* gcc.target/avr/torture/pr77326.c: New test.

From-SVN: r240306
2016-09-21 09:17:32 +00:00
Louis Krupp
c075003a1f pr68078.f90: Run on x86_64_*_linux* only.
2016-09-21  Louis Krupp  <louis.krupp@zoho.com>

	* gfortran.dg/pr68078.f90: Run on x86_64_*_linux* only.

From-SVN: r240304
2016-09-21 08:30:51 +00:00
Richard Biener
6811ea7976 re PR tree-optimization/77648 (Setting conversion to a integer to double to 0 3/4 through a loop)
2016-09-21  Richard Biener  <rguenther@suse.de>

	PR tree-optimization/77648
	* tree-ssa-structalias.c (process_constraint): Handle all DEREF
	with complex RHS.
	(make_transitive_closure_constraints): Adjust comment.
	(make_any_offset_constraints): New function.
	(handle_rhs_call): Make sure to first expand a pointer to all
	subfields before transitively closing it.
	(handle_const_call): Likewise.  Properly expand returned
	pointers as well.
	(handle_pure_call): Likewise.

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

From-SVN: r240303
2016-09-21 07:38:33 +00:00
Richard Biener
f955c4c483 re PR tree-optimization/77621 (Internal compiler error for mtune=atom + msse2)
2016-09-21  Richard Biener  <rguenther@suse.de>
	Jakub Jelinek  <jakub@redhat.com>

	PR tree-optimization/77621
	* tree-vect-data-refs.c (vect_analyze_data_ref_accesses): Split
	group at non-vectorizable stmts.

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

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

From-SVN: r240302
2016-09-21 07:37:18 +00:00
Paul Thomas
096506bb6e re PR fortran/77657 (link error with implementation of user-defined derived type input/output (UD-DTIO) in child extending abstract parent)
2016-09-21  Paul Thomas  <pault@gcc.gnu.org>

	PR fortran/77657

	* interface.c (gfc_find_specific_dtio_proc): Borrow trick from
	resolve_typebound_generic_call to find dtio procedures that
	over-ride those in the declared type.

2016-09-21  Paul Thomas  <pault@gcc.gnu.org>

	PR fortran/77657
	* gfortran.dg/dtio_12.f90: New test.

From-SVN: r240301
2016-09-21 06:57:28 +00:00
Senthil Kumar Selvaraj
37d168aedc Make integer size explicit
For the lower vrp bound to be 2/-2, unsigned ints must be 4 bytes wide. This
breaks targets like avr. Explicitly using __UINT32_TYPE__ (behind a typedef) 
makes the testcase pass for all targets.

gcc/testsuite/ChangeLog:

2016-09-21  Senthil Kumar Selvaraj  <senthil_kumar.selvaraj@atmel.com>

	* gcc.dg/tree-ssa/pr64130.c: Use __UINT32_TYPE__ instead of int.

From-SVN: r240300
2016-09-21 06:03:32 +00:00
Kugan Vivekanandarajah
664540008b Incorrect arithmetic optimization involving bitfield arguments
gcc/ChangeLog:

2016-09-21  Kugan Vivekanandarajah  <kuganv@linaro.org>

	PR tree-optimization/72835
	* tree-ssa-reassoc.c (make_new_ssa_for_def): New.
	(make_new_ssa_for_all_defs): Likewise.
	(zero_one_operation): Replace all SSA_NAMEs defined in the chain.


gcc/testsuite/ChangeLog:

2016-09-21  Kugan Vivekanandarajah  <kuganv@linaro.org>

	PR tree-optimization/72835
	* gcc.dg/tree-ssa/pr72835.c: New test.

From-SVN: r240299
2016-09-21 03:28:24 +00:00
Martin Sebor
88d0c3f0a1 PR middle-end/49905 - Better sanity checking on sprintf src & dest to
gcc/ChangeLog:

	PR middle-end/49905
	* Makefile.in (OBJS): Add gimple-ssa-sprintf.o.
	* config/linux.h (TARGET_PRINTF_POINTER_FORMAT): Redefine.
	* config/linux.c (gnu_libc_printf_pointer_format): New function.
	* config/sol2.h (TARGET_PRINTF_POINTER_FORMAT): Same.
	* config/sol2.c (solaris_printf_pointer_format): New function.
	* doc/invoke.texi (-Wformat-length, -fprintf-return-value): New
	options.
	* doc/tm.texi.in (TARGET_PRINTF_POINTER_FORMAT): Document.
	* doc/tm.texi: Regenerate.
	* gimple-fold.h (get_range_strlen): New function.
	(get_maxval_strlen): Declare existing function.
	* gimple-fold.c (get_range_strlen): Add arguments and compute both
	maximum and minimum.
	 (get_range_strlen): Define overload.
	(get_maxval_strlen): Adjust.
	* gimple-ssa-sprintf.c: New file and pass.
	* passes.def (pass_sprintf_length): Add new pass.
	* targhooks.h (default_printf_pointer_format): Declare new function.
	(gnu_libc_printf_pointer_format): Same.
	(solaris_libc_printf_pointer_format): Same.
	* targhooks.c (default_printf_pointer_format): Define new function.
	* tree-pass.h (make_pass_sprintf_length): Declare new function.
	* print-tree.c: Increase buffer size.

gcc/c-family/ChangeLog:

	PR middle-end/49905
	* c.opt: Add -Wformat-length and -fprintf-return-value.

gcc/testsuite/ChangeLog:

	PR middle-end/49905
	* gcc.dg/builtin-stringop-chk-1.c: Adjust.
	* gcc.dg/tree-ssa/builtin-sprintf-warn-1.c: New test.
	* gcc.dg/tree-ssa/builtin-sprintf-warn-2.c: New test.
	* gcc.dg/tree-ssa/builtin-sprintf-warn-3.c: New test.
	* gcc.dg/tree-ssa/builtin-sprintf-warn-4.c: New test.
	* gcc.dg/tree-ssa/builtin-sprintf.c: New test.
	* gcc.dg/tree-ssa/builtin-sprintf-2.c: New test.

From-SVN: r240298
2016-09-20 19:39:27 -06:00
GCC Administrator
6283a8db1f Daily bump.
From-SVN: r240297
2016-09-21 00:16:19 +00:00
Kugan Vivekanandarajah
a03df1d582 Use ipa-vrp result in tree-vrp
gcc/ChangeLog:

2016-09-21  Kugan Vivekanandarajah  <kuganv@linaro.org>

	 * tree-vrp.c (get_value_range): Teach PARM_DECL to use ipa-vrp
	 results.


gcc/testsuite/ChangeLog:

2016-09-21  Kugan Vivekanandarajah  <kuganv@linaro.org>

	* gcc.dg/guality/pr54519-1.c: Add -fno-ipa-vrp. Else constant
	arguments/compare will be optimized away.
	* gcc.dg/torture/ftrapv-1.c: Likewise.

From-SVN: r240293
2016-09-20 23:41:01 +00:00
Kugan Vivekanandarajah
8bc5448f39 Add IPA VRP
gcc/lto/ChangeLog:
2016-09-21  Kugan Vivekanandarajah  <kuganv@linaro.org>

	* lto-partition.c: Include tree-vrp.h.
	* lto.c: Likewise.

gcc/testsuite/ChangeLog:

2016-09-21  Kugan Vivekanandarajah  <kuganv@linaro.org>

	* g++.dg/ipa/pure-const-3.C: Add -fno-ipa-vrp. Else constant arguments
	will be optimized away.
	* gcc.dg/ipa/vrp1.c: New test.
	* gcc.dg/ipa/vrp2.c: New test.
	* gcc.dg/ipa/vrp3.c: New test.

gcc/ChangeLog:

2016-09-21  Kugan Vivekanandarajah  <kuganv@linaro.org>

	* common.opt: New option -fipa-vrp.
	* ipa-cp.c (ipa_get_vr_lat): New.
	(ipcp_vr_lattice::print): Likewise.
	(print_all_lattices): Call ipcp_vr_lattice::print.
	(ipcp_vr_lattice::meet_with): New.
	(ipcp_vr_lattice::meet_with_1): Likewise.
	(ipcp_vr_lattice::top_p): Likewise.
	(ipcp_vr_lattice::bottom_p): Likewsie.
	(ipcp_vr_lattice::set_to_bottom): Likewise.
	(set_all_contains_variable): Call VR set_to_bottom.
	(initialize_node_lattices): Init VR lattices.
	(propagate_vr_accross_jump_function): New.
	(propagate_constants_accross_call): Call
	propagate_vr_accross_jump_function.
	(ipcp_store_vr_results): New.
	(ipcp_driver): Handle VR.
	* ipa-prop.c (ipa_print_node_jump_functions_for_edge): Handle VR.
	(ipa_set_jf_unknown): Likewise.
	(ipa_compute_jump_functions_for_edge): Likewise.
	(ipa_node_params_t::duplicate): Likewise.
	(ipa_write_jump_function): Likewise.
	(ipa_read_jump_function): Likewise.
	(write_ipcp_transformation_info): Likewise.
	(read_ipcp_transformation_info): Likewise.
	(ipcp_update_vr): New.
	(ipcp_transform_function): Handle VR.
	* ipa-prop.h (struct ipa_vr): New.
	* cgraph.c: Include tree-vrp.h.
	* cgraphunit.c: Likewise.
	* ipa-utils.c: Likewise.
	* ipa.c: Likewise.

From-SVN: r240292
2016-09-20 23:29:05 +00:00
Kugan Vivekanandarajah
973625a04b Add Early VRP
gcc/ChangeLog:

2016-09-21  Kugan Vivekanandarajah  <kuganv@linaro.org>

	* doc/invoke.texi: Document -fdump-tree-evrp.
	* passes.def: Define new pass_early_vrp.
	* timevar.def: Define new TV_TREE_EARLY_VRP.
	* tree-pass.h (make_pass_early_vrp): New.
	* tree-ssa-propagate.c: Make replace_uses_in non static.
	* tree-ssa-propagate.h: Export replace_uses_in.
	* tree-vrp.c (extract_range_for_var_from_comparison_expr): New.
	(extract_range_from_assert): Factor out
	extract_range_for_var_from_comparison_expr.
	(vrp_initialize_lattice): New.
	(vrp_initialize): Factor out vrp_initialize_lattice.
	(vrp_valueize): Fix it to reject complex value ranges.
	(vrp_free_lattice): New.
	(evrp_dom_walker::before_dom_children): Likewise.
	(evrp_dom_walker::after_dom_children): Likewise.
	(evrp_dom_walker::push_value_range): Likewise.
	(evrp_dom_walker::pop_value_range): Likewise.
	(execute_early_vrp): Likewise.
	(execute_vrp): Call vrp_initialize_lattice and
	vrp_free_lattice.
	(make_pass_early_vrp): New.


gcc/testsuite/ChangeLog:

2016-09-21  Kugan Vivekanandarajah  <kuganv@linaro.org>

	* g++.dg/tree-ssa/pr31146-2.C: Run with -fno-tree-evrp as evrp also
	does the same transformation.
	* g++.dg/warn/pr33738.C: XFAIL as optimization now happens in ccp.
	* gcc.dg/tree-ssa/evrp1.c: New test.
	* gcc.dg/tree-ssa/evrp2.c: New test.
	* gcc.dg/tree-ssa/evrp3.c: New test.
	* gcc.dg/tree-ssa/pr20657.c: Check for the pattern in evrp dump.
	* gcc.dg/tree-ssa/pr22117.c: Likewise.
	* gcc.dg/tree-ssa/pr61839_2.c: Likewise.
	* gcc.dg/tree-ssa/pr64130.c: Likewise.
	* gcc.dg/tree-ssa/pr37508.c: Change the pattern to be checked as
	foling now happens early.
	* gcc.dg/tree-ssa/vrp04.c: Likewise.
	* gcc.dg/tree-ssa/vrp06.c: Likewise.
	* gcc.dg/tree-ssa/vrp16.c: Likewise.
	* gcc.dg/tree-ssa/vrp25.c: Likewise.
	* gcc.dg/tree-ssa/vrp67.c: Likewise.

From-SVN: r240291
2016-09-20 23:23:55 +00:00
Christophe Lyon
aa9baacfc9 Report DejaGnu ERROR messages in dg-extract-results.
2016-09-20  Christophe Lyon  <christophe.lyon@linaro.org>

	* dg-extract-results.py: Report DejaGnu error in the final
	summary.
	* dg-extract-results.sh: Likewise.

From-SVN: r240289
2016-09-20 22:15:30 +02:00
Christophe Lyon
b0a5704b4c Report DejaGnu ERROR messages in compare_tests
2016-09-20  Christophe Lyon  <christophe.lyon@linaro.org>

	* compare_tests: Take ERROR messages into account when
          comparing.

From-SVN: r240288
2016-09-20 22:14:14 +02:00
Marek Polacek
605909332c trans-intrinsic.c (conv_expr_ref_to_caf_ref): Adjust fall through comment.
* trans-intrinsic.c (conv_expr_ref_to_caf_ref): Adjust fall through
	comment.

From-SVN: r240286
2016-09-20 18:41:14 +00:00
Ian Lance Taylor
321f72a231 syscall: build export_unix_test.go on solaris
Patch from Rainer Orth.
    
    Reviewed-on: https://go-review.googlesource.com/29436

From-SVN: r240285
2016-09-20 18:26:55 +00:00
Uros Bizjak
ed34fc9723 i386.md (mult->ashift peephole2s): Use pow2p_hwi instead of exact_log2.
* config/i386/i386.md (mult->ashift peephole2s): Use pow2p_hwi
	instead of exact_log2.

From-SVN: r240281
2016-09-20 20:00:46 +02:00
Ian Lance Taylor
3c1917945d re PR go/77625 (go/gofrontend/ast-dump.cc:169:42: error: ‘new’ of type ‘std::ofstr eam {aka std::basic_ofstream<char>}’ with extended alignment 16)
PR go/77625

    compiler: allocate std::ofstream as a local variable
    
    GCC PR 77625 points out a warning about new std::ofstream.  I don't know
    how that is supposed to work, but in this case the std::ofstream may as
    well be a local variable anyhow.
    
    Reviewed-on: https://go-review.googlesource.com/29435

From-SVN: r240279
2016-09-20 17:52:23 +00:00
Uros Bizjak
9b1ba33cf6 re PR tree-optimization/77621 (Internal compiler error for mtune=atom + msse2)
PR target/77621
	* config/i386/i386.c (ix86_preferred_simd_mode) <case DFmode>:
	Don't return word_mode for !TARGET_VECTORIZE_DOUBLE.
	(ix86_add_stmt_cost): Penalize DFmode vector operations
	for !TARGET_VECTORIZE_DOUBLE.

testsuite/ChangeLog:

	PR target/77621
	* gcc.target/i386/pr77621.c: New test.
	* gcc.target/i386/vect-double-2.c: Update scan-tree-dump-times
	pattern, loop should vectorize with -mtune=atom.

From-SVN: r240277
2016-09-20 19:36:03 +02:00
Ian Lance Taylor
b276eda4b4 re PR go/77642 (GO Bootstrap fail starting with r239872 splitstack signature does not match)
PR go/77642

    runtime: pass correct type to __splitstack_find
    
    The code was passing uintptr* to a function that expected size_t*.
    
    Based on patch by Andreas Krebbel.
    
    Fixes GCC PR 77642.
    
    Reviewed-on: https://go-review.googlesource.com/29433

From-SVN: r240275
2016-09-20 16:48:19 +00:00