Commit Graph

177575 Commits

Author SHA1 Message Date
Steve Baird
7c3e76b8dc [Ada] Implement AI12-0369
2020-06-12  Steve Baird  <baird@adacore.com>

gcc/ada/

	* sem_util.ads, sem_util.adb: Define 3 new Boolean-valued
	functions - Statically_Denotes_Entity,
	Statically_Denotes_Object, and Statically_Names_Object. The
	first two were taken from sem_attr.adb. The term "statically
	names" is defined in the Ada RM and the new function
	Statically_Names_Object is intended to reflect that definition,
	or more precisely, as described in a comment in the code, to
	reflect the expected future definition of that term.
	* sem_attr.adb: Delete functions Statically_Denotes_Object and
	Statically_Denotes_Entity; these two functions have been moved
	to package Sem_Util. Replace call to Statically_Denotes_Object
	with a call to Statically_Names_Object as per AI12-0217 (a
	binding interpretation, so no Ada_Version check).
	* exp_ch9.adb (Expand_Entry_Barrier.Is_Simple_Barrier): Change
	name of function (it was previously Is_Simple_Barrier_Name)
	because the function should return True in the case of a static
	expression; implement this requirement.  Change function to
	include a call to Statically_Names_Object so that, for Ada_2020
	and later, it will return True for appropriate subcomponent
	names.
	(Expand_Entry_Barrier.Is_Pure_Barrier): Handle
	N_Indexed_Component and N_Selected_Component cases by calling
	Statically_Names_Object.
	(Expand_Entry_Barrier): Reorganize to treat Simple_Barriers and
	Pure_Barriers more uniformly.  Prevent cascaded errors.
2020-06-12 04:29:28 -04:00
Ed Schonberg
834bb57ac5 [Ada] Compiler locks up with -gnatX and formal subprogram with aspects
2020-06-12  Ed Schonberg  <schonberg@adacore.com>

gcc/ada/

	* sem_ch12.adb (Find_Matching_Actual): Add guard on search loops
	to detect a compilation error when using a compiler built
	without assertions.
	(Instantiate_Formal_Subprogram): Create a new subprogram name
	for the actual only if formal has contract aspects and expansion
	is enabled.
2020-06-12 04:29:27 -04:00
Eric Botcazou
a80b1eb72d [Ada] Improve code generated for assignment of dynamic record aggregates
2020-06-12  Eric Botcazou  <ebotcazou@adacore.com>

gcc/ada/

	* exp_aggr.adb: Add with and use clauses for Sem_Mech.
	(Get_Base_Object): New function to get the base object of a node.
	(In_Place_Assign_OK): Add Target_Object parameter.  Deal with a
	qualified expression on entry.  Remove short-circuit for array
	aggregates with a single "others" choice.  Do not look into the
	components of the aggregate if the parent is an allocator.
	(Check_Component): Add T_OK parameter and rewrite.
	(Safe_Component): Invoke Check_Component with T_OK set to False.
	(Convert_To_Assignments): Try to use an in-place assignment for
	any target; for that, call Get_Base_Object on the target and pass
	the result to In_Place_Assign_OK.
	(Expand_Array_Aggregate): Use Parent_Kind and Parent_Node more
	consistently.  For an assignment, call Get_Base_Object on the
	target and pass the result to In_Place_Assign_OK.
2020-06-12 04:29:26 -04:00
Dmitriy Anisimkov
e2b7399e34 [Ada] Don't correct socket timeout on Windows Server 2019
2020-06-12  Dmitriy Anisimkov  <anisimko@adacore.com>

gcc/ada/

	* socket.c (__gnat_minus_500ms): Use GetVersionEx to detect
	Windows Server version.
	* libgnat/g-sothco.ads (Minus_500ms_Windows_Timeout): Remade to
	Boolean constant.
	* libgnat/g-socket.adb (Set_Socket_Option): Use
	Minus_500ms_Windows_Timeout constant instead of function call.
2020-06-12 04:29:25 -04:00
Arnaud Charlet
5052a270c0 [Ada] AI12-0350 Swap for Indefinite_Holders
2020-06-12  Arnaud Charlet  <charlet@adacore.com>

gcc/ada/

	* libgnat/a-coinho.ads, libgnat/a-coinho.adb,
	libgnat/a-coinho__shared.ads, libgnat/a-coinho__shared.adb
	(Swap): New procedure.
2020-06-12 04:29:24 -04:00
Arnaud Charlet
842d28d2ac [Ada] Fix handling of subprograms declared in a protected body
2020-06-12  Arnaud Charlet  <charlet@adacore.com>

gcc/ada/

	* exp_ch6.adb (Expand_N_Subprogram_Declaration): Do nothing for
	a subprogram declared in a protected body.
	* exp_ch9.ads, exp_ch9.adb
	(Build_Private_Protected_Declaration): Moved to sem_ch6.adb.
	(Expand_N_Protected_Body): Do nothing for a subprogram declared
	in a protected body.
	* sem_ch6.adb (Build_Internal_Protected_Declaration): Moved from
	exp_ch9.adb and renamed and fixed to ensure in particular that
	such subprograms have convention Intrinsic and have no protected
	version.
	(Analyze_Subprogram_Body_Helper): Call
	Build_Internal_Protected_Declaration.
	(Move_Pragmas): Moved up and merged with the more general
	version from Build_Private_Protected_Declaration. We only want
	to copy selected pragmas, most pragmas are not suitable for a
	copy on the spec.
2020-06-12 04:29:24 -04:00
Ed Schonberg
3ca9a460f0 [Ada] Diagnose illegal overriding indicators in protected bodies
2020-06-12  Ed Schonberg  <schonberg@adacore.com>

gcc/ada/

	* sem_ch6.adb (Check_Overriding_Indicatior): Reject an
	overriding indicator on a subprogram declared within a protected
	body.
2020-06-12 04:29:23 -04:00
Piotr Trojanek
019e90494b [Ada] Reuse Is_Entry where possible
2020-06-12  Piotr Trojanek  <trojanek@adacore.com>

gcc/ada/

	* contracts.adb, einfo.adb, sem_ch4.adb, sem_ch6.adb,
	sem_res.adb, sem_util.adb: Replace Ekind_In with Is_Entry.
2020-06-12 04:29:22 -04:00
Piotr Trojanek
c0cecc953a [Ada] Detect overlapping actuals in entry calls
2020-06-12  Piotr Trojanek  <trojanek@adacore.com>

gcc/ada/

	* sem_res.adb (Resolve_Entry_Call): Add call to
	Warn_On_Overlapping_Actuals.
2020-06-12 04:29:21 -04:00
Arnaud Charlet
e7148bc74f [Ada] ACATS 4.2Q - BDD2007
2020-06-12  Arnaud Charlet  <charlet@adacore.com>

gcc/ada/

	* aspects.ads (Is_Representation_Aspect): New array.
	* sem_ch13.adb (Analyze_Aspect_Specifications): Check
	13.1(9.2/5) for representation aspects.

gcc/testsuite/

	* gnat.dg/rep_clause8.adb: Update error location.
2020-06-12 04:29:20 -04:00
Bob Duff
05f799de94 [Ada] Put_Image: preload type Sink, change what types have it enabled
2020-06-12  Bob Duff  <duff@adacore.com>

gcc/ada/

	* exp_put_image.ads, exp_put_image.adb (Preload_Sink): Procedure
	for preloading type Sink.  This has the side effect of loading
	various dependents, including Ada.Strings.UTF_Encoding.
	(Enable_Put_Image): Disable Put_Image in pre-2020 versions of
	Ada.  This limitation can probably be lifted later.  Enable for
	tagged types except in predefined units.  Disable for CPP types;
	Put_Image is legal, just prints the type name.
	* sem_attr.adb (Check_Put_Image_Attribute): Don't complain about
	Put_Image of CPP types; instead call the "unknown" version of
	Put_Image.
	* sem_ch10.adb (Analyze_Compilation_Unit): Call Preload_Sink.
2020-06-12 04:29:19 -04:00
Piotr Trojanek
052d648847 [Ada] Remove redundant iterations in checks for overlapping actuals
2020-06-12  Piotr Trojanek  <trojanek@adacore.com>

gcc/ada/

	* sem_warn.adb (Warn_On_Overlapping_Actuals): Simplify.
2020-06-12 04:29:18 -04:00
Piotr Trojanek
879f6fa876 [Ada] Remove suppression for overlapping actuals in internal units
2020-06-12  Piotr Trojanek  <trojanek@adacore.com>

gcc/ada/

	* sem_warn.adb (Warn_On_Overlapping_Actuals): Remove suppression
	for internal units.
2020-06-12 04:29:18 -04:00
Arnaud Charlet
1ed0551d5a [Ada] ACATS 4.1Q - CDD2A04 - RLS not followed
2020-06-12  Arnaud Charlet  <charlet@adacore.com>

gcc/ada/

	* exp_strm.adb (Build_Elementary_Input_Call): Add support for 24
	bits elementary types.
	* rtsfind.ads: Add 24 bits integer streaming routines.
	* sem_ch13.adb (Analyze_Attribute_Definition_Clause
	[Attribute_Stream_Size]): Add support for 24 bits elementary
	types.
	* libgnat/s-stratt.ads, libgnat/s-stratt.adb,
	libgnat/s-stratt__xdr.adb: Add support for signed and unsigned
	24 bits integers.
2020-06-12 04:29:17 -04:00
Piotr Trojanek
51ebdbc91a [Ada] Simplify getting discriminant value from a list of constraints
2020-06-12  Piotr Trojanek  <trojanek@adacore.com>

gcc/ada/

	* sem_ch3.adb (Get_Discr_Value): Cleanup.
2020-06-12 04:29:16 -04:00
Eric Botcazou
ec772e4b26 [Ada] Implement AI12-0175 Preelaborable packages with address clauses
2020-06-12  Eric Botcazou  <ebotcazou@adacore.com>

gcc/ada/

	* rtsfind.ads (RTU_Id): Add System_Address_To_Access_Conversions.
	* sem_elab.adb (Elaboration_Phase_Active): Alphabetize.
	(Finalize_All_Data_Structures): Likewise.
	(Error_Preelaborated_Call): New procedure.
	(Build_Call_Marker): Set Is_Preelaborable_Call flag in marker.
	(Build_Access_Marker): Likewise.
	(Build_Subprogram_Invocation): Likewise.
	(Build_Task_Activation): Likewise.
	(Check_Preelaborated_Call): Return when the call is preelaborable.
	Call Error_Preelaborated_Call to give the error otherwise.
	(Check_Elab_Call): Likewise.
	* sem_util.adb (Is_Preelaborable_Function): New predicate.
	(Is_Non_Preelaborable_Construct.Visit): Recurse on the
	Explicit_Actual_Parameter field of N_Parameter_Association.
	(Is_Non_Preelaborable_Construct.Visit_Subexpression): In Ada 2020,
	for a call to a preelaborable function, visit the parameter list;
	otherwise, raise Non_Preelaborable exception.
	(Is_Preelaborable_Construct): Likewise, but recursively check the
	parameters instead and return false upon failure, otherwise true.
	* sinfo.ads (Is_Preelaborable_Call): New flag in call marker nodes.
	(Is_Preelaborable_Call): New inline function.
	(Set_Is_Preelaborable_Call): New inline procedure.
	* sinfo.adb (Is_Preelaborable_Call): New inline function.
	(Set_Is_Preelaborable_Call): New inline procedure.
2020-06-12 04:29:15 -04:00
Bob Duff
6f6f89a494 [Ada] Remove unnecessary use_clause from stringt.ads
2020-06-12  Bob Duff  <duff@adacore.com>

gcc/ada/

	* stringt.ads: Remove "use System;".
2020-06-12 04:29:14 -04:00
Eric Botcazou
4459999864 [Ada] Small cleanup in handling of Ada 2012 implicit dereferences
2020-06-12  Eric Botcazou  <ebotcazou@adacore.com>

gcc/ada/

	* sem_ch4.adb (Try_Container_Indexing): Replace call to
	First_Discriminant by Get_Reference_Discriminant to get the
	reference discriminant.
	* sem_ch13.adb (Check_Indexing_Functions): Likewise.
	* sem_ch5.adb (Preanalyze_Range): Call Get_Reference_Discriminant
	to get the reference discriminant.
	* sem_util.adb (Is_OK_Variable_For_Out_Formal): Treat all
	Ada 2012 implicit dereferences in only one place.
	(Is_Variable): Minor tweak.
2020-06-12 04:29:13 -04:00
Ed Schonberg
c14b424ec7 [Ada] Compiler crash on instance with overloaded actual and aspects
2020-06-12  Ed Schonberg  <schonberg@adacore.com>

gcc/ada/

	* sem_ch12.adb (Has_Contracts): New predicate to check whether a
	formal subprogram carries an aspect specification for a pre- or
	postcondition.
	(Build_Subprogram_Wrappers): If actual is overloaded, create a
	new name to be used in call inside wrapper body. This names
	carries the interpretations of the actual, and is resolved when
	the body is analyzed.
	(Build_Subprogram_Body_Wrapper): Use this generated name in
	call.
	(Build_Subprogram_Decl_Wrapper): Build profile of wrapper from
	the profile of formal, and reset type entities for subsequent
	analysis.
2020-06-12 04:29:12 -04:00
Bob Duff
c324c77eed [Ada] Put_Image attribute
2020-06-12  Bob Duff  <duff@adacore.com>

gcc/ada/

	* debug.adb: Remove usage of -gnatd_z.
	* exp_attr.adb, exp_put_image.ads, exp_put_image.adb: Clean up
	the enable/disable code. If Put_Image is disabled for a type,
	systematically call the "unknown" version.  Improve comments.
	Consolidate workarounds.  Remove usage of -gnatd_z.
2020-06-12 04:29:12 -04:00
Eric Botcazou
53c5cd3393 [Ada] Fix typos in comments
2020-06-12  Eric Botcazou  <ebotcazou@adacore.com>

gcc/ada/

	* sem_elab.adb: Fix typos in comments.
2020-06-12 04:29:11 -04:00
Justin Squirek
695a27fbb7 [Ada] Missing accessibility error on object in type conversion
2020-06-12  Justin Squirek  <squirek@adacore.com>

gcc/ada/

	* sem_util.adb (Object_Access_Level): Add processing of implicit
	dereferences.
2020-06-12 04:29:10 -04:00
Bob Duff
5fdf7945d9 [Ada] Ada2020: update Big_Numbers.* specs
2020-06-12  Bob Duff  <duff@adacore.com>

gcc/ada/

	* libgnat/a-nbnbin.adb, libgnat/a-nbnbin.ads,
	libgnat/a-nbnbin__gmp.adb, libgnat/a-nbnbre.adb,
	libgnat/a-nbnbre.ads: Update Put_Image, and uncomment the aspect
	specification.  Add pragmas Ada_2020.
	* libgnat/a-stouut.ads, libgnat/a-stteou.ads: Add Preelaborate,
	because the Big_Numbers packages have Preelaborate, and now
	depend on these Text_Output packages.
2020-06-12 04:29:09 -04:00
Eric Botcazou
90e9751757 [Ada] Implement AI12-0269 No_Return for functions
2020-06-12  Eric Botcazou  <ebotcazou@adacore.com>

gcc/ada/

	* einfo.ads (No_Return): Document it for all subprograms.
	* einfo.adb (Set_No_Return): Adjust assertion accordingly.
	* sem_ch3.adb (Check_Abstract_Overriding): Implement the
	check prescribed by RM 6.5.1(6/2) here instead of...
	(Derive_Subprogram): Adjust comment accordingly.
	* sem_disp.adb (Override_Dispatching_Operation): ...here.
	Remove superfluous return statement.
	* sem_ch6.adb (Check_No_Return_Expression): New procedure.
	(Analyze_Function_Return): Call it to implement the check
	prescribed by AI12-0269 for simple return statements of
	No_Return functions, and also checks extended statements.
	(Analyze_Return_Statement): Only give an error on a return
	statement in No_Return procedures.  Use idiomatic form.
	* sem_ch8.adb (Analyze_Subprogram_Renaming): Adjust error
	message for No_Return renaming subprogram.
	* sem_prag.adb (Analyze_Pragma) <Pragma_No_Return>: Accept
	it on functions and generic functions in Ada 2020.
2020-06-12 04:29:08 -04:00
Alexandre Oliva
eda72164ad match any program name when pruning collect messages
When collect* programs have an executable suffix, they may include it
in their outputs.  Match them when pruning gcc output, making room for
other program names to print them.


for  gcc/testsuite/ChangeLog

	* lib/prune.exp (prune_gcc_output): Match any executable name
	in collect messages.
2020-06-12 05:08:33 -03:00
Martin Liška
47fe96341d
Fix few -Wformat-diag warnings.
Ready for master?

Thanks,
Martin

gcc/ChangeLog:

	* cgraphunit.c (process_symver_attribute): Wrap weakref keyword.
	* dbgcnt.c (dbg_cnt_set_limit_by_index): Do not print extra new
	line.
	* lto-wrapper.c (merge_and_complain): Wrap option names.
2020-06-12 09:32:53 +02:00
Kewen Lin
04f0546e3e vect: Factor out and rename some functions/macros
Power supports vector memory access with length (in bytes) instructions.
Like existing fully masking for SVE, it is another approach to vectorize
the loop using partially-populated vectors.

As Richard Sandiford suggested, we should share the codes in approaches
with partial vectors if possible.  This patch is to:
  1) factor out two functions:
     - vect_min_prec_for_max_niters
     - vect_known_niters_smaller_than_vf.
  2) rename four functions:
     - vect_iv_limit_for_full_masking
     - check_load_store_masking
     - vect_set_loop_condition_masked
     - vect_set_loop_condition_unmasked
  3) rename macros LOOP_VINFO_MASK_COMPARE_TYPE and LOOP_VINFO_MASK_IV_TYPE.

Bootstrapped/regtested on aarch64-linux-gnu.

gcc/ChangeLog:

	* tree-vect-loop-manip.c (vect_set_loop_controls_directly): Rename
	LOOP_VINFO_MASK_COMPARE_TYPE to LOOP_VINFO_RGROUP_COMPARE_TYPE.  Rename
	LOOP_VINFO_MASK_IV_TYPE to LOOP_VINFO_RGROUP_IV_TYPE.
	(vect_set_loop_condition_masked): Renamed to ...
	(vect_set_loop_condition_partial_vectors): ... this.  Rename
	LOOP_VINFO_MASK_COMPARE_TYPE to LOOP_VINFO_RGROUP_COMPARE_TYPE.  Rename
	vect_iv_limit_for_full_masking to vect_iv_limit_for_partial_vectors.
	(vect_set_loop_condition_unmasked): Renamed to ...
	(vect_set_loop_condition_normal): ... this.
	(vect_set_loop_condition): Rename vect_set_loop_condition_unmasked to
	vect_set_loop_condition_normal.  Rename vect_set_loop_condition_masked
	to vect_set_loop_condition_partial_vectors.
	(vect_prepare_for_masked_peels): Rename LOOP_VINFO_MASK_COMPARE_TYPE
	to LOOP_VINFO_RGROUP_COMPARE_TYPE.
	* tree-vect-loop.c (vect_known_niters_smaller_than_vf): New, factored
	out from ...
	(vect_analyze_loop_costing): ... this.
	(_loop_vec_info::_loop_vec_info): Rename mask_compare_type to
	compare_type.
	(vect_min_prec_for_max_niters): New, factored out from ...
	(vect_verify_full_masking): ... this.  Rename
	vect_iv_limit_for_full_masking to vect_iv_limit_for_partial_vectors.
	Rename LOOP_VINFO_MASK_COMPARE_TYPE to LOOP_VINFO_RGROUP_COMPARE_TYPE.
	Rename LOOP_VINFO_MASK_IV_TYPE to LOOP_VINFO_RGROUP_IV_TYPE.
	(vectorizable_reduction): Update some dumpings with partial
	vectors instead of fully-masked.
	(vectorizable_live_operation): Likewise.
	(vect_iv_limit_for_full_masking): Renamed to ...
	(vect_iv_limit_for_partial_vectors): ... this.
	* tree-vect-stmts.c (check_load_store_masking): Renamed to ...
	(check_load_store_for_partial_vectors): ... this.  Update some
	dumpings with partial vectors instead of fully-masked.
	(vectorizable_store): Rename check_load_store_masking to
	check_load_store_for_partial_vectors.
	(vectorizable_load): Likewise.
	* tree-vectorizer.h (LOOP_VINFO_MASK_COMPARE_TYPE): Renamed to ...
	(LOOP_VINFO_RGROUP_COMPARE_TYPE): ... this.
	(LOOP_VINFO_MASK_IV_TYPE): Renamed to ...
	(LOOP_VINFO_RGROUP_IV_TYPE): ... this.
	(vect_iv_limit_for_full_masking): Renamed to ...
	(vect_iv_limit_for_partial_vectors): this.
	(_loop_vec_info): Rename mask_compare_type to rgroup_compare_type.
	Rename iv_type to rgroup_iv_type.
2020-06-12 02:18:20 -05:00
Richard Sandiford
3a179232a7 recog: Use parameter packs for operator()
This patch uses parameter packs to define insn_gen_fn::operator().
I guess in some ways it's C++-ification for its own sake, but it does
make things simpler and removes the current artificial limit of 16
arguments.

Note that the call is still strongly typed: all arguments have to have
implicit conversions to rtx.  Error messages for bad arguments look
reasonable.

I'm sure there are more elegant ways of getting the function type,
but this version at least fits on one line, so I didn't try too
hard to find an alternative.

2020-06-12  Richard Sandiford  <richard.sandiford@arm.com>

gcc/
	* recog.h (insn_gen_fn::f0, insn_gen_fn::f1, insn_gen_fn::f2)
	(insn_gen_fn::f3, insn_gen_fn::f4, insn_gen_fn::f5, insn_gen_fn::f6)
	(insn_gen_fn::f7, insn_gen_fn::f8, insn_gen_fn::f9, insn_gen_fn::f10)
	(insn_gen_fn::f11, insn_gen_fn::f12, insn_gen_fn::f13)
	(insn_gen_fn::f14, insn_gen_fn::f15, insn_gen_fn::f16): Delete.
	(insn_gen_fn::operator()): Replace overloaded definitions with
	a parameter-pack version.
2020-06-12 08:16:48 +01:00
H.J. Lu
3dcea658c9 x86: Add UNSPECV_PATCHABLE_AREA
Currently patchable area is at the wrong place.  It is placed immediately
after function label, before both .cfi_startproc and ENDBR.  This patch
adds UNSPECV_PATCHABLE_AREA for pseudo patchable area instruction and
changes ENDBR insertion pass to also insert patchable area instruction.
TARGET_ASM_PRINT_PATCHABLE_FUNCTION_ENTRY is defined to avoid placing
patchable area before .cfi_startproc and ENDBR.

gcc/

	PR target/93492
	* config/i386/i386-features.c (rest_of_insert_endbranch):
	Renamed to ...
	(rest_of_insert_endbr_and_patchable_area): Change return type
	to void. Add need_endbr and patchable_area_size arguments.
	Don't call timevar_push nor timevar_pop.  Replace
	endbr_queued_at_entrance with insn_queued_at_entrance.  Insert
	UNSPECV_PATCHABLE_AREA for patchable area.
	(pass_data_insert_endbranch): Renamed to ...
	(pass_data_insert_endbr_and_patchable_area): This.  Change
	pass name to endbr_and_patchable_area.
	(pass_insert_endbranch): Renamed to ...
	(pass_insert_endbr_and_patchable_area): This.  Add need_endbr
	and patchable_area_size;.
	(pass_insert_endbr_and_patchable_area::gate): Set and check
	need_endbr and patchable_area_size.
	(pass_insert_endbr_and_patchable_area::execute): Call
	timevar_push and timevar_pop.  Pass need_endbr and
	patchable_area_size to rest_of_insert_endbr_and_patchable_area.
	(make_pass_insert_endbranch): Renamed to ...
	(make_pass_insert_endbr_and_patchable_area): This.
	* config/i386/i386-passes.def: Replace pass_insert_endbranch
	with pass_insert_endbr_and_patchable_area.
	* config/i386/i386-protos.h (ix86_output_patchable_area): New.
	(make_pass_insert_endbranch): Renamed to ...
	(make_pass_insert_endbr_and_patchable_area): This.
	* config/i386/i386.c (ix86_asm_output_function_label): Set
	function_label_emitted to true.
	(ix86_print_patchable_function_entry): New function.
	(ix86_output_patchable_area): Likewise.
	(x86_function_profiler): Replace endbr_queued_at_entrance with
	insn_queued_at_entrance.  Generate ENDBR only for TYPE_ENDBR.
	Call ix86_output_patchable_area to generate patchable area if
	needed.
	(TARGET_ASM_PRINT_PATCHABLE_FUNCTION_ENTRY): New.
	* config/i386/i386.h (queued_insn_type): New.
	(machine_function): Add function_label_emitted.  Replace
	endbr_queued_at_entrance with insn_queued_at_entrance.
	* config/i386/i386.md (UNSPECV_PATCHABLE_AREA): New.
	(patchable_area): New.

gcc/testsuite/

	PR target/93492
	* gcc.target/i386/pr93492-1.c: New test.
	* gcc.target/i386/pr93492-2.c: Likewise.
	* gcc.target/i386/pr93492-3.c: Likewise.
	* gcc.target/i386/pr93492-4.c: Likewise.
	* gcc.target/i386/pr93492-5.c: Likewise.
2020-06-11 20:45:19 -07:00
GCC Administrator
e68e80c8dd Daily bump. 2020-06-12 00:16:29 +00:00
Patrick Palka
11c7261128 c++: constrained class template friend [PR93467]
This fixes two issues in our handling of constrained class template
friend declarations.

The first issue is that we fail to set the constraints on the injected
class template declaration during tsubst_friend_class.

The second issue is that the template parameter levels within the parsed
constraints of a class template friend declaration are shifted if the
enclosing class is a template, and this shift leads to spurious
constraint mismatch errors in associate_classtype_constraints if the
friend declaration refers to an already declared class template.

gcc/cp/ChangeLog:

	PR c++/93467
	* constraint.cc (associate_classtype_constraints): If there is a
	discrepancy between the current template depth and the template
	depth of the original declaration, then adjust the template
	parameter depth within the current constraints appropriately.
	* pt.c (tsubst_friend_class): Substitute into and set the
	constraints on the injected declaration.

gcc/testsuite/ChangeLog:

	PR c++/93467
	* g++.dg/cpp2a/concepts-friend6.C: New test.
	* g++.dg/cpp2a/concepts-friend7.C: New test.
2020-06-11 16:33:41 -04:00
Jonathan Wakely
df665e568d contrib: Make prepare-commit-msg hook smarter for amends
With this change the prepare-commit-msg hook can compare the log of a
commit being amended with the staged changes, and not run mklog.py
unnecessarily. This is controlled by a git config option,
gcc-config.mklog-hook-type.

contrib/ChangeLog:

	* prepare-commit-msg: Use the gcc-config.mklog-hook-type Git
	config key instead of the GCC_FORCE_MKLOG environment variable.
	Optionally disable generating a new ChangeLog template for
	amended commits when the existing log is still OK.
2020-06-11 20:22:33 +01:00
Harald Anlauf
393ccb7256 PR fortran/95611 - ICE in access_attr_decl, at fortran/decl.c:9075
When reporting a duplicate access specification of an operator, refer to
the proper symbol.

2020-06-11  Harald Anlauf <anlauf@gmx.de>

gcc/fortran/
	PR fortran/95611
	* decl.c (access_attr_decl): Use correct symbol in error message.

Co-Authored-By: Steven G. Kargl  <kargl@gcc.gnu.org>
2020-06-11 21:07:49 +02:00
Harald Anlauf
7fd614ee81 PR fortran/95544 - Fix ICE in NULL() argument to intrinsics
Fortran 2018: An argument to an intrinsic procedure other than ASSOCIATED,
NULL, or PRESENT shall be a data object.  An EXPR_NULL is not a data
object.  Add checks for intrinsics.

2020-06-11  Steven G. Kargl  <kargl@gcc.gnu.org>
	    Harald Anlauf  <anlauf@gmx.de>

gcc/fortran/
	PR fortran/95544
	* check.c (invalid_null_arg): Rename to gfc_invalid_null_arg.
	(gfc_check_associated, gfc_check_kind, gfc_check_merge)
	(gfc_check_shape, gfc_check_size, gfc_check_spread)
	(gfc_check_transfer): Adjust.
	(gfc_check_len_lentrim, gfc_check_trim): Check for NULL() argument.
	* gfortran.h: Declare gfc_invalid_null_arg ().
	* intrinsic.c (check_arglist): Check for NULL() argument.
2020-06-11 20:29:45 +02:00
Iain Sandoe
1c140cfbfa coroutines: Handle lambda closure pointers like 'this'.
It was agreed amongst the implementors that the correct
interpretation of the standard is that lambda closure pointers
should be treated in the same manner as class object pointers.

gcc/cp/ChangeLog:

	* coroutines.cc (instantiate_coro_traits): Pass a reference
	to lambda closure objects to traits instantiation.
	(morph_fn_to_coro): Likewise for promise parameter
	preview and allocator lookup.
2020-06-11 19:27:17 +01:00
Jonathan Wakely
b32eea9c0c libstdc++: Fix istream::ignore discarding too many chars (PR 94749)
The current code assumes that if the next character in the stream is
equal to the delimiter then we stopped because we saw that delimiter,
and so discards it.  But in the testcase for the PR we stop because we
reached the maximum number of characters, and it's coincidence that the
next character equals the delimiter. We should not discard the next
character in that case.

The fix is to check that we haven't discarded __n characters already,
instead of checking whether the next character equals __delim. Because
we've already checked for EOF, if we haven't discarded __n yet then we
know we stopped because we saw the delimiter. On the other hand, if the
next character is the delimiter we don't know if that's why we stopped.

	PR libstdc++/94749
	* include/bits/istream.tcc (basic_istream::ignore(streamsize, CharT)):
	Only discard an extra character if we didn't already reach the
	maximum number.
	* src/c++98/istream.cc (istream::ignore(streamsiz, char))
	(wistream::ignore(streamsize, wchar_t)): Likewise.
	* testsuite/27_io/basic_istream/ignore/char/94749.cc: New test.
	* testsuite/27_io/basic_istream/ignore/wchar_t/94749.cc: New test.
2020-06-11 18:41:37 +01:00
Tamar Christina
8f896fe5cd Testsuite: Mark check_effective_target_exceptions_enabled test as C++ test input.
The test in check_effective_target_exceptions_enabled uses a C++ keyword `throw`
and the test fails with a syntax error on any non-g++ test.  I now tell the
testsuite driver that this is a C++ input file so it runs it as such in all the
drivers.

gcc/testsuite/ChangeLog:

	* lib/target-supports.exp (check_effective_target_exceptions_enabled):
	Mark as C++ test input.
2020-06-11 18:19:44 +01:00
Harald Anlauf
87af4f4045 PR fortran/95503 - Fix ICE in gfc_is_simply_contiguous, at fortran/expr.c:5844
The check for assigning a pointer that cannot be determined to be simply
contiguous at compile time to a contiguous pointer does not need to be
invoked if the lhs of the assignment is known to have conflicting attributes.

2020-06-11  Harald Anlauf  <anlauf@gmx.de>

gcc/fortran/
	PR fortran/95503
	* expr.c (gfc_check_pointer_assign): Skip contiguity check of rhs
	of pointer assignment if lhs cannot be simply contiguous.

gcc/testsuite/
	PR fortran/95503
	* gfortran.dg/pr95503.f90: New test.
2020-06-11 15:48:56 +02:00
José Rui Faustino de Sousa
2ee70f5d16 PR95331 - Unlimited polymorphic arrays have wrong bounds.
When iterating over a class array use the bounds provided by the
transformed descriptor (in sym->backend_decl) instead of the original
bounds of the array (in the descriptor passed in the class _data)
which are passed in se->expr.

The patch partially depends on the patch for PR52351 and PR85868, but
does not seems to break anything by itself.

gcc/fortran/ChangeLog:

2020-06-11  José Rui Faustino de Sousa  <jrfsousa@gmail.com>

	PR fortran/95331
	* trans-array.c (gfc_conv_array_ref): For class array dummy
	arguments use the transformed descriptor in sym->backend_decl
	instead of the original descriptor.

gcc/testsuite/ChangeLog:

2020-06-11  José Rui Faustino de Sousa  <jrfsousa@gmail.com>

	PR fortran/95331
	* gfortran.dg/PR95331.f90: New test.
2020-06-11 15:16:37 +02:00
David Edelsohn
19019cd301 aix: xfail pure-virtual1.C expects weak __cxa_pure_virtual
The testcase expects __cxa_pure_virtual to be weak to avoid an
implicit dependency.  This does not occur on AIX, so expect this testcase
to fail on AIX.

gcc/testsuite/ChangeLog

2020-06-11  David Edelsohn  <dje.gcc@gmail.com>

	* g++.dg/abi/pure-virtual1.C: XFAIL AIX.
2020-06-11 09:11:42 -04:00
Martin Liska
3b3ad4af02
Fix formatting in rs6000.c.
gcc/ChangeLog:

	* config/rs6000/rs6000.c (rs6000_density_test): Fix GNU coding
	style.
2020-06-11 15:00:45 +02:00
David Edelsohn
c61f678a4f aix: Don't implicitly include inttypes.h
AIX stdio.h implicitly includes inttypes.h, which explicitly conflicts
with the purpose of this testcase.  This patch conditionally adds a macro
definition that inhibits the implicit inclusion.

gcc/testsuite/ChangeLog

2020-06-11  David Edelsohn  <dje.gcc@gmail.com>

	* gcc.dg/spellcheck-inttypes.c: Don't include inttypes.h on AIX.
2020-06-11 08:53:16 -04:00
Martin Liska
444035eafa
rs6000: skip debug info statements
gcc/ChangeLog:

	PR target/95627
	* config/rs6000/rs6000.c (rs6000_density_test): Skip debug
	statements.
2020-06-11 14:51:15 +02:00
José Rui Faustino de Sousa
2ff0f48819 Wrong array section bounds when passing to an intent-in pointer dummy.
Add code to allow for the creation a new descriptor for array
sections with the correct one based indexing.

Rework the generated descriptors indexing (hopefully) fixing the
wrong offsets generated.

gcc/fortran/ChangeLog:

2020-06-11  José Rui Faustino de Sousa  <jrfsousa@gmail.com>

	PR fortran/52351
	PR fortran/85868
	* trans-array.c (gfc_conv_expr_descriptor): Enable the
	creation of a new descriptor with the correct one based
	indexing for array sections.  Rework array descriptor
	indexing offset calculation.

gcc/testsuite/ChangeLog:

2020-06-11  José Rui Faustino de Sousa  <jrfsousa@gmail.com>

	PR fortran/52351
	PR fortran/85868
	* gfortran.dg/coarray_lib_comm_1.f90: Adjust match test for
	the newly generated descriptor.
	* gfortran.dg/PR85868A.f90: New test.
	* gfortran.dg/PR85868B.f90: New test.
2020-06-11 14:21:38 +02:00
Martin Liska
be11812eef
git_update_version: add --current argument.
The argument can be useful to update arbitrary branch, the changes
are added to git index and user is supposed to make a commit.

contrib/ChangeLog:

	* gcc-changelog/git_update_version.py: Add --curent argument.
2020-06-11 13:57:10 +02:00
José Rui Faustino de Sousa
6a07010b77 Patch to Bug 94022 - Array slices of assumed-size arrays.
Make sure that when passing array sections of assumed-size arrays to
procedures expecting an assumed-rank array the upper bound of the
last dimension of the array section does not get improperly reset
to -1 to mark it has an assumed size array.

gcc/fortran/ChangeLog:

2020-06-11  José Rui Faustino de Sousa  <jrfsousa@gmail.com>

	PR fortran/94022
	* trans-expr.c (gfc_conv_procedure_call): In the case of
	assumed-size arrays ensure that the reference is to a full array.

gcc/testsuite/ChangeLog:

2020-06-11  José Rui Faustino de Sousa  <jrfsousa@gmail.com>

	PR fortran/94022
	* gfortran.dg/PR94022.f90: New test.
2020-06-11 13:25:59 +02:00
Eric Botcazou
419c355c7a [Ada] Fix missing insertion of explicit dereference in instance
2020-06-11  Eric Botcazou  <ebotcazou@adacore.com>

gcc/ada/

	* sem_res.adb (Resolve_Implicit_Dereference): In an instance,
	reset the type of the prefix if it is private before building
	the dereference.
2020-06-11 05:53:56 -04:00
Eric Botcazou
12ad5b9ccc [Ada] Fix assertion failure on entry call through unchecked conversion
2020-06-11  Eric Botcazou  <ebotcazou@adacore.com>

gcc/ada/

	* exp_util.adb (Safe_Unchecked_Type_Conversion): Add missing
	Is_Type guard before calling Has_Discriminants on Etype.
2020-06-11 05:53:55 -04:00
Bob Duff
eedafec2f2 [Ada] Make libgnat/a-nbnbin__gmp.adb compile
2020-06-11  Bob Duff  <duff@adacore.com>

gcc/ada/

	* libgnat/a-nbnbin__gmp.adb: There's no Optional_Big_Integer
	anymore.  Invalid_Big_Integer is not used.
	Greatest_Common_Divisor returns Big_Positive.
2020-06-11 05:53:54 -04:00
Piotr Trojanek
0bfa32f922 [Ada] Refine type of a routine parameter from Node_Id to Entity_Id
2020-06-11  Piotr Trojanek  <trojanek@adacore.com>

gcc/ada/

	* sem_aggr.adb (Get_Value): Refine type of the Compon parameter.
2020-06-11 05:53:53 -04:00