Commit Graph

148566 Commits

Author SHA1 Message Date
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
Gerald Pfeifer
c79222478d invoke.texi (Warning Options): Simplify language.
* doc/invoke.texi (Warning Options): Simplify language.
	(Optimize Options): Complete sentence.

From-SVN: r240274
2016-09-20 16:42:14 +00:00
David Edelsohn
8dd23f3e08 * dbxout.c (xcoff_debug_hooks): Add filename parameter to early_finish hook.
From-SVN: r240273
2016-09-20 12:37:08 -04:00
Michael Meissner
00cc7cbfb5 rs6000.c (rs6000_expand_vector_init): For V4SF inits on power8 and above, use the VMRGEW instruction instead of a permute.
2016-09-20  Michael Meissner  <meissner@linux.vnet.ibm.com>

	* config/rs6000/rs6000.c (rs6000_expand_vector_init): For V4SF
	inits on power8 and above, use the VMRGEW instruction instead of a
	permute.

	* config/rs6000/altivec.md (UNSPEC_VMRGEW_DIRECT): New unspec.
	(p8_vmrgew_v4sf_direct): New VMRGEW insn for V4SF floating
	initialization.

From-SVN: r240272
2016-09-20 16:22:24 +00:00
Tamar Christina
c55b54403e [PATCH] [AArch64] Add missing attributes to arm_neon.h
Committed on behalf of Tamar Christina  <tamar.christina@arm.com>

gcc/

	* config/aarch64/arm_neon.h
	(vst2_s64, vst2_u64, vst2_f64, vst2_s8): Add missing attributes.
	(vst3_s64, vst3_u64, vst3_f64, vst3_s8): Likewise.
	(vst4_s64, vst4_u64, vst4_f64, vst4_s8): Likewise.

From-SVN: r240271
2016-09-20 15:53:00 +00:00
Bernd Edlinger
978fc7d446 vax.h (ELIMINABLE_REGS): Define.
2016-09-20  Bernd Edlinger  <bernd.edlinger@hotmail.de>

        * config/var/vax.h (ELIMINABLE_REGS): Define.
        (INITIAL_ELIMINATION_OFFSET): Define.

From-SVN: r240269
2016-09-20 15:28:02 +00:00
Maxim Ostapenko
f5bd4ad831 re PR testsuite/63299 (ASan reported alloc-dealloc-mismatch in g++.old-deja/g++.jason/init3.C)
PR testsuite/63299
	* g++.old-deja/g++.jason/init3.C (My_string::~My_string): Use delete[]
	instead of delete.

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

From-SVN: r240268
2016-09-20 17:19:14 +02:00
Jakub Jelinek
b912f962e2 re PR c++/77626 (ICE with -Wall on x86_64-linux-gnu (internal compiler error: Segmentation fault, byte_from_pos, cxx_fold_indirect_ref))
PR c++/77626
	* constexpr.c (cxx_fold_indirect_ref): Don't call byte_position on
	FIELD_DECLs with error_mark_node type.  Remove useless break; after
	return.

	* g++.dg/other/pr77626.C: New test.

From-SVN: r240267
2016-09-20 17:18:31 +02:00
Jakub Jelinek
eaf1ece131 re PR c++/77638 (ICE on x86_64-linux-gnu (internal compiler error: tree check: expected tree that contains ‘decl common’ structure, have ‘error_mark’ in cp_parser_template_declaration_after_parameters, at cp/parser.c:25722))
PR c++/77638
	* parser.c (cp_parser_template_declaration_after_parameter): For 2
	argument operator"" template set ok to false for
	parm == error_mark_node.

	* g++.dg/cpp0x/udlit-tmpl-arg-neg2.C: New test.

From-SVN: r240266
2016-09-20 17:17:41 +02:00
Jakub Jelinek
590b62e90d re PR c++/77637 (ICE on x86_64-linux-gnu (Segmentation fault, tree_check, cp_parser_std_attribute_list...))
PR c++/77637
	* parser.c (cp_parser_std_attribute_list): Reject ... without
	preceding attribute.

	* g++.dg/cpp0x/gen-attrs-62.C: New test.

From-SVN: r240265
2016-09-20 17:16:55 +02:00
Ville Voutilainen
377f30c00f re PR libstdc++/77619 (uninitialized_meow_construct and friends not exception safe)
PR libstdc++/77619
	* include/bits/stl_construct.h: (_Construct_novalue): New.
	(_Destroy_n_aux, _Destroy_n): New.
	* include/bits/stl_uninitialized.h: (type_traits):
	New include in C++11 mode.
	(__uninitialized_default_novalue_1): New.
	(__uninitialized_default_novalue_n_1): Likewise.
	(__uninitialized_default_novalue): Likewise.
	(__uninitialized_default_novalue_n): Likewise.
	(__uninitialized_copy_n_pair): Likewise.
	(uninitialized_default_construct):
	Use __uninitialized_default_novalue.
	(uninitialized_default_construct_n):
	Use __uninitialized_default_novalue_n.
	(uninitialized_value_construct): Use __uninitialized_default.
	(uninitialized_value_construct_n): Use __uninitialized_default_n.
	(uninitialized_move): Use uninitialized_copy.
	(uninitialized_move_n): Use __uninitialized_copy_n_pair.
	(destroy_at): Use _Destroy.
	(destroy): Likewise.
	(destroy_n): Likewise.
	* testsuite/20_util/specialized_algorithms/
	memory_management_tools/1.cc: Add tests for exceptions,
	add tests for trivial cases for construct and move.

From-SVN: r240264
2016-09-20 18:15:36 +03:00
Jakub Jelinek
7d9cf80159 re PR middle-end/77624 (ICE on x86_64-linux-gnu (internal compiler error: in fold_builtin_atomic_always_lock_free, at builtins.c:5583))
PR middle-end/77624
	* builtins.c (fold_builtin_atomic_always_lock_free): Only look through
	cast to void * if the cast is from some other pointer type.

	* c-c++-common/pr77624-1.c: New test.
	* c-c++-common/pr77624-2.c: New test.

From-SVN: r240263
2016-09-20 15:48:40 +02:00
Andre Vehreschild
3aebb6ff75 coarray_allocate_7.f08: Using + instead of fixed number of digits expected.
2016-09-20  Andre Vehreschild  <vehre@gcc.gnu.org>

        * gfortran.dg/coarray_allocate_7.f08: Using + instead of fixed number
        of digits expected.

From-SVN: r240262
2016-09-20 14:39:31 +02:00
Richard Biener
b5bbe47bb3 re PR tree-optimization/77646 (GCC Segfault with -O3)
2016-09-20  Richard Biener  <rguenther@suse.de>

	PR tree-optimization/77646
	* tree-ssa-sccvn.c (visit_reference_op_call): Always value-number
	a VDEF.

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

From-SVN: r240261
2016-09-20 12:20:37 +00:00
Jonathan Wakely
564beb5f9b Replace casts with floordiv operator in Python xmethods
* python/libstdcxx/v6/xmethods.py (DequeWorkerBase.__init__)
	(DequeWorkerBase.index, VectorWorkerBase.get): Use // for division.

From-SVN: r240258
2016-09-20 10:57:02 +01:00
Tamar Christina
a063e20498 [GCC][PATCH] Add __artificial__ attribute to Aarch64 NEON intrinsics
Committed on behalf of Tamar Christina <tamar.christina@arm.com>.

gcc/

	* config/aarch64/arm_neon.h: Add gnu_inline and artificial
	attributes to all inlined functions and make them extern.

From-SVN: r240256
2016-09-20 09:06:13 +00:00
Richard Biener
6831798543 debug.h (gcc_debug_hooks): Add filename parameter to early_finish hook.
2016-09-20  Richard Biener  <rguenther@suse.de>

	* debug.h (gcc_debug_hooks): Add filename parameter to early_finish
	hook.
	* debug.c (do_nothing_debug_hooks): Adjust.
	* dbxout.c (dbx_debug_hooks): Likewise.
	* sdbout.c (sdb_debug_hooks): Likewise.
	* dwarf2out.c (dwarf2_lineno_debug_hooks): Likewise.
	(dwarf2out_finish): Move producer, filename and
	path annotation ...
	(dwarf2out_early_finish): ... here.  Remove in_lto_p special-casing.
	* cgraphunit.c (symbol_table::finalize_compilation_unit): Adjust.

	lto/
	* lto.c (lto_main): Call early_finish with "<artificial>" as
	filename.

From-SVN: r240255
2016-09-20 07:37:53 +00:00
GCC Administrator
b78713939b Daily bump.
From-SVN: r240254
2016-09-20 00:16:21 +00:00
Bernd Edlinger
144a96e4c9 re PR c++/77434 (warn about suspicious precedence of ternary operator (?:))
gcc:
2016-09-19  Bernd Edlinger  <bernd.edlinger@hotmail.de>

        PR c++/77434
        * doc/invoke.texi: Document -Wint-in-bool-context.

c-family:
2016-09-19  Bernd Edlinger  <bernd.edlinger@hotmail.de>

        PR c++/77434
        * c.opt (Wcond-in-bool-context): New warning.
        * c-common.c (c_common_truthvalue_conversion): Warn on integer
        constants in boolean context.

cp:
2016-09-19  Bernd Edlinger  <bernd.edlinger@hotmail.de>

        PR c++/77434
        * cvt.c (cp_convert_and_check): Suppress Wint-in-bool-context here.

testsuite:
2016-09-19  Bernd Edlinger  <bernd.edlinger@hotmail.de>

        PR c++/77434
        * c-c++-common/Wint-in-bool-context.c: New test.

From-SVN: r240251
2016-09-19 22:10:11 +00:00
Bernd Edlinger
3385d437fe re PR other/77421 (Bugs found in GCC with the help of PVS-Studio)
2016-09-19  Bernd Edlinger  <bernd.edlinger@hotmail.de>

        PR middle-end/77421
        * dwarf2out.c (output_loc_operands): Fix an assertion.

From-SVN: r240250
2016-09-19 21:57:46 +00:00
Joseph Myers
1f2071fafd Define TS 18661-1 CR_DECIMAL_DIG in <float.h>.
TS 18661-1 defines a macro CR_DECIMAL_DIG in <float.h>, for the number
of decimal digits for which conversions between decimal character
strings and (IEEE) binary formats, in both directions, are correctly
rounded.  This patch implements support for this macro in GCC's
<float.h>.

The definition __UINTMAX_MAX__ is the right one for GCC's conversions
of floating constants, since I made those use MPFR to make them
correctly rounding.  The macro also covers standard library functions
such as strtod and printf.  The definition is also correct for current
glibc.  If any targets' libcs support correct rounding in a way that
conforms to TS 18661-1 with a smaller value of CR_DECIMAL_DIG, making
<float.h> reflect that could not be done in isolation without changes
to the interpretation of floating constants as well, since a smaller
CR_DECIMAL_DIG requires double rounding of floating constants (first
to CR_DECIMAL_DIG decimal digits, then to the desired binary format).

Boostrapped with no regressions on x86_64-pc-linux-gnu.

gcc:
	* ginclude/float.h [__STDC_WANT_IEC_60559_BFP_EXT__]
	(CR_DECIMAL_DIG): New macro.

gcc/testsuite:
	* gcc.dg/cr-decimal-dig-1.c: New test.

From-SVN: r240249
2016-09-19 22:53:30 +01:00
Joseph Myers
63012d9a57 Make max_align_t respect _Float128.
The _FloatN, _FloatNx, _DecimalN and _DecimalNx types are specified in
such a way that they are basic types, meaning that max_align_t must be
at least as aligned as those types.

On 32-bit x86, max_align_t is currently 8-byte aligned, but
_Decimal128 and _Float128 are 16-byte aligned, so the alignment of
max_align_t needs to increase to meet the standard requirements for
these types.

This patch implements such an increase.  Because max_align_t needs to
be usable for C++ as well as for C, <stddef.h> can't actually refer to
_Float128, but needs to use __float128 (or some other notation for the
type) instead.  And since __float128 is architecture-specific, there
isn't a preprocessor conditional that means "__float128 is available"
(whereas one could test __FLT128_MANT_DIG__ to see if _Float128 is
available; __SIZEOF_FLOAT128__ is available on x86 only).  But I
believe the only case that actually has an alignment problem here is
32-bit x86, and <stddef.h> already has lots of conditional specific to
particular architectures or OSes, so this patch uses a conditional on
__i386__; that also is the minimal change that ensures neither size
nor alignment of max_align_t is changed in any case other than where
it is necessary.  If any other architectures turn out to have such an
issue, it will show up as failures of one of the testcases added by
this patch.

Such an increase is of course an ABI change, but a reasonably safe
one, in that max_align_t doesn't tend to appear in library interfaces
(rather, it's something to use when writing allocators and similar
code; most matches found on codesearch.debian.net look like copies of
the gnulib stddef.h module rather than anything actually using
max_align_t at all).

max_align_t_align has a corresponding change (adding _Float128 to the
types considered).

(I think glibc malloc alignment should also increase to 16-byte on
32-bit x86 so it works for allocating objects of these types, which is
now straightforward given the fix made for 32-bit powerpc.)

Bootstrapped with no regressions on x86_64-pc-linux-gnu, and
spot-tested with -m32 that the new float128-align.c test now compiles
where previously it didn't.

gcc:
	* ginclude/stddef.h (max_align_t) [__i386__]: Add __float128
	element.

gcc/c-family:
	* c-common.c (max_align_t_align): Also consider alignment of
	float128_type_node.

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

From-SVN: r240248
2016-09-19 22:51:56 +01:00
Vladimir Makarov
0241082625 re PR rtl-optimization/77416 (LRA rematerializing use of CA reg across function call)
2016-09-19  Vladimir Makarov  <vmakarov@redhat.com>

	PR rtl-optimization/77416
	* lra-remat.c (operand_to_remat): Process hard coded insn
	registers.

2016-09-19  Vladimir Makarov  <vmakarov@redhat.com>

	PR rtl-optimization/77416
	* gcc.target/powerpc/pr77416.c: New.

From-SVN: r240247
2016-09-19 21:38:27 +00:00