180179 Commits

Author SHA1 Message Date
Arnaud Charlet
263bb39332 [Ada] Reduce use of primary stack on string concatenation
gcc/ada/

	* exp_ch4.adb (Expand_Concatenate): Allocate result of string
	concatenation on secondary stack when relevant.
2020-10-16 03:31:26 -04:00
Ed Schonberg
a121d54f7b [Ada] Spurious visibility error on Declare_Expression with renames
gcc/ada/

	* sem_res.adb (Resolve_Declare_Expression): Retrieve the created
	block entity that is the scope of the local declarations, from
	either a local object declaration or an object renaming
	declaration. The block entity does not have an explicit
	declaration, but appears as the scope of all locally declared
	objects.
2020-10-16 03:31:25 -04:00
Eric Botcazou
f54147fcfd [Ada] Use new Max_Integer_Size attribute in system.ads files
gcc/ada/

	* libgnat/system-aix.ads: Likewise.
	* libgnat/system-darwin-arm.ads: Likewise.
	* libgnat/system-darwin-ppc.ads: Likewise.
	* libgnat/system-darwin-x86.ads: Likewise.
	* libgnat/system-djgpp.ads: Likewise.
	* libgnat/system-dragonfly-x86_64.ads: Likewise.
	* libgnat/system-freebsd.ads: Likewise.
	* libgnat/system-hpux-ia64.ads: Likewise.
	* libgnat/system-hpux.ads: Likewise.
	* libgnat/system-linux-alpha.ads: Likewise.
	* libgnat/system-linux-arm.ads: Likewise.
	* libgnat/system-linux-hppa.ads: Likewise.
	* libgnat/system-linux-ia64.ads: Likewise.
	* libgnat/system-linux-m68k.ads: Likewise.
	* libgnat/system-linux-mips.ads: Likewise.
	* libgnat/system-linux-ppc.ads: Likewise.
	* libgnat/system-linux-riscv.ads: Likewise.
	* libgnat/system-linux-s390.ads: Likewise.
	* libgnat/system-linux-sh4.ads: Likewise.
	* libgnat/system-linux-sparc.ads: Likewise.
	* libgnat/system-linux-x86.ads: Likewise.
	* libgnat/system-lynxos178-ppc.ads: Likewise.
	* libgnat/system-lynxos178-x86.ads: Likewise.
	* libgnat/system-mingw.ads: Likewise.
	* libgnat/system-qnx-aarch64.ads: Likewise.
	* libgnat/system-rtems.ads: Likewise.
	* libgnat/system-solaris-sparc.ads: Likewise.
	* libgnat/system-solaris-x86.ads: Likewise.
	* libgnat/system-vxworks-arm-rtp-smp.ads: Likewise.
	* libgnat/system-vxworks-arm-rtp.ads: Likewise.
	* libgnat/system-vxworks-arm.ads: Likewise.
	* libgnat/system-vxworks-e500-kernel.ads: Likewise.
	* libgnat/system-vxworks-e500-rtp-smp.ads: Likewise.
	* libgnat/system-vxworks-e500-rtp.ads: Likewise.
	* libgnat/system-vxworks-e500-vthread.ads: Likewise.
	* libgnat/system-vxworks-ppc-kernel.ads: Likewise.
	* libgnat/system-vxworks-ppc-ravenscar.ads: Likewise.
	* libgnat/system-vxworks-ppc-rtp-smp.ads: Likewise.
	* libgnat/system-vxworks-ppc-rtp.ads: Likewise.
	* libgnat/system-vxworks-ppc-vthread.ads: Likewise.
	* libgnat/system-vxworks-ppc.ads: Likewise.
	* libgnat/system-vxworks-x86-kernel.ads: Likewise.
	* libgnat/system-vxworks-x86-rtp-smp.ads: Likewise.
	* libgnat/system-vxworks-x86-rtp.ads: Likewise.
	* libgnat/system-vxworks-x86-vthread.ads: Likewise.
	* libgnat/system-vxworks-x86.ads: Likewise.
	* libgnat/system-vxworks7-aarch64-rtp-smp.ads: Likewise.
	* libgnat/system-vxworks7-aarch64.ads: Likewise.
	* libgnat/system-vxworks7-arm-rtp-smp.ads: Likewise.
	* libgnat/system-vxworks7-arm.ads: Likewise.
	* libgnat/system-vxworks7-e500-kernel.ads: Likewise.
	* libgnat/system-vxworks7-e500-rtp-smp.ads: Likewise.
	* libgnat/system-vxworks7-e500-rtp.ads: Likewise.
	* libgnat/system-vxworks7-ppc-kernel.ads: Likewise.
	* libgnat/system-vxworks7-ppc-rtp-smp.ads: Likewise.
	* libgnat/system-vxworks7-ppc-rtp.ads: Likewise.
	* libgnat/system-vxworks7-ppc64-kernel.ads: Likewise.
	* libgnat/system-vxworks7-ppc64-rtp-smp.ads: Likewise.
	* libgnat/system-vxworks7-x86-kernel.ads: Likewise.
	* libgnat/system-vxworks7-x86-rtp-smp.ads: Likewise.
	* libgnat/system-vxworks7-x86-rtp.ads: Likewise.
	* libgnat/system-vxworks7-x86_64-kernel.ads: Likewise.
	* libgnat/system-vxworks7-x86_64-rtp-smp.ads: Likewise.
2020-10-16 03:31:24 -04:00
Arnaud Charlet
2341c8a96d [Ada] Remove support for -gnatP and pragma Polling
gcc/ada/

	* Makefile.rtl, gnat1drv.adb, expander.adb
	doc/gnat_rm/implementation_defined_pragmas.rst,
	doc/gnat_ugn/building_executable_programs_with_gnat.rst,
	doc/gnat_ugn/the_gnat_compilation_model.rst, exp_ch5.ads,
	exp_ch5.adb, exp_ch6.adb, exp_ch7.adb, exp_util.adb,
	exp_util.ads, libgnarl/s-osinte__aix.adb,
	libgnarl/s-osinte__android.adb, libgnarl/s-osinte__darwin.adb,
	libgnarl/s-osinte__gnu.adb, libgnarl/s-osinte__hpux-dce.adb,
	libgnarl/s-osinte__lynxos178.adb, libgnarl/s-osinte__posix.adb,
	libgnarl/s-osinte__qnx.adb, libgnarl/s-osinte__rtems.adb,
	libgnarl/s-osinte__solaris.adb, libgnarl/s-osinte__vxworks.adb,
	libgnarl/s-osinte__x32.adb, libgnarl/s-solita.adb,
	libgnarl/s-taasde.adb, libgnarl/s-taprob.adb,
	libgnarl/s-taprop__dummy.adb, libgnarl/s-taprop__hpux-dce.adb,
	libgnarl/s-taprop__linux.adb, libgnarl/s-taprop__mingw.adb,
	libgnarl/s-taprop__posix.adb, libgnarl/s-taprop__qnx.adb,
	libgnarl/s-taprop__solaris.adb, libgnarl/s-taprop__vxworks.adb,
	libgnarl/s-tarest.adb, libgnarl/s-tasini.adb,
	libgnarl/s-taskin.adb, libgnarl/s-taspri__dummy.ads,
	libgnarl/s-taspri__hpux-dce.ads, libgnarl/s-taspri__lynxos.ads,
	libgnarl/s-taspri__mingw.ads,
	libgnarl/s-taspri__posix-noaltstack.ads,
	libgnarl/s-taspri__posix.ads, libgnarl/s-taspri__solaris.ads,
	libgnarl/s-taspri__vxworks.ads, libgnarl/s-tassta.adb,
	libgnarl/s-tasuti.adb, libgnarl/s-tposen.adb,
	libgnat/a-except.adb, libgnat/a-except.ads,
	libgnat/s-dwalin.adb, libgnat/s-dwalin.ads,
	libgnat/s-mastop.ads, libgnat/s-soflin.adb,
	libgnat/s-stalib.adb, libgnat/s-stalib.ads,
	libgnat/s-stchop.adb, libgnat/s-stchop.ads,
	libgnat/s-stchop__limit.ads, libgnat/s-traceb.ads,
	libgnat/s-traent.adb, libgnat/s-traent.ads,
	libgnat/s-trasym.adb, libgnat/s-trasym.ads,
	libgnat/s-trasym__dwarf.adb, opt.adb, opt.ads, par-prag.adb,
	sem_prag.adb, snames.ads-tmpl, switch-c.adb, targparm.adb,
	targparm.ads, usage.adb: Remove support for -gnatP and pragma
	Polling.
	* gnat_ugn.texi: Regenerate.
	* libgnat/a-excpol.adb, libgnat/a-excpol__abort.adb: Removed.
2020-10-16 03:31:23 -04:00
Piotr Trojanek
5540812a4d [Ada] Unique itypes names for unconstrained array object declaration
gcc/ada/

	* sem_ch3.adb (Array_Type_Declaration): Create itype with unique
	name.
2020-10-16 03:31:21 -04:00
Piotr Trojanek
2c06148312 [Ada] Cleanup related to itypes for unconstrained object declaration
gcc/ada/

	* sem_ch3.adb (Analyze_Object_Declaration): Limit scope of a
	local object by hiding it from local subprograms; simplify
	nested if-then-if-then condition for an Ada 83 restriction.
	(Array_Type_Declaration): Confirm with assertion when the else
	branch is executed.
	(Find_Type_Of_Object): Simplify membership test with a subtype
	range.
2020-10-16 03:31:20 -04:00
Yannick Moy
476a8ec4d8 [Ada] SPARK: update for effectively volatile types and objects
gcc/ada/

	* sem_prag.adb (Analyze_Global_In_Decl_Part): Update check to
	reject volatile object for reading.
	* sem_res.adb (Resolve_Actuals, Resolve_Entity_Name): Update
	check to reject volatile object for reading.
	* sem_util.adb, sem_util.ads
	(Check_Nonvolatile_Function_Profile,
	Has_Effectively_Volatile_Profile): Detect use of volatile object
	for reading.
	(Has_Enabled_Property): Accept constants as well.
	(Is_Effectively_Volatile_For_Reading): New function based on
	existing Is_Effectively_Volatile.
	(Is_Effectively_Volatile_Object_For_Reading): Adapted from the
	existing Is_Effectively_Volatile_Object, using a shared
	implementation in Is_Effectively_Volatile_Object_Shared.
2020-10-16 03:31:19 -04:00
Gary Dismukes
0574695888 [Ada] GNAT-LLVM unnesting issues in elaboration code
gcc/ada/

	* exp_ch7.adb (Check_Unnesting_In_Decls_Or_Stmts): In the case
	of an if-statement, call Unnest_If_Statement to determine
	whether there are nested subprograms in any of the statement
	lists of the "if" parts that require a wrapping procedure to
	handle possible up-level refeferences.
	(Unnest_Block): Call Check_Unnesting_In_Handlers to do unnesting
	of subprograms in exception handlers of the block statement.
	(Unnest_If_Statement): New procedure to traverse the parts of an
	if-statement and create wrapper procedures as needed to
	encapsulate nested subprograms that may make up-level
	references.
	(Check_Stmts_For_Subp_Unnesting): New support procedure in
	Unnest_If_Statement to traverse a statement list looking for
	top-level subprogram bodies that require wrapping inside a
	procedure (via Unnest_Statement_List) as well as possibly having
	other statements (block, loop, if) that may themselves require
	an unnesting transformation (via
	Check_Unnesting_In_Decls_Or_Stmts).
	(Unnest_Statement_List): New support procedure to traverse the
	statements of a statement list that contains subprogram bodies
	at the top level and replace the statement list with a wrapper
	procedure body encapsulating the statements and a call to the
	procedure.
2020-10-16 03:31:18 -04:00
Arnaud Charlet
6f238680dd [Ada] Crash when specifying an abstract subprogram with Stream_Convert
gcc/ada/

	* sem_prag.adb (Check_OK_Stream_Convert_Function): Check for
	abstract subprograms.
2020-10-16 03:31:17 -04:00
Piotr Trojanek
64d5b75fc6 [Ada] Fix documentation of No_Local_Timing_Events
gcc/ada/

	* doc/gnat_rm/standard_and_implementation_defined_restrictions.rst
	(No_Local_Timing_Events): Package Timing_Events is a child of
	Ada.Real_Time, not of Ada.
	* gnat_rm.texi: Regenerate.
2020-10-16 03:31:16 -04:00
Eric Botcazou
c7c7dd3a1d [Ada] Add Max_Integer_Size attribute and couple of helper functions
gcc/ada/

	* doc/gnat_rm/implementation_defined_attributes.rst: Document the
	new Max_Integer_Size attribute.
	* gnat_rm.texi: Regenerate.
	* exp_attr.adb (Get_Integer_Type): Call Small_Integer_Type_For.
	(Expand_N_Attribute_Reference) <Attribute_Pred>: Replace selection
	code with call to Integer_Type_For.
	<Attribute_Succ>: Likewise.
	<Attribute_Val>: Likewise.
	<Attribute_Valid>: Likewise.
	<Attribute_Max_Integer_Size>: Raise Program_Error.
	* exp_ch3.adb (Expand_Freeze_Enumeration_Type): Replace selection
	code with call to Integer_Type_For.
	(Simple_Init_Initialize_Scalars_Type): Use Long_Long_Unsigned and
	System_Max_Integer_Size to size the largest integer type.
	* exp_pakd.adb (Compute_Linear_Subscript): Minor tweak.
	(Create_Packed_Array_Impl_Type): Use Small_Integer_Type_For.
	* exp_util.ads (Integer_Type_For): New function.
	(Small_Integer_Type_For): Likewise.
	* exp_util.adb (Adjust_Condition): Use Integer_Type_For.
	(Component_May_Be_Bit_Aligned): Use System_Max_Integer_Size.
	(Integer_Type_For): New function.
	(Small_Integer_Type_For): Likewise.
	(Matching_Standard_Type): Use Small_Integer_Type_For.
	(Needs_Constant_Address): Replace 64 with System_Max_Integer_Size.
	* freeze.adb (Set_Small_Size): Likewise.
	(Size_Known): Likewise.
	(Check_Suspicious_Modulus): Likewise.
	(Check_Large_Modular_Array): Likewise.
	(Freeze_Entity): Likewise.
	* layout.adb (Layout_Type): Likewise.
	* sem_aggr.adb: Add with and use clauses for Ttypes.
	(Resolve_Aggregate): Replace 64 with System_Max_Integer_Size.
	* sem_attr.ads (Attribute_Impl_Def): Add Attribute_Max_Integer_Size.
	* sem_attr.adb (Analyze_Attribute) <Attribute_Max_Integer_Size>: New
	(Eval_Attribute): Likewise.
	* sem_ch13.adb (Adjust_Record_For_Reverse_Bit_Order): Change max
	scalar size to System_Max_Integer_Size.
	(Check_Array_Type): Replace 64 with System_Max_Integer_Size and
	remove superfluous test.
	(OK_Component): Likewise.
	* sem_ch5.adb: Add with and use clauses for Ttypes.
	(Analyze_Assignment): Replace 64 with System_Max_Integer_Size.
	* snames.ads-tmpl (Name_Max_Integer_Size): New attribute name.
	(Attribute_Id): Add Attribute_Max_Integer_Size.
	* ttypes.ads (System_Max_Integer_Size): New constant.
2020-10-16 03:31:15 -04:00
Richard Biener
429ad0bb0d tree-optimization/97428 - split SLP groups for loop vectorization
This enables SLP store group splitting also for loop vectorization.
For the existing testcase gcc.dg/vect/vect-complex-5.c this then
generates much better code, likewise for the PR97428 testcase.

Both of those have a splitting opportunity splitting the group
into two equal (vector-sized) halves, still the patch enables
quite arbitrary splitting since generally the interleaving scheme
results in quite awkward code for even small groups.  If any
problems surface with this it's easy to restrict the splitting
to known-good cases.

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

	PR tree-optimization/97428
	* tree-vect-slp.c (vect_analyze_slp_instance): Split store
	groups also for loop vectorization.

	* gcc.dg/vect/vect-complex-5.c: Expect to SLP.
	* gcc.dg/vect/pr97428.c: Likewise.
2020-10-16 08:28:37 +02:00
GCC Administrator
b85d5dc583 Daily bump. 2020-10-16 00:16:29 +00:00
Ian Lance Taylor
1e8e49f135 compiler: don't export function type parameter names
When hashing a function type the parameter names are ignored.
Therefore, we should not write them into the export data.
Otherwise, minor changes in the order in which we process the
types can cause the export data to change uselessly, leading to
unnecessary rebuilds.

Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/262818
2020-10-15 16:25:39 -07:00
Nikhil Benesch
f33ac3b0cd runtime: use correct types in __go_ptrace shim
Make the types of the addr and data arguments in the __go_ptrace shim
match the types declared in Go and the types declared by the C ptrace
function, i.e., void*. This avoids a warning about an implicit
int-to-pointer cast on some platforms.

Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/262340
2020-10-15 13:36:08 -07:00
Nikhil Benesch
6949fbefe2 libgo: correct Makefile typo in path to x/net/route package
Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/262342
2020-10-15 12:37:39 -07:00
Ian Lance Taylor
4f4f649d66 compiler: export type for string and bool constants
Also consolidate the identical code for constant type export into a
pair of static methods.

Fixes golang/go#35739

Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/262437
2020-10-15 12:34:07 -07:00
David Edelsohn
b7beab8282 testsuite: Fix some endianness bugs in p9 runnable tests.
This patch fixes some bugs in the powerpc testsuite for runnable tests
whose expected values were endian dependent.

gcc/testsuite/ChangeLog:

2020-10-15  David Edelsohn  <dje.gcc@gmail.com>

	* gcc.target/powerpc/builtins-1-p9-runnable.c: Adjust for big endian.
	* gcc.target/powerpc/builtins-7-p9-runnable.c: Same.
2020-10-15 15:25:40 -04:00
Jonathan Wakely
7dbf96e2a2 libstdc++: Fix typos in copyright notice
It looks like I did a s/a/__a/ substition in one of these headers, and
then copied it to the other one.

libstdc++-v3/ChangeLog:

	* include/std/concepts: Fix typos in copyright notice.
	* include/std/ranges: Likewise.
2020-10-15 19:20:21 +01:00
Jason Merrill
f3ee947246 c++: Fix [[deprecated]] and implicit operator==. [PR97358]
Trying to diagnose the problem with an implicit copy function breaks if the
function isn't actually a copy function.

gcc/cp/ChangeLog:

	PR c++/95844
	* decl.c (copy_fn_p): Return false for a function that is neither a
	constructor nor an assignment operator.
	(move_signature_fn_p): Likewise.

gcc/testsuite/ChangeLog:

	PR c++/95844
	* g++.dg/cpp2a/spaceship-eq10.C: New test.
2020-10-15 13:27:37 -04:00
David Edelsohn
782ebeaa68 testsuite: Add appropriate target requirements to P9 testcases.
This patch adds effective target and target specific expected results
to a few P9 testcases.

gcc/testsuite/ChangeLog:

	* gcc.target/powerpc/builtins-5-p9-runnable.c: Require lp64.
	* gcc.target/powerpc/builtins-msum-runnable.c: Require int128.
	* gcc.target/powerpc/float128-cmp2-runnable.c: Require float128.
	* gcc.target/powerpc/fold-vec-extract-double.p9.c: Require lp64.
2020-10-15 13:04:31 -04:00
Marek Polacek
08e712211e c++: Improve printing of pointers-to-members [PR97406, PR85901]
This PR points out that when printing the parameter mapping for a
pointer-to-member-function, the output was truncated:

  [with T = void (X::*]

Fixed by printing the abstract declarator for pointers-to-members in
cxx_pretty_printer::type_id.  So now we print:

  [with T = void (X::*)()]

But when I tried a pointer-to-data-member, I got

  [with T = ‘offset_type’ not supported by simple_type_specifier)‘offset_type’ not supported by direct_abstract_declarator]

so had to fix that too so that we now print:

  [with T = int X::*]

or

  [with T = int (X::*)[5]]

when the type is an array type.  Which is what PR85901 was about.

gcc/cp/ChangeLog:

	PR c++/97406
	PR c++/85901
	* cxx-pretty-print.c (pp_cxx_type_specifier_seq): Handle OFFSET_TYPE.
	(cxx_pretty_printer::abstract_declarator): Fix the printing of ')'.
	(cxx_pretty_printer::direct_abstract_declarator): Handle OFFSET_TYPE.
	(cxx_pretty_printer::type_id): Likewise.  Print the abstract declarator
	for pointers-to-members.

gcc/testsuite/ChangeLog:

	PR c++/97406
	PR c++/85901
	* g++.dg/diagnostic/ptrtomem1.C: New test.
	* g++.dg/diagnostic/ptrtomem2.C: New test.
2020-10-15 11:17:22 -04:00
Tom de Vries
f2ff7d2672 [nvptx, testsuite] Xfail stack atomics
Nvptx currently doesn't support atomics if it involves a stack address.
PR97444 is open about.

Xfail corresponding execution fails in gcc.dg/atomic.  Tested on nvptx.

gcc/testsuite/ChangeLog:

2020-10-15  Tom de Vries  <tdevries@suse.de>

	* gcc.dg/atomic/c11-atomic-exec-6.c: Xfail execution for nvptx.
	* gcc.dg/atomic/c11-atomic-exec-7.c: Same.
	* gcc.dg/atomic/stdatomic-op-5.c: Same.
2020-10-15 16:00:15 +02:00
Andre Vehreschild
f6db796d0a Fix fndecl's for fortran coarray calls.
gcc/fortran/ChangeLog:

	* trans-decl.c (gfc_build_builtin_function_decls): Fix the coarray fndecls.
2020-10-15 15:47:15 +02:00
Tom de Vries
34af17c016 [nvptx] Remove -m32
The nvptx port has an -m32 option, but it's not clear whether this
was ever build/tested/used.

Don't expose to user anymore.  Tested on nvptx.

gcc/ChangeLog:

2020-10-15  Tom de Vries  <tdevries@suse.de>

	PR target/97436
	* config/nvptx/nvptx.opt (m32): Comment out.
	* doc/invoke.texi (NVPTX options): Remove -m32.

gcc/testsuite/ChangeLog:

2020-10-15  Tom de Vries  <tdevries@suse.de>

	PR target/97436
	* gcc.target/nvptx/atomic_fetch-3.c: Remove.
2020-10-15 15:25:34 +02:00
Jan Hubicka
6b55fa29ad Fix toplevel comment of attr-fnspec.h
gcc/ChangeLog:

2020-10-15  Jan Hubicka  <hubicka@ucw.cz>
	    Richard Biener  <rguenther@suse.de>

	* attr-fnspec.h: Fix toplevel comment.
2020-10-15 14:46:12 +02:00
Richard Biener
7cb40b08bd fix TARGET_MEM_REF dumping
This fixes the missing constant offset from TARGET_MEM_REF dumping.

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

	* tree-pretty-print.c (dump_mem_ref): Print constant offset
	also for TARGET_MEM_REF.
2020-10-15 13:59:58 +02:00
Jan Hubicka
2fa684fd37 Also accept symbols in other partition in symtab_node::binds_to_current_def_p
* symtab.c (symtab_node::binds_to_current_def_p): Also accept symbols
	defined in other partition.
2020-10-15 13:50:22 +02:00
Kwok Cheung Yeung
445567b22a libgomp: Amend documentation for omp_get_max_active_levels and omp_get_supported_active_levels
2020-10-15  Kwok Cheung Yeung  <kcy@codesourcery.com>

	libgomp/
	* libgomp.texi (omp_get_max_active_levels): Modify description.
	(omp_get_supported_active_levels): Make descriptions consistent.
2020-10-15 03:02:57 -07:00
Richard Biener
852dce0608 Fix ICE in vectorizable_live_operation
This fixes the case where the insertion iterator for the live stmt
is the end of a BB by adjusting the dominance query to the definition
of the def we're substituting.

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

	* tree-vect-loop.c (vectorizable_live_operation): Adjust
	dominance query.

	* gcc.dg/vect/bb-slp-52.c: New testcase.
2020-10-15 11:49:38 +02:00
Arnaud Charlet
d8394e2aa2 [Ada] Spurious visibility on private with package
gcc/ada/

	* sem_ch10.adb (Install_With_Clause): Fix implementation of Ada
	2005 AI-262 by taking into account generic packages.  Minor
	reformatting.
	* libgnat/a-cbhase.ads, libgnat/a-cbhase.adb: Remove use clause
	on runtime unit spec.
2020-10-15 05:39:14 -04:00
Arnaud Charlet
7e3f6147a7 [Ada] Wrong use of Scope_Depth_Value
gcc/ada/

	* einfo.ads, einfo.adb (Scope_Depth_Value,
	Set_Scope_Depth_Value): Add assertions on valid nodes and update
	documentation accordingly.
	(Write_Field22_Name): Sync with change in Scope_Depth_Value.
	* sem_ch8.adb (Find_Direct_Name): Fix call to Scope_Depth_Value.
2020-10-15 05:39:14 -04:00
Javier Miranda
cba9c0267a [Ada] Ada2020: AI12-0003 Specifying the standard storage pool
gcc/ada/

	* sem_prag.adb (Analyze_Pragma): Adding semantic support of
	Standard to Default_Storage_Pool.
	* freeze.adb (Freeze_Entity): If pragma Default_Storage_Pool
	applies and it is set to Standard then use the global pool as
	the associated storage pool of the access type.
2020-10-15 05:39:13 -04:00
Javier Miranda
952604032a [Ada] Cleanup definition of Might_Have_Tasks
gcc/ada/

	* exp_ch6.ads (Might_Have_Tasks): Update documentation.
	* exp_ch6.adb (Might_Have_Tasks): Return also true when the type
	has tasks.
	(Make_Build_In_Place_Call_In_Allocator): Code cleanup.
	* exp_ch3.adb (Ensure_Activation_Chain_And_Master,
	Expand_N_Full_Type_Declaration, Expand_N_Object_Declaration):
	Code cleanup.
2020-10-15 05:39:13 -04:00
Steve Baird
8861bdd59a [Ada] Get finalization right when a function returns a function call
gcc/ada/

	* checks.adb (Apply_Predicate_Check): Generate "infinite
	recursion" warning message even if run-time predicate checking
	is disabled.
	* exp_ch6.adb (Expand_Simple_Function_Return): In testing
	whether the returned expression is a function call, look for the
	case where the call has been transformed into a dereference of
	an access value that designates the result of a function call.
	* sem_ch3.adb (Analyze_Object_Declaration): Legality checking
	for a static expression is unaffected by assertion policy (and,
	in particular, enabling/disabling of subtype predicates.  To get
	the right legality checking, we need to call
	Check_Expression_Against_Static_Predicate for a static
	expression even if predicate checking is disabled for the given
	predicate-bearing subtype.  On the other hand, we don't want to
	call Make_Predicate_Check unless predicate checking is enabled.
	* sem_ch7.adb (Uninstall_Declarations.Preserve_Full_Attributes):
	Preserve the Predicates_Ignored attribute.
	* sem_eval.adb (Check_Expression_Against_Static_Predicate):
	Previously callers ensured that this procedure was only called
	if predicate checking was enabled; that is no longer the case,
	so predicates-disabled case must be handled.
	* sem_prag.adb (Analyze_Pragma): Fix bug in setting
	Predicates_Ignored attribute in Predicate pragma case.
2020-10-15 05:39:13 -04:00
Ed Schonberg
7e37c1a522 [Ada] Crash on subtype of fixed-point type
gcc/ada/

	* freeze.adb (Freeze_Fixed_Point_Type): Do not scale the bounds
	of a declared subtype using the 'Small of the type;  this is
	done during resolution of the bound itself, unlike what is done
	for the bounds of the base type, which are used to determine its
	required size. Previous code performed this scaling twice,
	leading to meaningless values for such a subtype.
2020-10-15 05:39:12 -04:00
Piotr Trojanek
e4f503be5d [Ada] Fix access to uninitialized global variable when emitting error
gcc/ada/

	* sem_util.adb (Bad_Predicated_Subtype_Use): Emit an
	unconditional error, not a conditional warning.
2020-10-15 05:39:12 -04:00
Piotr Trojanek
a0a294d3eb [Ada] Cleanup defensive guards for Null_Exclusion_Present
gcc/ada/

	* sem_ch3.adb (Process_Subtype): Combine guards for
	Null_Exclusion_Present in May_Have_Null_Exclusion; use this
	combined guard when checking AI-231.
2020-10-15 05:39:12 -04:00
Piotr Trojanek
8f366ea4db [Ada] Bring defensive guard for Null_Exclusion_Present up to date
gcc/ada/

	* sem_ch3.adb (Process_Subtype): Sync May_Have_Null_Exclusion
	with assertion in Null_Exclusion_Present; clarify the scope of
	local variables.
2020-10-15 05:39:12 -04:00
Piotr Trojanek
1d1e5e2e2c [Ada] Explain predicate function not being inherited by index type
gcc/ada/

	* sem_ch3.adb (Analyze_Subtype_Declaration): Fix style.
	(Make_Index): Refactor to avoid repeated detection of subtype
	indication; add comment.
2020-10-15 05:39:11 -04:00
Piotr Trojanek
2b47f13dab [Ada] Adjust style in support for CUDA_Execute pragma
gcc/ada/

	* sem_prag.adb (Is_Acceptable_Dim3): Use Is_RTE to not pull CUDA
	package unless necessary; rename local Tmp variable; iterate
	with procedural Next.
2020-10-15 05:39:11 -04:00
Piotr Trojanek
e1e129684c [Ada] Avoid unnecessary (re)assignments in Make_Info
gcc/ada/

	* sem_ch3.adb (Array_Type_Declaration): Refine type of a local
	variable.
	(Make_Index): Simplify to avoid assignment with a type entity
	and then backtracking by reassigning to Empty; remove excessive
	whitespace.
	* sem_ch9.adb (Analyze_Entry_Body): Remove extra parens.
2020-10-15 05:39:11 -04:00
Piotr Trojanek
fcbac1b334 [Ada] Remove excessive defensive calls to Is_Type
gcc/ada/

	* sem_ch3.adb (Access_Subprogram_Declaration): Remove extra
	parens.
	(Make_Index): Remove excessive calls to Is_Type.
2020-10-15 05:39:10 -04:00
Arnaud Charlet
701a05667f [Ada] Code cleanup
gcc/ada/

	* sem_util.adb (Enter_Name): Remove unnecessary conditions in
	Enter_Name that come from the beginning of times.
2020-10-15 05:39:10 -04:00
Bob Duff
f644627e27 [Ada] Remove obsolete DSP comment
gcc/ada/

	* exp_ch6.adb (Expand_Simple_Function_Return): Remove DSP part
	of comment, and reformat.
2020-10-15 05:39:10 -04:00
Boris Yakobowski
8b6d722d6e [Ada] Do not expand 'Initialized in codepeer mode
gcc/ada/

	* exp_attr.adb (Expand_N_Attribute_Reference): Do not expand
	'Initialized in CodePeer mode.
2020-10-15 05:39:10 -04:00
Arnaud Charlet
cc53bec460 [Ada] Assert failure on incorrect code
gcc/ada/

	* sem_ch12.adb (Reset_Entity): Protect against malformed tree.
2020-10-15 05:39:09 -04:00
Arnaud Charlet
96ece83775 [Ada] Double evaluation of predicate
gcc/ada/

	* sem_ch13.adb (Add_Predicates): Prevent analyzing twice the
	same pragma in case an inner package references the type with a
	predicate (as opposed to defining the type).
2020-10-15 05:39:09 -04:00
Eric Botcazou
73b211a76e [Ada] Do not use maximal values from System in runtime units
gcc/ada/

	* libgnat/a-cfinve.adb (Int): Use subtype of Long_Long_Integer.
	* libgnat/a-cofove.adb (Int): Likewise.
	* libgnat/a-cgcaso.adb (T): Likewise.
	* libgnat/a-cogeso.adb (T): Likewise.
	* libgnat/g-debpoo.ads (Byte_Count): Use Long_Long_Integer'Size.
2020-10-15 05:39:09 -04:00
Piotr Trojanek
a39bc02543 [Ada] Simplify membership tests with N_Entity subtype
gcc/ada/

	* sem_ch12.adb: Replace list of N_Defining_... enumerations with
	N_Entity.
2020-10-15 05:39:09 -04:00