This patch corrects an issue in the compiler whereby the level for
allocated objects of anonymous access types was calculated incorrectly.
Tested on x86_64-pc-linux-gnu, committed on trunk
gcc/ada/
* sem_util.adb (Function_Or_Allocator_Level): Properly handle
direct function call
Add missing return statements in socket.c as flagged by cppcheck.
Tested on x86_64-pc-linux-gnu, committed on trunk
gcc/ada/
PR ada/102073
* socket.c (__gnat_gethostbyaddr, __gnat_inet_pton): Add missing
return statements.diff --git a/gcc/ada/socket.c b/gcc/ada/socket.c
-
This explicitly documents the behavior for /include/-ending paths and also
updates other parts of the description.
Tested on x86_64-pc-linux-gnu, committed on trunk
gcc/ada/
* doc/gnat_ugn/the_gnat_compilation_model.rst (Binding generation):
Document specific behavior for /includ
This patch corrects an issue in the compiler whereby taking 'Access of a
protected subprogram based on an implicitly dereferenced protected
object causes a spurious non-variable error when such an object is an
in-mode access type formal.
Tested on x86_64-pc-linux-gnu, committed on trunk
gcc/ada/
In CodePeer mode attribute Image is not expanded and has its Etype set
as the unconstrained String type. When this attribute appears as a
prefix of an indexed component, we get a check; when it appears as a
prefix of a slice, we don't get a check.
For indexed components, the check effectively come
A slice range can be specified either by a subtype name, regular range,
or subtype indication with constraints. The compiler missed the last
case.
Tested on x86_64-pc-linux-gnu, committed on trunk
gcc/ada/
* sem_res.adb (Resolve_Slice): Handle range given as a subtype
indication.
When resolving a slice with subtype name we created a shallow copy of
the type range and applied range checks to this copy. This was wrong,
because when applying checks we were modifying the type declaration
itself (and the type could be anything, for example the predefined
Integer type).
Instead
This patch changes Declaration_Node for Itypes so that it either returns
Empty or returns a proper declaration node. If the tree structure is
that of a normal type or subtype declaration, so the parent of the Itype
is that declaration, then we return the declaration. Otherwise, we
return Empty rath
This patch modifies the resolution of Declare_Expressions to avoid the
use of a fake scope to perform name capture in the expression, because
such a scope (needed to analyze the declarations of the construct)
conflicts with the transient scopes that may be generated by the
presence of calls in the
Attribute Leading_Part, when its second parameter is zero or negative,
is now raising a constraint error when evaluated at compilation time
just like it did when evaluated at run time.
Tested on x86_64-pc-linux-gnu, committed on trunk
gcc/ada/
* sem_attr.adb (Eval_Attribute): Evaluation
To facilitate using the standard library, Ada RM description from
section A.4.4 is added to the code as comments.
Tested on x86_64-pc-linux-gnu, committed on trunk
gcc/ada/
* libgnat/a-strbou.ads: Add comments.diff --git a/gcc/ada/libgnat/a-strbou.ads b/gcc/ada/libgnat/a-strbou.ads
--- a
Cleanup related to handling of array accesses in CodePeer mode.
Tested on x86_64-pc-linux-gnu, committed on trunk
gcc/ada/
* checks.adb (Selected_Range_Checks): Fix style.
* exp_ch4.adb (Expand_N_Slice): Fix style and comment.
* sem_res.adb (Resolve_Indexed_Component): Fi
Coverage analysis on quantified expressions now requires always
processing their predicate expression as a decision.
Tested on x86_64-pc-linux-gnu, committed on trunk
gcc/ada/
* scos.ads: Extend the documentation.
* par_sco.adb (Process_Decisions): Emit specific SCOs for
Code cleanup related to recent fixes for resolution of array slices;
behaviour is unaffected.
Tested on x86_64-pc-linux-gnu, committed on trunk
gcc/ada/
* sem_res.adb (Resolve_Indexed_Component, Resolve_Slice): Rename
the local constant Name to Pref; remove repeated calls to
Remove duplicated CASE branches detected by infer; semantics is
unaffected.
Tested on x86_64-pc-linux-gnu, committed on trunk
gcc/ada/
* sprint.adb (Sprint_Node_Actual): Refactor code for generic
package and subprogram declarations.diff --git a/gcc/ada/sprint.adb b/gcc/ada/sprint
If Data_First is set to the special value of -1 (the default), then we
cannot look at Data (Data_First).
Tested on x86_64-pc-linux-gnu, committed on trunk
gcc/ada/
* libgnat/s-regpat.ads: Change Data_First to Data'First. Change
"still" to "always". Similar changes for Data_Last.
Now that access-to-constant types are supported in SPARK, type
File_Access is accepted and the public interface of Ada.Text_IO can be
marked in SPARK.
Fix a missing save/restore for the global variable storing whether
SPARK_Mode should be ignored inside instances, around the analysis of a
new unit
This set of changes implements proper checking of types completing
private types in a generic unit where the full type has components of
formal types of the generic and the private type has a
Preelaborable_Initialization aspect given by a conjunction of one or
more references to Preelab_Initializat
This commit removes entities marked with the CUDA_Device pragma from the
packages specs and bodies they exist in.
Tested on x86_64-pc-linux-gnu, committed on trunk
gcc/ada/
* gnat_cuda.adb (Remove_CUDA_Device_Entities): New function.
(Expand_CUDA_Package): Call Remove_CUDA_Device
In the generated nmake.adb file the "return" keyword in function
declarations was printed at the start of a line. Now it is correctly
indented, which makes the generated code easier to read.
Tested on x86_64-pc-linux-gnu, committed on trunk
gcc/ada/
* gen_il-gen.adb (Put_Make_Spec): Don'
This patch expands the implementation of aspects Integer_Literal,
Real_Literal and String_Literal, so that the value of the aspect, which
must be a function name, can be specified by an Operator_Symbol.
Tested on x86_64-pc-linux-gnu, committed on trunk
gcc/ada/
* sem_ch6.adb (Analyze_Ope
The runtime checks for overlaping actual parameters, which gets enabled
by the -gnateA switch, were introduced to combine proof and test for the
antialiasing rules of SPARK.
The original implementation of these checks contained few mistakes which
resulted in spurious compilation errors. These are
This patch corrects various issues discovered during testing of the
No_Dynamic_Accessibility_Checks restriction and documents the feature in
the GNAT RM.
Tested on x86_64-pc-linux-gnu, committed on trunk
gcc/ada/
* doc/gnat_rm/standard_and_implementation_defined_restrictions.rst:
When "for" or "some" keyword is missing from a quantified expression, it
is interpreted as an iterated component association by GNAT, leading to
misleading error messages such as:
badquant.ads:4:07: error: expected type "Standard.Boolean"
badquant.ads:4:07: error: found a composite type
Recognize
Nearly complete functional specification of this unit based on the Ada
RM requirements in Ada RM A.4.2. The small differences are noted in
comments. Also add comments from the Ada RM text.
GNATprove proves both absence of runtime errors and that the code
correctly implements the specified contrac
Complete functional specification of this unit based on the Ada RM
requirements in Ada RM A.3.2. This includes also obsolete subprograms
moved to Ada.Characters.Conversions in Ada 2005.
GNATprove proves both absence of runtime errors and that the code
correctly implements the specified contracts.
A previous change improves an error message to "missing ALL or SOME in
quantified expression", but this was effective only -gnat2022 mode.
This change allows the better error message to be printed in older
language modes.
It also treats the relevant features identically, except for the "...is
an A
Just like postconditions, contract cases on formal containers use
functional containers which might leak memory. Disable them.
Tested on x86_64-pc-linux-gnu, committed on trunk
gcc/ada/
* libgnat/a-cfdlli.ads: Use pragma Assertion_Policy to disable
contract cases at execution.
SPARK emitted spurious checks on Unbounded_String variables that were
not initialized. This patch adds a default initial condition to the type
Unbounded_String so that they disappear.
Tested on x86_64-pc-linux-gnu, committed on trunk
gcc/ada/
* libgnat/a-strunb.ads, libgnat/a-strunb__sha
When creating the entity of a derived subprogram we copy all kinds of
properties from the parent, but we failed to copy the ghost status of
the entity.
Tested on x86_64-pc-linux-gnu, committed on trunk
gcc/ada/
* sem_ch3.adb (Derive_Subprogram): Copy ghost status from parent
to d
When building a derived class-wide pre- or postcondition we are mapping
references to inherited formals and to the inherited subprogram itself.
We now do the same for references to the inherited operator. Such
references might appear as prefixes of the Result attribute, e.g.
"="'Result.
Tested on
This set of changes implements the GNAT front end's support for the new
aspects Storage_Model_Type and Designated_Storage_Model. It also defines
a set of functions intended to provide an interface for back ends to
call to retrieve operations and other entities associated with types
that specify the
Contrary to record aggregates, array aggregate cannot mix named and
positional associations. Make it clear in the error message.
Tested on x86_64-pc-linux-gnu, committed on trunk
gcc/ada/
* sem_aggr.adb (Resolve_Array_Aggregate): Improve error message.diff --git a/gcc/ada/sem_aggr.adb b/
See RM A.3.6 and AI12-0260.
Tested on x86_64-pc-linux-gnu, committed on trunk
gcc/ada/
* libgnat/a-zchhan.ads, libgnat/a-zchhan.adb
(Character_Set_Version, Is_Basic, To_Basic): New.
* libgnat/a-zchuni.ads, libgnat/a-zchuni.adb (Is_Basic,
To_Basic): New.diff --git
As part of an improvement to the precision of
Ada.Directories.Modification_Time, we use the type `struct timespec`
when we can (if _POSIX_C_SOURCE is greater than 200809L). For QNX, we
need to include the system header `sys/time.h` to get the type
declaration, `time.h` does not have it.
Tested on
The support for the attribute itself was removed a long time ago.
Tested on x86_64-pc-linux-gnu, committed on trunk
gcc/ada/
* exp_attr.adb (Expand_Fpt_Attribute): Likewise.
* snames.ads-tmpl (Name_Unaligned_Valid): Delete.diff --git a/gcc/ada/exp_attr.adb b/gcc/ada/exp_attr.adb
To get access to the errno variable, we need to include errno.h.
Tested on x86_64-pc-linux-gnu, committed on trunk
gcc/ada/
* init.c (QNX): Add #include errno.h.diff --git a/gcc/ada/init.c b/gcc/ada/init.c
--- a/gcc/ada/init.c
+++ b/gcc/ada/init.c
@@ -2551,6 +2551,7 @@ __gnat_install_han
This marks the local renaming generated for private components of protected
types as coming from source, so that the components are displayed when the
'info locals' command is used in GDB.
Tested on x86_64-pc-linux-gnu, committed on trunk
gcc/ada/
* exp_ch9.adb (Install_Private_Data_Decl
This is the GNAT part of the patch that adds the strub attribute for
function and variable types, command-line options, passes and
adjustments to implement it, documentation, and tests.
Besides documentation, the bulk of the patch adds strub(callable) to
subprograms that the compiler may call impl
Avoid calling End_Label on the Empty node.
Tested on x86_64-pc-linux-gnu, committed on trunk
gcc/ada/
* gcc-interface/trans.c (set_end_locus_from_node): Check that
Handled_Statement_Sequence is not Empty before calling
End_Label, because the Empty node has no End_Label, a
Starting with VxWorks 21.03, a call to fopen() can now set errno to
ENODEV if a prefix of the path does not match any known device. This
led the runtime to raise the wrong exception type when trying to a file
for which the parent directory did not exist and caused the acats
testsuite to fail. This
This is necessary when expression functions are really too large.
Tested on x86_64-pc-linux-gnu, committed on trunk
gcc/ada/
* gcc-interface/trans.c (Subprogram_Body_to_gnu): Do not set the
DECL_DISREGARD_INLINE_LIMITS flag if -gnatd.8 is specified.diff --git a/gcc/ada/gcc-interf
Before this commit, in case these pragmas were used inside adc file,
gnat1 would fail with a `constraint_error` as it tries to get the
context of the pragma.
This commit induces a regression on dubious uses of these pragmas as
configuration pragmas in ads/adb files.
Review documentation on config
Set the default size of time_t_bits to match the standard runtimes. The
size must match that which is used in the VSB, since the same VSB is
used to build all of the runtimes.
Tested on x86_64-pc-linux-gnu, committed on trunk
gcc/ada/
* libgnat/s-parame__ae653.ads (time_t_bits): Change t
It is simpler to access the type of first formal using semantic instead
of syntactic query. Behaviour is unaffected.
Tested on x86_64-pc-linux-gnu, committed on trunk
gcc/ada/
* sem_util.adb (Compile_Time_Constraint_Error): Simplify getting
the type of the first formal parameter.
When complaining about a compile-time constraint error within a default
initialization procedure we assumed that this procedure initializes a
record object. However, it can initialize an array object too.
Tested on x86_64-pc-linux-gnu, committed on trunk
gcc/ada/
* exp_util.adb (Inside_I
During Expand, prevent the clearing of the Analyzed flag if it has
already been set by Fold_Ureal.
Tested on x86_64-pc-linux-gnu, committed on trunk
gcc/ada/
* expander.adb (Expand): Skip clearing of Analyzed flag if
already set for N_Real_Literal.diff --git a/gcc/ada/expander.ad
Remove the RTEMS specific version of System.Stack_Checking.Operations as
the internal RTEMS API it uses can only detect stack overflow after the
event, whereas the stack checking emulation is meant to detect the stack
overflow before it occurs. Use the standard
System.Stack_Checking.Operations pack
Concurrent record types are either task record types or protected record
types. Now we detect them collectively (when looking for any of them) or
exclusively (when looking for one or the other).
Cleanup code related to fixes in expansion of boxes in record
aggregates. Behaviour is unaffected.
Tes
There is no need to explicitly guard against an empty list where the
subsequent iteration with First/Next/Present works fine.
Cleanup related to expansion of aggregates in GNATprove mode; behaviour
is unaffected.
Tested on x86_64-pc-linux-gnu, committed on trunk
gcc/ada/
* exp_aggr.adb
Rewriting of boxes in record aggregates into the corresponding default
values was done in resolution, where we special-cased access types and
scalar types with a Default_Value aspect.
However, this rewriting rather belong to expansion. Also, the
special-casing didn't take Normalize_Scalars nor Ini
When detecting record components with default initialization we did two
iteration over the component list; now we do only one.
Also, there was no need to explicitly guard against an empty list where
the subsequent iteration with First/Next/Present works fine.
Cleanup related to expansion of aggre
Replace IF with a single RETURN statement. Cleanup related to expansion
of aggregates in GNATprove mode; semantics is unaffected.
Tested on x86_64-pc-linux-gnu, committed on trunk
gcc/ada/
* exp_aggr.adb (Is_Delayed_Aggregate): Simplify.diff --git a/gcc/ada/exp_aggr.adb b/gcc/ada/exp_agg
When building a derived class-wide pre- or postcondition we are mapping
references to inherited formals and subprogram.
Originally we only did it for simple names; recently we fixed this
mapping to also work for operator symbols; with this patch we also do
this for extended names.
Tested on x86_6
Required by the style guide and by future changes in this function.
Tested on x86_64-pc-linux-gnu, committed on trunk
gcc/ada/
* sem_ch4.adb (Analyze_Membership_Op): Reorder subprogram spec
and bodies in alphabetical order.diff --git a/gcc/ada/sem_ch4.adb b/gcc/ada/sem_ch4.adb
--
The various __gl_XYZ binder globals prevent some link-time optimizations
when imported as mutable. Work around this by turning them into
constants.
Tested on x86_64-pc-linux-gnu, committed on trunk
gcc/ada/
* libgnarl/s-intman__android.adb, libgnarl/s-intman__lynxos.adb,
libgnarl
RTEMS supports attaching interrupt handlers to hardware interrupt
vectors, which is superior to the current approach of attaching handlers
to signals. Direct attachment of handlers removes the execution
overhead of converting hardware interrupts to signals and their
subsequent propagation to the i
This fixes a couple of long-standing oversights in the fixed-point multiply
implementation that were recently copied into the divide implementation and
thus made more visible: when computing the operand size for compile-time
known values, the negative case must be taken into account and comparisons
When resolving
type Color is (Blue, Orange);
function Get_Color return Color
is begin return Blue; end Get_Color;
function Get_Color return String
is begin return "Blue"; end Get_Color;
Test : Boolean := Get_Color in Blue;
we did not try all the possible interpretations of
All these arguments were identified programmatically as being always
used with the same value (often the default one). As such, they can be
omitted.
Tested on x86_64-pc-linux-gnu, committed on trunk
gcc/ada/
* ali.adb (Get_Name): Ignore_Spaces is always False.
* bindo-graphs.adb
Use collective N_Generic_Declaration subtype instead of its members
N_Generic_Subprogram_Declaration and N_Generic_Package_Declaration where
reasonable. Code cleanup related to handling of Global contracts in
generic units; semantics is unaffected.
Tested on x86_64-pc-linux-gnu, committed on trunk
Use _POSIX_Threads_Minimum_stack_size instead of
ada_pthread_minimum_stack_size so the runtime does not require the RTEMS
kernel to be configured to have Ada support.
Tested on x86_64-pc-linux-gnu, committed on trunk
gcc/ada/
* libgnat/s-parame__rtems.adb: use
_POSIX_Threads_Mini
In determining at run time whether a statically-known discrete value
satisifies the predicate of a subtype where both
- a Dynamic_Predicate aspect specification applies (directly or
indirectly) to a subtype; and
- at least one other predicate aspect specification (that is, either
We already had a warning for unchecked conversions that involve the
private type Ada.Calendar.Time, whose representation might differ
between releases and targets of the compiler. Now this warning is
extended to Ada.Real_Time.Time and Ada.Real_Time.Time_Span, which is
similarly non-portable.
Previ
For users, 'Old attribute references are only allowed within
postcondition expressions. Internally, the FE may build trees that
transiently (before some subsequent transformation) violate these rules;
this is ok, but these violations were being incorrectly flagged in some
cases. Fix this problem.
Rewrite the former System.Threads implementation for AE653 to work on
the new Light runtime for VxWworks7r2Cert.
Tested on x86_64-pc-linux-gnu, committed on trunk
gcc/ada/
* libgnat/s-thread.ads: Fix comments. Remove unused package
imports.
(Thread_Body_Exception_Exit):
Routines Make_Predefined_Primitive_Specs and
Predefined_Primitive_Bodies, which create predefined primitives for
derived tagged types, are only called when restriction
No_Dispatching_Calls is inactive. There is no need to recheck this
restriction when creating individual primitive operations relate
The reason is that the automatic alignment promotion is not yet performed
in the case where the nominal subtype is of variable size.
Tested on x86_64-pc-linux-gnu, committed on trunk
gcc/ada/
* gcc-interface/decl.c (promote_object_alignment): Add GNU_SIZE
parameter and use it for
This prevents the warning from being given when there may still be regular
exception handlers in the code, although some of them have been turned into
local raises, by querying the predicate that determines whether such regular
handlers are removed or not in the front-end.
Tested on x86_64-pc-linu
This implements the support for most type-generic GCC atomic builtins.
Tested on x86_64-pc-linux-gnu, committed on trunk
gcc/ada/
* gcc-interface/gigi.h (resolve_atomic_size): Declare.
(list_third): New inline function.
* gcc-interface/decl.c (type_for_atomic_builtin_p):
In case of a checked type conversion, correctly update Typ to match the
expression being validated and call Analyze_And_Resolve on the modified
expression.
Tested on x86_64-pc-linux-gnu, committed on trunk
gcc/ada/
* checks.adb (Insert_Valid_Check): in case of checked type
conver
It is common that a quantified expression takes the form of a
conjunction or disjunction. In such a case, it is expected that all
conjuncts/ disjuncts reference the quantified variable. Not doing so can
be either the symptom of an error, or of a non-optimal expression, as
that sub-expression could
Cleanup and remove some unused system specs and references to same.
These are specs that set Frontend_Exceptions, which is no longer
used in GNAT.
Tested on x86_64-pc-linux-gnu, committed on trunk
gcc/ada/
* Makefile.rtl: Remove references to system-vxworks-ppc.ads
and system-vxw
This removes an unreachable case in a nested predicate function as well
as trims down a verbose condition. No functional changes.
Tested on x86_64-pc-linux-gnu, committed on trunk
gcc/ada/
* sem_eval.ads (Check_Non_Static_Context): Update documentation.
* sem_eval.adb (In_Any_In
Testing for Convention_Intrinsic is not the proper way in order to spot
intrinsic subprograms, calling the predicate Is_Intrinsic_Subprogram is.
Tested on x86_64-pc-linux-gnu, committed on trunk
gcc/ada/
* gcc-interface/decl.c (gnat_to_gnu_entity) :
Replace test on Convention_Int
This exposes the newly added support for type-generic GCC atomic builtins
to the user through the System.Atomic_Primitives package, where a generic
version of the existing routines is added. This also uses this support
in the implementation of the System.Atomic_Operations packages.
Tested on x86_
A temporary workaround needed by GNATprove after cleaning up the
handling of AST fields with universal integers.
Tested on x86_64-pc-linux-gnu, committed on trunk
gcc/ada/
* exp_spark.adb (Expand_SPARK_N_Attribute_Reference): Guard
against equality of an uninitialized RM_Size fie
When corresponding parameter subtypes or result subtypes denote
different declarations between the declaration and body of a subprogram,
but those are fully conforming, a warning will be issued indicating that
the subtypes come from different declarations. In the case of anonymous
access subtypes,
Use No_Uint to indicate "unknown" or "not yet known" for various fields
whose type is Uint, instead of using Uint_0. Otherwise Uint_0 could be
ambiguous -- it could also mean "value is known, and is zero". This
patch does not fix all bugs in this area, but fixes most of them, and
adds assertions th
Distance of a variant in the enclosing type declaration is never
negative. Code cleanup related to fix for boxes in record delta
aggregates; semantics is unaffected.
Tested on x86_64-pc-linux-gnu, committed on trunk
gcc/ada/
* sem_aggr.adb (Variant_Depth): Refine type from Integer to
This patch corrects issues in the compiler whereby default initializing
a protected type component of an access type containing controlled parts
with an allocator causes a crash at compile-time at the point of an
object declaration of such protected type.
Tested on x86_64-pc-linux-gnu, committed o
In some cases where a function result type has an access discriminant
part, Ada requires that the execution of a return statement include a
check that the access discriminant does not designate an object whose
accessibility level is too deep (Ada RM 6.5(21)). This check was being
incorrectly omitte
Implement Ada 2022 4.3.1(17.3/5), prevents box compound delimiter <> to
appear in record delta aggregates.
Tested on x86_64-pc-linux-gnu, committed on trunk
gcc/ada/
* sem_aggr.adb (Resolve_Delta_Record_Aggregate): Reject boxes in
record delta aggregates.diff --git a/gcc/ada/sem_
The RM 4.9(38/2) clause specifies that the rounding to be applied to a
real static expression that is not part of a larger static expression
is implementation defined, so it makes sense to have a single function
implementing the operation. The change also sets the Is_Machine_Number
flag more consi
This gets rid of a bogus error issued for the conversion to a static
floating-point subtype of a named number which is not a machine number
of this floating-point subtype but happens to be very close (or equal)
to one of the nominal bounds of the subtype.
This conversion may not change the value o
The version of Ada.Numerics.Big_Numbers.Big_Integers used in the light
and embedded runtimes is only meant for proof, not execution. As a
result, all subprograms were previously marked as imported, but this
leads to a spurious compilation error in GNAT. Work around that bug for
now by providing a d
This proves the absence of runtime errors and the functional spec
of function System.Width_U which implements the runtime support for
attribute 'Width.
It requires using the library unit Ada.Numerics.Big_Numbers.Big_Integers
because it was not possible to achieve even absence of runtime errors
by
This call to No_Uint_To_0 was unnecessary. We should try to remove
all calls to No_Uint_To_0; they are all questionable.
Tested on x86_64-pc-linux-gnu, committed on trunk
gcc/ada/
* gcc-interface/decl.c (gnat_to_gnu_entity): Remove unnecessary
call to No_Uint_To_0.diff --git a/gc
Count_Compile_Time_Pragma_Warnings also counted deleted pragmas. This
caused discrepancies ultimately leading to a crash when Compile_Time
warnings were suppressed by a Warnings(Off, ...) pragma.
Tested on x86_64-pc-linux-gnu, committed on trunk
gcc/ada/
* erroutc.adb (Count_Compile_Time
Checking for ghost placement was only occurring inside the various
versions of predicate aspects, not inside the pragma Predicate. Now
fixed.
Tested on x86_64-pc-linux-gnu, committed on trunk
gcc/ada/
* sem_ch13.adb (Freeze_Entity_Checks): Perform same check on
predicate expressi
There are three "fields" that are aliases for the Renamed_Or_Alias
field: Alias, Renamed_Entity, and Renamed_Object. The getters and
setters were (mis)used more or less interchangeably, in violation of the
comments.
This patch adds assertions to enforce the comments, and changes all of
the call si
Ada 2022 specifies that when the controlling type of a formal abstract
subprogram declaration is a formal type, and the actual type is a
class-wide type T'Class, the actual subprogram can be an implicitly
declared subprogram corresponding to a primitive operation of type T
(AI12-0165-1/05).
Tested
Which is a false positive, caused by a confusion on the expanded code
for pragma Loop_Variant.
Tested on x86_64-pc-linux-gnu, committed on trunk
gcc/ada/
* libgnat/s-widthu.adb: Add pragma Annotate.diff --git a/gcc/ada/libgnat/s-widthu.adb b/gcc/ada/libgnat/s-widthu.adb
--- a/gcc/ada/lib
When using cross-reference information to get subprogram effects in
SPARK (i.e. its reads and writes), we were calling Renamed_Object on
enumeration literals. This was pointless but harmless; now it rightly
triggers an assertion failure in developer builds, so avoid that.
Tested on x86_64-pc-linux
There are two variants of the Ada.Strings.Unbounded_String package, with
and without atomic reference counters. The underlying pointer is never
null in one variant (and had a null-excluding type) and almost never
null in the other variant (and now has a null-excluding type as well).
Cleanup relate
CodePeer was warning about this variable being potentially used without
being initialized.
Tested on x86_64-pc-linux-gnu, committed on trunk
gcc/ada/
* sem_ch8.adb (Analyze_Subprogram_Renaming): Set New_S to Empty.diff --git a/gcc/ada/sem_ch8.adb b/gcc/ada/sem_ch8.adb
--- a/gcc/ada/sem_c
When spawning subprocesses with fork & execv there is no need to check
the result of execve, because it either succeeds and does not return or
fails and returns -1.
This is only a code cleanup related to the use of fork-vs-vfork in
GNATprove; behaviour is unaffected, though the GNAT runtime librar
Routine Predefined_Primitive_Bodies, which create predefined primitives
for derived tagged types, is only called with non-interface types
entities (which is even enforced with an assertion at the very start of
its body). There is no need to recheck this condition when creating
individual primitive
Replace subtle conditions on First_Entity/Last_Entity with a
straightforward Number_Formals/First_Formal/Last_Formal.
Code cleanup related to handling of dispatching equality in SPARK.
Tested on x86_64-pc-linux-gnu, committed on trunk
gcc/ada/
* exp_ch3.adb (Predefined_Primitive_Bodies)
For consistency, add Global => null contracts also to expression
functions in the Ada.Strings.Superbounded package.
Tested on x86_64-pc-linux-gnu, committed on trunk
gcc/ada/
* libgnat/a-strsup.ads (Super_Length, Super_Element,
Super_Slice): Add Global contracts.diff --git a/gcc/
3101 - 3200 of 3426 matches
Mail list logo