With this patch the compiler now handles properly the use of @ as a prefix
of a reference to a discriminated record component and to its bounds.
The following must compile quietly in gnat2020 mode:
---
procedure Discrs is
begin
declare
-- Discrim-dependent subtypes
subtype Index is Int
This patch adds another condition to an edge case used to delay expression
function freezing (P804-015). The offending package is within the body of a
library-level unit where this edge-case does not apply. By adding a condition
that only delays freezing of expression functions if we are in a libra
This patch cleans up some uses of global variables in Sem_Prag.
No change in behavior; no test available.
Tested on x86_64-pc-linux-gnu, committed on trunk
2017-04-25 Bob Duff
* sem_prag.adb: Remove suspicious uses of Name_Buf.
* stringt.ads, stringt.adb, exp_dbug.adb, sem_dim
This patch augments the existing support for tagged discriminants in assertion
expressions such as those of pragma Default_Initial_Condition or Type_Invariant
'Class by adding support for ancestor subtypes.
-- Source --
-- tester.ads
package Tester is
type Type_Id i
This patch fixes a bug in which pragma Ignore_Pragma(Interface); is illegal,
except in Ada 83 mode. It should be legal in all modes.
The following test should compile quietly.
-- gnat.adc
pragma Ignore_Pragma(Interface);
-- legal_interface.ads
package Legal_Interface is
procedure Interfa
The -gnatec switch is used to specify configuration files containing that
contain configuration pragmas. With This patch the compiler rejects properly
a name for a configuration file that designates a directory rather than
crashing.
Executing
gcc -c pkg.ads -gnatec=.
must yield:
gnat1: canno
This patch fixes a bug in which pragma Ignore_Pragma can cause errors in the
run-time system, if it applies to pragmas actually used in the run-time
system. Pragma Ignore_Pragma no longer applies to pragmas in the run-time
system.
The following test should compile quietly.
-- gnat.adc
pragma Ig
This patch corrects the mechanism which verifies the legality of references to
variables and constants acting as Part_Of constituents of single protected or
task types to continue examining the context of the reference when it appears
in an expression function.
-- Source --
--
If the prefix of a selected component denotes a synchronized object the
selected component is part of an external call (or requeue) that can only
access public operations of the object. The previous check on this construct
was too restrictive, and did not allow public protected operations, only tas
This patch adds a predicate to verify that entities within an inner package
do not rely on library unit level private types in cases where the full view of
said private types are unseen.
Tested on x86_64-pc-linux-gnu, committed on trunk
2017-04-25 Justin Squirek
* sem_ch3.adb (Analyze
This patch introduces support for pragma No_Heap_Finalization which has the
following syntax and semantics:
pragma No_Heap_Finalization [ (first_subtype_LOCAL_NAME) ];
Pragma `No_Heap_Finalization` may be used as a configuration pragma or as a
type-specific pragma.
In its configuration form,
This patch corrects an issue whereby an import aspect used within a generic
package would fail to resolve. By analyzing the expresions within the aspect's
arguments (a.k.a "interfacing" aspects) in addition to the generated pragma's
arguments the generic template gets properly resolved names for in
The trigonometric functions of children of Ada.Numerics are implemented by
inline assembly statements on the x86 architecture, and for sin/cos/tan
a special range reduction algorithm is used to avoid a loss of accuracy in
range reduction implemented in hardware on x86 processors.
This algorithm co
This patch removes the restriction on attribute definition clause 'Address
which prevented it from being used with controlled objects. The restriction
was a legacy left over from the previous controlled type implementation where
each controlled type had hidden components that should not be overlaye
String concatenation can be implemented either in-line or out-of-line by the
compiler, depending on the optimization level and other factors. But doing
in-line concatenation at library level is undesirable in general and the
compiler already avoids it for simple declarations:
S : String := S1 &
This patch is an improvement that causes an array object that has a
pragma Linker_Section with a compile-time-known initial value to be
statically initialized in place in the appropriate section.
Tested on x86_64-pc-linux-gnu, committed on trunk
2017-04-25 Bob Duff
* freeze.adb (Freez
Fixes bugs in which the wrong casing was used for restriction names in
pragmas Restrictions and Restriction_Warnings, and check names in pragma
Check. No test is available -- too complicated to make it fail.
Tested on x86_64-pc-linux-gnu, committed on trunk
2017-04-25 Bob Duff
* sem_p
CodePeer does not do anything useful with the various components
of the record type Ada.Tags.Type_Specific_Data. Suppress generation
of some checks which reference these components in cases where these
checks cause CodePeer to generate unwanted messages.
This change has no user-visible effect exce
This patch fixes a bug in the handling of use_type_clauses
If a use_type_clause "use type X;" appears in the parent of
a generic child package, and "use type X;" also appears before an
instantiation of that generic child package, the second "use type X;"
is ineffective; the primitive operators of t
Calls to Finalize_Address routines were already being omitted for CodePeer.
If we are never going to call them, then we also shouldn't generate them.
This change has no user-visible effect except when Gnat2scil is running.
Tested on x86_64-pc-linux-gnu, committed on trunk
2017-04-25 Steve Baird
AI12-0131, part of the Ada2012 Corrigendum, places restrictions on class-wide
preconditions of overriding operations, to prevent anomalies that would violate
LSP if an overriding operation could declare such a precondition without an
acestor of the operation having such a precondition to override.
This patch partially reimplements validity checks to prevent multiple reads or
copies of volatile expressions. This is achieved by first capturing the value
of a volatile object into a variable (rather than a constant). The variable is
then tested for validity (rather than the object again) and use
Function Determine_Range_R is used in GNATprove to compute the maximal
bounds of floating-point expressions. This computation now also deals
with type conversion expressions, for conversions from integer to float.
This allows to prove more checks (range and overflow) in GNATprove with
a simple inte
Range checks are now optimized away on float-to-int conversions when
bound analysis can determine that the value is always in range. This is
only possible in GNATprove mode, where NaN and infinite values are ruled
out by the analysis. Also improve the computation of bounds for
expressions that invo
This patch fixes a spurious error on a record component whose type is an
anonymous access to subprogram, when the component carries the Windows
convention Stdcall.
The following must compile quietly:
---
package P is
type T is record
AF : access function (i:Integer) return integer wi
This patch modifies the mechanism which determines whether A.B denotes an
object.operation call to work with the base type when the candidate type is
a private extension.
-- Source --
-- base.ads
package Base is
type A is tagged private;
private
type A is tagged
Ada allows adding visible operations to a tagged type after deriving a
private extension from it, which leads to confusing specifications on
which declarations of public primitives of different types are mixed.
This patch adds a new warning (enabled by means of -gnatw.j or -gnatwa)
that warns on p
A pragma No_Return that applies to a procedure body is illegal. This
patch fixes a bug that caused the compiler to fail to give an error.
The following test should get an error:
no_return.adb:6:04: representation item appears too late
package No_Return is
procedure P;
end No_Return;
package b
This patch fixes the following bug: If a function returns an
unconstrained array whose component type is nonlimited controlled, and
the function has an 'out' or 'in out' parameter, calls to that function
can cause the compiler to crash.
The following test must compile quietly.
with Ada.Strings.Un
Thic patch modifies the expansion of actual parameters to account for a case
where a validation variable may act as the argument of a type conversion and
produce proper code to avoid a potential duplicate copy of the variable.
-- Source --
-- types.ads
package Types is
Recent changes made to New_Copy_Tree significantly slowed down the front-end
of the compiler, up to 10% of the compilation time spent in the front-end,
which translated into a 5% slowdown of the entire compiler at -O0 for typical
files of real codebases. The function was wasting tens of millions o
When control flow preservation is requested, we want to be explicit about the
units elaboration order in a partition, and we want to have in the executable
an object file for all the units involved in the partition.
This requires special processing for units which wouldn't produce any
object code
Info messages are used in GNATprove to inform the user of subtleties in
how source constructs are verified. They should not be mistaken for
error messages in continuation messages. Now fixed.
Tested on x86_64-pc-linux-gnu, committed on trunk
2017-04-25 Yannick Moy
* errout.adb (Error_
This micro-optimizes again the implementation of a couple of hot functions
after recent changes. No functional changes.
Tested on x86_64-pc-linux-gnu, committed on trunk
2017-04-25 Eric Botcazou
* fname.adb (Has_Internal_Extension): Add pragma Inline.
Use direct 4-character s
This patch augments the generic instantiation machinery to preserve a key
property of a package or subprogram spec for the corresponding body which
may be instantiated or inlined later. Whenever a generic is instantiated in an
environment where the SPARK_Mode is Off, any SPARK_Mode pragma found wit
This patch fixes a bug in which the compiler crashes if the number of
subcomponents in an array aggregate is 2**31 or more.
Tested on x86_64-pc-linux-gnu, committed on trunk
2017-04-25 Bob Duff
* exp_aggr.adb (Component_Count): Protect the
arithmetic from attempting to convert
This patch modifies the analysis of exception handlers to bypass restriction
checks when the handler is internally generated and the verification mode is
warnings.
-- Source --
-- gen.ads
generic
type Ptr is private;
package Gen is
end Gen;
-- types.ads
with Gen;
This patch corrects an issue outlined by AI12-0150-1 (text below) and changes
class-wide type invariant procedures to avoid expensive dynamic dispatching. To
accomplish this changes to most calls to Build_Invariant_Procedure_Body and
Build_Invariant_Procedure_Declaration were made to handle the spe
This patch provides a better error message on expression functions that are
completions, when the expression has a reference to a type that cannot be
frozen yet.
Compiling try.ads must yield:
try.ads:10:49: premature usage of incomplete type "T2" defined at line 3
try.ads:10:49: type "T2" h
Comparisons of composite objects may be internally transformed by the
frontend into a special kind of node that facilitates their internal
management. If processing the comparison causes the internal declaration
of a subtype declaration associated with some sub-expression, the backend
may crash whe
This patch fixes an omission in the generation of predicate functions for
private types whose full view derives from a subtype with predicates.
Executing the following:
gnatmake -gnata -q predicate_check
predicate_check
must yield;
OK derived subtype
OK original subtype
---
with Te
This patch fixes a crash in a compilation involving nested generics when
a generic subprogram carries an Inline_Always pragma, and a configuration
file has a corresponding pragma Ignore_Pragma (Inline_Always).
No small example available.
Tested on x86_64-pc-linux-gnu, committed on trunk
2017-04-
This patch fixes two errors in the handling of unchecked unions used as
record components, in cases where such a use a potentially erroneous.
The following must ocmpile quietly:
gcc -c objects-base.adb
---
package body Objects.Base is
procedure setClass (self: in out SObject'Class; class :
This is an experimental profile to test EDF scheduling on bareboard platforms.
No test as no runtime yet.
Tested on x86_64-pc-linux-gnu, committed on trunk
2017-04-25 Tristan Gingold
* exp_ch9.adb (Expand_N_Task_Type_Declaration):
Add relative_deadline to task record on edf pr
Minor clean-up in the binder generated file: data for 'Version and 'Body_Version
are not emitted anymore if not needed.
Tested on x86_64-pc-linux-gnu, committed on trunk
2017-04-25 Tristan Gingold
* bingen.adb (System_Version_Control_Used): New variable.
(Resolve_Binder_Option
This patch fixes a spurious error on a predicate specification for a type
declared in a local package, when an object declaration that references that
type appears outside of the package.
The following must compile quietly:
---
procedure Pred_Scope is
package P is
Local : Boolean := Fal
This patch modifies the analysis of subunits to preserve the SPARK mode in
effect while multiple scopes and contexts are uninstalled to provide a clean
environment for the context of the subunit itself. As a result, the original
SPARK mode is still in effect when the subunit is analyzed.
The patch
This patch fixes a spurious error on a user-defined indexing that appears
as the actual in a parameter association of a procedure call. Given that the
enclosing call has not been analyzed yet, determining the matching formal
of the candidate subprogram must be located by name and not by position.
This patch removes the zero-origin array indexing that was used for
Source_Buffers with thin pointers. It is impossible to implement
zero-origin indexing correctly in Ada without fat pointers.
For one thing, 'First and 'Last can't work. For another thing,
array bounds checking can't work. And final
This patch removes a spurious visibility error on a reference to a formal T
of a formal package, when T is declared as a formal derived type and there
is no corresponding actual for T in the formal package declaration, that is
to say it is covered by an (others => <>) clause.
Compiling c.adb must
This patch has several effects:
1) The management of the secondary stack is now "tighter". A transient block
created for the purpose of managing the secondary stack will do so unless
the block appears within a function returning on the secondary stack or when
2) is in effect. Previously,
This patch corrects a crash that was produced when comparing "null" to an
allocator due to type Any_Access being improperly setup with no designated
type. Because both operands require a specific type from context such a case
will now emit the proper "ambiguous operands" error.
-- Sou
This patch introduces new children of Ada.Containers. They provide
functional, mathematical like containers, which can be used as high
level models when specifying data structures.
Tested on x86_64-pc-linux-gnu, committed on trunk
2017-04-27 Claire Dross
* a-cofuba.ads, a-cofuba.adb (
This patch adds a diagnostic to detect an illegal quantified expression which
is masquerading as an iterated component association.
-- Source --
-- proc.adb
with Ada.Containers;
with Ada.Containers.Hashed_Sets;
procedure Proc is
function Hash (X : Integer) return A
Names of Ghost entities are now prefixed by "___ghost_" (three leading
underscores) to make it possible to independently check the presence of
ghost code in an object file or an executable.
Tested on x86_64-pc-linux-gnu, committed on trunk
2017-04-27 Yannick Moy
* exp_dbug.adb, exp_db
This patch fixes a bug in which Ada.Directories.Current_Directory
returns invalid data if the current directory does not exist.
The following test should run silently:
rm -rf bug7550
mkdir -p bug7550
cd bug7550
cp ../bug7550.adb .
gnatmake -q -f bug7550.adb -o bug7550
./bug7550 &
cd ..
sleep 1
rm
This patch modifies the management of secondary stack within transient blocks
by allowing "relaxed management" to be the default. In this mode a block will
not manage the secondary stack if there exists an enclosing scope which already
does that. "Strict management" can be enforced by means of swit
Primitives of doubly linked lists are now annotated with precise
contracts which can be used for formal verification with GNATprove.
Tested on x86_64-pc-linux-gnu, committed on trunk
2017-04-27 Claire Dross
* a-cfdlli.adb, a-cfdlli.ads (=): Generic parameter removed to
allow t
This patch removes a spurious error from a function call when the return type
of the function is an incomplete type. This can be the case if the type is a
generic formal, or a limited view. It can also happen when the function
declaration appears before the full view of the type (which is legal in
This patch fixes a bug in which 'Type_Key on a subtype or derived type
could sometimes access the wrong source buffer. The following test
should compile and run silently.
package P is
type My_Int is range 1 .. 10;
for My_Int'Size use 10;
end P;
with P; use P;
package Q is
type New_My_Int
This change has no user-visible effect except when Gnat2scil is running.
Tested on x86_64-pc-linux-gnu, committed on trunk
2017-04-27 Steve Baird
* exp_attr.adb (Expand_N_Attribute_Reference):
Don't expand Image, Wide_Image, Wide_Wide_Image attributes
for CodePeer.
In
This patch corrects the visibility machinery to properly infer the original
visibility of a use-visible entity defined within a nested package within a
generic when the generic is instantiated and there is already another use-
visible entity which satisfies the referenced.
-- Source -
This patch corrects an issue whereby variant records with controlled components
would skip generation of finalization routines due to a counter (Num_Comps)
improperly being reset.
-- Source --
-- map_leak.adb
with Ada.Strings.Hash;
with Ada.Containers.Indefinite_Hashed
GNATprove relies on side-effects being removed and value being fixed from
renamings, which was not the case for the renaming of a qualified
expression. Now done.
Tested on x86_64-pc-linux-gnu, committed on trunk
2017-04-27 Yannick Moy
* exp_util.ads, exp_util.adb (Evaluate_Name): Forc
The wrappers introduced to handle correctly calls to overridden primitives
in class-wide contracts of inherited primitives need to be introduced for
compilation (whether SPARK_Mode is On or Off) but not formal verification
(when GNATprove_Mode is True).
Tested on x86_64-pc-linux-gnu, committed on
Static analysis tools benefit from some evaluations being done in
frontend, in particular comparisons between values of universal types
which are supposed to be evaluated at compile time and which static
analysis tools like GNATprove may not support. Restore such evaluation
during semantic analysis
This patch suppresses the generation of elaboration counters and access-before-
elaboration checks for GNATprove compilations.
-- Source --
-- dic.ads
package Dic with Elaborate_Body Is
G : Integer;
type T is private with Default_Initial_Condition => Foo (T);
This patch introduces a new access-before-elaboration check which attempts to
detect an indirect call to a primitive of a tagged type through dispatching
where the body of the primitive has not been elaborated yet. The check uses a
flag which is set after the body of the primitive is elaborated and
This patch is a partial implementation of the semantics mandated in AI12-0195
concerning class-wide preconditions on dispatching calls: the precondition
that applies is that of the denoted subprogram entity, not that of the body
that is actually executed.
Tested in ACATS test C611A03
Tested on x8
This implements a warning on the questionable placement of specific sorts
of components in record types, more specifically those with non-fixed size
or those with a fixed size that is not a mutiple of the storage unit. It
is enabled by -gnatw.q (and disabled by -gnatw.Q) only for the time being.
This fixes some of the remaining warnings that appear in a compiler bootstrap.
The above ones are false positives of -Wmaybe-uninitialized and most are fixed
by initializing the variable in case the control flow is fairly complicated; a
couple of very local cases are fixed by just adding pragma War
The expresion in an expression function that is a completion freezes. This
is implemented by first freezing the return type of the function, and then
traversing the analyzed expression and freezing explicitly all type references
within. If the expression includes a type conversion between access to
This fixes some of the remaining warnings that appear in a compiler bootstrap.
The above ones are false positives of -Wmaybe-uninitialized and most are fixed
by initializing the variable in case the control flow is fairly complicated; a
couple of very local cases are fixed by just adding pragma War
This patch fixes a bug where a protected procedure that propagates an
exception can cause deadlock. This can happen if all of these checks are
suppressed: Access_Check, Discriminant_Check, Range_Check, Index_Check,
and Stack_Check (possibly by -gnatp), and the protected procedure calls
something th
This patch ensures that info messages are not treated as errors when
warnings must be treated as errors due to -gnatwe.
-- Source --
-- pack.ads
package Pack is
procedure Proc_1;
procedure Proc_2;
end Pack;
-- pack.adb
package body Pack is
procedure Proc_1
This fixes some of the remaining warnings that appear in a compiler bootstrap.
The above ones are false positives of -Wmaybe-uninitialized and some are fixed
by initializing the variable in case the control flow is complicated; the rest
is fixed by just adding pragma Warnings.
No functional change
This patch fixes a loop in the compiler when an address clause is used to
specify an overlay, and the overlaid object has an illegal object declaration
in which the expression is a premature reference to the object itself.
Compiling p.ads must yield:
p.ads:3:33: object "Nowhere" cannot be used
This patch fixes a spurious conformance error on the occurrence of the
discriminant of a protected type in the expression for an aspect of the type,
when the type and its body appear within a subprogram body.
The check that the expression has the same visbility at the freeze point of
the type and a
This patch adds an enhancement for detecting and warning about constraint errors
in aggregate types with uninitialized null-excluding components at compile-time.
All composite types without aggregate initialization will now be recursivly
checked for such null-excluding components without default in
If the Small values of the fixed points involved in a division operation
have common factors, it is possible to simplify the restulting expression,
which will involve numerators and denominators of the corresponding Small
values of the type, as those values are integer literals.
The following must
This patch suppresses the generation of a discriminant check when the
associated type is a constrained subtype created for an unconstrained nominal
type. The discriminant check is not needed because the subtype has the correct
discriminants by construction.
-- Source --
When restriction No_Implicit_Heap_Allocation is active, the compiler rejects
a protected type that includes private components of dynamic size, This patch
extends the corresponding warning to the declaration of discriminated objects.
Given the following gnat.adc file:
pragma profile (Ravenscar
This patch fixes a bug in which ceiling priorities were off
by one, so that Program_Error is raised for a ceiling violation when a
task calls a protected operation and the priority of the task is equal
to the ceiling priority of the protected object. Program_Error should be
raised only if the prior
This optimizes the layout of some record types declared in the runtime, but
only in the private part of the spec or in the body, hence no API changes.
There is also a similar to the Xr_Tabls support package.
Tested on x86_64-pc-linux-gnu, committed on trunk
2017-05-02 Eric Botcazou
*
This patch fixes a bug in the handling of primitive operations that involve
renamings of equality. The placement of the primitive in the dispatch table
depends on whether the operation overrides an existing operation, is an
explicit renaming, or is inherited by a type extension.
Executing testz88
This patch adds a gnatmake compiliation flag to treat certain warnings as
errors similar to -gnatwe. However, the new flag -gnatwE looks for any warnings
regarding run-time exceptions being generated in order to only raise a
compile-time error in these cases.
-- Source --
This patch fixes a bug in which the compiler fails to give an error on
T'Enum_Rep, where T is a type. If X is an object of enumeration type T,
then X'Enum_Rep and T'Enum_Rep(X) are allowed, but not T'Enum_Rep.
The following test must get an error.
enum_val_test.adb:4:21: prefix of "Enum_Rep" attr
This patch fixes an error in the handling of freeze actions generated for
a generic package that is a compilation unit, whose entities carry iterable
aspects.
The following must compile quietly:
---
generic
type Data_Type (<>) is limited private;
package Data_Streams is
type Root_Data_Stre
The layout done in gigi for partially constrained derived untagged types,
that is to say discriminated record types derived from an untagged parent
type with constraints, is done independently of that of their parent type,
which is a bit annoying since the layouts must be compatible if there is no
This is a heads up that I am working with Pierre-Marie (in cc:) to
transition my work as "AdaCore merger" - aka the person who submits most
of AdaCore front-end changes in GCC - over to him.
Pierre-Marie has already write-after-approval and has submitted and
committed many patches already in the p
Duncan,
> >>it looks like this is in essence inlining the run-time library
> >>routine. In which case, shouldn't you only do it if inlining is
> >>enabled? For example, it seems rather odd to do this if
> >>compiling with -Os.
> >
> >Actually, measurements showed that this instance of inlining is
> s-taprop.adb failed to compile for x32:
>
> s-taprop.adb:341:29: operator for type "System.Linux.time_t" is not
> directly visible
> s-taprop.adb:341:29: add with_clause and use_clause for "Linux"
>
> which is caused by
>
> 2017-09-25 Doug Rupp
>
> * libgnarl/s-taprop__linux.adb (B
> I have no idea how to do it. I opened:
>
> https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82384
See Pierre-Marie's suggested patch on the PR.
Arno
> The attached patch to gcc trunk enables Ada support on
> aarch64-*-freebsd*. All tests pass except those affected by the
> currently missing unwind support (c52103x, c52104x, c52104y,
> cb1010a, cb1010c, cb1010d, gnat.dg/null_pointer_deref* (3)).
>
> I'd also like to get this patch backported
> This is exactly what aarch64-*-linux* is doing is doing in gcc 6
> branch (e.g. system.ads modeled it after, but now I see it has been changed to
Well no, you are reusing an x86_64 file for an aarch64 architecture, so
this is exactly the same issue.
Arno
> I was pointing out that on gcc-6, aarch64-linux is using x86-64
> system file too. Since I used gcc-6 for the original testing on
> freebsd, that's where it came from. It's been changed on trunk, but
> nobody backported those changes to gcc-6. It was obviously "good
> enough" and a "placeholde
> gcc/ada/Changelog:
> 2017-02-XX John Marino
>
> * system-freebsd-x86.ads: Rename into...
> * system-freebsd.ads: ...this
> (Default_Bit_Order): Define using Standard'Default_Bit_Order
> * gcc-interface/Makefile.in: Support aarch64-freebsd
> (x86_64/FreeBSD): Adju
> This patch fixes an error caused by my changing of the signal constants
> on MIPS in r244026. While that patch worked on mipsel, ada fails to
> bootstrap with it on mips64el with the error:
>
> s-osinte.ads:610:07: component "sa_flags" overlaps "sa_handler" at
> line 608
> ../gcc-interface/Makef
> Yes, you are right, somehow I submitted the old patch. Attached is the
> updated one, with a proposed ChangeLog entry included.
The copyright notices are wrong (or at least incomplete).
Arno
>
> Thanks!
> 2016-03-16 Svante Signell
>
> * gcc-interface/Makefile.in: Add support for x
> > The copyright notices are wrong (or at least incomplete).
>
> Hi, what is wrong then, copyright years and/or the text?
Both. The copyright year should include 2016 and the text should be
copyright FSF, not AdaCore.
Arno
801 - 900 of 2439 matches
Mail list logo