Commit Graph

157925 Commits

Author SHA1 Message Date
GCC Administrator a121f8229d Daily bump.
From-SVN: r254976
2017-11-21 00:16:16 +00:00
Jason Merrill 753c2e693f Avoid duplicate visibility warning.
* decl2.c (constrain_class_visibility): Don't warn about artificial
	fields.

From-SVN: r254973
2017-11-20 17:37:45 -05:00
François Dumont e324f9cb92 streambuf_iterator.h (istreambuf_iterator<>): Declare std::advance for istreambuf_iterator of char types to be friend.
2017-11-20  François Dumont  <fdumont@gcc.gnu.org>

	* include/bits/streambuf_iterator.h (istreambuf_iterator<>): Declare
	std::advance for istreambuf_iterator of char types to be friend.
	(std::advance(istreambuf_iterator&, _Distance)): New overload.
	* include/std/streambuf (basic_streambuf<>): Declare std::advance for
	istreambuf_iterator of char types to be friend.
	* testsuite/22_locale/money_get/get/char/9.cc: Have
	istreambuf_iterator created on the fly when calling money_get<>::get.
	* testsuite/22_locale/money_get/get/wchar_t/9.cc: Likewise.
	* testsuite/24_iterators/istreambuf_iterator/debug/1_neg.cc: New.
	* testsuite/24_iterators/istreambuf_iterator/debug/2_neg.cc: New.
	* testsuite/25_algorithms/advance/istreambuf_iterators/char/1.cc: New.
	* testsuite/25_algorithms/advance/istreambuf_iterators/char/1_neg.cc:
	New.
	* testsuite/25_algorithms/advance/istreambuf_iterators/char/2.cc: New.
	* testsuite/25_algorithms/advance/istreambuf_iterators/char/2_neg.cc:
	New.
	* testsuite/25_algorithms/advance/istreambuf_iterators/char/3_neg.cc:
	New.
	* testsuite/25_algorithms/advance/istreambuf_iterators/wchar_t/1.cc:
	New.
	* testsuite/25_algorithms/advance/istreambuf_iterators/wchar_t/1_neg.cc:
	New.
	* testsuite/25_algorithms/advance/istreambuf_iterators/wchar_t/2.cc:
	New.
	* testsuite/25_algorithms/advance/istreambuf_iterators/wchar_t/2_neg.cc:
	New.
	* testsuite/25_algorithms/advance/istreambuf_iterators/wchar_t/3_neg.cc:
	New.
	* testsuite/25_algorithms/find/istreambuf_iterators/char/2.cc: Leverage
	on std::advance overload.
	* testsuite/25_algorithms/find/istreambuf_iterators/wchar_t/2.cc:
	Likewise.

From-SVN: r254972
2017-11-20 22:30:28 +00:00
Jonathan Wakely 9be0a9d6d2 Fix failing tests caused by duplicate dg-options
* testsuite/special_functions/18_riemann_zeta/check_value.cc: Fix
	duplicate dg-options directive.
	* testsuite/tr1/5_numerical_facilities/special_functions/
	20_riemann_zeta/check_value_neg.cc: Likewise.

From-SVN: r254971
2017-11-20 21:48:31 +00:00
Jakub Jelinek 49e68526ab i386.c (parse_mtune_ctrl_str): Start diagnostics with lower case letter.
* config/i386/i386.c (parse_mtune_ctrl_str): Start diagnostics
	with lower case letter.

From-SVN: r254970
2017-11-20 22:03:47 +01:00
Uros Bizjak 121075d760 i386.md (bswaphi2): New expander.
* config/i386/i386.md (bswaphi2): New expander.
	(*bswaphi2_movbe): New insn pattern.
	(bswaphi -> rorhi pepehole2): New peephole pattern.

testsuite/ChangeLog:

	* gcc.target/i386/movbe-5.c: New test.

From-SVN: r254967
2017-11-20 20:52:14 +01:00
Paul Thomas 6017b8f0cf re PR fortran/79072 (ICE with class(*) pointer function result and character value)
2017-11-20  Paul Thomas  <pault@gcc.gnu.org>

	PR fortran/79072
	* trans-expr.c (trans_class_vptr_len_assignment): Set from_len
	if the temporary is unlimited polymorphic.
	* trans-stmt.c (trans_associate_var): Use the fake result decl
	to obtain the 'len' field from an explicit function result when
	in that function scope.

2017-11-20  Paul Thomas  <pault@gcc.gnu.org>

	PR fortran/79072
	* gfortran.dg/class_result_5.f90: New test.

From-SVN: r254966
2017-11-20 19:09:34 +00:00
Kito Cheng ee1c213355 RISC-V: Implement __umulsidi3, umul_ppmm and __muluw3
2017-11-20  Kito Cheng  <kito.cheng@gmail.com>

        * longlong.h [__riscv] (__umulsidi3): Define.
        [__riscv] (umul_ppmm): Likewise.
        [__riscv] (__muluw3): Likewise.

From-SVN: r254965
2017-11-20 19:08:38 +00:00
Jakub Jelinek d68ddd2b35 P0329R4: Designated Initialization
P0329R4: Designated Initialization
	* parser.c (cp_parser_initializer_clause): List in comment grammar
	designated-initializer-list.
	(cp_parser_initializer_list): Allow .identifier = without pedwarn for
	C++2A, parse .identifier { ... }.  Improve location_t argument to
	pedwarn.  Add pedwarn for [cst] = designators.  Diagnose ... in
	designated initializer list.  Diagnose mixing designated and
	non-designated initializer clauses for C++2A.  Diagnose duplicated
	identifiers in designators.
	* name-lookup.h (search_anon_aggr): New declaration.
	* name-lookup.c (fields_linear_search): Use search_anon_aggr.
	(search_anon_aggr): New function.
	* typeck2.c (process_init_constructor_record): Allow designator
	to skip over some non-static data members.  Handle anonymous
	aggregates.  Add diagnostics for designator order not matching
	member declaration order.

	* g++.dg/ext/desig2.C: Adjust comment, no sorry about designator
	refering to second member.
	(b): New variable and associated expected diagnostic.
	* g++.dg/ext/desig4.C: For C++2A expect diagnostics.
	* g++.dg/ext/desig5.C: Add dg-do dg-compile and empty dg-options.
	* g++.dg/ext/desig8.C: Likewise.
	* g++.dg/ext/desig9.C: New test.
	* g++.dg/ext/pr27019.C: Don't expect any diagnostics.
	* g++.dg/init/error2.C: Adjust expected diagnostics.
	* g++.dg/cpp0x/desig1.C: Add dg-options with -pedantic, expect
	warning on C99 designators.
	* g++.dg/cpp2a/desig1.C: New test.
	* g++.dg/cpp2a/desig2.C: New test.
	* g++.dg/cpp2a/desig3.C: New test.
	* g++.dg/cpp2a/desig4.C: New test.
	* g++.dg/cpp2a/desig5.C: New test.
	* g++.dg/cpp2a/desig6.C: New test.

From-SVN: r254964
2017-11-20 19:58:01 +01:00
David Malcolm 6c7a259b81 c-family: add name_hint/deferred_diagnostic
In various places we use lookup_name_fuzzy to provide a hint,
and can report messages of the form:
  error: unknown foo named 'bar'
or:
  error: unknown foo named 'bar'; did you mean 'SUGGESTION?

This patch provides a way for lookup_name_fuzzy to provide
both the suggestion above, and (optionally) additional hints
that can be printed e.g.

  note: did you forget to include <SOME_HEADER.h>?

This patch provides the mechanism and ports existing users
of lookup_name_fuzzy to the new return type.
There are no uses of such hints in this patch, but followup
patches provide various front-end specific uses of this.

gcc/c-family/ChangeLog:
	* c-common.h (enum lookup_name_fuzzy_kind): Move to name-hint.h.
	(lookup_name_fuzzy): Likewise.  Convert return type from
	const char * to name_hint.  Add location_t param.
	* name-hint.h: New header.

gcc/c/ChangeLog:
	* c-decl.c: Define INCLUDE_UNIQUE_PTR before including system.h.
	Include "c-family/name-hint.h"
	(implicit_decl_warning): Convert "hint" from
	const char * to name_hint.  Pass location to
	lookup_name_fuzzy.  Suppress any deferred diagnostic if the
	warning was not printed.
	(undeclared_variable): Likewise for "guessed_id".
	(lookup_name_fuzzy): Convert return type from const char *
	to name_hint.  Add location_t param.
	* c-parser.c: Define INCLUDE_UNIQUE_PTR before including system.h.
	Include "c-family/name-hint.h"
	(c_parser_declaration_or_fndef): Convert "hint" from
	const char * to name_hint.  Pass location to lookup_name_fuzzy.
	(c_parser_parameter_declaration): Likewise.

gcc/cp/ChangeLog:
	* name-lookup.c: Define INCLUDE_UNIQUE_PTR before including system.h.
	Include "c-family/name-hint.h"
	(suggest_alternatives_for): Convert "fuzzy_name" from const char *
	to name_hint, and rename to "hint".  Pass location to
	lookup_name_fuzzy.
	(lookup_name_fuzzy): Convert return type from const char *
	to name_hint.  Add location_t param.
	* parser.c: Define INCLUDE_UNIQUE_PTR before including system.h.
	Include "c-family/name-hint.h"
	(cp_parser_diagnose_invalid_type_name): Convert
	"suggestion" from const char * to name_hint, and rename to "hint".
	Pass location to lookup_name_fuzzy.

From-SVN: r254963
2017-11-20 18:37:05 +00:00
Jeff Law 74ba745bdc Makefile.in (OBJS): Add gimple-ssa-evrp-analyze.o.
* Makefile.in (OBJS): Add gimple-ssa-evrp-analyze.o.
	* gimple-ssa-evrp-analyze.c: New file pulled from gimple-ssa-evrp.c.
	* gimple-ssa-evrp-analyze.h: New file pulled from gimple-ssa-evrp.c.
	* gimple-ssa-evrp.c: Remove bits moved into new files.  Include
	gimple-ssa-evrp-analyze.h.

From-SVN: r254961
2017-11-20 10:44:45 -07:00
Jeff Law 8c66dd9b33 gimple-ssa-evrp.c (evrp_dom_walker::before_dom_children): Do not set BB_VISITED here.
* gimple-ssa-evrp.c (evrp_dom_walker::before_dom_children): Do not
	set BB_VISITED here.
	(evrp_range_analyzer::enter): Set BB_VISITED here instead.

From-SVN: r254960
2017-11-20 10:29:33 -07:00
Nathan Sidwell 6aa80414a0 [PR c++/82878] pass-by-invisiref in lambda
https://gcc.gnu.org/ml/gcc-patches/2017-11/msg01115.html
	PR c++/82878
	PR c++/78495
	* call.c (build_call_a): Don't set CALL_FROM_THUNK_P for inherited
	ctor.
	* cp-gimplify.c	(cp_genericize_r): Restore THUNK dereference
	inhibibition check removed in previous c++/78495 change.

	PR c++/82878
	* g++.dg/cpp0x/pr82878.C: New.
	* g++.dg/cpp1z/inh-ctor38.C: Check moves too.

From-SVN: r254958
2017-11-20 14:39:00 +00:00
Ville Voutilainen 7b7b60c830 Implement LWG 2353
* include/bits/stl_iterator_base_funcs.h (next):
Use InputIterator instead of ForwardIterator.
* testsuite/24_iterators/operations/lwg2353.cc: New.
* testsuite/24_iterators/operations/next_neg.cc: Remove.

From-SVN: r254957
2017-11-20 16:21:42 +02:00
Bin Cheng 9cdcebf971 tree-predcom.c: Add general comment on Store-Store chains.
* tree-predcom.c: Add general comment on Store-Store chains.
	(split_data_refs_to_components): Postpone clearing eliminate_store_p
	flag in component.
	(get_chain_last_ref_at): Rename into...
	(get_chain_last_write_at): ...this.
	(get_chain_last_write_before_load): New function.
	(add_ref_to_chain): Promote type of chain from CT_STORE_LOAD to
	CT_STORE_STORE when write reference is added.
	(determine_roots_comp): Support load ref in CT_STORE_STORE chains.
	(is_inv_store_elimination_chain): Update get_chain_last_write_at call.
	(initialize_root_vars_store_elim_1): Ditto.
	(initialize_root_vars_store_elim_2): Ditto.  Replace rhs once default
	definition is created.
	(execute_pred_commoning_chain): Support load ref in CT_STORE_STORE
	chain by replacing it with dominant stored value.

	gcc/testsuite
	* gcc.dg/tree-ssa/predcom-dse-12.c: New test.

From-SVN: r254956
2017-11-20 14:20:08 +00:00
Bin Cheng 90ef577378 * tree-predcom.c (add_ref_to_chain): Remove check on distance.
From-SVN: r254955
2017-11-20 14:15:30 +00:00
Marc Glisse 50dec459c6 VRP: x+1 and -x cannot be INT_MIN
2017-11-20  Marc Glisse  <marc.glisse@inria.fr>

gcc/
	* vr-values.c (extract_range_from_binary_expr): Use a full range
	for VR_VARYING.

gcc/testsuite/
	PR testsuite/82951
	* gcc.c-torture/execute/20040409-1.c: Move invalid tests...
	* gcc.c-torture/execute/20040409-1w.c: ... here with -fwrapv.
	* gcc.c-torture/execute/20040409-2.c: Move invalid tests...
	* gcc.c-torture/execute/20040409-2w.c: ... here with -fwrapv.
	* gcc.c-torture/execute/20040409-3.c: Move invalid tests...
	* gcc.c-torture/execute/20040409-3w.c: ... here with -fwrapv.
	* gcc.dg/tree-ssa/cmpmul-1.c: Tweak condition.
	* gcc.dg/tree-ssa/vrp118.c: New file.

From-SVN: r254954
2017-11-20 13:26:39 +00:00
Rainer Orth 9aab553436 Add g++.dg/pr82836.C requirements
* g++.dg/pr82836.C: Require int128, __float128 support.
	Add __float128 options.
	(size_t): Define using __SIZE_TYPE__.

From-SVN: r254953
2017-11-20 13:03:06 +00:00
Jakub Jelinek f370e36dc9 re PR c++/82781 (Vector extension operators return wrong result in constexpr)
PR c++/82781
	* constexpr.c (cxx_eval_vector_conditional_expression): New function.
	(cxx_eval_constant_expression) <case VEC_COND_EXPR>: Use it instead
	of cxx_eval_conditional_expression.

	* g++.dg/ext/constexpr-pr82781.C: New test.

From-SVN: r254952
2017-11-20 13:57:50 +01:00
Igor Tsimbalist 1ebafce0bc re PR bootstrap/83015 (bootstrap comparison failure on ia64)
PR bootstrap/83015
	* config/cr16/unwind-cr16.c (uw_install_context): Add FRAMES
	parameter.
	* config/xtensa/unwind-dw2-xtensa.c: Likewise
	* config/ia64/unwind-ia64.c: Add frames parameter.
	* unwind-sjlj.c: Likewise.

From-SVN: r254951
2017-11-20 13:30:25 +01:00
Thomas Preud'homme 0a413fbc6c [ARM] Do no clobber r4 in Armv8-M nonsecure call
Expanders for Armv8-M nonsecure call unnecessarily clobber r4 despite
the libcall they perform not writing to r4.  Furthermore, the
requirement for the branch target address to be in r4 as expected by
the libcall is modeled in a convoluted way in the define_insn patterns:
the address is a register match_operand constrained by the match_dup
for the clobber which is guaranteed to be r4 due to the expander.

This patch simplifies all this by simply requiring the address to be in
r4 and removing the clobbers. Expanders are left alone because
cmse_nonsecure_call_clear_caller_saved relies on branch target memory
attributes which would be lost if expanding to reg:SI R4_REGNUM.

2017-11-20  Thomas Preud'homme  <thomas.preudhomme@arm.com>

    gcc/
    * config/arm/arm.md (R4_REGNUM): Define constant.
    (nonsecure_call_internal): Remove r4 clobber.
    (nonsecure_call_value_internal): Likewise.
    * config/arm/thumb1.md (nonsecure_call_reg_thumb1_v5): Remove second
    clobber and resequence match_operands.
    (nonsecure_call_value_reg_thumb1_v5): Likewise.
    * config/arm/thumb2.md (nonsecure_call_reg_thumb2): Likewise.
    (nonsecure_call_value_reg_thumb2): Likewise.

From-SVN: r254950
2017-11-20 11:06:05 +00:00
Christophe Lyon 4acdaf98f9 [testsuite,arm] [Diagnostic Patch] don't print column zero
2017-11-20  Christophe Lyon  <christophe.lyon@linaro.org>

	gcc/testsuite/
	* gcc.target/arm/pr69180.c: Use -: for no column in expected
	warnings.

From-SVN: r254949
2017-11-20 11:40:36 +01:00
Jakub Jelinek 4b84d9b8f9 re PR tree-optimization/78821 (GCC7: Copying whole 32 bits structure field by field not optimised into copying whole 32 bits at once)
PR tree-optimization/78821
	* gimple-ssa-store-merging.c (find_bswap_or_nop_load): Give up
	if base is TARGET_MEM_REF.  If base is not MEM_REF, set base_addr
	to the address of the base rather than the base itself.
	(find_bswap_or_nop_1): Just use pointer comparison for vuse check.
	(find_bswap_or_nop_finalize): New function.
	(find_bswap_or_nop): Use it.
	(bswap_replace): Return a tree rather than bool, change first
	argument from gimple * to gimple_stmt_iterator, allow inserting
	into an empty sequence, allow ins_stmt to be NULL - then emit
	all stmts into gsi.  Fix up MEM_REF address gimplification.
	(pass_optimize_bswap::execute): Adjust bswap_replace caller.
	(struct store_immediate_info): Add N and INS_STMT non-static
	data members.
	(store_immediate_info::store_immediate_info): Initialize them
	from newly added ctor args.
	(merged_store_group::apply_stores): Formatting fixes.  Sort by
	bitpos at the end.
	(stmts_may_clobber_ref_p): For stores call also
	refs_anti_dependent_p.
	(gather_bswap_load_refs): New function.
	(imm_store_chain_info::try_coalesce_bswap): New method.
	(imm_store_chain_info::coalesce_immediate_stores): Use it.
	(split_group): Handle LROTATE_EXPR and NOP_EXPR rhs_code specially.
	(imm_store_chain_info::output_merged_store): Fail if number of
	new estimated stmts is bigger or equal than old.  Handle LROTATE_EXPR
	and NOP_EXPR rhs_code.
	(pass_store_merging::process_store): Compute n and ins_stmt, if
	ins_stmt is non-NULL and the store rhs is otherwise invalid, use
	LROTATE_EXPR rhs_code.  Pass n and ins_stmt to store_immediate_info
	ctor.
	(pass_store_merging::execute): Calculate dominators.

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

From-SVN: r254948
2017-11-20 11:10:23 +01:00
Jakub Jelinek dffec8ebdb tree-ssa-math-opts.c (nop_stats, [...]): Moved to ...
* tree-ssa-math-opts.c (nop_stats, bswap_stats, struct symbolic_number,
	BITS_PER_MARKER, MARKER_MASK, MARKER_BYTE_UNKNOWN, HEAD_MARKER, CMPNOP,
	CMPXCHG, do_shift_rotate, verify_symbolic_number_p,
	init_symbolic_number, find_bswap_or_nop_load, perform_symbolic_merge,
	find_bswap_or_nop_1, find_bswap_or_nop, pass_data_optimize_bswap,
	class pass_optimize_bswap, bswap_replace,
	pass_optimize_bswap::execute): Moved to ...
	* gimple-ssa-store-merging.c: ... this file.
	Include optabs-tree.h.
	(nop_stats, bswap_stats, do_shift_rotate, verify_symbolic_number_p,
	init_symbolic_number, find_bswap_or_nop_load, perform_symbolic_merge,
	find_bswap_or_nop_1, find_bswap_or_nop, bswap_replace): Put into
	anonymous namespace, remove static keywords.
	(pass_optimize_bswap::gate): Test BITS_PER_UNIT == 8 here...
	(pass_optimize_bswap::execute): ... rather than here.  Formatting fix.

From-SVN: r254947
2017-11-20 11:08:48 +01:00
Jan Hubicka 12b8cb2e5b re PR bootstrap/83062 (Bootstrap failure: libsanitizer/tsan/tsan_rtl.h:713:44: error: inlining failed in call to always_inline ‘void __tsan::MemoryRead(__tsan::ThreadState*, __sanitizer::uptr, __sanitizer: :uptr, int)’: caller is not optimized)
PR bootstrap/83062
	* ipa-inline.c (can_inline_edge_p): Fix typo in previous patch.

From-SVN: r254946
2017-11-20 09:55:02 +00:00
Aldy Hernandez 19a30b7123 vec.h (debug_helper): New function.
* vec.h (debug_helper): New function.
	(DEFINE_DEBUG_VEC): New macro.
	* hash-set.h (debug_helper): New function.
	(DEFINE_DEBUG_HASH_SET): New macro.
	* cfg.c (debug_slim (edge)): New function.
	Call DEFINE_DEBUG_VEC for edges.
	Call DEFINE_DEBUG_HASH_SET for edges.
	* cfghooks.c (debug_slim (basic_block)): New function.
	Call DEFINE_DEBUG_VEC for basic blocks.
	Call DEFINE_DEBUG_HASH_SET for basic blocks.
	* print-tree.c (debug_slim): New function to handle trees.
	Call DEFINE_DEBUG_VEC for trees.
	Call DEFINE_DEBUG_HASH_SET for trees.
	(debug (vec<tree, va_gc>) &): Remove.
	(debug (<vec<tree, va_gc>) *): Remove.
	* print-rtl.c (debug_slim): New function to handle const_rtx.
	Call DEFINE_DEBUG_VEC for rtx_def.
	Call DEFINE_DEBUG_VEC for rtx_insn.
	Call DEFINE_DEBUG_HASH_SET for rtx_def.
	Call DEFINE_DEBUG_HASH_SET for rtx_insn.
	* sel-sched-dump.c (debug (vec<rtx_insn *> &): Remove.
	(debug (vec<rtx_insn *> *ptr): Remove.
	(debug_insn_vector): Remove.
	* stor-layout.c (debug_rli): Call debug() instead of debug_vec_tree.

From-SVN: r254945
2017-11-20 08:32:57 +00:00
Tom de Vries 7cfaa4c643 Fix comparison mode in simplify_ternary_operation
2017-11-20  Tom de Vries  <tom@codesourcery.com>

	PR rtl-optimization/82020
	* simplify-rtx.c (simplify_ternary_operation): Fix comparison mode of
	IF_THEN_ELSE condition.

From-SVN: r254944
2017-11-20 08:20:35 +00:00
GCC Administrator 7476c7da18 Daily bump.
From-SVN: r254943
2017-11-20 00:16:19 +00:00
Eric Botcazou 3b36246bc2 re PR ada/83016 (gnat1: warning: command line option ‘-nostdinc++’ is valid for C++/ObjC++ but not for Ada)
PR ada/83016
	* gnatlink.adb (Process_Args): Accept multiple switches for --LINK.
	(Usage): Adjust.
	* gcc-interface/Makefile.in (GCC_LINK): Remove $(ADA_INCLUDES).
	(common-tools): Pass $(CC) as --GCC= and $(GCC_LINK) as --LINK= in
	the invocations of $(GNATLINK).
	(../../gnatdll$(exeext)): Likewise.
	(../../vxaddr2line$(exeext)): Likewise.
	(gnatmake-re): Likewise.
	(gnatlink-re): Likewise.

From-SVN: r254940
2017-11-19 22:36:25 +00:00
Jan Hubicka 290295fdf8 re PR target/82281 (Bulldozer/Zen tuning: uses XMM for single 64-bit integer AND, even with a simple mask)
PR target/82281
	* gcc.target/i386/pr82281.c: New testcase.

From-SVN: r254939
2017-11-19 20:30:26 +00:00
Jeff Law 43502b8313 tree-ssa-dom.c (record_equivalences_from_phis): Fix handling of degenerates resulting from ignoring an edge.
* tree-ssa-dom.c (record_equivalences_from_phis): Fix handling
        of degenerates resulting from ignoring an edge.

From-SVN: r254938
2017-11-19 13:15:45 -07:00
Jan Hubicka 8a4a6d2e84 re PR ipa/81360 (ice in estimate_edge_growth, at ipa-inline.h:86)
PR ipa/81360
	* ipa-inline.c (can_inline_edge_p): Also check that caller is optimized
	* gcc.c-torture/compile/pr81360.c: New testcase.

From-SVN: r254937
2017-11-19 19:58:12 +00:00
Paul Thomas a6b22eea5b re PR fortran/78990 (ICE when assigning polymorphic array function result)
2017-11-19  Paul Thomas  <pault@gcc.gnu.org>

	PR fortran/78990
	* expr.c (gfc_is_class_array_function): Renamed from
	'gfc_is_alloc_class_array_function' and modified to return true
	for pointers as well as allocatable results.
	* gfortran.h : Change of name for prototype of above function.
	* trans-array.c (gfc_add_loop_ss_code): Force finalization of
	class array results.
	(build_class_array_ref): Change assertion into a condition.
	(build_class_array_ref): Set the se class_vptr for class array
	function results.
	(gfc_walk_function_expr): Reference gfc_is_class_array_function
	as above.
	* trans-decl.c (get_proc_result): Move it up before
	gfc_trans_deferred_vars.
	(gfc_trans_deferred_vars): Nullify explicit return class arrays
	on entry.
	* trans-expr.c (gfc_conv_class_to_class): Allow conversion of
	class array functions that have an se class_vptr and use it
	for the result vptr.
	(gfc_conv_subref_array_arg): Rename reference to the above
	function.
	(gfc_conv_procedure_call): Ditto. Add the se pre block to the
	loop pre block before the function is evaluated. Do not
	finalize class pointer results.
	(arrayfunc_assign_needs_temporary, gfc_trans_assignment_1) More
	renamed references.
	* trans-intrinsic.c (gfc_conv_intrinsic_size): Ditto.

2017-11-19  Paul Thomas  <pault@gcc.gnu.org>

	PR fortran/78990
	* gfortran.dg/class_67.f90: New test.

From-SVN: r254936
2017-11-19 19:50:50 +00:00
Jan Hubicka 77459763f4 re PR ipa/83001 (ICE in edge_badness, at ipa-inline.c:1025)
PR ipa/83001
	* profile-count.c (profile_count::to_sreal_scale): Fix return value
	for uninitialied counts.

From-SVN: r254935
2017-11-19 18:56:58 +00:00
Jan Hubicka 0fa23756e3 re PR ipa/60243 (IPA is slow on large cgraph tree)
PR ipa/60243
	* tree-inline.c (estimate_num_insns): Set to 1 at least.

From-SVN: r254934
2017-11-19 18:55:30 +00:00
Jan Hubicka 66c9290335 re PR target/82713 (ICE in ix86_builtin_vectorization_cost, at config/i386/i386.c:44475)
PR target/82713
	* i386.c (ix86_builtin_vectorization_cost): Be ready for insane
	types.

From-SVN: r254933
2017-11-19 18:52:54 +00:00
Jakub Jelinek f9c59f7e95 re PR c/66618 (Failure to diagnose non-constant initializer for static object with -O1)
PR c/66618
	PR c/69960
c-family/
	* c-common.h (c_fully_fold): Add LVAL argument defaulted to false.
c/
	* c-parser.c (c_parser_omp_atomic): Pass true as LVAL to c_fully_fold
	where needed.
	* c-typeck.c (build_unary_op, build_modify_expr, build_asm_expr,
	handle_omp_array_sections): Likewise.
	(digest_init): Don't call decl_constant_value_for_optimization.
	* c-tree.h (decl_constant_value_for_optimization): Removed.
	* c-fold.c (c_fold_array_ref): New function.
	(c_fully_fold_internal): Add LVAL argument, propagate it through
	recursive calls.  For VAR_P call decl_constant_value and
	unshare if not LVAL and either optimizing or IN_INIT.  Remove
	decl_constant_value_for_optimization calls.  If IN_INIT and not LVAL,
	fold ARRAY_REF with STRING_CST and INTEGER_CST operands.
	(c_fully_fold): Add LVAL argument, pass it through to
	c_fully_fold_internal.
	(decl_constant_value_for_optimization): Removed.
cp/
	* cp-gimplify.c (c_fully_fold): Add LVAL argument, call
	cp_fold_maybe_rvalue instead of cp_fold_rvalue and pass it !LVAL.
testsuite/
	* gcc.dg/pr69960.c: New test.
	* gcc.dg/pr66618.c: New test.
	* gcc.dg/pr66618-2.c: New test.

From-SVN: r254930
2017-11-19 18:17:01 +01:00
Tom de Vries 4397fc04e3 [arc] Remove semicolon after do while (0) in FUNCTION_PROFILER
2017-11-19  Tom de Vries  <tom@codesourcery.com>

	* config/arc/arc.h (FUNCTION_PROFILER): Remove semicolon after
	"do while (0)".

From-SVN: r254929
2017-11-19 12:21:07 +00:00
Tom de Vries 3412efc86e [phoenix] Remove semicolon after do {} while (0) in TARGET_OS_CPP_BUILTINS
2017-11-19  Tom de Vries  <tom@codesourcery.com>

	* config/phoenix.h (TARGET_OS_CPP_BUILTINS): Remove semicolon after
	"do {} while (0)".

From-SVN: r254928
2017-11-19 10:40:00 +00:00
Tom de Vries b08c57ef9b [visium] Remove semicolon after ASM_OUTPUT_CASE_END
2017-11-19  Tom de Vries  <tom@codesourcery.com>

	* config/visium/visium.h (ASM_OUTPUT_CASE_END): Remove semicolon after
	macro body.

From-SVN: r254927
2017-11-19 10:39:50 +00:00
Tom de Vries f8575ee93f [ft32, spu] Remove semicolon after do {} while (0) in REGISTER_TARGET_PRAGMAS
2017-11-19  Tom de Vries  <tom@codesourcery.com>

	* config/ft32/ft32.h (REGISTER_TARGET_PRAGMAS): Remove semicolon after
	"do {} while (0)".
	* config/spu/spu.h (REGISTER_TARGET_PRAGMAS): Same.

From-SVN: r254926
2017-11-19 10:39:38 +00:00
Tom de Vries 6014142052 [mcore] Remove semicolon after do {} while (0) in MCORE_EXPORT_NAME
2017-11-19  Tom de Vries  <tom@codesourcery.com>

	* config/mcore/mcore-elf.h (MCORE_EXPORT_NAME): Remove semicolon after
	"do {} while (0)".
	* config/mcore/mcore.h (ASM_OUTPUT_ALIGNED_COMMON): After missing
	semicolon after MCORE_EXPORT_NAME call.

From-SVN: r254925
2017-11-19 10:39:27 +00:00
Edward Smith-Rowland b46881363f PR libstdc++/pr66689 - comp_ellint_3 and ellint_3 return garbage values
2017-11-18  Edward Smith-Rowland  <3dw4rd@verizon.net>

	PR libstdc++/pr66689 - comp_ellint_3 and ellint_3 return garbage values
	* include/tr1/ell_integral.tcc: Correct the nu sign convention
	in ellint_3 and comp_ellint_3.
	* testsuite/tr1/5_numerical_facilities/special_functions/
	06_comp_ellint_3/check_value.cc: Regen with correct values.
	* testsuite/tr1/5_numerical_facilities/special_functions/
	14_ellint_3/check_value.cc: Ditto.
	* testsuite/special_functions/06_comp_ellint_3/check_value.cc: Ditto.
	* testsuite/special_functions/13_ellint_3/check_value.cc: Ditto.
	* testsuite/tr1/5_numerical_facilities/special_functions/
	01_assoc_laguerre/check_value.cc: Regen.
	* testsuite/tr1/5_numerical_facilities/special_functions/
	02_assoc_legendre/check_value.cc: Regen.
	* testsuite/tr1/5_numerical_facilities/special_functions/
	03_beta/check_value.cc: Regen.
	* testsuite/tr1/5_numerical_facilities/special_functions/
	04_comp_ellint_1/check_value.cc: Regen.
	* testsuite/tr1/5_numerical_facilities/special_functions/
	05_comp_ellint_2/check_value.cc: Regen.
	* testsuite/tr1/5_numerical_facilities/special_functions/
	07_conf_hyperg/check_value.cc: Regen.
	* testsuite/tr1/5_numerical_facilities/special_functions/
	08_cyl_bessel_i/check_value.cc: Regen.
	* testsuite/tr1/5_numerical_facilities/special_functions/
	09_cyl_bessel_j/check_value.cc: Regen.
	* testsuite/tr1/5_numerical_facilities/special_functions/
	10_cyl_bessel_k/check_value.cc: Regen.
	* testsuite/tr1/5_numerical_facilities/special_functions/
	11_cyl_neumann/check_value.cc: Regen.
	* testsuite/tr1/5_numerical_facilities/special_functions/
	12_ellint_1/check_value.cc: Regen.
	* testsuite/tr1/5_numerical_facilities/special_functions/
	13_ellint_2/check_value.cc: Regen.
	* testsuite/tr1/5_numerical_facilities/special_functions/
	15_expint/check_value_neg.cc: Regen.
	* testsuite/tr1/5_numerical_facilities/special_functions/
	16_hermite/check_value.cc: Regen.
	* testsuite/tr1/5_numerical_facilities/special_functions/
	17_hyperg/check_value.cc: Regen.
	* testsuite/tr1/5_numerical_facilities/special_functions/
	18_laguerre/check_value.cc: Regen.
	* testsuite/tr1/5_numerical_facilities/special_functions/
	19_legendre/check_value.cc: Regen.
	* testsuite/tr1/5_numerical_facilities/special_functions/
	20_riemann_zeta/check_value_neg.cc: Regen.
	* testsuite/tr1/5_numerical_facilities/special_functions/
	21_sph_bessel/check_value.cc: Regen.
	* testsuite/tr1/5_numerical_facilities/special_functions/
	22_sph_legendre/check_value.cc: Regen.
	* testsuite/tr1/5_numerical_facilities/special_functions/
	23_sph_neumann/check_value.cc: Regen.
	* testsuite/ext/special_functions/conf_hyperg/check_value.cc: Regen.
	* testsuite/ext/special_functions/hyperg/check_value.cc: Regen.
	* testsuite/special_functions/01_assoc_laguerre/check_value.cc: Regen.
	* testsuite/special_functions/02_assoc_legendre/check_value.cc: Regen.
	* testsuite/special_functions/03_beta/check_value.cc: Regen.
	* testsuite/special_functions/04_comp_ellint_1/check_value.cc: Regen.
	* testsuite/special_functions/05_comp_ellint_2/check_value.cc: Regen.
	* testsuite/special_functions/07_cyl_bessel_i/check_value.cc: Regen.
	* testsuite/special_functions/08_cyl_bessel_j/check_value.cc: Regen.
	* testsuite/special_functions/09_cyl_bessel_k/check_value.cc: Regen.
 	* testsuite/special_functions/10_cyl_neumann/check_value.cc: Regen.
	* testsuite/special_functions/11_ellint_1/check_value.cc: Regen.
	* testsuite/special_functions/12_ellint_2/check_value.cc: Regen.
	* testsuite/special_functions/14_expint/check_value.cc: Regen.
	* testsuite/special_functions/15_hermite/check_value.cc: Regen.
	* testsuite/special_functions/16_laguerre/check_value.cc: Regen.
	* testsuite/special_functions/17_legendre/check_value.cc: Regen.
	* testsuite/special_functions/18_riemann_zeta/check_value.cc: Regen.
	* testsuite/special_functions/19_sph_bessel/check_value.cc: Regen.
	* testsuite/special_functions/20_sph_legendre/check_value.cc: Regen.
	* testsuite/special_functions/21_sph_neumann/check_value.cc: Regen.
	* testsuite/tr1/5_numerical_facilities/special_functions/
	06_comp_ellint_3/pr66689.cc: New.
	* testsuite/tr1/5_numerical_facilities/special_functions/
	14_ellint_3/pr66689.cc: New.
	* testsuite/special_functions/06_comp_ellint_3/pr66689.cc: New.
	* testsuite/special_functions/13_ellint_3/pr66689.cc: New.

From-SVN: r254924
2017-11-19 01:01:50 +00:00
GCC Administrator d432108324 Daily bump.
From-SVN: r254923
2017-11-19 00:16:20 +00:00
Tom de Vries 33f4e967a1 [vms] Add missing vmsdbgout_early_finish
2017-11-19  Tom de Vries  <tom@codesourcery.com>

	PR target/82961
	* vmsdbgout.c (vmsdbgout_early_finish): New function.
	(vmsdbg_debug_hooks): Set early_finish field to vmsdbgout_early_finish.

From-SVN: r254920
2017-11-18 23:30:50 +00:00
Jan Hubicka 517048cef0 cgraphclones.c (cgraph_edge::clone): Rename gcov_count to prof_count.
* cgraphclones.c (cgraph_edge::clone): Rename gcov_count to prof_count.
	(cgraph_edge::clone): Cleanup updating of profile.
	* ipa-cp.c (update_profiling_info): Likewise.
	* ipa-inline-transform.c (inline_transform): Likewise.
	* ipa-inline.c (inline_small_functions): Add missing space to dump.
	* ipa-split.c (execute_split_functions): Do not split when function
	is cold.
	* predict.c (estimate_bb_frequencies): Cleanup updating of profile.
	* profile-count.c (profile_count::dump): Add global0.
	(profile_count::to_cgraph_frequency): Do not ICE when entry is
	undefined.
	(profile_count::to_sreal_scale): Likewise.
	(profile_count::adjust_for_ipa_scaling): Fix typo in comment.
	(profile_count::combine_with_ipa_count): New function.
	* profile-count.h (profile_guessed_global0adjusted): New.
	(profile_count::adjusted_zero): New.
	(profile_count::global0adjusted): New.
	(profile_count::combine_with_ipa_count): New.
	* tree-inline.c (copy_edges_for_bb): Add NUM/DEN arugment;
	correct profile of return block of split functions.
	(copy_cfg_body): Remove unused profile_count.
	(copy_body): Likewise.
	(expand_call_inline): Update.
	(tree_function_versioning): Update.

From-SVN: r254919
2017-11-18 22:55:56 +00:00
Janne Blomqvist 2563a16d3c PR 44292 Handle large record lengths
Now that the ABI supports large record lengths, there's a few places
in libgfortran where we need to use larger types. For internal units
which by definition are in-memory, it's enought to use ptrdiff_t, for
external units gfc_offset.

Regtested on x86_64-pc-linux-gnu?

libgfortran/ChangeLog:

2017-11-19  Janne Blomqvist  <jb@gcc.gnu.org>

        PR fortran/44292
	* io/transfer.c (skip_record): Use gfc_offset to handle large
	records.
	(next_record_r): Likewise.
	(sset): Likewise.
	(next_record_w): Use gfc_offset/ptrdiff_t appropriately.

From-SVN: r254918
2017-11-19 00:05:13 +02:00
Edward Smith-Rowland a7a389d6ee specfun.h: Expose airy_ai and airy_bi.
2017-11-18  Edward Smith-Rowland  <3dw4rd@verizon.net>

	* include/bits/specfun.h: Expose airy_ai and airy_bi.
	* include/tr1/modified_bessel_func.tcc: Treat NaN and inf arg, return.
	* testsuite/ext/special_functions/airy_ai/check_nan.cc: New.
	* testsuite/ext/special_functions/airy_ai/check_value.cc: New.
	* testsuite/ext/special_functions/airy_ai/compile.cc: New.
	* testsuite/ext/special_functions/airy_bi/check_nan.cc: New.
	* testsuite/ext/special_functions/airy_bi/check_value.cc: New.
	* testsuite/ext/special_functions/airy_bi/compile.cc: New.

From-SVN: r254917
2017-11-18 19:53:25 +00:00
Janne Blomqvist a7037861a7 PR 83036 Make NEXTREC specifier for INQUIRE work for large record numbers
This is accomplished by making the NEXTREC specifier be a 8 byte
integer where supported.

I wasn't able to come up with a testcase that does not create a large
file that could be added to the testsuite, but here's one which
creates a 2 GB file:

program nextrec
  implicit none
  integer(8) :: ii, n
  open(10, file="foo.dat", recl=1, access="direct", form="unformatted", &
       status="replace")
  do ii = 1, huge(1) + 2_8
     write(10, rec=ii) 'a'
  end do
  inquire(10, nextrec=n)
  if (n /= huge(1) + 3_8) then
     call abort()
  end if
  close(10, status="delete")
end program nextrec

Regtested on x86_64-pc-linux-gnu.

gcc/fortran/ChangeLog:

2017-11-18  Janne Blomqvist  <jb@gcc.gnu.org>

	PR fortran/83036
	* ioparm.def (IOPARM): Make nextrec a pintio.

libgfortran/ChangeLog:

2017-11-18  Janne Blomqvist  <jb@gcc.gnu.org>

	PR fortran/83036
	* io/io.h: Make nextrec a GFC_IO_INT*.
---
 gcc/fortran/ioparm.def | 2 +-
 libgfortran/io/io.h    | 3 +--
 2 files changed, 2 insertions(+), 3 deletions(-)

diff --git a/gcc/fortran/ioparm.def b/gcc/fortran/ioparm.def
index 5fc04bc..59cc7cd 100644
--- a/gcc/fortran/ioparm.def
+++ b/gcc/fortran/ioparm.def
@@ -62,7 +62,7 @@ IOPARM (inquire, exist,		1 << 7,  pint4)
 IOPARM (inquire, opened,	1 << 8,  pint4)
 IOPARM (inquire, number,	1 << 9,  pint4)
 IOPARM (inquire, named,		1 << 10, pint4)
-IOPARM (inquire, nextrec,	1 << 11, pint4)
+IOPARM (inquire, nextrec,	1 << 11, pintio)
 IOPARM (inquire, recl_out,	1 << 12, pintio)
 IOPARM (inquire, strm_pos_out,	1 << 13, pintio)
 IOPARM (inquire, file,		1 << 14, char1)
diff --git a/libgfortran/io/io.h b/libgfortran/io/io.h
index 3330bce..d29b112 100644
--- a/libgfortran/io/io.h
+++ b/libgfortran/io/io.h
@@ -388,8 +388,7 @@ typedef struct
 {
   st_parameter_common common;
   GFC_INTEGER_4 *exist, *opened, *number, *named;
-  GFC_INTEGER_4 *nextrec;
-  GFC_IO_INT  *recl_out, *strm_pos_out;
+  GFC_IO_INT *nextrec, *recl_out, *strm_pos_out;
   CHARACTER1 (file);
   CHARACTER2 (access);
   CHARACTER1 (form);
-- 
2.7.4

From-SVN: r254916
2017-11-18 18:56:21 +02:00
Janne Blomqvist 831cf09d60 PR 44292 Enable large record lengths in OPEN and INQUIRE statements
This is a straightforward change that we can do now that the ABI has
been bumped (again!).

Regtested on x86_64-pc-linux-gnu.

gcc/fortran/ChangeLog:

2017-11-18  Janne Blomqvist  <jb@gcc.gnu.org>

	PR fortran/44292
	* ioparm.def (IOPARM): Make recl_in intio, and recl_out pintio.

libgfortran/ChangeLog:

2017-11-18  Janne Blomqvist  <jb@gcc.gnu.org>

	PR fortran/44292
	* io/io.h: Make recl_in a GC_IO_INT and recl_out a type
	GFC_IO_INT*.

gcc/testsuite/ChangeLog:

2017-11-18  Janne Blomqvist  <jb@gcc.gnu.org>

	PR fortran/44292
	* gfortran.dg/large_recl.f90: New test.

From-SVN: r254915
2017-11-18 18:13:20 +02:00