Commit Graph

171600 Commits

Author SHA1 Message Date
Richard Sandiford 5a5a3bc5fa Add a function for getting the ABI of a call insn target
This patch replaces get_call_reg_set_usage with insn_callee_abi,
which returns the ABI of the target of a call insn.  The ABI's
full_reg_clobbers corresponds to regs_invalidated_by_call,
whereas many callers instead passed call_used_or_fixed_regs, i.e.:

  (regs_invalidated_by_call | fixed_reg_set)

The patch slavishly preserves the "| fixed_reg_set" for these callers;
later patches will clean this up.

2019-09-30  Richard Sandiford  <richard.sandiford@arm.com>

gcc/
	* target.def (insn_callee_abi): New hook.
	(remove_extra_call_preserved_regs): Delete.
	* doc/tm.texi.in (TARGET_INSN_CALLEE_ABI): New macro.
	(TARGET_REMOVE_EXTRA_CALL_PRESERVED_REGS): Delete.
	* doc/tm.texi: Regenerate.
	* targhooks.h (default_remove_extra_call_preserved_regs): Delete.
	* targhooks.c (default_remove_extra_call_preserved_regs): Delete.
	* config/aarch64/aarch64.c (aarch64_simd_call_p): Constify the
	insn argument.
	(aarch64_remove_extra_call_preserved_regs): Delete.
	(aarch64_insn_callee_abi): New function.
	(TARGET_REMOVE_EXTRA_CALL_PRESERVED_REGS): Delete.
	(TARGET_INSN_CALLEE_ABI): New macro.
	* rtl.h (get_call_fndecl): Declare.
	(cgraph_rtl_info): Fix formatting.  Tweak comment for
	function_used_regs.  Remove function_used_regs_valid.
	* rtlanal.c (get_call_fndecl): Moved from final.c
	* function-abi.h (insn_callee_abi): Declare.
	(target_function_abi_info): Mention insn_callee_abi.
	* function-abi.cc (fndecl_abi): Handle flag_ipa_ra in a similar
	way to get_call_reg_set_usage did.
	(insn_callee_abi): New function.
	* regs.h (get_call_reg_set_usage): Delete.
	* final.c: Include function-abi.h.
	(collect_fn_hard_reg_usage): Add fixed and stack registers to
	function_used_regs before the main loop rather than afterwards.
	Use insn_callee_abi instead of get_call_reg_set_usage.  Exit early
	if function_used_regs ends up not being useful.
	(get_call_fndecl): Move to rtlanal.c
	(get_call_cgraph_rtl_info, get_call_reg_set_usage): Delete.
	* caller-save.c: Include function-abi.h.
	(setup_save_areas, save_call_clobbered_regs): Use insn_callee_abi
	instead of get_call_reg_set_usage.
	* cfgcleanup.c: Include function-abi.h.
	(old_insns_match_p): Use insn_callee_abi instead of
	get_call_reg_set_usage.
	* cgraph.h (cgraph_node::rtl_info): Take a const_tree instead of
	a tree.
	* cgraph.c (cgraph_node::rtl_info): Likewise.  Initialize
	function_used_regs.
	* df-scan.c: Include function-abi.h.
	(df_get_call_refs): Use insn_callee_abi instead of
	get_call_reg_set_usage.
	* ira-lives.c: Include function-abi.h.
	(process_bb_node_lives): Use insn_callee_abi instead of
	get_call_reg_set_usage.
	* lra-lives.c: Include function-abi.h.
	(process_bb_lives): Use insn_callee_abi instead of
	get_call_reg_set_usage.
	* postreload.c: Include function-abi.h.
	(reload_combine): Use insn_callee_abi instead of
	get_call_reg_set_usage.
	* regcprop.c: Include function-abi.h.
	(copyprop_hardreg_forward_1): Use insn_callee_abi instead of
	get_call_reg_set_usage.
	* resource.c: Include function-abi.h.
	(mark_set_resources, mark_target_live_regs): Use insn_callee_abi
	instead of get_call_reg_set_usage.
	* var-tracking.c: Include function-abi.h.
	(dataflow_set_clear_at_call): Use insn_callee_abi instead of
	get_call_reg_set_usage.

From-SVN: r276309
2019-09-30 16:19:49 +00:00
Richard Sandiford 002ffd3caa Add a target hook for getting an ABI from a function type
This patch adds a target hook that allows targets to return
the ABI associated with a particular function type.  Generally,
when multiple ABIs are in use, it must be possible to tell from
a function type and its attributes which ABI it is using.

2019-09-30  Richard Sandiford  <richard.sandiford@arm.com>

gcc/
	* target.def (fntype_abi): New target hook.
	* doc/tm.texi.in (TARGET_FNTYPE_ABI): Likewise.
	* doc/tm.texi: Regenerate.
	* target.h (predefined_function_abi): Declare.
	* function-abi.cc (fntype_abi): Call targetm.calls.fntype_abi,
	if defined.
	* config/aarch64/aarch64.h (ARM_PCS_SIMD): New arm_pcs value.
	* config/aarch64/aarch64.c: Include function-abi.h.
	(aarch64_simd_abi, aarch64_fntype_abi): New functions.
	(TARGET_FNTYPE_ABI): Define.

From-SVN: r276308
2019-09-30 16:19:43 +00:00
Richard Sandiford bd785b4493 Add function_abi.{h,cc}
This patch adds new structures and functions for handling
multiple ABIs in a translation unit.  The structures are:

- predefined_function_abi: describes a static, predefined ABI
- function_abi: describes either a predefined ABI or a local
  variant of one (e.g. taking -fipa-ra into account)

The patch adds functions for getting the ABI from a given type
or decl; a later patch will also add a function for getting the
ABI of the target of a call insn.

Although ABIs are about much more than call-clobber/saved choices,
I wanted to keep the name general in case we add more ABI-related
information in future.

2019-09-30  Richard Sandiford  <richard.sandiford@arm.com>

gcc/
	* Makefile.in (OBJS): Add function-abi.o.
	(GTFILES): Add function-abi.h.
	* function-abi.cc: New file.
	* function-abi.h: Likewise.
	* emit-rtl.h (rtl_data::abi): New field.
	* function.c: Include function-abi.h.
	(prepare_function_start): Initialize crtl->abi.
	* read-rtl-function.c: Include regs.h and function-abi.h.
	(read_rtl_function_body): Initialize crtl->abi.
	(read_rtl_function_body_from_file_range): Likewise.
	* reginfo.c: Include function-abi.h.
	(init_reg_sets_1): Initialize default_function_abi.
	(globalize_reg): Call add_full_reg_clobber for each predefined ABI
	when making a register global.
	* target-globals.h (this_target_function_abi_info): Declare.
	(target_globals::function_abi_info): New field.
	(restore_target_globals): Copy it.
	* target-globals.c: Include function-abi.h.
	(default_target_globals): Initialize the function_abi_info field.
	(target_globals): Allocate it.
	(save_target_globals): Free it.

From-SVN: r276307
2019-09-30 16:19:38 +00:00
Nick Clifton 0c88d078eb Fix compile time warning about building the FRV backend by adding missing break statements to the switches in frv_register_move_cost.
PR target/85978
	* config/frv/frv.c (frv_register_move_cost): Add break statements
	to avoid falling through to the wrong cases.  Tidy code.

From-SVN: r276306
2019-09-30 15:27:14 +00:00
Richard Sandiford 51051f474a [AArch64] Strengthen aarch64_hard_regno_call_part_clobbered
The aarch64_vector_pcs handling in aarch64_hard_regno_call_part_clobbered
checks whether the mode might be bigger than 16 bytes, since on SVE
targets the (non-SVE) vector PCS only guarantees that the low 16 bytes
are preserved.  But for multi-register modes, we should instead test
whether each single-register part might be bigger than 16 bytes.
(The size is always divided evenly between registers.)

The testcase uses XImode as an example where this helps.

2019-09-30  Richard Sandiford  <richard.sandiford@arm.com>

gcc/
	* config/aarch64/aarch64.c (aarch64_hard_regno_call_part_clobbered):
	For multi-registers modes, test how big each register part is.

gcc/testsuite/
	* gcc.target/aarch64/torture/simd-abi-8.c: New test.

From-SVN: r276305
2019-09-30 15:23:30 +00:00
Nick Clifton 4baad9863a Remove the iq2000_select_section function the iq2000 backend - it never provided any useful functionality.
PR target/59205
	* config/iq2000/iq2000.c (iq2000_select_section): Delete.
	(TARGET_ASM_SELECT_SECTION): Remove definition.
	(TARGET_HAVE_SWITCHABLE_BSS_SECTIONS): Allow definition.

From-SVN: r276304
2019-09-30 15:18:14 +00:00
Ilya Leoshkevich 20fa157e67 Introduce rtx_alloca, alloca_raw_REG and alloca_rtx_fmt_*
When one passes short-lived fake rtxes to backends in order to test
their capabilities, it might be beneficial to allocate these rtxes on
stack in order to reduce the load on GC.

Provide macro counterparts of some of the gen_* functions for that
purpose.

gcc/ChangeLog:

2019-09-30  Ilya Leoshkevich  <iii@linux.ibm.com>

	* emit-rtl.c (init_raw_REG): New function.
	(gen_raw_REG): Use init_raw_REG.
	* gengenrtl.c (gendef): Emit init_* functions and alloca_*
	macros.
	* rtl.c (rtx_alloc_stat_v): Use rtx_init.
	* rtl.h (rtx_init): New function.
	(rtx_alloca): New function.
	(init_raw_REG): New function.
	(alloca_raw_REG): New macro.

From-SVN: r276303
2019-09-30 14:56:33 +00:00
Richard Sandiford 9343bf99b5 [C] Print ", ..." rather than ", ..." in diagnostics
pp_separate_with inserts a space after the separator, so there's
no need to add whitespace before "..." as well.

2019-09-30  Richard Sandiford  <richard.sandiford@arm.com>

gcc/c-family/
	* c-pretty-print.c (pp_c_parameter_type_list): Avoid printing
	two spaces between a comma and "...".

gcc/testsuite/
	* gcc.dg/Wincompatible-pointer-types-1.c (f1): Expect only one
	space between the comma and "...".

From-SVN: r276302
2019-09-30 14:49:07 +00:00
Kwok Cheung Yeung d7f9ee981f libgomp_g.h: Include stdint.h instead of gstdint.h.
2019-09-30  Kwok Cheung Yeung  <kcy@codesourcery.com>

        * libgomp_g.h: Include stdint.h instead of gstdint.h.

From-SVN: r276301
2019-09-30 16:16:34 +02:00
Michael Meissner 26ca7d1b24 Add initial support for prefixed/PC-relative addressing.
2019-09-30  Michael Meissner  <meissner@linux.ibm.com>

	* config/rs6000/predicates.md (pcrel_address): Delete predicate.
	(pcrel_local_address): Replace pcrel_address predicate, use the
	new function address_to_insn_form.
	(pcrel_external_address): Replace with new implementation using
	address_to_insn_form..
	(prefixed_mem_operand): Delete predicate which is now unused.
	(pcrel_external_mem_operand): Delete predicate which is now
	unused.
	* config/rs6000/rs6000-protos.h (enum insn_form): New
	enumeration.
	(enum non_prefixed): New enumeration.
	(address_to_insn_form): New declaration.
	(prefixed_load_p): New declaration.
	(prefixed_store_p): New declaration.
	(prefixed_paddi_p): New declaration.
	(rs6000_asm_output_opcode): New declaration.
	(rs6000_final_prescan_insn): Move declaration and update calling
	signature.
	(address_is_prefixed): New helper inline function.
	* config/rs6000/rs6000.c(print_operand_address): Check for either
	PC-relative local symbols or PC-relative external symbols.
	(rs6000_emit_move): Support loading PC-relative addresses.
	(mode_supports_prefixed_address_p): Delete, no longer used.
	(rs6000_prefixed_address_mode_p): Delete, no longer used.
	(address_to_insn_form): New function to decode an address format.
	(reg_to_non_prefixed): New function to identify what the
	non-prefixed memory instruction format is for a register.
	(prefixed_load_p): New function to identify prefixed loads.
	(prefixed_store_p): New function to identify prefixed stores.
	(prefixed_paddi_p): New function to identify prefixed load
	immediates.
	(next_insn_prefixed_p): New static state variable.
	(rs6000_final_prescan_insn): New function to determine if an insn
	uses a prefixed instruction.
	(rs6000_asm_output_opcode): New function to emit 'p' in front of a
	prefixed instruction.
	* config/rs6000/rs6000.h (FINAL_PRESCAN_INSN): New target hook.
	(ASM_OUTPUT_OPCODE): New target hook.
	* config/rs6000/rs6000.md (prefixed): New insn attribute for
	prefixed instructions.
	(prefixed_length): New insn attribute for the size of prefixed
	instructions.
	(non_prefixed_length): New insn attribute for the size of
	non-prefixed instructions.
	(pcrel_local_addr): New insn to load up a local PC-relative
	address.
	(pcrel_extern_addr): New insn to load up an external PC-relative
	address.
	(mov<mode>_64bit_dm): Split the alternatives for loading 0.0 to a
	GPR and loading a 128-bit floating point type to a GPR.

From-SVN: r276300
2019-09-30 13:49:13 +00:00
Richard Biener 61362d9d18 gimple.c (gimple_get_lhs): For PHIs return the result.
2019-09-30  Richard Biener  <rguenther@suse.de>

	* gimple.c (gimple_get_lhs): For PHIs return the result.
	* tree-vectorizer.h (vectorizable_live_operation): Also get the
	SLP instance as argument.
	* tree-vect-loop.c (vect_analyze_loop_operations): Also handle
	double-reduction PHIs with vectorizable_lc_phi.
	(vect_analyze_loop_operations): Adjust.
	(vect_create_epilog_for_reduction): Remove all code not dealing
	with reduction LC PHI or epilogue generation.
	(vectorizable_live_operation): Call vect_create_epilog_for_reduction
	for live stmts of reductions.
	* tree-vect-stmts.c (vectorizable_condition): When !for_reduction
	do not handle defs that are not vect_internal_def.
	(can_vectorize_live_stmts): Adjust.
	(vect_analyze_stmt): When the vectorized stmt defined a value
	used on backedges adjust the backedge uses of vectorized PHIs.

From-SVN: r276299
2019-09-30 11:59:16 +00:00
Jonathan Wakely 582c57a17e Implement LWG 3255 for std::span constructors
Also fix the constraints on span(Container&) and span(const Container&)
constructors so that they aren't used for const spans or const arrays.

	* include/std/span (span(element_type(&)[N]))
	(span(array<value_type, N>&), span(const array<value_type, N>&)):
	Deduce array element type to allow safe const conversions (LWG 3255).
	[!_GLIBCXX_P1394] (span(Container&), span(const Container&)): Use
	remove_cv_t on arguments to __is_std_span and __is_std_array.
	* testsuite/23_containers/span/lwg3255.cc: New test.

From-SVN: r276298
2019-09-30 12:52:08 +01:00
Jonathan Wakely 6438d29fb1 PR libstdc++/77936 remove unused variable
PR libstdc++/77936
	* include/parallel/checkers.h (__is_sorted): Remove unused variable.

From-SVN: r276297
2019-09-30 12:52:01 +01:00
Martin Jambor be525d9221 [PR 91853] Prevent IPA-SRA ICEs on type-mismatched calls
2019-09-30  Martin Jambor  <mjambor@suse.cz>

	PR ipa/91853
	* tree-inline.c (force_value_to_type): New function.
	(setup_one_parameter): Use force_value_to_type to convert type.
	* tree-inline.c (force_value_to_type): Declare.
	* ipa-param-manipulation.c (ipa_param_adjustments::modify_call): Deal
	with register type mismatches.

	testsuite/
	* gcc.dg/ipa/pr91853.c: New test.

From-SVN: r276296
2019-09-30 10:18:59 +02:00
Andreas Tobler 15bbad9243 config.gcc: Use the secure-plt on FreeBSD 13 and upwards for 32-bit PowerPC.
2019-09-30  Andreas Tobler  <andreast@gcc.gnu.org>

	* config.gcc: Use the secure-plt on FreeBSD 13 and upwards for
	32-bit PowerPC.
	Define TARGET_FREEBSD32_SECURE_PLT for 64-bit PowerPC.
	* config/rs6000/t-freebsd64: Make use of the above define and build
	the 32-bit libraries with secure-plt.

From-SVN: r276295
2019-09-30 09:54:52 +02:00
Jakub Jelinek 6a556ba414 re PR target/91931 (ICE in decompose, at rtl.h:2277)
PR target/91931
	* config/i386/i386-expand.c (ix86_expand_adjust_ufix_to_sfix_si): Use
	gen_int_mode instead of GEN_INT.

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

From-SVN: r276294
2019-09-30 09:26:58 +02:00
GCC Administrator 65403f15ec Daily bump.
From-SVN: r276276
2019-09-30 00:16:51 +00:00
Steven G. Kargl 3262dde64c re PR fortran/91641 (ICE in gfc_conv_is_contiguous_expr, at fortran/trans-intrinsic.c:2857)
2019-09-29  Steven G. Kargl  <kargl@gcc.gnu.org>

	PR fortran/91641
	* check.c (gfc_check_is_contiguous): null() cannot be an actual
	argument to is_contiguous().

2019-09-29  Steven G. Kargl  <kargl@gcc.gnu.org>

	PR fortran/91641
	* gfortran.dg/pr91641.f90: New test.

From-SVN: r276272
2019-09-29 19:12:08 +00:00
Iain Sandoe 7a40dd5a26 [Darwin, PPC, Mode Iterators 5/n] Update macho_low.
Replace the define_expand and two define_insns with a single
@macho_low_<mode> and update callers.

gcc/ChangeLog:

2019-09-29  Iain Sandoe  <iain@sandoe.co.uk>

	* config/darwin.c (gen_macho_low):Amend to include the mode
	argument.
	(machopic_indirect_data_reference): Amend gen_macho_low call
	to include mode argument
	* config/rs6000/rs6000.c (emit_move): Likewise. Amend a comment.
	* config/rs6000/darwin.md (@macho_low_<mode>): New, replaces
	the macho_high expander and two define_insn entries.

From-SVN: r276271
2019-09-29 19:09:13 +00:00
Steven G. Kargl c4770ba091 re PR fortran/91714 (Accepts type statement without delimiter in free form)
2019-09-29  Steven G. Kargl  <kargl@gcc.gnu.org>

	PR fortran/91714
	* decl.c (gfc_match_decl_type_spec):  Issue errors for a few
	mangled types.

2019-09-29  Steven G. Kargl  <kargl@gcc.gnu.org>

	PR fortran/91714
	* gfortran.dg/dec_type_print_3.f90: Update dg-error regex.
	* gfortran.dg/pr91714.f90: New test.

From-SVN: r276270
2019-09-29 16:19:58 +00:00
Paul Thomas 56b070e3bb re PR fortran/91726 (ICE in gfc_conv_array_ref, at fortran/trans-array.c:3612)
2019-09-29  Paul Thomas  <pault@gcc.gnu.org>

	PR fortran/91726
	* resolve.c (gfc_expr_to_initialize): Bail out with a copy of
	the original expression if the array ref is a scalar and the
	array_spec has corank.
	* trans-array.c (gfc_conv_array_ref): Such expressions are OK
	even if the array ref codimen is zero.
	* trans-expr.c (gfc_get_class_from_expr): New function taken
	from gfc_get_vptr_from_expr.
	(gfc_get_vptr_from_expr): Call new function.
	* trans-stmt.c (trans_associate_var): If one of these is a
	target expression, extract the class expression from the target
	and copy its fields to a new target variable.
	* trans.h : Add prototype for gfc_get_class_from_expr.

2019-09-29  Paul Thomas  <pault@gcc.gnu.org>

	PR fortran/91726
	* gfortran.dg/coarray_poly_9.f90 : New test.

From-SVN: r276269
2019-09-29 10:12:42 +00:00
Jakub Jelinek ae517a31c9 re PR bootstrap/90543 (Build failure on MINGW for gcc-9.1.0)
PR bootstrap/90543
	* optc-save-gen.awk: Fix up printing string option differences.

From-SVN: r276268
2019-09-29 12:06:40 +02:00
Kewen Lin b19d2e5e1a vec_perm cost to 1 for non-Power7 VSX architectures
gcc/ChangeLog

2019-09-29  Kewen Lin  <linkw@gcc.gnu.org>

    * config/rs6000/rs6000.c (rs6000_builtin_vectorization_cost): Lower
    vec_perm cost to 1 for non-Power7 VSX architectures.

From-SVN: r276267
2019-09-29 09:18:22 +00:00
Kewen Lin 51df413634 This patch is to add the support for float from/to long conversion
vectorization on port rs6000.

gcc/ChangeLog

2019-09-29  Kewen Lin  <linkw@gcc.gnu.org>

    * config/rs6000/vsx.md (vec_pack[su]_float_v2di): New define_expand.
    (vec_unpack_[su]fix_trunc_hi_v4sf): Likewise.
    (vec_unpack_[su]fix_trunc_lo_v4sf): Likewise.

gcc/testsuite/ChangeLog

2019-09-29  Kewen Lin  <linkw@gcc.gnu.org>

    * gcc.target/powerpc/conv-vectorize-1.c: New test.
    * gcc.target/powerpc/conv-vectorize-2.c: New test.

From-SVN: r276266
2019-09-29 05:08:14 +00:00
Jerry DeLisle 59784d3851 re PR fortran/91802 (ICE in mio_name_expr_t, at fortran/module.c:2141)
2019-09-28  Jerry DeLisle  <jvdelisle@gcc.ngu.org>

	PR fortran/91802
	* decl.c (attr_decl1): Return MATCH_ERROR without free to avoid
	bad expression type in free_expr0() ICE in rank+corank check.

From-SVN: r276265
2019-09-29 02:35:58 +00:00
GCC Administrator e834b8adb6 Daily bump.
From-SVN: r276264
2019-09-29 00:16:32 +00:00
François Dumont 97d5766531 stl_algo.h (merge): Fix documentation.
2019-09-28  François Dumont  <fdumont@gcc.gnu.org>

	* include/bits/stl_algo.h (merge): Fix documentation.
	* include/debug/functions.h (__check_sorted_aux): Add C++20 constexpr.
	(__check_sorted): Likewise and remove nested irreflexive check.
	(__check_sorted_set_aux, __check_sorted_set): Add C++20 constexpr.
	(__check_partitioned_lower, __check_partitioned_upper): Likewise.
	(_Irreflexive_checker::_S_is_valid): Likewise.
	(__is_irreflexive, __is_irreflexive_pred): Likewise.
	* include/debug/helper_functions.h (__get_distance): Add constexpr.
	(__valid_range_aux): Add C++20 constexpr.
	(__valid_range(_Iter, _Iter, _Distance_traits<_Iter>::__type&)):
	Likewise and add std::is_constant_evaluated check.
	(__valid_range_aux(_Iter, _Iter, std::input_iterator_tag)): New.
	(__valid_range_aux(_Iter, _Iter, std::random_accss_iterator_tag)): New.
	(__valid_range_aux(_Integral, _Integral, std::__true_type)): New,
	use latter.
	(__valid_range(_Iter, _Iter)): Adapt to use latter, add constexpr and
	__builtin_is_contant_evaludated check..
	(__can_advance, __base): Add constexpr.
	* include/debug/macros.h [_GLIBCXX_HAVE_BUILTIN_IS_CONSTANT_EVALUATED]
	(_GLIBCXX_DEBUG_VERIFY_COND_AT): New.
	(__glibcxx_check_sorted): Use __glibcxx_check_irreflexive.
	(__glibcxx_check_sorted_pred): Use __glibcxx_check_irreflexive_pred.
	* testsuite/25_algorithms/binary_search/constexpr.cc: Use irreflexive
	std::less.
	* testsuite/25_algorithms/is_sorted/constexpr.cc: Likewise.
	* testsuite/25_algorithms/merge/constexpr.cc: Fix order in camm. Fix
	lambda to be irreflexive.

From-SVN: r276260
2019-09-28 21:11:55 +00:00
Iain Sandoe 23cb6f8e0c [Darwin, PPC, Mode Iterators 4/n] Update macho_high.
Drop the expander and use a mode iterator on the define_insn
for @macho_high_<mode> instead.

gcc/ChangeLog:

2019-09-28  Iain Sandoe  <iain@sandoe.co.uk>

	* config/darwin.c (gen_macho_high): Amend to include the mode
	argument.
	(machopic_indirect_data_reference): Amend gen_macho_high call
	to include mode argument.
	(machopic_legitimize_pic_address): Likewise.
	* config/rs6000/rs6000.c (rs6000_legitimize_address):
	* config/rs6000/darwin.md (@macho_high_<mode>): New, replaces
	the macho_high expander and two define_insn entries.

From-SVN: r276256
2019-09-28 19:32:31 +00:00
Jerry DeLisle 60674b3f8a re PR libfortran/91593 (Implicit enum conversions in libgfortran/io/transfer.c)
2019-09-28  Jerry DeLisle  <jvdelisle@gcc.gnu.org>

	PR libfortran/91593
	* io/io.h: Add gcc_unreachable().
	* io/transfer.c (file_mode, current_mode,
	formatted_transfer_scalar_read, formatted_transfer_scalar_write,
	pre_position, next_record_r, next_record_w): Add and use
	FORMATTED_UNSPECIFIED to enumeration.

From-SVN: r276255
2019-09-28 19:14:47 +00:00
Steven G. Kargl 4c59710186 re PR fortran/91802 (ICE in mio_name_expr_t, at fortran/module.c:2141)
2019-09-28  Steven G. Kargl  <kargl@gcc.ngu.org>

	PR fortran/91802
	* decl.c (attr_decl1): Check if rank+corank > 15.

2019-09-28  Steven G. Kargl  <kargl@gcc.ngu.org>

	PR fortran/91802
	* gfortran.dg/pr91802.f90: New test.

From-SVN: r276254
2019-09-28 17:10:34 +00:00
Steven G. Kargl 036aa59282 re PR fortran/91864 (ICE in gfc_check_do_variable, at fortran/parse.c:4405)
2019-09-28  Steven G. Kargl  <kargl@gcc.gnu.org>

	PR fortran/91864
	* gcc/fortran/io.c (match_io_element): An inquiry parameter cannot be
	read into.
	* gcc/fortran/match.c (gfc_match_allocate): An inquiry parameter 
	can be neither an allocate-object nor stat variable.
	(gfc_match_deallocate): An inquiry parameter cannot be deallocated.

2019-09-28  Steven G. Kargl  <kargl@gcc.gnu.org>

	PR fortran/91864
	* gcc/testsuite/gfortran.dg/pr91864.f90

From-SVN: r276253
2019-09-28 16:26:43 +00:00
Marek Polacek 406c9a1173 PR c++/91889 - follow-up fix for DR 2352.
* call.c (involves_qualification_conversion_p): New function.
	(direct_reference_binding): Build a ck_qual if the conversion
	would involve a qualification conversion.
	(convert_like_real): Strip the conversion created by the ck_qual
	in direct_reference_binding.

	* g++.dg/cpp0x/ref-bind3.C: Add dg-error.
	* g++.dg/cpp0x/ref-bind4.C: New test.
	* g++.dg/cpp0x/ref-bind5.C: New test.
	* g++.dg/cpp0x/ref-bind6.C: New test.
	* g++.old-deja/g++.pt/spec35.C: Revert earlier change.

From-SVN: r276251
2019-09-28 15:35:37 +00:00
Marek Polacek 7cf66a2dbe PR c++/91921 - stray warning with -Woverloaded-virtual.
* class.c (warn_hidden): Only emit the second part of
	-Woverloaded-virtual if the first part was issued.  Use inform instead
	warning_at.

	* g++.dg/warn/Woverloaded-2.C: New.
	* g++.dg/warn/Woverloaded-2.h: New.
	* g++.dg/warn/pr61945.C: Turn dg-warning into dg-message.
	* g++.old-deja/g++.mike/warn6.C: Likewise.
	* g++.old-deja/g++.warn/virt1.C: Likewise.

From-SVN: r276249
2019-09-28 11:46:33 +00:00
Marek Polacek 028c9b3be4 PR c++/91923 - failure-to-SFINAE with class type NTTP in C++17.
* pt.c (invalid_nontype_parm_type_p): Only emit errors when
	tf_error.

	* g++.dg/cpp0x/nontype5.C: New test.

From-SVN: r276248
2019-09-28 11:36:36 +00:00
Oleg Endo c57a385006 re PR target/86805 (sh port needs updating for CVE-2017-5753)
gcc/
2019-09-28  Oleg Endo  <olegendo@gcc.gnu.org>

	PR target/86805
	* config/sh/sh.c (TARGET_HAVE_SPECULATION_SAFE_VALUE): Define.

From-SVN: r276244
2019-09-28 08:53:27 +00:00
Oleg Endo 2664bcb876 re PR target/80672 (gcc/config/sh/sh.c:716: prefer compare to find.)
gcc/
2019-09-28  Oleg Endo  <olegendo@gcc.gnu.org>

	PR target/80672
	* config/sh/sh.c (parse_validate_atomic_model_option): Use
	std::string::compare instead of std::string::find.

From-SVN: r276240
2019-09-28 08:33:31 +00:00
Alan Modra b164999002 Fix endian issue in pr91656 testcases
PR testsuite/91676
	PR rtl-optimization/91656
	* gcc.dg/torture/pr91656-1.c: Correct for big and pdp endian.
	* gcc.dg/torture/pr91656-2.c: Likewise.
	* gcc.dg/torture/pr91656-3.c: Likewise.

From-SVN: r276236
2019-09-28 16:42:14 +09:30
Ian Lance Taylor 6e81d34ea2 compiler: resolve importing ambiguity for more complex function calls
Tweak the exporter for inlinable function bodies to work around a
    problem with importing of function calls whose function expressions
    are not simple function names. In the bug in question, the function
    body exporter was writing out a function call of the form
    
           (*(*FuncTyp)(var))(arg)
    
    which produced an export data representation of
    
           *$convert(<type 5>, var)(x)
    
    which is hard to parse unambiguously. Fix: change the export data
    emitter to introduce parens around the function expression for more
    complex calls.
    
    Testcase for this bug is in CL 197217.
    
    Fixes golang/go#34503.
    
    Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/197122

From-SVN: r276228
2019-09-28 00:16:57 +00:00
GCC Administrator 222e8cb6ca Daily bump.
From-SVN: r276227
2019-09-28 00:16:24 +00:00
Maciej W. Rozycki e9085da528 Regenerate `configure' scripts for `uclinuxfdpiceabi' libtool.m4 update
A change made with r275564 ("[ARM/FDPIC v6 02/24] [ARM] FDPIC: Handle 
arm*-*-uclinuxfdpiceabi in configure scripts") to libtool.m4 has not 
regenerated all the `configure' scripts affected.  Fix it.

	gcc/
	* configure: Regenerate.

	libatomic/
	* configure: Regenerate.

	libbacktrace/
	* configure: Regenerate.

	libcc1/
	* configure: Regenerate.

	libffi/
	* configure: Regenerate.

	libgfortran/
	* configure: Regenerate.

	libgomp/
	* configure: Regenerate.

	libhsail-rt/
	* configure: Regenerate.

	libitm/
	* configure: Regenerate.

	libobjc/
	* configure: Regenerate.

	liboffloadmic/
	* configure: Regenerate.

	libphobos/
	* configure: Regenerate.

	libquadmath/
	* configure: Regenerate.

	libsanitizer/
	* configure: Regenerate.

	libssp/
	* configure: Regenerate.

	libstdc++-v3/
	* configure: Regenerate.

	libvtv/
	* configure: Regenerate.

	lto-plugin/
	* configure: Regenerate.

	zlib/
	* configure: Regenerate.

From-SVN: r276213
2019-09-27 21:24:42 +00:00
Jakub Jelinek 59bc434a33 re PR c++/88203 (assert does not compile with OpenMP's pragma omp parallel for default(none))
PR c++/88203
c-family/
	* c-common.h (c_omp_predefined_variable): Declare.
	* c-omp.c (c_omp_predefined_variable): New function.
	(c_omp_predetermined_sharing): Return OMP_CLAUSE_DEFAULT_SHARED
	for predefined variables.
c/
	* c-parser.c (c_parser_predefined_identifier): New function.
	(c_parser_postfix_expression): Use it.
	(c_parser_omp_variable_list): Parse predefined identifiers.
	* c-typeck.c (c_finish_omp_clauses): Allow predefined variables
	in shared and firstprivate clauses, even when they are predetermined
	shared.
cp/
	* parser.c (cp_parser_omp_var_list_no_open): Parse predefined
	variables.
	* semantics.c (finish_omp_clauses): Allow predefined variables in
	shared and firstprivate clauses, even when they are predetermined
	shared.
	* cp-gimplify.c (cxx_omp_predetermined_sharing_1): Return
	OMP_CLAUSE_DEFAULT_SHARED for predefined variables.
testsuite/
	* c-c++-common/gomp/pr88203-1.c: New test.
	* c-c++-common/gomp/pr88203-2.c: New test.
	* c-c++-common/gomp/pr88203-3.c: New test.

From-SVN: r276212
2019-09-27 22:14:24 +02:00
Jakub Jelinek 00798c5843 re PR middle-end/91920 (ggc 9.2.0 failing openmp compile on ppc64le)
PR middle-end/91920
	* gimplify.c (omp_default_clause): Predetermine DECL_IN_CONSTANT_POOL
	variables as shared.

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

From-SVN: r276211
2019-09-27 22:13:00 +02:00
Iain Sandoe 576113abdb [Darwin, PPC, Mode Iterators 3/n] Update macho_correct_pic.
Drop the expander and use a mode expander on the define_insn
for macho_correct_pic instead.

gcc/ChangeLog:

2019-09-27  Iain Sandoe  <iain@sandoe.co.uk>

	* config/rs6000/darwin.md (@macho_correct_pic_<mode>): New,
	replaces the expander and two define_insn entries.
	(@reload_macho_picbase_<mode>): Update gen_macho_correct_pic
	call.
	* config/rs6000/rs6000.md (builtin_setjmp_receiver): Likewise.

From-SVN: r276196
2019-09-27 19:23:39 +00:00
David Malcolm 26a23d11ed Const-correctness fixes for fibonacci_heap.h
gcc/ChangeLog:
	* fibonacci_heap.h (fibonacci_heap::empty): Make const.
	(fibonacci_heap::nodes): Likewise.
	(fibonacci_heap::min_key): Likewise.
	(fibonacci_heap::min): Likewise.

From-SVN: r276193
2019-09-27 18:24:44 +00:00
Jason Merrill 1a120ec124 constexpr.c (cxx_fold_indirect_ref): Use similar_type_p.
* constexpr.c (cxx_fold_indirect_ref): Use similar_type_p.

Merging the similar_type_p change to the concepts branch broke a cmcstl2
testcase; investigating led me to this small testcase which has always
failed on trunk.

	(cxx_eval_indirect_ref): Likewise.  Improve error location.

From-SVN: r276192
2019-09-27 14:23:10 -04:00
Jason Merrill c872f1506d cp-tree.h (class iloc_sentinel): New.
* cp-tree.h (class iloc_sentinel): New.

We didn't already have a sentinel for input_location, and while
temp_override would work, it would also happily set input_location to 0,
which breaks things that try to look up the associated filename.

	* decl.c (grokdeclarator, finish_enum_value_list): Use it.
	* mangle.c (mangle_decl_string): Use it.
	* pt.c (perform_typedefs_access_check): Use it.

From-SVN: r276191
2019-09-27 14:19:55 -04:00
David Malcolm 975d043ff6 Make cgraph_node::get_fun const
gcc/ChangeLog:
	* cgraph.c (cgraph_node::get_fun): Make const.
	* cgraph.h (cgraph_node::get_fun): Likewise.

From-SVN: r276190
2019-09-27 18:12:56 +00:00
Ian Lance Taylor 37ed4c3269 compiler: don't read known type, simplify Import::finalize_methods
With the current export format, if we already know the type, we don't
    have to read and parse the definition.
    
    We only use the finalizer in Import::finalize_methods, so make it a
    local variable.  To match Finalize_methods::type, only put struct
    types into real_for_named.
    
    Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/197700

From-SVN: r276188
2019-09-27 17:51:43 +00:00
Ian Lance Taylor 51c3b7c6ec compiler: only check whether struct or array types are big
Fetching the size of a type typically involves a hash table lookup,
    and is generally non-trivial.  The escape analysis code calls is_big
    more than one might expect.  So only fetch the size if we need it.
    
    Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/197699

From-SVN: r276187
2019-09-27 17:34:58 +00:00
Ian Lance Taylor df43545684 compiler: fix brace formatting
Just happened to notice this one.
    
    Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/197698

From-SVN: r276186
2019-09-27 17:32:27 +00:00