Commit Graph

180622 Commits

Author SHA1 Message Date
Rasmus Villemoes
ad1a9afc60 Fix overzealous gthread support inhibition for vxworks
The tests for macros possibly defined in gthr.h needs to
be performed after the corresponding #include. This was tested
together with the previous updates to gthr-vxworks-thread.c
and gthr-vxworks-cond.c and was meant to be squashed with them.

2010-10-23  Rasmus Villemoes  <rv@rasmusvillemoes.dk>

libgcc/
	* config/gthr-vxworks-thread.c: #include gthr.h before
	testing the guard defined there.
	* config/gthr-vxworks-cond.c: Likewise.
2020-10-23 15:23:33 +00:00
Douglas Rupp
081dc85073 Add a if-exists-then-else built-in spec function
This patch adds an if-exists-then-else
builtin spec function, which tests for the existence of
a file and returns one or the other of the following
arguments depending on the result of the test.

This differs from the existing if-exists or
if-exists-else function which return the name of the
tested file if it exists.

This new function is of help to a forthcoming change for
VxWorks where we check for the presence of a specific header
file to decide the name of a library to include in the link
closure.

2020-10-23  Douglas Rupp  <rupp@adacore.com>

gcc/
	* gcc.c (if-exists-then-else): New built-in spec function.
	* doc/invoke.texi: Document it.
2020-10-23 15:21:38 +00:00
Tulio Magno Quites Machado Filho via Gcc-patches
940e68b9de rs6000: Fix extraneous characters in the documentation
Replace them with a whitespace in order to avoid artifacts in the HTML
document.

2020-08-19  Tulio Magno Quites Machado Filho  <tuliom@linux.ibm.com>

gcc/
	* doc/extend.texi (PowerPC Built-in Functions): Replace
	extraneous characters with whitespace.
2020-10-23 15:09:30 +00:00
Martin Liska
9067a15450 gcov: fix reading of zero sections.
I noticed that during coverage build of binutils.

gcc/ChangeLog:

	* gcov.c (read_count_file): Never call gcov_sync with a negative
	value.
2020-10-23 16:22:55 +02:00
Jonathan Wakely
b66b30a807 testsuite: Add noexcept(false) to throwing destructor
I think this test is intended to check this property of the C++
standard:

"If a destructor directly invoked by stack unwinding exits via an
exception, std::terminate is invoked." [except.throw]

Since C++11 any exception escaping a destructor will call
std::terminate, so the test would terminate even if the unwinding
behaviour was wrong.

Give the destructor a potentially-throwing exception specification,
so that we know that terminate was called for the right reason.

gcc/testsuite/ChangeLog:

	* g++.dg/compat/eh/filter2_y.C: Add noexcept(false) to
	destructor.
2020-10-23 15:03:38 +01:00
Patrick Palka
50106208ff libstdc++: Apply proposed resolutions for LWG 3428, 3447
libstdc++-v3/ChangeLog:

	* include/std/ranges (single_view::single_view): Mark the
	in place constructor explicit as per LWG 3428.
	(take_view): Remove the constraint on the deduction guide's
	template parameter as per LWG 3447.
2020-10-23 09:03:25 -04:00
Alexandre Oliva
9e3b9ddb99 more wraplf for aux long long float: s390, sparc and powerpc
The wraplf version of Ada.Numerics.Aux_Long_Long_Float is needed on
s390* as well.  Also add it to sparc*-linux-gnu and powerpc-darwin,
that were missed when adding it for sparc and ppc targets.


for  gcc/ada/ChangeLog

	PR ada/97504
	* Makefile.rtl (LIBGNAT_TARGET_PAIRS): Select wraplf version
	of Aux_Long_Long_Float for s390 and remaining sparc and
	powerpc targets.
2020-10-23 06:37:07 -03:00
Dmitriy Anisimkov
d08d481912 [Ada] Sockets.Poll implementation
gcc/ada/

	* Makefile.rtl (GNATRTL_SOCKETS_OBJS): New object
	g-socpol$(objext) New source files noted: g-socpol.adb,
	g-socpol.ads, g-socpol__dummy.adb, g-socpol__dummy.ads,
	g-sopowa.adb, g-sopowa__posix.adb, g-sopowa__mingw.adb,
	g-spogwa.adb, g-spogwa.ads.
	* impunit.adb (Non_Imp_File_Names_95): New base filename
	g-socpol in "GNAT Library Units" section for GNAT.Sockets.Poll
	unit.
	* libgnat/g-socket.ads, libgnat/g-socket.adb:
	(Raise_Socket_Error): Moved from body to private part of
	specification to use in GNAT.Sockets.Poll.
	* libgnat/g-socpol.ads, libgnat/g-socpol.adb: Main unit of the
	implementation.
	* libgnat/g-socpol__dummy.ads, libgnat/g-socpol__dummy.adb:
	Empty unit for the systems without sockets support.
	* libgnat/g-spogwa.ads, libgnat/g-spogwa.adb: Generic unit
	implementing sockets poll on top of select system call.
	* libgnat/g-sopowa.adb (Wait): Separate implementation for
	operation systems with poll system call support.
	* libgnat/g-sopowa__posix.adb (Wait): Separate implementation
	for POSIX select system call.
	* libgnat/g-sopowa__mingw.adb (Wait): Separate implementation
	for Windows select system call.
	* gsocket.h (_WIN32_WINNT): Increase to 0x0600 for winsock2.h to
	allow WSAPoll related definitions.
	* s-oscons-tmplt.c: Fix comment next to #endif for
	#if defined (__linux__) || defined (__ANDROID__) line.  Include
	<poll.h> for all except VxWorks and Windows.
	(SIZEOF_nfds_t): New definition.
	(SIZEOF_fd_type): New definition.
	(SIZEOF_pollfd_events): New definition.
	(POLLIN, POLLPRI, POLLOUT, POLLERR, POLLHUP, POLLNVAL): New
	definitions for VxWorks to be able to emulate poll on top of
	select in it.  Define POLLPRI as zero on Windows as it is not
	supported there.
	(Poll_Linkname): New definition, because the poll system call
	has different name in Windows and POSIX.
2020-10-23 04:25:07 -04:00
Justin Squirek
66e97274ce [Ada] Further Ada 2020 work on accessibility checking
gcc/ada/

	* checks.adb (Apply_Accessibility_Check): Skip checks against
	the extra accessibility of a function result when in Ada 2005
	mode or earlier.
	* exp_ch3.adb (Build_Initialization_Call): Modify accessibility
	level calls to use Accessibility_Level.
	(Expand_N_Object_Declaration): Modify accessibility level calls
	to use Accessibility_Level.
	* exp_ch4.adb (Expand_Allocator_Expression): Add static check
	for anonymous access discriminants. Remove unneeded propagation
	of accessibility actual.
	(Expand_N_In): Modify accessibility level calls to use
	Accessibility_Level.
	(Expand_N_Type_Conversion): Modify accessibility level calls to
	use Accessibility_Level.
	* exp_ch5.adb (Expand_N_Assignment_Statement): Modify
	accessibility level calls to use Accessibility_Level.
	* exp_ch6.adb (Expand_Call_Helper): Rewrite accessibility
	calculation for the extra accessibility of result actual in
	function calls, and modify accessibility level calls to use
	Accessibility_Level.
	(Check_Against_Result_Level): Removed.
	* exp_ch9.adb (Expand_N_Requeue_Statement): Add dynamic
	accessibility check for requeues
	* sem_attr.adb (Resolve_Attribute): Modify accessibility level
	calls to use Accessibility_Level.
	* sem_ch13.adb (Associate_Storage_Pool): Modify accessibility
	level calls to use Accessibility_Level.
	* sem_ch4.adb (Analyze_Call): Add static check for explicitly
	aliased formals in function calls within return statements.
	* sem_ch6.adb (Check_Return_Construct_Accessibility): Rewrite
	routine to account for non-aggregate return objects.
	(Generate_Minimum_Accessibility): Created.
	(Analyze_Call): Modify accessibility level calls to use
	Accessibility_Level.
	(Analyze_Subprogram_Body_Helper): Add generation of minimum
	accessibility for the extra accessibility of the function
	result.
	* sem_ch9.adb (Analyze_Requeue): Modify accessibility level
	calls to use Accessibility_Level.
	* sem_res.adb: (Check_Aliased_Parameters): Modify accessibility
	level calls to use Accessibility_Level.
	(Valid_Conversion): Modify accessibility level calls to use
	Accessibility_Level.
	* sem_util.adb, sem_util.ads (Accessibility_Level_Helper):
	Renamed to Accessibility_Level, add detection for functions in
	prefix notation, and add cases where to return zero when
	specified. Modified to take new, more descriptive, parameters.
	(Accessibility_Level): Created.
	(Function_Call_Level): Removed.
	(Function_Call_Or_Allocator_Level): Created to centralize the
	calculation accessibility levels for function calls and
	allocators.
	(Static_Accessibility_Level): Removed.
	(Dynamic_Accessibility_Level): Removed.
	(Get_Dynamic_Accessibility): Renamed from Get_Accessibility.
	(In_Return_Value): Created to determine if a given expression
	contributes to the current function's return value.
	(Is_Master): Created.
	(Is_Explicitly_Aliased): Created
2020-10-23 04:25:06 -04:00
Bob Duff
15e2ad005b [Ada] gnatpp: Document --no-comments-fill
gcc/ada/

	* doc/gnat_ugn/gnat_utility_programs.rst: Document
	--no-comments-fill.
2020-10-23 04:25:04 -04:00
Piotr Trojanek
48d0e61aba [Ada] Reject illegal syntax in pragma Contract_Cases
gcc/ada/

	* contracts.adb (Analyze_Entry_Or_Subprogram_Contract,
	Analyze_Subprogram_Body_Stub_Contract): Fix missing references
	to Subprogram_Variant where similar references to Contract_Cases
	are present.
	* sem_prag.adb (Analyze_Contract_Case, Analyze_Variant): Check
	that aggregate parameter has no expressions.
	(Analyze_Pragma): Replace Contract_Cases with Subprogram_Variant
	in a copy-pasted comment.
2020-10-23 04:25:04 -04:00
Philippe Gil
973c7b7e54 [Ada] GNAT.Sockets: fix comment typo
gcc/ada/

	* libgnat/g-socket.ads: Fix comment typo.
2020-10-23 04:25:03 -04:00
Eric Botcazou
b120ca616f [Ada] Implement new legality rules introduced in C.6(12) by AI12-0363
gcc/ada/

	* doc/gnat_rm/implementation_defined_pragmas.rst (VFA): Remove uage
	restrictions in conjunction with Atomic and Aliased.
	* gnat_rm.texi: Regenerate.
	* aspects.ads (Aspect_Id): Add Aspect_Full_Access_Only.
	(Is_Representation_Aspect): Likewise.
	(Aspect_Names): Likewise.
	(Aspect_Delay): Likewise.
	* einfo.ads (Is_Atomic_Or_VFA): Rename into...
	(Is_Full_Access): ...this.
	(Is_Volatile_Full_Access): Document new usage for Full_Access_Only.
	* einfo.adb (Is_Atomic_Or_VFA): Rename into...
	(Is_Full_Access): ...this.
	* freeze.ads (Is_Atomic_VFA_Aggregate): Rename into...
	(Is_Full_Access_Aggregate): ...this.
	* freeze.adb (Is_Atomic_VFA_Aggregate): Rename into...
	(Is_Full_Access_Aggregate): ...this.  Adjust to above renaming.
	(Freeze_Array_Type): Likewise.
	(Freeze_Entity): Likewise.
	* exp_aggr.adb (Aggr_Assignment_OK_For_Backend): Likewise.
	(Expand_Record_Aggregate): Likewise.
	* exp_ch4.adb (Expand_N_Op_Eq): Likewise.
	* exp_ch5.adb (Expand_Assign_Array): Likewise.
	* exp_ch8.adb (Evaluation_Required): Likewise.
	* layout.adb (Layout_Type): Likewise.
	(Set_Composite_Alignment): Likewise.
	* sem_aux.ads (Has_Rep_Item): Delete.
	* sem_aux.adb (Has_Rep_Item): Likewise.
	* sem_attr.adb (Resolve_Attribute) <Attribute_Access>: Implement
	new legality rules in C.6(12).
	* sem_ch12.adb (Instantiate_Object): Likewise.
	* sem_res.adb (Resolve_Actuals): Likewise.
	* sem_ch13.adb (Inherit_Delayed_Rep_Aspects): Deal with aspect
	Full_Access_Only.
	(Check_False_Aspect_For_Derived_Type): Likewise.
	(Make_Pragma_From_Boolean_Aspect): Test for the presence of Expr.
	Deal with aspect Full_Access_Only.
	(Analyze_Aspects_At_Freeze_Point): Likewise.
	(Analyze_One_Aspect): Do not set Delay_Required to true even for
	Always_Delay boolean aspects if they have no expression.  Force
	Delay_Required to true for aspect Full_Access_Only in all cases.
	Reject aspect Full_Access_Only if not in Ada 2020 mode.
	(Check_Aspect_At_End_Of_Declarations): Deal with empty expression.
	(Check_Aspect_At_Freeze_Point): Likewise.
	(Rep_Item_Entity): Delete.
	(Inherit_Aspects_At_Freeze_Point): Align handling for Bit_Order
	with that for Scalar_Storage_Order.
	* sem_prag.adb (Check_Atomic_VFA): Delete.
	(Check_VFA_Conflicts): Likewise.
	(Check_Full_Access_Only): New procedure.
	(Process_Atomic_Independent_Shared_Volatile): Call to implement
	the new legality checks in C.6(8/2) and mark the entity last.
	(Analyze_Pragma) <Pragma_Atomic_Components>: Remove obsolete check.
	* sem_util.ads (Is_Atomic_Or_VFA_Object): Rename into...
	(Is_Full_Access_Object): ...this.
	(Is_Subcomponent_Of_Atomic_Object): Rename into...
	(Is_Subcomponent_Of_Full_Access_Object): ...this.
	* sem_util.adb (Inherit_Rep_Item_Chain): Use Present_In_Rep_Item.
	(Is_Atomic_Or_VFA_Object): Rename into...
	(Is_Full_Access_Object): ...this.
	(Is_Subcomponent_Of_Atomic_Object): Rename into...
	(Is_Subcomponent_Of_Full_Access_Object): ...this and adjust.
	* snames.ads-tmpl (Name_Full_Access_Only): New name of aspect.
	* gcc-interface/decl.c (gnat_to_gnu_entity): Adjust for renaming.
	(promote_object_alignment): Likewise.
	(gnat_to_gnu_field): Likewise.  Rename local variable and use
	specific qualifier in error message for Volatile_Full_Access.
	* gcc-interface/trans.c (lvalue_required_p): Likewise.
2020-10-23 04:25:02 -04:00
Arnaud Charlet
84a5809c72 [Ada] Clean up in writing of ALI files
gcc/ada/

	* lib-writ.ads, lib-writ.adb (Write_ALI): No longer read
	existing ALI files in -gnatc mode.
2020-10-23 04:25:00 -04:00
Arnaud Charlet
6c1929894c [Ada] Fix logic in C_Select under mingw
gcc/ada/

	* libgnat/g-socthi__mingw.adb (C_Select): Fix logic in code and
	make it explicit that we are checking against null values before
	dereferencing them.
2020-10-23 04:24:59 -04:00
Eric Botcazou
3a5c9377f6 [Ada] Do not use Long_Long_Long_Integer'Image with pragma Discard_Names
gcc/ada/

	* exp_imgv.adb (Expand_Image_Attribute): For an enumeration type
	subject to pragma Discard_Names, convert 'Pos to Long_Long_Integer
	before applying 'Img to the result.
2020-10-23 04:24:58 -04:00
Ed Schonberg
995e0727ce [Ada] Crash on expression function and access type
gcc/ada/

	* freeze.adb (Freeze_Type_Refs): Add guard on freezing of the
	designated type of an access type appearing in the expression,
	when expression includes an explicit dereference whose prefix
	includes a function call.
2020-10-23 04:24:58 -04:00
Piotr Trojanek
0edbf7fa12 [Ada] Fix crash in SPARK on array delta_aggregate with subtype_indication
gcc/ada/

	* exp_spark.adb (Expand_SPARK_Delta_Or_Update): Handle
	subtype_indication; do not apply range checks for ranges; add
	comment saying that others_choices is not allowed.
2020-10-23 04:24:57 -04:00
Piotr Trojanek
f2668d9058 [Ada] Decorate iterated_component_association in SPARK expansion
gcc/ada/

	* exp_spark.adb (Expand_SPARK_N_Aggregate,
	Expand_SPARK_Delta_Or_Update): Expand
	Iterated_Component_Association occurring within delta
	aggregates.
	(Expand_SPARK): Apply SPARK-specific expansion to ordinary
	aggregates.
2020-10-23 04:24:56 -04:00
Johannes Kanig
955886d1a2 [Ada] GNATprove: remove support for external axiomatizations
gcc/ada/

	* exp_util.adb, exp_util.ads
	(Containing_Package_With_Ext_Axioms,
	Has_Annotate_Pragma_For_External_Axiomatizations): Removed.
	* sem_ch8.adb (Analyze_Subprogram_Renaming): Removed code
	related to external axiomatizations.
	* einfo.ads
	(Is_Generic_Actual_Subprogram): Removed comment about external
	axiomatization.
2020-10-23 04:24:55 -04:00
Ed Schonberg
294e16b4e7 [Ada] Ignore container types for aggregates if not in Ada_2020
gcc/ada/

	* sem_aggr.adb (Resolve_Aggregate): Do not call
	Resolve_Container_Aggregate if compilation version is earlier
	than Ada_2020.
2020-10-23 04:24:54 -04:00
Arnaud Charlet
99d4c1b09b [Ada] Improve documentation of pragma Abort_Defer
gcc/ada/

	* doc/gnat_rm/implementation_defined_pragmas.rst: Improve
	documentation of pragma Abort_Defer.
	* gnat_rm.texi: Regenerate.
2020-10-23 04:24:53 -04:00
Ghjuvan Lacambre
6cc203bf2a [Ada] CUDA: fix CUDA_Execute not working with aggregates
gcc/ada/

	* exp_prag.adb (Etype_Or_Dim3): New function.
	(Expand_Pragma_Cuda_Execute): Use Etype_Or_Dim3 for temporary
	decls.
2020-10-23 04:24:52 -04:00
Arnaud Charlet
4e40d14622 [Ada] Error when closing c_stream
gcc/ada/

	* libgnat/s-fileio.adb (Open): Fix setting of Tempfile.
2020-10-23 04:24:51 -04:00
Ghjuvan Lacambre
c12e23c467 [Ada] CUDA: Use internal types instead of public ones
gcc/ada/

	* exp_prag.adb (Get_Launch_Kernel_Arg_Type): Renamed to
	Get_Nth_Arg_Type and made more generic.
	(Build_Dim3_Declaration): Now builds a CUDA.Internal.Dim3
	instead of a CUDA.Vector_Types.Dim3.
	(Build_Shared_Memory_Declaration): Now infers needed type from
	Launch_Kernel instead of using a hard-coded type.
	(Expand_Pragma_CUDA_Execute): Build additional temporaries to
	store Grids and Blocks.
	* rtsfind.ads: Move Launch_Kernel from public to internal
	package.
2020-10-23 04:24:51 -04:00
Arnaud Charlet
0e3ccc6a04 [Ada] Missing detection of unused with_clause
gcc/ada/

	* sem_ch4.adb (Complete_Object_Operation): Only mark entities
	referenced if we are compiling the extended main unit.
	* sem_attr.adb (Analyze_Attribute [Attribute_Tag]): Record a
	reference on the type and its scope.
2020-10-23 04:24:50 -04:00
Ed Schonberg
c875250d42 [Ada] Prevent copying uninitialized array with address clause
gcc/ada/

	* freeze.adb (Is_Uninitialized_Aggregate): Recognize an array
	aggregate with box initialization, scalar components, and no
	component default values.
	(Freeze_Entity, Check_Address_Clause): Call it, and simplify
	freeze code for entity by removing useless assignment.
2020-10-23 04:24:49 -04:00
Javier Miranda
4d245fdaf7 [Ada] Spurious errors on tagged types with renamed subprograms
gcc/ada/

	* sem_ch3.adb (Check_Abstract_Overriding): Subprogram renamings
	cannot be overridden.
	(Derive_Subprogram): Enable setting attribute
	Requires_Overriding on functions with controlling access results
	of record extensions with a null extension part require
	overriding (AI95-00391/06).
2020-10-23 04:24:48 -04:00
Piotr Trojanek
70b590e248 [Ada] Fix scope of index parameter inside a delta aggregate
gcc/ada/

	* sem_aggr.adb (Resolve_Delta_Array_Aggregate): Push scope of
	the implicit loop before entering name of the index parameter,
	not after; enter name no matter if the identifier has been
	decorated before.
2020-10-23 04:24:47 -04:00
Gary Dismukes
f9c20bd785 [Ada] Better error for illegal call to abstract operation in instantiations
gcc/ada/

	* sem_ch4.adb (Analyze_Call): In the case where the call is not
	overloaded, check for a call to an abstract nondispatching
	operation and flag an error.
2020-10-23 04:24:46 -04:00
Eric Botcazou
ca5d8b9072 [Ada] Always enable the support for 128-bit integer types on 64-bit platforms
gcc/ada/

	* gnat1drv.adb (Adjust_Global_Switches): Rewrite again code enabling
	or disabling the support for 128-bit integer types.
2020-10-23 04:24:45 -04:00
Arnaud Charlet
b740cf2853 [Ada] Update header of front-end files
gcc/ada/

	* alloc.ads, aspects.adb, aspects.ads, atree.adb, atree.ads,
	casing.adb, casing.ads, csets.adb, csets.ads, debug.adb, debug.ads,
	einfo.adb, einfo.ads, elists.adb, elists.ads, fname.adb, fname.ads,
	gnatvsn.adb, gnatvsn.ads, hostparm.ads, indepsw-aix.adb,
	indepsw-darwin.adb, indepsw-gnu.adb, indepsw.adb, indepsw.ads,
	krunch.adb, krunch.ads, lib-list.adb, lib-sort.adb, lib.adb, lib.ads,
	namet-sp.adb, namet-sp.ads, namet.adb, namet.ads, nlists.adb,
	nlists.ads, opt.adb, opt.ads, output.adb, output.ads, rident.ads,
	scans.adb, scans.ads, scil_ll.adb, scil_ll.ads, sem_aux.ads,
	sem_aux.adb, sfn_scan.adb, sinfo.adb, sinfo.ads, sinput.adb,
	sinput.ads, snames.adb-tmpl, snames.ads-tmpl, stand.ads,
	stringt.adb, stringt.ads, table.adb, table.ads, types.adb,
	types.ads, uintp.adb, uintp.ads, uname.adb, uname.ads,
	urealp.adb, urealp.ads, vast.adb, vast.ads, widechar.adb,
	widechar.ads: Update header.
2020-10-23 04:24:44 -04:00
Arnaud Charlet
44f30851a7 [Ada] Take advantage of Long_Long_Long_Integer in From_String
gcc/ada/

	* libgnat/a-nbnbin.adb (From_String): Take advantage of
	Long_Long_Long_Integer.
	* libgnat/s-genbig.ads, libgnat/s-genbig.adb (To_Bignum): New
	function taking a Long_Long_Long_Integer.
2020-10-23 04:24:43 -04:00
Justin Squirek
01364aeb56 [Ada] Iterative patch for accessibility cleanup
gcc/ada/

	* sem_util.adb (Accessibility_Call_Helper): In the selected
	component case, test if a prefix is a function call and whether
	the subprogram call is not being used in its entirety and use
	the Innermost_Master_Scope_Depth in that case.
	(Innermost_Master_Scope_Depth): Test against the node_par
	instead of its identifier to avoid misattributing unnamed blocks
	as not being from source.
	(Function_Call_Level): Add calculation for whether a subprogram
	call is initializing an object in its entirety.
	(Subprogram_Call_Level): Renamed to Function_Call_Level.
2020-10-23 04:24:42 -04:00
Piotr Trojanek
4d4ba374a7 [Ada] Sync code for external properties with SPARK RM
gcc/ada/

	* sem_prag.adb (Check_External_Properties): Rewrite to match the
	SPARK RM description.
2020-10-23 04:24:41 -04:00
Piotr Trojanek
846744902e [Ada] Fix whitespace in code for external property pragmas
gcc/ada/

	* contracts.adb (Check_Type_Or_Object_External_Properties):
	Cleanup.
2020-10-23 04:24:40 -04:00
Piotr Trojanek
9d0761c76b [Ada] Fix default value for re-analysis of external property pragmas
gcc/ada/

	* sem_prag.adb (Analyze_External_Property_In_Decl_Part): Set the
	output parameter Expr_Val to the (implicit) pragma argument even
	when returning early.
2020-10-23 04:24:39 -04:00
Jakub Jelinek
9a83366b62 Fix up plugin header install
Jeff has noticed and I've confirmed that config/i386/i386.h header which is
installed on x86 in plugin/include/ directory newly in GCC 11 has
which breaks all plugins that include tm.h etc. because that header is not
shipped.
The following patch seems to fix that.  Unfortunately it isn't just a matter
of TM_H += t-i386 change, because the header has full path and therefore
needs to be installed in its full path.
Additionally, I've noticed that the b-header-vars generation is completely
broken, it will just throw many of the dependencies away, because it
incorrectly removed everything from first ... remaining till the last /,
while what it clearly wants to do is remove each ... till last / in the same
header path (i.e. instead of .* should have used [^     ]* and g modifier).
I've also noticed that some other headers mentioned in #include of other
headers aren't included (gomp-constants.h as dependency of omp-general.h
and various dependencies of expr.h (where omp-general.h and expr.h were
previously installed)).

2020-10-23  Jakub Jelinek  <jakub@redhat.com>

	* Makefile.in (PLUGIN_HEADERS): Add gomp-constants.h and $(EXPR_H).
	(s-header-vars): Accept not just spaces but also tabs between *_H name
	and =.  Handle common/config/ headers similarly to config.  Don't
	throw away everything from first ... to last / on the remaining
	string, instead skip just ... to corresponding last / without
	intervening spaces and tabs.
	(install-plugin): Treat common/config headers like config headers.
	* config/i386/t-i386 (TM_H): Add
	$(srcdir)/common/config/i386/i386-cpuinfo.h.
2020-10-23 10:11:41 +02:00
Jakub Jelinek
50bc94898f stor-layout: Reject forming arrays with elt sizes not divisible by elt alignment [PR97164]
As mentioned in the PR, since 2005 we reject if array elements are smaller
than their alignment (i.e. overaligned elements), because such arrays don't
make much sense, only their first element is guaranteed to be aligned as
user requested, but the next element can't be.
The following testcases show something we've been silent about but is
equally bad, the 2005 case is just the most common special case of that
the array element size is not divisible by the alignment.  In those arrays
too only the first element is guaranteed to be properly aligned and the
second one can't be.

This patch rejects those cases too, but keeps the existing wording for the
old common case.

Unfortunately, the patch breaks bootstrap, because libbid uses this mess
(forms arrays with 24 byte long elements with 16 byte element alignment).
I don't really see justification for that, so I've decreased the alignment
to 8 bytes instead.

2020-10-23  Jakub Jelinek  <jakub@redhat.com>

	PR tree-optimization/97164
gcc/
	* stor-layout.c (layout_type): Also reject arrays where element size
	is constant, but not a multiple of element alignment.
gcc/testsuite/
	* c-c++-common/pr97164.c: New test.
	* gcc.c-torture/execute/pr36093.c: Move ...
	* gcc.dg/pr36093.c: ... here.  Add dg-do compile and dg-error
	directives.
	* gcc.c-torture/execute/pr43783.c: Move ...
	* gcc.dg/pr43783.c: ... here.  Add dg-do compile, dg-options and
	dg-error directives.
libgcc/config/libbid/
	* bid_functions.h (UINT192): Decrease alignment to 8 bytes.
2020-10-23 10:07:36 +02:00
Eric Botcazou
5f966d6897 Do not use doloop pattern with pragma Unroll
This fixes the following Ada failure on 64-bit PowerPC:

-FAIL: gnat.dg/unroll4.adb scan-rtl-dump-times loop2_unroll "optimized:
loop unrolled 7 times" 2

The IVOPTS pass detects a doloop pattern and consequently discombobulates
the loop sufficiently as to make it hard for the RTL unrolling pass to
compute the best number of iterations.

gcc/ChangeLog:
	* tree-ssa-loop-ivopts.c (analyze_and_mark_doloop_use): Bail out if
	the loop is subject to a pragma Unroll with no specific count.
2020-10-23 09:58:33 +02:00
Dennis Zhang
98161c248c arm: Auto-vectorization for MVE: vsub
This patch enables MVE vsub instructions for auto-vectorization.
The sub<mode>3 in vec-common.md is modified to use new mode macros
to include MVE extension for vectorization. MVE vsub insns in mve.md are
modified to use 'minus' instead of unspec expression to support
sub<mode>3. Use VDQ instead fo VALL to cover all supported modes. The
redundant sub<mode>3 insns in neon.md are then removed.

gcc/ChangeLog:

2020-10-23  Dennis Zhang  <dennis.zhang@arm.com>

	* config/arm/mve.md (mve_vsubq<mode>): New entry for vsub instruction
	using expression 'minus'.
	(mve_vsubq_f<mode>): Use minus instead of VSUBQ_F unspec.
	* config/arm/neon.md (sub<mode>3, sub<mode>3_fp16): Removed.
	(neon_vsub<mode>): Use gen_sub<mode>3 instead of gen_sub<mode>3_fp16.
	* config/arm/vec-common.md (sub<mode>3): Use the new mode macros
	ARM_HAVE_<MODE>_ARITH. Use iterator VDQ instead of VALL.

gcc/testsuite/ChangeLog:

	* gcc.target/arm/simd/mve-vsub_1.c: New test.
2020-10-23 08:53:53 +01:00
Martin Liska
6fade5a604 LTO: check that make command works
gcc/ChangeLog:

	PR lto/97524
	* lto-wrapper.c (make_exists): New function.
	(run_gcc): Use it to check that make is present and working
	for parallel execution.
2020-10-23 09:48:10 +02:00
Richard Biener
7cda498920 Revert "middle-end/97521 - fix VECTOR_CST expansion"
2020-10-23  Richard Biener  <rguenther@suse.de>

	PR middle-end/97521
	* expr.c (expand_expr_real_1): Revert last change.

	* gcc.target/i386/pr97521.c: Remove.
This reverts commit b960a9c83a.
2020-10-23 08:22:00 +02:00
Kewen Lin
67b8991b54 vect: Remove redundant LOOP_VINFO_FULLY_MASKED_P
Remove one redundant LOOP_VINFO_FULLY_MASKED_P condition check
which will be checked in vect_use_loop_mask_for_alignment_p.

gcc/ChangeLog:

	* tree-vect-loop.c (vect_transform_loop): Remove the redundant
	LOOP_VINFO_FULLY_MASKED_P check.
2020-10-22 22:47:39 -05:00
GCC Administrator
43868df37b Daily bump. 2020-10-23 00:16:30 +00:00
Jonathan Wakely
ca021ac617 libstdc++: Ensure std::forward_as_tuple is defined
The recent changes to reduce includes in <memory_resource> went a bit
too far, and it's possible for std::forward_as_tuple to not be defined
when used.

While doing this, I noticed the problematic calls to forward_as_tuple
were not qualified, so performed unwanted ADL.

libstdc++-v3/ChangeLog:

	* include/experimental/memory_resource: Include <tuple>.
	(polymorphic_allocator::construct): Qualify forward_as_tuple.
	* include/std/memory_resource: Likewise.
2020-10-23 01:12:00 +01:00
Alan Modra
5c1506304c [RS6000] Power10 vec-splati-runnable multiple test failures
FAIL: gcc.target/powerpc/vec-splati-runnable.c 1 blank line(s) in output
FAIL: gcc.target/powerpc/vec-splati-runnable.c (test for excess errors)
Excess errors:
rs6000_emit_xxspltidp_v2df called ...

and running the test fails.  As the comment says
  /* Although the instruction says the results are not defined, it does seem
     to work, at least on Mambo.  But no guarentees!  */
So the simulator works but not real hardware.

gcc/
	* config/rs6000/rs6000.c (rs6000_emit_xxspltidp_v2df): Delete
	debug printf.  Remove trailing ".\n" from inform message.
	Break long line.
gcc/testsuite/
	* gcc.target/powerpc/vec-splati-runnable.c: Don't abort on
	undefined output.
2020-10-23 10:08:41 +10:30
Jonathan Wakely
0a74a0e1a2 libstdc++: Fix custom clock in test
This test fails in C++20 mode because std::is_clock is false for the
test clock, because it doesn't define a duration member.

libstdc++-v3/ChangeLog:

	* testsuite/30_threads/condition_variable/members/68519.cc:
	Define recent_epoch_float_clock::duration to meet the Cpp17Clock
	requirements.
2020-10-22 23:14:13 +01:00
David Edelsohn
3307a810d9 testsuite: Adjust expected results for rlwimi-2.c and vec-rlmi-rlnm.c
Enable rlwimi-2.c and vec-rlmi-rlmn.c testcases for additional
target configurtions and update the expected results.

gcc/testsuite/ChangeLog:

	* gcc.target/powerpc/rlwimi-2.c: Adjust expected results for lp64.
	* gcc.target/powerpc/vec-rlmi-rlnm.c: Remove target and LP64.
	Adjust xxlor expected results.
2020-10-22 16:54:34 -04:00
Andrew MacLeod
76d6782207 Use precision and sign to compare types for ranges
Updated to only use range_compatible_p in range assert sanity checks,
not for actual type cmpatibility.

	* gimple-range-gori.cc (is_gimple_logical_p): Use types_compatible_p
	for logical compatibility.
	(logical_stmt_cache::cacheable_p): Ditto.
2020-10-22 16:50:23 -04:00