Commit Graph

180421 Commits

Author SHA1 Message Date
Jonathan Wakely b1e7c6fce1 libstdc++: Reduce header dependencies in and on <memory>
By moving std::make_obj_using_allocator and the related "utility
functions for uses-allocator construction" to a new header, we can avoid
including the whole of <memory> in <scoped_allocator> and
<memory_resource>.

In order to simplify the implementation of those utility functions they
now use concepts unconditionally. They are no longer defined if
__cpp_concepts is not defined. To simplify the code that uses those
functions I've introduced a __cpp_lib_make_obj_using_allocator feature
test macro (not specified in the standard, which might be an oversight).
That allows the code in <memory_resource> and <scoped_allocator> to
check the feature test macro to decide whether to use the new utilities,
or fall back to the C++17 code.

At the same time, this reshuffles some of the headers included by
<memory> so that they are (mostly?) self-contained. It should no longer
be necessary to include other headers before <bits/shared_ptr.h> when
other parts of the library want to use std::shared_ptr without including
the whole of <memory>.

libstdc++-v3/ChangeLog:

	* include/Makefile.am: Add new header.
	* include/Makefile.in: Regenerate.
	* include/bits/shared_ptr.h: Include <iosfwd>.
	* include/bits/shared_ptr_base.h: Include required headers here
	directly, instead of in <memory>.
	* include/bits/uses_allocator_args.h: New file. Move utility
	functions for uses-allocator construction from <memory> to here.
	Only define the utility functions when concepts are available.
	(__cpp_lib_make_obj_using_allocator): Define non-standard
	feature test macro.
	* include/std/condition_variable: Remove unused headers.
	* include/std/future: Likewise.
	* include/std/memory: Remove headers that are not needed
	directly, and are now inclkuded where they're needed. Include
	new <bits/uses_allocator_args.h> header.
	* include/std/memory_resource: Include only the necessary
	headers. Use new feature test macro to detect support for the
	utility functions.
	* include/std/scoped_allocator: Likewise.
	* include/std/version (__cpp_lib_make_obj_using_allocator):
	Define.
2020-10-22 18:42:03 +01:00
Olivier Hainque d667beea36 Scope libstdc++ configuration for vxworks to all versions
When libstdc++ is enabled, the current high level configuration
bits should apply the same to all versions of VxWorks.  Adjust the
config triplets matching rules accordingly.

2010-10-21  Olivier Hainque  <hainque@adacore.com>

libstdc++-v3/
	* crossconfig.m4: Turn vxworks matcher into vxworks*.
	* configure.host: Likewise.
	* configure: Regenerate.
2020-10-22 16:40:57 +00:00
Jan Hubicka 0e590b68fa Materialize clones on demand
this patch removes the pass to materialize all clones and instead this
is now done on demand.  The motivation is to reduce lifetime of function
bodies in ltrans that should noticeably reduce memory use for highly
parallel compilations of large programs (like Martin does) or with
partitioning reduced/disabled. For cc1 with one partition the memory use
seems to go down from 4gb to cca 1.5gb (seeing from top, so this is not
particularly accurate).

gcc/ChangeLog:

2020-10-22  Jan Hubicka  <hubicka@ucw.cz>

	* cgraph.c (cgraph_node::get_untransformed_body): Perform lazy
	clone materialization.
	* cgraph.h (cgraph_node::materialize_clone): Declare.
	(symbol_table::materialize_all_clones): Remove.
	* cgraphclones.c (cgraph_materialize_clone): Turn to ...
	(cgraph_node::materialize_clone): .. this one; move here
	dumping from symbol_table::materialize_all_clones.
	(symbol_table::materialize_all_clones): Remove.
	* cgraphunit.c (mark_functions_to_output): Clear stmt references.
	(cgraph_node::expand): Initialize bitmaps early;
	do not call execute_all_ipa_transforms if there are no transforms.
	* ipa-inline-transform.c (save_inline_function_body): Fix formating.
	(inline_transform): Materialize all clones before function is modified.
	* ipa-param-manipulation.c (ipa_param_adjustments::modify_call):
	Materialize clone if needed.
	* ipa.c (class pass_materialize_all_clones): Remove.
	(make_pass_materialize_all_clones): Remove.
	* passes.c (execute_all_ipa_transforms): Materialize all clones.
	* passes.def: Remove pass_materialize_all_clones.
	* tree-pass.h (make_pass_materialize_all_clones): Remove.
	* tree-ssa-structalias.c (ipa_pta_execute): Clear refs.
2020-10-22 17:32:32 +02:00
Tobias Burnus c26d7df103 OpenMP: Fortran - support omp flush's memorder clauses
gcc/fortran/ChangeLog:

	* gfortran.h (enum gfc_omp_memorder): Add.
	(gfc_omp_clauses): Use it.
	* openmp.c (gfc_match_omp_flush): Match memorder clauses.
	* trans-openmp.c (gfc_trans_omp_flush): Handle them.
	(gfc_trans_omp_directive): Update call.

gcc/testsuite/ChangeLog:

	* gfortran.dg/gomp/flush-1.f90: New test.
	* gfortran.dg/gomp/flush-2.f90: New test.
2020-10-22 17:09:22 +02:00
Will Schmidt b69c00612d [PATCH, rs6000] VSX load/store rightmost element operations
Hi,
  This adds support for the VSX load/store rightmost element operations.
  This includes the instructions lxvrbx, lxvrhx, lxvrwx, lxvrdx,
  stxvrbx, stxvrhx, stxvrwx, stxvrdx; And the builtins
  vec_xl_sext() /* vector load sign extend */
  vec_xl_zext() /* vector load zero extend */
  vec_xst_trunc() /* vector store truncate */.

  Testcase results show that the instructions added with this patch show
  up at low/no optimization (-O0), with a number of those being replaced
  with other load and store instructions at higher optimization levels.
  For consistency I've left the tests at -O0.

  [v2] Refreshed per review comments.  Comments cleaned up, indentation
  corrected.


gcc/ChangeLog:
	* config/rs6000/altivec.h (vec_xl_zext, vec_xl_sext, vec_xst_trunc):
	New defines.
	* config/rs6000/rs6000-builtin.def (BU_P10V_OVERLOAD_X): New builtin
	macro.
	(BU_P10V_AV_X): New builtin macro.
	(se_lxvrhbx, se_lxrbhx, se_lxvrwx, se_lxvrdx): Define internal names
	for load and sign extend vector element.
	(ze_lxvrbx, ze_lxvrhx, ze_lxvrwx, ze_lxvrdx): Define internal names
	for load and zero extend vector element.
	(tr_stxvrbx, tr_stxvrhx, tr_stxvrwx, tr_stxvrdx): Define internal names
	for truncate and store vector element.
	(se_lxvrx, ze_lxvrx, tr_stxvrx): Define internal names for overloaded
	load/store rightmost element.
	* config/rs6000/rs6000-call.c (altivec_builtin_types): Define the
	internal monomorphs P10_BUILTIN_SE_LXVRBX, P10_BUILTIN_SE_LXVRHX,
	P10_BUILTIN_SE_LXVRWX, P10_BUILTIN_SE_LXVRDX,
	P10_BUILTIN_ZE_LXVRBX, P10_BUILTIN_ZE_LXVRHX, P10_BUILTIN_ZE_LXVRWX,
	P10_BUILTIN_ZE_LXVRDX,
	P10_BUILTIN_TR_STXVRBX, P10_BUILTIN_TR_STXVRHX, P10_BUILTIN_TR_STXVRWX,
	P10_BUILTIN_TR_STXVRDX,
	(altivec_expand_lxvr_builtin): New expansion for load element builtins.
	(altivec_expand_stv_builtin): Update to for truncate and store builtins.
	(altivec_expand_builtin): Add clases for load/store rightmost builtins.
	(altivec_init_builtins): Add def_builtin entries for
	__builtin_altivec_se_lxvrbx, __builtin_altivec_se_lxvrhx,
	__builtin_altivec_se_lxvrwx, __builtin_altivec_se_lxvrdx,
	__builtin_altivec_ze_lxvrbx, __builtin_altivec_ze_lxvrhx,
	__builtin_altivec_ze_lxvrwx, __builtin_altivec_ze_lxvrdx,
	__builtin_altivec_tr_stxvrbx, __builtin_altivec_tr_stxvrhx,
	__builtin_altivec_tr_stxvrwx, __builtin_altivec_tr_stxvrdx,
	__builtin_vec_se_lxvrx, __builtin_vec_ze_lxvrx, __builtin_vec_tr_stxvrx.
	* config/rs6000/vsx.md (vsx_lxvr<wd>x, vsx_stxvr<wd>x, vsx_stxvr<wd>x):
	New define_insn entries.
	* doc/extend.texi:  Add documentation for vsx_xl_sext, vsx_xl_zext,
	and vec_xst_trunc.

gcc/testsuite/ChangeLog:
	* gcc.target/powerpc/vsx-load-element-extend-char.c: New test.
	* gcc.target/powerpc/vsx-load-element-extend-int.c: New test.
	* gcc.target/powerpc/vsx-load-element-extend-longlong.c: New test.
	* gcc.target/powerpc/vsx-load-element-extend-short.c: New test.
	* gcc.target/powerpc/vsx-store-element-truncate-char.c: New test.
	* gcc.target/powerpc/vsx-store-element-truncate-int.c: New test.
	* gcc.target/powerpc/vsx-store-element-truncate-longlong.c: New test.
	* gcc.target/powerpc/vsx-store-element-truncate-short.c: New test.
2020-10-22 09:46:23 -05:00
Will Schmidt 8732511910 [PATCH, rs6000] int128 sign extention instructions (partial prereq)
Hi
  This is a sub-set of the 128-bit sign extension support patch series
  that will be fully implemented in a subsequent patch from Carl.
  This is a necessary pre-requisite for the vector-load/store rightmost
  element patch that follows in this thread.

  [v2] Refreshed and touched up per review comments.
  - updated set_attr entries.  removed superfluous set_attr entries.
  - moved define_insn and define_expand entries to vsx.md.


gcc/ChangeLog:
	* config/rs6000/vsx.md (enum unspec): Add
	UNSPEC_EXTENDDITI2 and UNSPEC_MTVSRD_DITI_W1 entries.
	(mtvsrdd_diti_w1, extendditi2_vector): New define_insns.
	(extendditi2): New define_expand.
2020-10-22 09:42:52 -05:00
Eric Botcazou dfb7345cd5 [Ada] Enable the support of 128-bit integer types by default
gcc/ada/

	* Makefile.rtl (GNATRTL_128BIT_PAIRS): Add i-cexten.ads.
	* debug.adb (d.H): Document new usage.
	* doc/gnat_rm/representation_clauses_and_pragmas.rst (Size Clauses):
	Document new limit on 64-bit platforms.
	(Component_Size Clauses): Likewise.
	(Pragma Pack for Arrays): Likewise.
	(Pragma Pack for Records): Likewise.
	(Record Representation Clauses): Likewise.
	* gnat_rm.texi: Regenerate.
	* gnat1drv.adb (Adjust_Global_Switches): Rewrite code enabling or
	disabling the support for 128-bit integer types.
	* switch-c.adb (Scan_Front_End_Switches): Do not deal with e128.
	* usage.adb (Write_Switch_Char): Do not print -gnate128 switch.
	* libgnat/i-cexten__128.ads: New file.

gcc/testsuite/

	* ada/acats/run_all.sh: Define and substitute target_{max,min}_int.
	* ada/acats/support/macro.dfs: Parameterize {MAX,MIN}_INT.
	* gnat.dg/assert1.adb: Adjust conditionally to 128-bit integer types.
	* gnat.dg/size_clause1.adb: Do not expect a warning for LP64 targets.
	* gnat.dg/warn11.adb: Likewise.
	* gnat.dg/specs/rep_clause5.ads (Array_2_Type): Add alignment clause.
2020-10-22 08:11:28 -04:00
Javier Miranda b2dea70e92 [Ada] ACATS 4.1H - B853001 - missed errors for renamed limited
gcc/ada/

	* einfo.ads (Has_Limited_View): New synthesized attribute.
	* einfo.adb (Has_Limited_View): New synthesized attribute.
	(Set_Limited_View): Complete assertion.
	* sem_ch10.ads (Is_Visible_Through_Renamings): Make this routine
	public to invoke it from Find_Expanded_Name and avoid reporting
	spurious errors on renamings of limited-with packages.
	(Load_Needed_Body): Moved to have this spec alphabetically
	ordered.
	* sem_ch10.adb (Is_Visible_Through_Renamings): Moved to library
	level.
	(Is_Limited_Withed_Unit): New subprogram.
	* sem_ch3.adb (Access_Type_Declaration): Adding protection to
	avoid reading attribute Entity() when not available.
	* sem_ch8.adb (Analyze_Package_Renaming): Report error on
	renamed package not visible through context clauses.
	(Find_Expanded_Name): Report error on renamed package not
	visible through context clauses; handle special case where the
	prefix is a renaming of a (now visible) shadow package.
2020-10-22 08:11:27 -04:00
Ghjuvan Lacambre f0c57fcd0a [Ada] CUDA: discover runtime types instead of hard-coding
gcc/ada/

	* exp_prag.adb (Get_Launch_Kernel_Arg_Type): New function.
	(Build_Shared_Memory_Declaration): Use
	Get_Launch_Kernel_Arg_Type.
	(Build_Stream_Declaration): Use Get_Launch_Kernel_Arg_Type.
	* rtsfind.ads: Remove RO_IC_Unsigned_Long_Long.
2020-10-22 08:11:27 -04:00
Arnaud Charlet d4194d74fa [Ada] Add more annotations and assertions in the runtime
gcc/ada/

	* libgnat/s-imenne.adb, libgnat/s-imgrea.adb: Add assertions.
2020-10-22 08:11:27 -04:00
Arnaud Charlet 41a5205049 [Ada] Update annotations for codepeer analysis on GNAT runtime
gcc/ada/

	* libgnat/s-imgrea.adb (Set_Image_Real): Update annotations.
2020-10-22 08:11:27 -04:00
Steve Baird 7b3bda2ce2 [Ada] AI12-0211: Consistency of inherited nonoverridable aspects
gcc/ada/

	* aspects.ads: Introduce the subtype Nonoverridable_Aspect_Id,
	whose Static_Predicate reflects the list of nonoverridable
	aspects given in Ada RM 13.1.1(18.7).
	* sem_util.ads, sem_util.adb: Add two new visible subprograms,
	Check_Inherited_Nonoverridable_Aspects and Is_Confirming. The
	former is used to check the consistency of inherited
	nonoverridable aspects from multiple sources. The latter
	indicates whether two aspect specifications for a nonoverridable
	aspect are confirming. Because of compatibility concerns in
	compiling QGen, Is_Confirming always returns True if
	Relaxed_RM_Semantics (i.e., -gnatd.M) is specified.
	* sem_ch3.adb (Derived_Type_Declaration): Call new
	Check_Inherited_Nonoverridable_Aspects procedure if interface
	list is non-empty.
	* sem_ch9.adb (Check_Interfaces): Call new
	Check_Inherited_Nonoverridable_Aspects procedure if interface
	list is non-empty.
	* sem_ch13.adb (Analyze_Aspect_Specifications): When an explicit
	aspect specification overrides an inherited nonoverridable
	aspect, check that the explicit specification is confirming.
2020-10-22 08:11:26 -04:00
Eric Botcazou 944fed738c [Ada] Update the head comment of Check_Compile_Time_Size
gcc/ada/

	* freeze.ads (Check_Compile_Time_Size): Adjust size limit.
2020-10-22 08:11:26 -04:00
Richard Kenner 44b9c6715c [Ada] Allow use of debug routines when output is going elsewhere
gcc/ada/

	* sprint.adb (pg, po, ps): Use {Push,Pop}_Output.
	* treepr.adb (pl, pn): Likewise.
2020-10-22 08:11:26 -04:00
Eric Botcazou 47c53b0a23 [Ada] Minor fix in GNAT RM
gcc/ada/

	* doc/gnat_rm/implementation_advice.rst: Minor fix.
	* gnat_rm.texi: Regenerate.
2020-10-22 08:11:26 -04:00
Steve Baird 9a678fedcb [Ada] Implement AI12-0280's interactions with container aggregates
gcc/ada/

	* sem_util.adb (Is_Container_Aggregate): A new local predicates
	which indicates whether a given expression is a container
	aggregate. The implementation of this function is incomplete; in
	the unusual case of a record aggregate (i.e., not a container
	aggregate) of a type whose Aggregate aspect is specified, the
	function will incorrectly return True.
	(Immediate_Context_Implies_Is_Potentially_Unevaluated): Improve
	handling of aggregate components.
	(Is_Repeatedly_Evaluated): Test for container aggregate
	components along with existing test for array aggregate
	components.
2020-10-22 08:11:25 -04:00
Eric Botcazou d7a6aa4969 [Ada] Get rid of useless if-then-else in Exp_Fixd.Fpt_Value
gcc/ada/

	* exp_fixd.adb (Fpt_Value): Fold if-then-else with identical arms.
2020-10-22 08:11:25 -04:00
Ed Schonberg daaf017932 [Ada] Ada_2020 AI12-0250: Iterator filters in Iterated_Element_Assocations
gcc/ada/

	* par-ch4.adb (P_Iterated_Component_Association): If the
	construct includes an iterator filter it corresponds to an
	Iterated_Element_Association, so build the proper node for it.
	* exp_aggr.adb (Expand_Container_Aggregate, Aggregate_Size): If
	the component is an Iterated_Element_Association, treat it as
	having a non-static size.
2020-10-22 08:11:25 -04:00
Ghjuvan Lacambre e354dca602 [Ada] Fix parser not detecting casing issues in keywords
gcc/ada/

	* scng.adb (Scan): Check if any letter of the token is
	uppercase.
2020-10-22 08:11:25 -04:00
Justin Squirek d302be6eba [Ada] Wrong accessibility for conversion to named access
gcc/ada/

	* sem_util.adb (Accessibility_Level_Helper): Conversions to
	named access types get the level associated with the named
	access type.
2020-10-22 08:11:24 -04:00
Eric Botcazou 67a3b519af [Ada] Adjust documentation for Has_Constrained_Partial_View flag
gcc/ada/

	* einfo.ads (Has_Constrained_Partial_View): Add "base type" marker.
2020-10-22 08:11:24 -04:00
Gary Dismukes 84d7433aff [Ada] AI12-0095 Formal types and Constrained Partial Views
gcc/ada/

	* einfo.adb (Has_Constrained_Partial_View): Apply Base_Type to Id.
	* sem_res.adb (Resolve_Actuals.Check_Aliased_Parameter): Remove
	"not Is_Generic_Type" test and call
	Object_Type_Has_Constrained_Partial_View instead of
	Has_Constrained_Partial_View. Improve related error message to
	say "does not statically match" instead of just "does not
	match".
2020-10-22 08:11:24 -04:00
Steve Baird 29f2d76c65 [Ada] Implement AI12-0030: Stream attribute availability
gcc/ada/

	* sem_util.ads, sem_util.adb: Declare and implement a new
	predicate, Derivation_Too_Early_To_Inherit.  This function
	indicates whether a given derived type fails to inherit a given
	streaming-related attribute from its parent type because the
	declaration of the derived type precedes the corresponding
	attribute_definition_clause of the parent.
	* exp_tss.adb (Find_Inherited_TSS): Call
	Derivation_Too_Early_To_Inherit instead of unconditionally
	assuming that a parent type's streaming attribute is available
	for inheritance by an immediate descendant type.
	* sem_attr.adb (Stream_Attribute_Available): Call
	Derivation_Too_Early_To_Inherit instead of unconditionally
	assuming that a parent type's streaming attribute is available
	for inheritance by an immediate descendant type.
	* exp_attr.adb (Default_Streaming_Unavailable): A new predicate;
	given a type, indicates whether predefined (as opposed to
	user-defined) streaming operations for the type should be
	implemented by raising Program_Error.
	(Expand_N_Attribute_Reference): For each of the 4
	streaming-related attributes (i.e., Read, Write, Input, Output),
	after determining that no user-defined implementation is
	available (including a Stream_Convert pragma), call
	Default_Streaming_Unavailable; if that call returns True, then
	implement the streaming operation as "raise Program_Error;".
2020-10-22 08:11:24 -04:00
Eric Botcazou 46e5478350 [Ada] Fix bogus error on conversion from Float to 128-bit unsigned
gcc/ada/

	* checks.adb (Apply_Float_Conversion_Check): Saturate the bounds
	of the check to those of the base type of the expression.
2020-10-22 08:11:23 -04:00
Justin Squirek d7e2013065 [Ada] Reimplementation of accessibility checking
gcc/ada/

	* checks.adb (Apply_Accessibility_Check): Modify condition to
	avoid flawed optimization and use Get_Accessibility over
	Extra_Accessibility.
	* exp_attr.adb: Remove inclusion of Exp_Ch2.adb.
	* exp_ch2.adb, exp_ch2.ads (Param_Entity): Moved to sem_util.
	* exp_ch3.ads (Init_Proc_Level_Formal): New function.
	* exp_ch3.adb (Build_Init_Procedure): Add extra accessibility
	formal for init procs when the associated type is a limited
	record.
	(Build_Initialization_Call): Add condition to handle propagation
	of the new extra accessibility paramter actual needed for init
	procs.
	(Init_Proc_Level_Formal): Created to fetch a the extra
	accessibility parameter associated with init procs if one
	exists.
	* exp_ch4.adb (Build_Attribute_Reference): Modify static check
	to be dynamic.
	* exp_ch6.adb (Add_Cond_Expression_Extra_Actual): Move logic
	used to expand conditional expressions used as actuals for
	anonymous access formals.
	(Expand_Call_Helper): Remove extranious accessibility
	calculation logic.
	* exp_util.adb: Remove inclusion of Exp_Ch2.adb.
	* par-ch3.adb (P_Array_Type_Definition): Properly set
	Aliased_Present on access definitions
	* sem_attr.adb (Resolve_Attribute): Replace instances for
	Object_Access_Level with Static_Accessibility_Level.
	* sem_ch13.adb (Storage_Pool): Replace instances for
	Object_Access_Level with Static_Accessibility_Level.
	* sem_ch6.adb (Check_Return_Construct_Accessibility): Replace
	instances for Object_Access_Level with
	Static_Accessibility_Level.
	* sem_ch9.adb (Analyze_Requeue): Replace instances for
	Object_Access_Level with Static_Accessibility_Level.
	* sem_res.adb (Check_Aliased_Parameter,
	Check_Allocator_Discrim_Accessibility, Valid_Conversion):
	Replace instances for Object_Access_Level with
	Static_Accessibility_Level.
	* sem_util.adb, sem_util.ads (Accessibility_Level_Helper):
	Created to centralize calculation of accessibility levels.
	(Build_Component_Subtype): Replace instances for
	Object_Access_Level with Static_Accessibility_Level.
	(Defining_Entity): Add extra parameter to dictate whether an
	error is raised or empty is return in the case of an irrelevant
	N.
	(Dynamic_Accessibility_Level): Rewritten to use
	Accessibility_Level_Helper.
	(Is_View_Conversion): Check membership against Etype to capture
	nodes like explicit dereferences which have types but are not
	expanded names or identifers.
	(Object_Access_LeveL): Removed.
	(Param_Entity): Moved from sem_util.
	(Static_Accessibility_Level): Created as a replacement to
	Object_Access_Level, it also uses Accessibility_Level_Helper for
	its implementation.
	* snames.ads-tmpl: Added new name for extra accessibility
	parameter in init procs.
2020-10-22 08:11:23 -04:00
Piotr Trojanek cda800dd90 [Ada] Refactor appending to possibly empty lists
gcc/ada/

	* exp_prag.adb (Expand_Pragma_Contract_Cases,
	Expand_Pragma_Loop_Variant): Reuse Append_New_To.
	* sem_prag.adb (Analyze_Contract_Cases_In_Decl_Part): Fix typo.
	(Analyze_Pre_Post_Condition): Refactor repeated calls to
	Defining_Entity.
2020-10-22 08:11:23 -04:00
Eric Botcazou ea56c18c50 [Ada] Minor fixes in GNAT RM
gcc/ada/

	* doc/gnat_rm/implementation_defined_characteristics.rst: Minor
	fixes.
	* gnat_rm.texi: Regenerate.
2020-10-22 08:11:22 -04:00
Piotr Trojanek 9032759659 [Ada] Reduce scope of local variables for detecting extra WITH clauses
gcc/ada/

	* sem_warn.adb (Check_Unused_Withs): Move local variables from
	to a nested procedure; Lunit is passed as a parameter to
	Check_System_Aux and its type is refined from Node_Id to
	Entity_Id; Cnode is now a constant.
2020-10-22 08:11:22 -04:00
Patrick Bernardi 61d832dee4 [Ada] Add No_Implicit_Task_Allocations and No_Implicit_PO_Allocations to Jorvik
gcc/ada/

	* libgnat/s-rident.ads (Profile_Info): Use a common profile
	definition for Jorvik and GNAT Extended Ravenscar, using the
	GNAT Extended Ravenscar definition.
2020-10-22 08:11:22 -04:00
Eric Botcazou b1f909cfc1 [Ada] Build support units for 128-bit integer types on 64-bit platforms
gcc/ada/

	* Makefile.rtl (64-bit platforms): Add GNATRTL_128BIT_PAIRS to
	the LIBGNAT_TARGET_PAIRS list and also GNATRTL_128BIT_OBJS to
	the EXTRA_GNATRTL_NONTASKING_OBJS list.
2020-10-22 08:11:21 -04:00
Ghjuvan Lacambre 1019e23137 [Ada] Fix error message for import aspect
gcc/ada/

	* sem_prag.adb (Process_Convention,
	Process_Import_Or_Interface): Fix error message.
2020-10-22 08:11:20 -04:00
Ghjuvan Lacambre 8be08b9b67 [Ada] Fix transformation of Suppress aspect into pragma
gcc/ada/

	* sem_ch13.adb (Make_Aitem_Pragma): Turn into function. This
	removes a side-effect on the Aitem variable.
	(Analyze_Aspect_Specifications): Handle Suppress and Unsuppress
	aspects differently from the Linker_Section aspect.
	(Ceck_Aspect_At_Freeze_Point): Don't expect Suppress/Unsuppress
	to be delayed anymore.
2020-10-22 08:11:20 -04:00
Ed Schonberg 08c8883f44 [Ada] Ada_2020: ongoing work for aggregates for bounded containers
gcc/ada/

	* sem_aggr.adb: (Resolve_Container_Aggregate): For an indexed
	container, verify that expressions and component associations
	are not both present.
	* exp_aggr.adb: Code reorganization, additional comments.
	(Expand_Container_Aggregate): Use Aggregate_Size for Iterated_
	Component_Associations for indexed aggregates. If present, the
	default value of the formal in the constructor function is used
	when the size of the aggregate cannot be determined statically.
2020-10-22 08:11:20 -04:00
Eric Botcazou 4a11d43f15 [Ada] Fix oversight in Eval_Attribute for Bit_Position
gcc/ada/

	* sem_attr.adb (Eval_Attribute): Fix oversight for Bit_Position.
2020-10-22 08:11:20 -04:00
Ed Schonberg c448859271 [Ada] AI12-0307: uniform resolution rules for aggregates
gcc/ada/

	* sem_util.ads, sem_util.adb (Check_Ambiguous_Aggregate): When a
	subprogram call is found to be ambiguous, check whether
	ambiguity is caused by an aggregate actual.  and indicate that
	it should carry a type qualification.
	* sem_ch4.adb (Traverse_Hoonyms, Try_Primitive_Operation): Call
	it.
	* sem_res.adb (Report_Ambiguous_Argument): Call it.
2020-10-22 08:11:19 -04:00
Piotr Trojanek 1c583927a5 [Ada] Cleanup repeated code in checks for unused WITH clauses
gcc/ada/

	* sem_warn.adb (Check_One_Unit): Avoid repeated calls by using a
	local variable Lunit; remove local constant Eitem, which was
	identical to Lunit.
2020-10-22 08:11:19 -04:00
Alexandre Oliva f5d2432f92 use wraplf for low-precision elementary functions on x86*-vxworks too
The earlier patch that introduced the wraplf variants missed the
x86*-vxworks* ports.  This fixes them.


for  gcc/ada/ChangeLog

	* Makefile.rtl (LIBGNAT_TARGET_PAIRS) <x86*-vxworks*>: Select
	nolibm and wraplf variants like other vxworks ports.
2020-10-22 08:57:33 -03:00
Alexandre Oliva 4f48f31bbf enable sincos optimization on mingw-w64
The sincos transformation does not take place on all platforms,
because the libc_has_function target hook disables it by default.

Current mingw-w64's math library supports sincos, sincosl and sincosf,
in 32- and 64-bit modes.  I suppose this has been this way for long.

This patch enables the sincos optimization on this platform.


for  gcc/ChangeLog

	* config/i386/mingw-w64.h (TARGET_LIBC_HAS_FUNCTION): Enable
	sincos optimization.
2020-10-22 08:54:16 -03:00
Patrick Palka 3d423c6f6a c++: Handle RANGE_EXPR index in init_subob_ctx [PR97328]
In the testcase below, we're ICEing during constexpr evaluation of the
CONSTRUCTOR {.data={{}, [1 ... 7]={}}} of type 'vector'.  The interesting
thing about this CONSTRUCTOR is that it has a RANGE_EXPR index for an
element initializer which doesn't satisfy reduced_constant_expression_p
(because the field 't' is uninitialized).

This is a problem because init_subob_ctx currently punts on setting up a
sub-aggregate initialization context when given a RANGE_EXPR index, so
we later trip over the asserts in verify_ctor_sanity when recursing into
cxx_eval_bare_aggregate on this element initializer.

Fix this by making init_subob_ctx set up an appropriate initialization
context when supplied a RANGE_EXPR index.

gcc/cp/ChangeLog:

	PR c++/97328
	* constexpr.c (init_subob_ctx): Don't punt on RANGE_EXPR
	indexes, instead build a sub-aggregate initialization context
	with no subobject.

gcc/testsuite/ChangeLog:

	PR c++/97328
	* g++.dg/cpp2a/constexpr-init19.C: New test.
	* g++.dg/cpp2a/constexpr-init20.C: New test.
2020-10-22 07:40:40 -04:00
Patrick Palka 46fdced6a9 c++: constexpr evaluation and bare EMPTY_CLASS_EXPR [PR96575]
In the testcase below, folding of the initializer for 'ret' inside the
instantiated f<lambda>::lambda ends up yielding an initializer for which
potential_constant_expression returns false.  This causes finish_function
to mark the lambda as non-constexpr, which ultimately causes us to reject
'f(g)' as a call to a non-constexpr function.

The initializer for 'ret' inside f<lambda>::lambda, prior to folding, is
the CALL_EXPR

  <lambda(S)>::operator() (&cb, ({}, <<< Unknown tree: empty_class_expr >>>;))

where the second argument is a COMPOUND_EXPR whose second operand is an
EMPTY_CLASS_EXPR that was formed by build_class_a.  cp_fully_fold_init
is able to only partially fold this initializer: it gets rid of the
side-effectless COMPOUND_EXPR to obtain

  <lambda(S)>::operator() (&cb, <<< Unknown tree: empty_class_expr >>>)

as the final initializer for 'ret'.  This initializer no longer satifies
potential_constant_expression due to the bare EMPTY_CLASS_EXPR which is
not wrapped in a COMPOUND_EXPR.

(cp_fully_fold_init first tries maybe_constant_value on the original
CALL_EXPR, but constexpr evaluation punts upon seeing
__builtin_is_constant_evaluated, since manifestly_const_eval is false.)

To fix this, it seems we could either make cp_fold preserve the
COMPOUND_EXPR trees produced by build_call_a, or we could improve
the constexpr machinery to treat EMPTY_CLASS_EXPR trees as first-class
citizens.  Assuming it's safe to continue folding away these
COMPOUND_EXPRs, the second approach seems cleaner, so this patch
implements the second approach.

gcc/cp/ChangeLog:

	PR c++/96575
	* constexpr.c (cxx_eval_constant_expression)
	<case EMPTY_CLASS_EXPR>: Lower it to a CONSTRUCTOR.
	(potential_constant_expression_1) <case COMPOUND_EXPR>: Remove
	now-redundant handling of COMPOUND_EXPR with EMPTY_CLASS_EXPR
	second operand.
	<case EMPTY_CLASS_EXPR>: Return true instead of false.

gcc/testsuite/ChangeLog:

	PR c++/96575
	* g++.dg/cpp1z/constexpr-96575.C: New test.
2020-10-22 07:33:58 -04:00
Patrick Palka b083a14dfe c++: Check DECL_TEMPLATE_PARM_P in duplicate_decls [PR97511]
This makes duplicate_decls differentiate a TYPE_DECL for an alias
template from a TYPE_DECL for one of its template parameters.  The
recently added assert in template_parm_to_arg revealed this latent issue
because merging of the two TYPE_DECLs cleared the DECL_TEMPLATE_PARM_P
flag.

With this patch, we now also correctly diagnose the name shadowing in
the below testcase (as required by [temp.local]/6).

gcc/cp/ChangeLog:

	PR c++/97511
	* decl.c (duplicate_decls): Return NULL_TREE if
	DECL_TEMPLATE_PARM_P differ.

gcc/testsuite/ChangeLog:

	PR c++/97511
	* g++.dg/template/shadow3.C: New test.
2020-10-22 07:27:55 -04:00
Alan Modra 03e93e1efe [RS6000] VSX_MM_SUFFIX
gcc.target/powerpc/vsx_mask-count-runnable.c and others
Assembler messages:
Error: unrecognized opcode: `vcntmb<VSX_MM_SUFFIX>'

	* config/rs6000/vsx.md (vec_cntmb_<mode>, vec_extract_<mode>),
	(vec_expand_<mode>): Replace <VSX_MM_SUFFIX> with <wd>.
2020-10-22 21:33:09 +10:30
Richard Biener 655f7f0fb7 Refactor vect_analyze_slp_instance a bit
In preparation for a larger change this refactors vect_analyze_slp_instance
so it doesn't need to know a vector type early.

2020-10-22  Richard Biener  <rguenther@suse.de>

	* tree-vect-slp.c (vect_analyze_slp_instance): Refactor so
	computing a vector type early is not needed, for store group
	splitting compute a new vector type based on the desired
	group size.
2020-10-22 12:59:33 +02:00
Richard Biener b960a9c83a middle-end/97521 - fix VECTOR_CST expansion
This fixes expansion of VECTOR_BOOLEAN_TYPE_P VECTOR_CSTs which
when using an integer mode are not always "mask-mode" but may
be using an integer mode when there's no supported vector mode.

The patch makes sure to only go the mask-mode expansion if
the elements do not line up to cover the full integer mode
(when they do and the mode was an actual mask-mode there's
no actual difference in both expansions).

2020-10-22  Richard Biener  <rguenther@suse.de>

	PR middle-end/97521
	* expr.c (expand_expr_real_1): Be more careful when
	expanding a VECTOR_BOOLEAN_TYPE_P VECTOR_CSTs.

	* gcc.target/i386/pr97521.c: New testcase.
2020-10-22 12:59:33 +02:00
David Malcolm e14c2bdce0 ipa-modref-tree.c: fix selftest leaks
"make selftest-valgrind" was reporting:

40 bytes in 1 blocks are definitely lost in loss record 25 of 735
   at 0x483AE7D: operator new(unsigned long) (vg_replace_malloc.c:344)
   by 0xFA0CEA: selftest::test_insert_search_collapse() (ipa-modref-tree.c:40)
   by 0xFA2F9B: selftest::ipa_modref_tree_c_tests() (ipa-modref-tree.c:164)
   by 0x256E3AB: selftest::run_tests() (selftest-run-tests.c:93)
   by 0x1366A8B: toplev::run_self_tests() (toplev.c:2385)
   by 0x1366C47: toplev::main(int, char**) (toplev.c:2467)
   by 0x263203F: main (main.c:39)

40 bytes in 1 blocks are definitely lost in loss record 26 of 735
   at 0x483AE7D: operator new(unsigned long) (vg_replace_malloc.c:344)
   by 0xFA264A: selftest::test_merge() (ipa-modref-tree.c:123)
   by 0xFA2FA0: selftest::ipa_modref_tree_c_tests() (ipa-modref-tree.c:165)
   by 0x256E3AB: selftest::run_tests() (selftest-run-tests.c:93)
   by 0x1366A8B: toplev::run_self_tests() (toplev.c:2385)
   by 0x1366C47: toplev::main(int, char**) (toplev.c:2467)
   by 0x263203F: main (main.c:39)

40 bytes in 1 blocks are definitely lost in loss record 27 of 735
   at 0x483AE7D: operator new(unsigned long) (vg_replace_malloc.c:344)
   by 0xFA279E: selftest::test_merge() (ipa-modref-tree.c:130)
   by 0xFA2FA0: selftest::ipa_modref_tree_c_tests() (ipa-modref-tree.c:165)
   by 0x256E3AB: selftest::run_tests() (selftest-run-tests.c:93)
   by 0x1366A8B: toplev::run_self_tests() (toplev.c:2385)
   by 0x1366C47: toplev::main(int, char**) (toplev.c:2467)
   by 0x263203F: main (main.c:39)

With this patch, the output is clean.

gcc/ChangeLog:
	* ipa-modref-tree.c (selftest::test_insert_search_collapse): Fix
	leak.
	(selftest::test_merge): Fix leaks.
2020-10-22 06:44:27 -04:00
Andreas Krebbel f3cf5174b1 Fix PR97502
The S/390 backend does not define vec_cmp expanders so far. We relied
solely on expanding vcond.  With commit 502d63b6d various testcases
started to ICE now.

This patch just adds the missing expanders to prevent the ICE.
However, there are still a couple of performance-related testcase
regressions with the vcond lowering which have to be fixed
independently.

gcc/ChangeLog:

	PR target/97502
	* config/s390/vector.md ("vec_cmp<VI_HW:mode><VI_HW:mode>")
	("vec_cmpu<VI_HW:mode><VI_HW:mode>"): New expanders.

gcc/testsuite/ChangeLog:

	* gcc.dg/pr97502.c: New test.
2020-10-22 12:38:48 +02:00
Andreas Krebbel e3f25eac67 Fix PR97439
decimal_real_maxval misses to set the sign flag in the REAL_VALUE_TYPE.

gcc/ChangeLog:

	PR rtl-optimization/97439
	* dfp.c (decimal_real_maxval): Set the sign flag in the
	generated number.

gcc/testsuite/ChangeLog:

	* gcc.dg/dfp/pr97439.c: New test.
2020-10-22 12:38:01 +02:00
David Malcolm f7decfaebb analyzer: fix ICE when handling callback exceeds enode limit [PR97514]
gcc/analyzer/ChangeLog:
	PR analyzer/97514
	* engine.cc (exploded_graph::add_function_entry): Handle failure
	to create an enode, rather than asserting.

gcc/testsuite/ChangeLog:
	PR analyzer/97514
	* gcc.dg/analyzer/pr97514.c: New test.
2020-10-22 06:16:28 -04:00
David Malcolm 9ed7b339c9 analyzer: add some C++ test coverage
gcc/testsuite/ChangeLog:
	* g++.dg/analyzer/ctor-dtor-1.C: New test.
	* g++.dg/analyzer/dyncast-1.C: New test.
	* g++.dg/analyzer/vfunc-1.C: New test.
2020-10-22 06:15:08 -04:00
David Malcolm b7f2cfbf0f analyzer: fix ICE on dtor [PR97489]
gcc/analyzer/ChangeLog:
	PR analyzer/97489
	* engine.cc (exploded_graph::add_function_entry): Assert that we
	have a function body.
	(exploded_graph::on_escaped_function): Reject fndecls that don't
	have a function body.

gcc/testsuite/ChangeLog:
	PR analyzer/97489
	* g++.dg/analyzer/pr97489.C: New test.
2020-10-22 06:12:31 -04:00