========================================================
Known problems in GNAT version 5.03a1 as of Oct 06, 2006
========================================================

Copyright (c) 2005-2006, AdaCore

The following is a listing of known problems in release 5.03a1. Except
where specifically noted, all these problems have been corrected in
version 5.04, which  means they are corrected in any wavefront issued
subsequent to the date above, and in the final 5.04 release (which is
not yet scheduled or available). The status line indicates the date the
problem was fixed (in ISO format YYYY-MM-DD). This can be used to
determine if a given wavefront has the fix identified in the entry.

KP-503a1-F101-003 Pragma Ada_05 not always effective

  Problem:    When pragma Ada_05 is used as a configuration pragma within a
              file, rather than in a separate file of configuration pragmas,
              it is not always correctly processed and recognized.

  Status:     This was fixed in 5.04 on 2006-01-04

  Workaround: Use pragma in a configuration pragmas file, or use the -gnat05
              compiler switch on the command line.

KP-503a1-F104-010 Unexpected exception from Unchecked_Deallocation

  Problem:    If a call to Unchecked_Deallocation occurs within an IF statement
              that checks for the argument being non-null, but then there is an
              assignment of null that precedes the unchecked deallocation, the
              compiler incorrectly may assume that the argument is non-null,
              resulting in an unexpected Constraint_Error exception.

  Status:     This was fixed in 5.04 on 2006-01-05

  Workaround: Add an additional test to avoid the call if the argument is
              null. This should be immediately around the call.

KP-503a1-EC28-007 Missing access checks in nested subprograms

  Problem:    An access check is omitted in some cases where a variable of an
              access type is declared in a subprogram and referenced within a
              nested subprogram.

  Status:     This was fixed in 5.04 on 2005-12-28

  Workaround: Avoid dereferencing null values, if necessary by inserting an
              explicit check into the source code.

KP-503a1-EC24-002 Allocators and access to class-wide interface formals

  Problem:    The use of allocators in subprograms whose formal is an access to
              class-wide abstract interface requires the compiler to generate a
              displacement of the pointer to the allocated object to reference
              the corresponding interface's secondary dispatch table, and the
              generation of such displacements is missing in the front end.

  Status:     This was fixed in 5.04 on 2005-12-27

  Workaround: Use an auxiliary variable to allocate the object.

KP-503a1-EC21-004 Max/Min and Restriction No_Implicit_Conditionals

  Problem:    On most targets, especially without optimization, the code for
              the Max/Min attributes generates implicit conditionals and thus
              these attributes should be prohibited in the presence of the
              restriction No_Implicit_Conditionals. For a clean rule, the best
              thing is to simply forbid these attributes entirely when this
              restriction is active.

  Status:     This was fixed in 5.04 on 2005-12-24

  Workaround: Avoid use of Max/Min attributes if this restriction is set.

KP-503a1-EC20-020 Project manager crashes when reporting an error

  Problem:    In some circumstances, when trying to report an error, the
              project manager crashes as the location of the error is unknown.

  Status:     This was fixed in 5.04 on 2005-12-22

  Workaround: Correct errors in the project file.

KP-503a1-EC17-008 Combined switches for gnatbind

  Problem:    Switches for gnatbind can be combined so that for example the
              command "gnatbind -bAd k.ali" is interpreted as equivalent to
              "gnatbind -b -A -d k.ali". This is not documented and gnatbind
              should not allow such combinations of switches.

  Status:     This was fixed in 5.04 on 2005-12-17.

  Workaround: Use separate switches, as documented and intended.

KP-503a1-EC17-007 Crash with empty linker option

  Problem:    A crash may occur if gnatmake is used with a project file  where
              the first option in the value of attribute Linker_Options is an
              empty string.

  Status:     This was fixed in 5.04 on 2005-12-17

  Workaround: Avoid empty string in attributes Linker_Options, which in any
              case have no effect.

KP-503a1-EC17-005 gnatlink and -shared-libgcc

  Problem:    When gnatbind is called with -shared, gnatlink does not
              always call gcc with -shared-libgcc, as it should.

  Status:     This was fixed in 5.04 on 2005-12-17

  Workaround: When using gnatlink directly, if gnatbind has been called
              with -shared, invoke gnatlink with -shared-libgcc.

KP-503a1-EC16-005 Wrong order of elaboration using child units

  Problem:    If a child unit makes a call to a function at elaboration time,
              and the function is defined in a unit that is WITH'ed in the
              spec of the parent package (or a higher level ancestor package),
              then when using the static elaboration model, the binder does
              not take the call into account, resulting in some rare cases
              in a bad order of elaboration.

  Status:     This was fixed in 5.04 on 2005-12-23

  Workaround: Add the unit to the WITH list of the unit containing the call.

KP-503a1-EC16-004 Asis.Expressions.Corresponding_Name_Definition problem

  Problem:    Asis.Expressions.Corresponding_Name_Definition blows up when
              applied to the references to formal IN objects in the expanded
              generic code

  Status:     This was fixed in 5.04 on 2005-12-22

  Workaround: Get the corresponding name definition using another ASIS query.

KP-503a1-EC15-020 Crash on renaming of access-to-string dereference

  Problem:    When a renaming of a dereference of an access-to-string type
              is used as actual for a formal of a constrained string subtype,
              the compiler may crash.

  Status:     This was fixed in 5.04 on 2005-12-15

  Workaround: Replace the offending usage occurrence of the renaming identifier
              with the renamed expression.

KP-503a1-EC14-009 Executable not rebuilt when library rebuilt

  Problem:    When a foreign object file is modified in a library project
              invoking gnatmake to rebuild an executable will rebuild the
              library, but may fail to rebuild the executable.

  Status:     This was fixed in 5.04 on 2005-12-14

  Workaround: Remove the executable and invoke gnatmake again.

KP-503a1-EC13-014 Fatal error using gnatpp with at clause

  Problem:    If a program contains the obsolescent construct USE AT, instead
              of an address attribute clause, then gnatpp blows up.

  Status:     This was fixed in 5.04 on 2005-12-13

  Workaround: Either convert these obsolescent Ada features into an attribute
              definition clauses or comment them out, use gnatpp and then
              uncomment and reformat manually.

KP-503a1-EC12-035 ZCX propagation failure with PA-RISC 2.0 code on HPUX

  Problem:    With the ZCX scheme, exception propagation sometimes fails on
              on HPUX for applications linked with PA-RISC 2.0 object code,
              resulting in unhandled occurrences despite applicable handlers.
              This is caused by the ZCX unwinder failing to recognize PA 2.0
              export stubs inserted by the HPUX linker when PA 2.0 code is
              part of the application.

  Status:     This was fixed in 5.04 on 2005-12-18

  Workaround: Arrange to avoid linking with PA-RISC 2.0 object code, or use
              the SJLJ exception scheme instead of the ZCX one.

KP-503a1-EC12-004 Allocators and access to class-wide interfaces

  Problem:    The use of allocators with variables whose type is a class-wide
              limited interface is not fully supported.

  Status:     This was fixed in 5.04 on 2005-12-17

  Workaround: Use an access to class-wide synchronized or task interface
              instead of the access to class-wide limited interface.

KP-503a1-EC10-001 GDB handles arrays with non-standard bounds incorrectly

  Problem:    On some 64-bit platforms, GDB can get confused by arrays with
              a constant, negative bound. When asked to print such arrays,
              it will report that they are objects with an unknown type,
              and will print no data.

  Status:     This was fixed in 5.04 on 2005-12-21

  Workaround: You can examine the array's components by explicitly giving
              a type and length, using a couple of GDB extensions, as in:
                 print { integer } Bad_Array'address @ 5
              to print five elements of integer array Bad_Array.

KP-503a1-EC09-026 Cannot print object with type deferred to body in debugger

  Problem:    The debugger is unable to print objects whose type is declared
              in the spec of a package, but whose full definition is done in
              the package body.  The debugger prints "<incomplete type>"
              in place of the expected object value.  This only occurs
              when using dwarf2 as the debugging format.

  Status:     This is fixed in 5.04 on 2005-12-21

  Workaround: Compile the unit where the type is defined with -gstabs+,
              or move the type definition to the package spec.

KP-503a1-EC06-013 No_Direct_Boolean_Operators restriction over-enthusiastic

  Problem:    The restriction No_Direct_Boolean_Operators is being applied to
              equality and comparisons. This is not what the documentation says
              (which restricts it to logical operations OR/AND/XOR) and worse,
              it means that implicitly generated record comparisons trigger the
              restriction if there is a boolean component.

  Status:     This was fixed in 5.04 on 2005-12-07

  Workaround: Use Restriction_Warnings instead, and use pragma Warnings (Off)
              around inappropriate triggerings of this warning.

KP-503a1-EC01-002 Problem with allocating Finalization_Storage_Only object

  Problem:    An allocator with initialization for a controlled object that is
              Finalize_Storage_Only may result in an incorrect chaining within
              the finalization list. If Unchecked_Deallocation is subsequently
              used on such an object, this may yield an inconsistent internal
              structure and erroneous memory access on some multiprocessor
              or hyperthreading platforms.

  Status:     This was fixed in 5.04 on 2005-12-05

  Workaround: If the allocator is of an access-to-classwide type, the problem
              can be worked around by converting the initialization expression
              in the allocator to the designated classwide type. Else,
              replace the allocator with initialization with an allocator
              without initialization, and then perform an assignment of the
              initializing expression into the newly allocated object.

KP-503a1-EB30-002 'Access with tasks implementing abstract interfaces

  Problem:    The use of the 'Access attribute is not fully supported when
              applied to a task implementing abstract interfaces.

  Status:     This was fixed in 5.04 on 2005-12-03

  Workaround: Avoid the use of this attribute to tasks implementing
              abstract interfaces.

KP-503a1-EB29-008 Modification_Time not in local time

  Problem:    The time returned by Ada.Directories.Modification_Time
              is not local time, except on VMS. In other words, it cannot
              be compared to Calendar.Clock.

  Status:     This was fixed in 5.04 on 2005-12-06

  Workaround: Do not compare Modification_Time with any other Calendar.Time
              except those also returned by Modification_Time.

KP-503a1-EB29-006 Legality problems with private with clauses

  Problem:    In Ada 2005 mode, a private with clause for a private child unit
              is being allowed even when the unit having the with clause does
              not share a common ancestor with the private child unit. On the
              other hand, the compiler rejects a limited private with clause
              for a private child unit on a library package declaration that
              is not declared private (when a regular private with clause for
              the same child unit would be accepted).

  Status:     This was fixed in 5.04 on 2005-12-09

  Workaround: In the case of the rejected limited private with clause, use a
              nonlimited with clause if possible, or else change the private
              child unit to a nonprivate unit.

KP-503a1-EB29-005 Problem with Copy_File to read only file

  Problem:    If GNAT.OS_Lib.Copy_File is used to copy to a read protected
              file, then an error is signalled, but the input file is opened
              and never closed, resulting in a leak.

  Status:     This was fixed in 5.04 on 2005-11-29

  Workaround: Check for the read only status before calling Copy_File.

KP-503a1-EB28-024 Problem stopping Find with sub-directories

  Problem:    GNAT.Directory_Operations.Iteration.Find will only stop the
              parsing of the current sub-directory when Quit callback parameter
              is set to False. The iterator will continue to parse the parent
              directory.

  Status:     This was fixed in 5.04 on 2005-11-29

  Workaround: Use Wildcard_Iterator instead of Find.

KP-503a1-EB28-013 Crash on multiple formal packages

  Problem:    Compiler crashes or loops on an instantiation with a formal
              package which is itself an instantiation with multiple formal
              package parameters, when the actuals in the generic declaration
              depend on previous formal parameters, and the last package in
              this sequence is parameterless.

  Status:     This was fixed in 5.04 on 2005-12-09

  Workaround: Add dummy parameter to parameterless generic and its instances.

KP-503a1-EB28-012 Crash calling subprogram with conversion of packed slice

  Problem:    If the actual argument to a subprogram is a type conversion whose
              expression is a slice of a bit packed array, then the compiler
              may crash during code generation.

  Status:     This was fixed in 5.04 on 2005-12-03

  Workaround: Copy the argument to a temporary and pass the temporary to the
              subprogram (and do a copy back for the IN OUT case).

KP-503a1-EB26-003 Compiler crash on record subtype with -gnatr

  Problem:    If all fields of a subtype of a packed variant record have
              component clauses, then the compilation blows up if the -gnatwr
              switch is set.

  Status:     This was fixed in 5.04 on 2005-11-26

  Workaround: Compile the unit in question without the -gnatwr switch.

KP-503a1-EB25-018 Problem with pragma Unreferenced on arrays

  Problem:    If a pragma Unreferenced is given for an array variable, then
              an assignment to a component is considered to violate the pragma.
              Only references should count, not assignments.

  Status:     This was fixed in 5.04 on 2005-12-26

  Workaround: Avoid the use of pragma Unreferenced in this case, and suppress
              undesired warnings with pragma Warnings (Off).

KP-503a1-EB24-007 Spurious error on subtype with unknown discriminants

  Problem:    Compiler rejects an object declaration where the subtype mark
              is a locally declared subtype of a private type with unknown
              discriminants.

  Status:     This was fixed in 5.04 on 2005-11-27

  Workaround: Use expanded name of private type in declaration, rather than
              name of locally declared subtype.

KP-503a1-EB24-002 Categorization not checked for subprogram body

  Problem:    If a subprogram has a separate spec, which is marked Pure or
              Preelaborate, then if the body with's incompatible units that are
              not correspondingly Pure/Preelaborate, no error message is given.

  Status:     This was fixed in 5.04 on 2005-11-27

  Workaround: Avoid such illegal dependencies.

KP-503a1-EB21-001 Multiple calls to function via single renaming

  Problem:    When a function call is used as part of a renaming expression,
              the function is sometimes called several times instead of once
              only.

  Status:     This was fixed in 5.04 on 2005-11-24

  Workaround: Use an explicit temporary object instead of a renaming.

KP-503a1-EB21-010 Compiler crash on code accessing field in gigantic record

  Problem:    Compiler crashes on code accessing a field of a record type
              containing gigantic fields, if the field comes after them.

  Status:     This was fixed in 5.04 on 2005-11-25

  Workaround: Ensure that the field comes before gigantic fields in the record.
              In practice declaring an object of such a record type will cause
              the compiler to issue a Storage_Error warning message.

KP-503a1-EB21-002 Task termination when using controlled types and Ravenscar

  Problem:    When using Ravenscar and controlled types, the termination of
              the environment task leads to the immediate termination of the
              whole application. What is expected is that the termination of
              the environment task does not affect the rest of the tasks.

  Status:     This was fixed in 5.04 on 2005-11-21

  Workaround: Ensure that the environment task does not terminate which is
              indeed what is expected by the Ravenscar Profile.

KP-503a1-EB15-008 Private types implementing abstract interfaces

  Problem:    The analysis of private types implementing abstract interfaces
              is too restrictive.

  Status:     This was fixed in 5.04 on 2005-12-17

  Workaround: Use public declarations.

KP-503a1-EB15-003 Memory access warning printed by debugger

  Problem:    When printing the value of an array of tagged types, the debugger
              sometimes prints a warning that it can not access the memory at
              address 0x0. It then prints normally the value of the array, and
              the value is correct.

  Status:     This was fixed in 5.04 on 2005-11-24

  Workaround: The warning is harmless and can be ignored.

KP-503a1-EB14-003 Box with non-limited components not fully supported

  Problem:    If a non-limited record has non-limited components whose type is
              a record or an array then the default initialization (using the
              box notation <>) is not supported.

  Status:     This was fixed in 5.04 on 2005-11-14

  Workaround: Either make the record limited or else avoid the use of default
              initialization.

KP-503a1-EB10-001 Failure to build an extending project with no source

  Problem:    When an extending project is described with no sources, its
              object directory is not put in the Ada objects path. This
              prevents the project from being built correctly.

  Status:     This was fixed in 5.04 on 2005-11-11

  Workaround: Do not specify an empty list for Source_Files or Source_Dirs.
              The source directory, either defaulted or explicit, should just
              contain no source file entries.

KP-503a1-EB07-009 Failure of gnatbind with extending projects

  Problem:    When using extending projects or specifying mapping files
              (gnatmake switch -C) and the project hierarchy includes
              an externally build library project with no ALI files
              in the object directory, gnatbind fails complaining that
              it cannot find some ALI files.

  Status:     This was fixed in 5.04 on 2005-11-08

  Workaround: Copy the ALI files in the library directory to the object
              directory, preserving the attributes, specially the time stamps.

KP-503a1-EB04-014 Incomplete backtrace in debugger on PA HP/UX

  Problem:    The debugger is sometimes unable to unwind past a function
              that was compiled by a non-GCC compiler, such as the HP C
              compiler for instance. This problem occurs when the function
              uses a stack frame pointer and sets the Large_frame_r3 flag
              in its associated unwind record.

  Status:     This was fixed in 5.04 on 2005-11-10

  Workaround: This does not affect correct operation of the program. Avoid the
              use of backtraces when debugging, or use output statements to
              perform the debugging operation.

KP-503a1-EB03-012 Unexpected breakpoint location proposed by debugger

  Problem:    When inserting a breakpoint using a function name, the debugger
              sometimes presents the user with a list of locations where some
              of them are unexpected. This can occur for instance when an
              enumeral has the same name as the function name.

  Status:     This was fixed in 5.04 on 2005-11-11

  Workaround: Simply select the appropriate choice in the menu presented
              by the debugger. Make sure to insert the breakpoint only
              after all shared libraries have been mapped in memory, to
              avoid having this menu appear during the program startup.
              This is usually done by inserting a breakpoint on main
              followed by a "run", after which the breakpoint can be
              safely inserted.

KP-503a1-EB02-026 ZCX exception from signal not caught on HPUX 11.11

  Problem:    On HPUX 11.11 with the ZCX scheme, exceptions raised by the
              run-time library in response to an operating system signal such
              as SIGSEGV are not propagated properly and are reported as
              unhandled even when handlers are applicable.

  Status:     This was fixed in 5.04 on 2005-11-07

  Workaround: Arrange for the unexpected signal not to occur or switch to
              the SJLJ alternate exception handling scheme.

KP-503a1-EB01-010 Incorrect packed record field value printed by debugger

  Problem:    On big endian targets, the debugger sometimes prints incorrect
              values for fields of a packed record. This can only occur if
              the field is either a record or an array.

  Status:     This was fixed in 5.04 on 2005-11-01

  Workaround: Write a small routine in your application that prints the record
              value on standard output, and call this routine from GDB.

KP-503a1-EA28-019 Malfunction in GNAT.Debug_Pools

  Problem:    In unusual cases of a peculiar sequence of widely separated
              addresses returned from malloc, the use of GNAT.Debug_Pools
              can lead to a segmentation fault.

  Status:     This was fixed in 5.04 on 2005-10-30

  Workaround: Avoid the use of debug pools in this environment, or
              alternatively patch a local copy of the body of this unit,
              modifying line 639
              Offset := (Storage - Edata) / Default_Alignment; to instead read
              Offset := Storage_Offset ((To_Integer (Storage) - To_Integer
                        (Edata)) / Default_Alignment);
              The problem is that subtracting a very small address from a very
              large one can result in a negative offset.

KP-503a1-EA26-030 Error in RCI package for use of limited type with Read/Write

  Problem:    The compiler issues an error when a subprogram in a package
              classified as a Remote Call Interface has a formal whose
              type is a limited private type with stream Read and Write
              attributes where the full type is derived from a private
              type (such as System.Address) or is a scalar type.

  Status:     This was fixed in 5.04 on 2005-11-14

  Workaround: Declare the full type of the limited private type as a record
              type wrapping a component of the desired full type.

KP-503a1-EA26-011 Bad syntax causes gnatchop hangs

  Problem:    In some cases, submitting seriously syntactically incorrect
              code to gnatchop can cause it to hang.

  Status:     This was fixed in 5.04 on 2005-10-27

  Workaround: Correct the bad syntax before running gnatchop. You can compile
              with -gnats -gnatdO to get error messages.

KP-503a1-EA24-013 Incomplete backtrace in debugger on PA HP/UX

  Problem:    On rare occasions, the debugger is unable to compute
              the complete backtrace. This can occur when trying to
              unwind past a subprogram which doesn't use alloca and
              yet whose frame size is dynamic.

  Status:     This was fixed in 5.04 on 2005-10-25

  Workaround: This does not affect correct operation of the program. Avoid the
              use of backtraces when debugging, or use output statements to
              perform the debugging operation.

KP-503a1-EA24-006 Bogus infinite recursion warning (2005-10-26)

  Problem:    The warning for possible infinite recursion is supposed to be
              suppressed if the call in question follows immediately after
              an unconditional raise statement (since this is a common idiom
              for function stubs). This suppression does not work in some
              generic cases.

  Status:     This was fixed in 5.04 on 2005-10-26

  Workaround: Use pragma Warnings (Off) to suppress the junk warning.

KP-503a1-EA24-001 Asis.Compilation_Units.Unit_Class problem with child units

  Problem:    In case of a child subprogram that does not have a separate
              spec Asis.Compilation_Units.Unit_Class returns A_Public_Body
              whereas it should be A_Public_Declaration_And_Body.

  Status:     This was fixed in 5.04 on 2005-10-24

  Workaround: Use a wrapper query for Unit_Class, this query should
              double-check the A_Public_Body result of Unit_Class by
              checking if Corresponding_Declaration returns a nil unit
              when applied to the argument of A_Public_Body

KP-503a1-EA22-001 Compiler hangs inlining subprogram with unchecked conversion

  Problem:    Compiler may hang when an inlined function with an internal
              instantiation of Unchecked_Conversion is invoked as part of
              an expression that involves the use of the secondary stack.

  Status:     This was fixed in 5.04 on 2005-10-24

  Workaround: Remove the inline pragma on the function.

KP-503a1-EA21-024 Incorrect array value printed by debugger

  Problem:    The debugger is sometimes printing the wrong value for
              unconstrained arrays when the variable is declared inside
              a nested procedure.

  Status:     This was fixed in 5.04 on 2005-10-25

  Workaround: Use Put_Line statements to inspect the value of this variable.

KP-503a1-EA21-023 Incorrect size for storage pool Deallocate call

  Problem:    When an access to unconstrained packed array type has a
              user-defined storage pool, the size passed to the Deallocate
              operation is incorrectly computed (it does not take packing into
              account).

  Status:     This was fixed in 5.04 on 2005-10-31

  Workaround: Replace any access to unconstrained packed array type that
              has a user-defined storage pool with an access types that
              desginates an unconstrained wrapper record type whose
              discriminants will be used to constrain a packed array
              component.

KP-503a1-EA20-020 Incorrect warning for -(A mod B)

  Problem:    When an expression of the form -(A mod B) occurs in source code,
              the compiler produces a bogus warning that the unary expression
              should be parenthesized.

  Status:     This was fixed in 5.04 on 2005-10-20

  Workaround: Introduce additional parentheses: (-(A mod B))

KP-503a1-EA20-013 gnatstub generates bodies for imported library subprograms

  Problem:    gnatstub generates a body stub for a library subprogram or
              generic subprogram if this subprogram is completed by pragma
              Import

  Status:     This was fixed in 5.04 on 2005-10-24

  Workaround: Do not apply gnatstub for such compilation units.

KP-503a1-EA19-017 Windows debugger fails to re-run program

  Problem:    When a program that is being debugged is rerun, the second run
              reports several error "error return win32-nat.c:1949 was 6" and
              the debugged program crashes after receiving a SIGTRAP.

  Status:     This was fixed in 5.04 on 2005-12-10

  Workaround: Use the "kill" command before re-running the program.

KP-503a1-EA18-006 Unchecked_Access causes wrong interface dispatching

  Problem:    The use of 'Unchecked_Access with an object implementing abstract
              interfaces deactivates some implicit conversions required to
              handle the secondary dispatch tables associated with abstract
              interface types.

  Status:     This was fixed in 5.04 on 2005-10-22

  Workaround: Replace 'Unchecked_access by 'Access.

KP-503a1-EA18-001 ASIS Corresponding_Last_Subtype problem with 'Base

  Problem:    Asis.Declarations.Corresponding_Last_Subtype gets into
              infinite loop if the subtype mark in the argument subtype
              declaration is a 'Base attribute

  Status:     This was fixed in 5.04 on 2005-10-20

  Workaround: Use a wrapper query that first checks the kind of the
              subtype mark in the argument subtype declaration and then either
              calls to Corresponding_Last_Subtype or (in case if it is
              A_Base_Attribute, takes the prefix and returns the declaration
              of the corresponding (sub)type as a result.

KP-503a1-EA13-011 GNAAMP treats statically constrained component as nonstatic

  Problem:    On the AAMP target only, the compiler is mishandling record
              components that are statically constrained discriminated records
              containing discriminant-dependent array componennts. The compiler
              blows up on an attempt to declare an object of the outer record
              type. Additionally, such types are being treated as having a
              nonstatic size needing run-time code for allocation and size
              computations even though the components have static constraints.

  Status:     This was fixed in 5.04 on 2005-10-15

  Workaround: Declare a defaulted discriminant on the type containing the
              constrained record component. This will avoid the compiler
              blow-up, though may still result in inefficient code for
              allocating and determining the size of objects of the type.

KP-503a1-EA13-010 gnatpp incorrectly formats aggregates

  Problem:    gnatpp uses incorrect layout for the first line of an aggregate
              if the aggregate should be placed on several lines, and if gnatpp
              options define the indentation level for continuation lines
              (-clnnn option) different than indentation level minus 1 (that
              is a standard indentation setting)

  Status:     This was fixed in 5.04 on 2005-10-15

  Workaround: Do not use -clnnn option for gnatpp

KP-503a1-EA11-010 Compiler loops on private grand-child unit

  Problem:    Compiler goes into an infinite loop when compiling a private
              child unit, if the grandparent unit has a use_clause in its
              private part.

  Status:     This was fixed in 5.04 on 2005-10-12

  Workaround: Make the unit non-private, or move the use clause to the visible
              part of the grandparent unit.

KP-503a1-EA07-019 Debugger unable to print array returned by function on x86

  Problem:    On x86 targets, the "finish" command in the debugger is unable to
              print the value returned by the current function when the
              returned value is an array whose size is statically known.
              It either prints incorrect values, or reports an internal error.

  Status:     This was fixed in 5.04 on 2005-10-08

  Workaround: Ignore the value printed by the debugger or the internal-error
              messages, and then print the variable where the result of the
              function call has been stored.

KP-503a1-EA06-009 Wrong handling when freeing "not null" object

  Problem:    In Ada 2005 mode, if an object is declared NOT NULL, and then
              an attempt is made to free the object, the attempt to set the
              object to null should fail and raise Constraint_Error, but
              this does not happen, and the object gets set to null.

  Status:     This was fixed in 5.04 on 2005-10-16

  Workaround: Assign the value to a normal access object and free that. This is
              really more than a work around, it is a reasonable way to free
              such an object (assuming as seems reasonable that the program is
              not anticipating the exception).

KP-503a1-EA06-004 Wrong value out of global constant of variable size with -O2

  Problem:    In rare circumstances, wrong code is produced by -O2 for
              access to components of global constants of variable size,
              from elaboration code in the same package as the one where
              the constants are declared. The effect is fetching some of
              the memory locations allocated for an object before their
              initialization, with anomalous values as an outcome.

  Status:     This was fixed in 5.04 on 2005-10-13

  Workaround: Declare the affected object as variable instead of constant
              or compile with an optimization level lower than -O2.

KP-503a1-E923-022 Bad placement of Elaborate_All desirable indication

  Problem:    If the static elaboration model detects the need for an elaborate
              all indication from a construct in a package body, and the unit
              needing elaborating is withed in the package spec, then the
              indication of elaboration all required is erroneously placed
              on the spec rather than the body. This can result in a situation
              where a circularity is diagnosed by the binder when in fact no
              circularity exists. This is a rather rare situation and can never
              lead to incorrect execution.

  Status:     This was fixed in 5.04 on 2005-09-24

  Workaround: Put an explicit with for the unit in question on the body and
              an explicit pragma Elaborate_All in the context clause of the
              body, avoiding the need for an implicit indication.

KP-503a1-E923-002 gprmake crashes when no object directory

  Problem:    Crash when gprmake is invoked to build a project with no sources
              where the object directory is not specified explicitly.

  Status:     This was fixed in 5.04 on 2005-09-23

  Workaround: Specify the object directory explicitly.

KP-503a1-E920-016 Erroneous behavior for invalid data

  Problem:    Invalid data caused by a function returning an invalid
              value id not always detected in contexts where such
              checks are required in normal default RM checking mode
              (e.g. assignment to an array with a bad subscript). The
              result is erroneous behavior which is not allowed for
              this bounded error situation.

  Status:     This was fixed in 5.04 on 2005-09-21

  Workaround: Avoid the bounded error resulting from the function returning
              an invalid result, or use -gnatVs to turn on validity checking
              for all subscripts (the latter action can have significant
              negative effects on execution efficiency).

KP-503a1-E919-003 Asis.Expressions.Corresponding_Name_Definition problem

  Problem:    Asis.Expressions.Corresponding_Name_Definition returns a wrong
              result in case if the argument is a reference to a record
              component of the object that has the type derived from the access
              type pointing to a record type.

  Status:     This was fixed in 5.04 on 2005-09-21

  Workaround: Compute the defining name using other ASIS queries.

KP-503a1-E916-006 Wrong result for address mod negative storage offset

  Problem:    Result for X mod Y is incorrect for the case where X is of type
              address and Y of type Storage_Offset with a negative value.

  Status:     This was fixed in 5.04 on 2005-09-18

  Workaround: Replace A mod S by (-A) mod (-S) when S negative.

KP-503a1-E915-012 Incomplete backtrace in debugger on PA HP/UX.

  Problem:    On rare occasions, the debugger is unable to compute
              the full backtrace. This can occur when trying to unwind
              past a subprogram such that the associated unwind data
              splits its code into two or more regions.

  Status:     This was fixed in 5.04 on 2005-10-03

  Workaround: This does not affect correct operation of the program. Avoid the
              use of backtraces when debugging, or use output statements to
              perform the debugging operation.

KP-503a1-E915-010 Compiler abort at -O3 on x86-64 or other platforms

  Problem:    Compiler aborts at -O3 while computing liveness information
              for complex code (the error message mentions flow.c).

  Status:     This was fixed in 5.04 on 2005-09-17

  Workaround: Compile at -O2 or -O3 -fno-rename-registers.

KP-503a1-E915-006 Compiler crash in configurable runtime mode

  Problem:    The compiler crashes when encountering certain complex
              configurations of generic instantiations in configurable
              runtime mode and inlining is enabled (-gnatn).

  Status:     This was fixed in 5.04 on 2005-10-24

  Workaround: Disable inlining for the problematic units.

KP-503a1-E913-012 Externally built projects cleaned by gnatclean

  Problem:    Projects that are externally built (attribute Externally_Built
              specified to be "true") get incorrectly cleaned by gnatclean.

  Status:     This was fixed in 5.04 on 2005-09-14

  Workaround: Do not use gnatclean recursively (-r) when one of the projects
              in the hierarchy is externally built. Do not use gnatclean
              directly on externally built projects.

KP-503a1-E913-004 Incomplete debug information for protected type

  Problem:    In some cases, the debug information generated for protected
              types is incomplete, making it difficult to display its value
              in the debugger.

  Status:     This was fixed in 5.04 on 2005-09-19

  Workaround: Debug the expanded code (gnatmake option -gnatD)

KP-503a1-E912-013 Asis.Expressions.Corresponding_Name_Definition problem

  Problem:    Asis.Expressions.Corresponding_Name_Definition blows up if
              the argument type element is the reference to a formal type
              inside the expanded instantiation code (the result should be the
              actual type).

  Status:     This was fixed in 5.04 on 2005-09-13

  Workaround: Compute the defining name using other ASIS queries.

KP-503a1-E907-019 Asis.Declarations.Corresponding_Type_Declaration problem

  Problem:    Asis.Declarations.Corresponding_Type_Declaration blows up if
              the argument type element is in the proper body of a subunit.

  Status:     This was fixed in 5.04 on 2005-09-09

  Workaround: Build your own version of this query using Traverse_Element.

KP-503a1-E907-018 Asis.Declarations.Corresponding_Type_Declaration problem

  Problem:    Asis.Declarations.Corresponding_Type_Declaration blows up if the
              argument type element is in the body of a child unit and if there
              is no incomplete view of this type.

  Status:     This was fixed in 5.04 on 2005-09-08

  Workaround: Build your own version of this query using Traverse_Element.

KP-503a1-E906-018 GNAAMP compiler fails on aggregates with address literals

  Problem:    On the AAMP target only, the compiler back end raises a
              Status_Error exception when processing an aggregate with
              component associations given by Address attributes (specifically
              when all component expressions of the aggregate have statically
              determined values).

  Status:     This was fixed in 5.04 on 2005-09-07

  Workaround: Enclose the Address attribute in a conversion to System.Address
              or assign the attribute to an Address object and use the name
              of the address object in the component association.

KP-503a1-E901-006 Useless recompilations of C sources with gprmake

  Problem:    When there are directories with symbolic links in
              ADA_PROJECT_PATH /GPR_PROJECT_PATH, gprmake may recompile
              C sources that are already up to date.

  Status:     This was fixed in 5.04 on 2005-09-13

  Workaround: Do not use symbolic links in ADA_PROJECT_PATH/GPR_PROJECT_PATH.

KP-503a1-E901-003 Asis.Declarations.Corresponding_Base_Entity problem

  Problem:    Corresponding_Base_Entity stops unwinding the renaming chain if
              a name after RENAMES is an expanded name.

  Status:     This was fixed in 5.04 on 2005-09-01

  Workaround: Manually traverse the renaming chain.

KP-503a1-E831-019 MacOS debugger unable to call function with range parameter

  Problem:    On MacOS, the debugger is unable to call a function if one
              of the arguments is a range type parameter. It prints an
              error message saying that one of the arguments "has unknown
              type code 0xb (TYPE_CODE_RANGE)".

  Status:     This was fixed in 5.04 on 2005-09-09.

  Workaround: Write a small wrapper to your function that takes a global
              variable in place of the range parameter, and then calls
              your function.

KP-503a1-E830-012 Missing interface sources for extending SAL project

  Problem:    When a stand-alone library project extends another one and some
              of the interface sources are inherited, the inherited interface
              sources are not copied to the library source directory.

  Status:     This was fixed in 5.04 on 2005-08-30

  Workaround: Make sure that all the interface sources are copied in a source
              directory of the extending SAL project, even if unmodified.

KP-503a1-E826-008 Constant mutable objects improperly initialized

  Problem:    Improper evaluation of the initializing expression of constant
              mutable objects with hidden discriminants potentially leads to
              evaluating the same function call several times, when it should
              only be evaluated once.

  Status:     This was fixed in 5.04 on 2005-08-31

  Workaround: Un-hide the discriminants by copying them from the private view
              to the public one, or call the function once in a separate
              declaration, and use the return value. Note that this is not
              seriously harmful if the function has no side effects.

KP-503a1-E826-005 Wrong membership test applied to class-wide interface actuals

  Problem:    The use of the membership test with a class-wide interface actual
              is not supported.

  Status:     This was fixed in 5.04 on 2005-08-28

  Workaround: Pass the value of the membership test as an additional parameter.

KP-503a1-E825-018 Project files and -aL with a relative path

  Problem:    When gnatmake is invoked with a project file and -aL followed
              by a relative path, if the object directory is not the project
              directory, the library directory may not be found.

  Status:     This was fixed in 5.04 on 2005-09-16

  Workaround: Use absolute paths when using -aL with project files.

KP-503a1-E825-007 ASIS Context and Windows logical drives problem

  Problem:    ASIS may fail to open a Context if you have a compiler installed
              on one logical drive (e.g. on C:), and you ASIS application is
              launched from another logical drive (e.g. D:).

  Status:     This was fixed in 5.04 on 2005-08-31

  Workaround: Use "-SN" Context parameter.

KP-503a1-E820-001 ASIS can not decompose expanded spec of formal package

  Problem:    ASIS queries Visible_Part_Declarative_Items and
              Private_Part_Declarative_Items blow up when applied to the
              expanded declaration of a formal package.

  Status:     This was fixed in 5.04 on 2005-08-25

  Workaround: Do not apply these queries to the expanded spec of a formal
              package, instead compute the corresponding information using the
              spec of the template from the formal package declaration.

KP-503a1-E816-016 Compiler allowing illegal qualified class-wide expression

  Problem:    Qualified expressions where the qualifying type is a specific
              tagged type and the expression is class-wide are not rejected.

  Status:     This was fixed in 5.04 on 2005-08-17

  Workaround: Write the expression as a conversion of the class-wide argument
              to the specific type rather than as a qualified expression.

KP-503a1-E816-005 Crash on protected op. with access to incomplete tagged type

  Problem:    Compiler aborts on the declaration of a protected operation that
              has an access type whose designated type is incomplete, when the
              full view of the type is tagged.

  Status:     This was fixed in 5.04 on 2005-08-018

  Workaround: Place the completion of the designated type before the protected
              declaration.

KP-503a1-E811-007 Missing conformance definition check of not-null access

  Problem:    There is a missing check in the frontend to ensure that the
              null-excluding and access-to-constant attributes specified must
              match between the subprogram specification found in package
              specification and the corresponding subprogram found in the
              package body. This is a requirement to have fully conformant
              profiles.

  Status:     This was fixed in 5.04 on 2005-08-12

  Workaround: Check that the profiles coincide and avoid writing illegal code
              where the profiles do not conform.

KP-503a1-E810-017 Asis.Expressions.Corresponding_Name_Definition problem

  Problem:    When applied to a reference to a generic formal parameter in
              an expanded generic code, this query blows up if the
              corresponding actual is an implicitly defined predefined
              entity.

  Status:     This was fixed in 5.04 on 2005-08-17

  Workaround: Try to get the defining name manually using other ASIS queries

KP-503a1-E809-004 Finalization with aggregates with late controlled components

 Problem:    Improper handling of aggregates of a tagged type with new
             controlled components appearing after components whose size
             depends on a discriminant leading to improper finalization of
             those former components.

 Status:     This was fixed in 5.04 on 2005-09-07

 Workaround: Avoid aggregates for types having the above mentioned
             characteristics.

KP-503a1-E809-002 Named array aggregate causes excessive memory consumption

  Problem:    Compiler takes a long time and uses a large amount of memory
              to compile an array aggregate using named notation when the
              component type of the underlying array type is a record type
              and the array range is large, at -O2.

  Status:     This was fixed in 5.04 on 2005-05-25

  Workaround: Use an "others" clause in the array aggregate or use -O1.

KP-503a1-E808-014 gnatpp wrongly indents IS after comment line

  Problem:    The IS keyword is wrongly indented by gnatpp if IS follows a
              parameter profile and there is a comment line between ')' and IS.

  Status:     This was fixed in 5.04 on 2005-10-06

  Workaround: Compile gnatpp result with '-gnaty' to detect wrong indentations
              and correct them manually.

KP-503a1-E808-003 Compilation error with Attach_Handler and restricted profile

  Problem:    When compiling code using Attach_Handler pragma under the
              restricted or ravenscar profile using a full run-time, a
              compilation error is generated.

  Status:     This was fixed in 5.04 on 2005-11-28

  Workaround: Remove the restricted profile restrictions from your
              configuration file, or compile with --RTS=ravenscar on platforms
              that provide this run time.

KP-503a1-E804-004 Issue with function returning mutable record

 Problem:    An improper copy can occur when a variable of a constrained
             type is assigned a value from a function returning a mutable
             record type whose maximum size is bigger than the type of
             the target.

Status:      This was fixed in 5.04 on 2005-09-02

Workaround:  Either type the target variable with the unconstrained base
             type or constrain the expression of the return statement of the
             function with the actual subtype of the returned value.

KP-503a1-E803-014 Asis.Expressions.Corresponding_Name_Definition problem

  Problem:    When applied to a reference to a formal parameter of an inherited
              subprogram, this query returns the result that is always
              Is_Part_Of_Instance.

  Status:     This was fixed in 5.04 on 2005-08-15

  Workaround: Try to get the defining name manually using other ASIS queries.

KP-503a1-E802-015 Asis.Expressions.Corresponding_Name_Definition problem

  Problem:    When applied to a reference to protected operation item or to a
              parameter thereof, returns a wrong result in case if this
              protected operation item is declared in a protected body with no
              explicit spec.

  Status:     This was fixed in 5.04 on 2005-08-15

  Workaround: Try to get the defining name manually using other ASIS queries

KP-503a1-E802-002 Missing diagnostic on illegal aliased component declaration

  Problem:    Compiler accepts a composite type with an aliased component
              when the component has a discriminated type with defaults, and
              the declaration appears in the specification of an instance.

  Status:     This was fixed in 5.04 on 2005-09-29

  Workaround: Do not create such illegal type declarations.

KP-503a1-E801-007 gnatpp blows up on discrete subtype definition in FOR loop

  Problem:    gnatpp blows up when processing the discrete subtype definition
              containing a range constraint, if this discrete subtype
              definition is a part of a loop parameter specification.

  Status:     This was fixed in 5.04 on 2005-08-01

  Workaround: Try to change the loop parameter specification syntax to avoid
              this construct

KP-503a1-E729-004 ASIS problems with UTF8 encoding

  Problem:    ASIS queries Defining_Name_Image and Value_Image return wrong
              results when applied to Ada source in UTF8 encoding.

  Status:     This was fixed in 5.04 on 2005-08-31

  Workaround: Use Asis.Text queries.

KP-503a1-E729-003 Spurious error with generics and incomplete type

  Problem:    Compiler rejects a complex call through an array component
              that holds an access_to_subprogram type that is a formal type
              of the current generic unit, when the return type of the
              access_to_subprogram has an incomplete declaration.

  Status:     This was fixed in 5.04 on 2005-07-29

  Workaround: Introduce a subtype of the designated type after its full
              declaration, and use the subtype subsequently.

KP-503a1-E725-009 Program_Error when handling signal in task on Linux

  Problem:    Under Linux systems only, when using a task entry to handle
              an interrupt (signal), the internal priority of the task
              is not always reset properly, leading to spurious ceiling
              violation when calling e.g. protected operations after handling
              the signal.

  Status:     This was fixed in 5.04 on 2005-07-27

  Workaround: Use a protected object to handle the signal.

KP-503a1-E718-001 Memory corruption on assignment to global mutable

  Problem:    When a library level variable is declared of a discriminated type
              with default discriminants, and an initialization expression is
              used, then the amount of storage allocated for the variable is
              restricted to what is required for the expression instead of
              being large enough to hold any possible value. Later assignments
              with values larger than the initializer overrun the allocated
              storage.

  Status:     This was fixed in 5.04 on 2005-08-09

  Workaround: Don't use an initialization expression to set the initial value
              of the variable, or ensure the expression is as large as any
              possible value the variable may be assigned with later on.

KP-503a1-E715-003 Wrong call to controlled type Adjust in -gnat05 mode

  Problem:    When compiling for Ada 2005 (-gnat05), a return statement for a
              function with a controlled class-wide result type may cause an
              additional call to the Adjust operation without a corresponding
              call to Finalize.

  Status:     This was fixed in 5.04 on 2005-07-25

  Workaround: Assign the expression of the return statement to a temporary
              object of the class-wide type and change the return statement
              to return the object.

KP-503a1-E713-025 Crash on indexing of array obtained by unchecked conversion

  Problem:    Compiler crashes when indexing a constant to array unchecked
              conversion with mismatched sizes.

  Status:     Fixed in 5.04 on 2005-09-04

  Workaround: Make sure sizes match in unchecked conversion.

KP-503a1-E712-014 Crash in elab procedure for big object on Windows

  Problem:    Compiler crashes when compiling the elaboration procedure
              of a big object at the library level on Windows, when
              the code is compiled for the Pentium III processor and
              optimizations are enabled.

  Status:     This was fixed in 5.04 on 2005-07-13

  Workaround: Reduce the size of the object or do not compile for Pentium III
              or do not enable optimizations for the compilation unit.

KP-503a1-E707-008 Unwanted optimization of overlayed variables

  Problem:    The use of address clauses to overlay variables is common usage,
              but the effect is implementation dependent. In some cases GNAT
              optimizes supposedly known values of such variables ignoring
              the presence of an address clause. This behavior is conforming
              but definitely undesirable.

  Status:     This was fixed in 5.04 on 2005-07-11

  Workaround: Declare the overlayed variables to be volatile.

KP-503a1-E706-018 Asis Corresponding_Name_Definition problem

  Problem:    Asis.Expressions.Corresponding_Name_Definition returns
              Nil_Element if the argument is an argument of a type conversion,
              the target type is a class-wide type or a reference to
              a class-wide type, and this type conversion is an actual
              parameter of a subprogram call.

  Status:     This was fixed in 5.04 on 2005-07-07

  Workaround: Use other ASIS structural and semantic queries to compute the
              defining name manually.

KP-503a1-E701-008 Duplicate entries generated by gnatbind

  Problem:    Sometimes, when pragmas Source_File_Name are used (for example
              with project file casing Mixed_Case), the recorded file name in
              an ALI file is not in lower case. On platforms where the file
              names are case-insensitive, this may lead to have the same file
              recorded in different ALI file under different file names, and
              the source generated by gnatbind may be not compilable because
              of duplicate entries.

  Status:     This was fixed in 5.04 on 2005-07-08

  Workaround: Use only small case for source file names.

KP-503a1-E628-017 Packed component conversion in out parameter problem

  Problem:    When a (view) conversion of a bit-packed array component is
              used as the actual for an 'out' or 'in out' parameter, incorrect
              code may be generated, causing the assignment of the returned
              value upon subprogram exit to fail.

  Status:     This was fixed in 5.04 on 2005-06-29

  Workaround: Use a temporary variable of the appropriate type as the actual
              parameter in the call, and assign it explicitly to the packed
              component.

KP-503a1-E628-011 Link failure for program compiled with -pg and optimization

  Problem:    Programs compiled with -pg and -O1 or above cannot be linked on
              certain platforms because of references to undefined symbols.

  Status:     This was fixed in 5.04 on 2005-06-29

  Workaround: Additionally pass -fno-inline.

KP-503a1-E626-003 Wrong style checking for 'Mod attribute

  Problem:    Mod used as an attribute is being checked using the style check
              rules for keywords, instead of identifiers.

  Status:     This was fixed in 5.04 on 2005-06-27

  Workaround: Supress or ignore the style check warning.

KP-503a1-E626-002 ASIS Corresponding_Expression_Type problem

  Problem:    Asis.Expressions.Corresponding_Expression_Type returns a wrong
              result when applied to an explicit dereference and the designated
              type is a string type (a string type is returned instead of the
              corresponding access type).

  Status:     This was fixed in 5.04 on 2005-06-26

  Workaround: Manually compute the expression type with other ASIS structural
              and semantic queries.

KP-503a1-E624-004 ASIS Corresponding_Generic_Element problem on inherit args

  Problem:    Asis.Declarations.Corresponding_Generic_Element always return
              Nil_Element when applied to an implicit inherited argument

  Status:     This was fixed in 5.04 on 2005-06-24

  Workaround: Manually compute the corresponding generic element with other
              ASIS structural and semantic queries.

KP-503a1-E623-012 Blow-up on anonymous subprogram access in object declaration

  Problem:    The compiler hangs when compiling an object declaration with an
              anonymous access-to-subprogram type.

  Status:     This was fixed in 5.04 on 2005-06-27

  Workaround: Use a named access-to-subprogram type as the object's type.

KP-503a1-E623-004 ASIS returns wrong span and text image of an identifier

  Problem:    Queries from the Asis.Text package (Element_Span, Element_Image)
              return wrong result for an identifier if this identifier is
              immediatelly followed by '!' (This may be the case if '!' is
              used instead of '|' as choice separator).

  Status:     This was fixed in 5.04 on 2005-06-23

  Workaround: Manually scan the element image and remove the wrong tail part

KP-503a1-E622-015 ASIS problem with decomposing a call to an intrinsic operator

  Problem:    ASIS structural queries (Asis.Expressions.Actual_Parameter,
              Asis.Expressions.Function_Call_Parameters) blow up on an infix
              call of an operator if the call convension for the operator is
              Intrinsic.

  Status:     This was fixed in 5.04 on 2005-06-27

  Workaround: Stop ASIS decomposition on the A_Function_Call element and then
              try to get the details from the text image of the call.

KP-503a1-E622-008 Instantiation error involving access-to-subprogram conversion

  Problem:    The compiler rejects a valid instantiation of a package with a
              formal with unknown discriminants, when the actual is a private
              type whose full view is a discriminated type with defaults, and
              the generic contains a conversion to an access-to-subprogram type
              with a formal parameter whose type is the generic formal type.

  Status:     This was fixed in 5.04 on 2005-06-23

  Workaround: Make the actual type nonprivate, or else expose the full type's
              discriminants in the private type declaration.

KP-503a1-E622-003 Object.Operation notation used to pass a value in a call

  Problem:    The case in which the object.operation notation is used to call
              a function and pass the returned value as the actual parameter of
              a call to a subprogram is not fully supported.

  Status:     This was fixed in 5.04 on 2005-07-23

  Workaround: Use the procedural (Ada 95) notation in this case.

KP-503a1-E617-008 Unneeded rebuild of global archive by gprmake

  Problem:    When building a project hierarchy of non Ada projects, gprmake
              rebuilds every time the global archive, even when it is up to
              date.

  Status:     This was fixed in 5.04 on 2005-06-17

  Workaround: Do not attempt to rebuild a project hierarchy that is up to date.

KP-503a1-E616-009 ASIS problem with parameters of an inherited subprogram

  Problem:    ASIS incorrectly processes elements representing formal
              parameters of implicit inherited subprogram.
              Asis.Declarations.Names returns only one defining name from
              parameter specification, though the parameter specification
              defines several names.

              Asis.Expressions.Corresponding_Name_definition returns a wrong
              result if the argument is a reference to a formal parameter of an
              inherited subprogram

  Status:     This was fixed in 5.04 on 2005-06-25

  Workaround: Use explicit declaration of the subprogram that is inherited to
              analyse the profile of implicit inherited subprogram.

KP-503a1-E616-006 GNAAMP uses full names in exception source file info

  Problem:    On the AAMP target only, full path names can appear in the source
              file information generated for raises of predefined exceptions.
              This can result in differences in generated code depending on
              where a source file resides, potentially interfering with
              debugging.

  Status:     This was fixed in 5.04 on 2005-06-27

  Workaround: Always compile a given file from the same location, or avoid
              path names by compiling from the directory containing the
              source file.

KP-503a1-E616-004 Incorrect visibility of private primitives in child instance

  Problem:    When a child generic unit declares a tagged type extension
              that derives from a type declared in a parent of the child
              unit, private primitives of the parent type may be inherited
              as visible operations of the derived type in an instance.

  Status:     This was fixed in 5.04 on 2005-11-03

  Workaround: Remove references to private primitives that should not
              be visible.

KP-503a1-E610-021 Suppress_Exception_Locations not working with ZFP

  Problem:    When using pragma Suppress_Exception_Locations together
              with the restriction No_Exception_Handlers, the source
              location is not removed from the call to the last chance
              handler.

  Status:     This was fixed in 5.04 on 2005-06-11

  Workaround: Use the -gnatdN compiler switch instead of the pragma
              Suppress_Exception_Locations.

KP-503a1-E610-012 ASIS Corresponding_Pragmas problem with child units

  Problem:    Asis.Elements.Corresponding_Pragmas blows up when applied
              to a declaration of a child unit.

  Status:     This was fixed in 5.04 on 2005-06-09

  Workaround: Do not apply Corresponding_Pragmas to child unit (this query is
              only partially implemented at the moment, it does not get any
              useful information for child units).

KP-503a1-E610-018 ASIS Type_Model_Kind problem with record rep clauses

  Problem:    A call to Asis.Data_Decomposition.Type_Model_Kind returns
              A_Simple_Static_Model result for a discriminanted record type
              (and for a type derived from such a type) in the case if a record
              representation clause is applied to the type. The correct result
              is A_Simple_Dynamic_Model

  Status:     This was fixed in 5.04 on 2005-06-09

  Workaround: In case of a presence of a representation clause, use either ASIS
              queries to analyse the type definition structure.

KP-503a1-E608-014 Out-of-range short jumps on VMS

  Problem:    In certain special cases, namely in blocks that have too many
              individually declared or referenced items, the compiler
              generates incorrect assembly code with out-of-range short jumps.

  Status:     This is a limitation of the current technology.

  Workaround: Avoid blocks that have too many individually declared or
              referenced items.

KP-503a1-E531-015 Withed unit not visible following child unit instantiation

  Problem:    An instantiation of a generic child which has a generic parent
              unit, but has an ultimate parent that is nongeneric, can cause
              the ultimate nongeneric parent unit to be removed from immediate
              visibility.

  Status:     This was fixed in 5.04 on 2005-10-06

  Workaround: Use a package renaming to capture the name of the withed unit
              prior to the child unit instance that disrupts the visibility,
              and replace all references to the withed unit with the name of
              the renaming declaration.

KP-503a1-E530-007 ASIS Corresponding_Name_Definition problem on dispatch call

  Problem:    Corresponding_Name_Definition does not return Nil_Element when
              applied to a subprogram name or to a formal parameter name from
              a dispatching call. Other ASIS queries may return wrong results
              when applied to these non-null results.

  Status:     This was fixed in 5.04 on 2005-05-31

  Workaround: Use a wrapper query that checks the enclosing context of the
              argument of Corresponding_Name_Definition and returns Nil_Element
              for these components of dispatching calls.

KP-503a1-E530-005 Crash on parameterless function call in prefix of call

  Problem:    Compiler crashes on a statement of the form F (X); when F is
              a parameterless function that returns an access_to_procedure.

  Status:     This was fixed in 5.04 on 2005-05-31

  Workaround: Add an explicit dereference, i.e. write F.all (X); instead.

KP-503a1-E527-020 Exception on initialization of record with alignment clause

  Problem:    The initialization of record component raises storage error
              if the component has an array subcomponent that is constrained
              by a discriminant, the component itself has a static discriminant
              constraint, and the enclosing record has an alignment clause that
              is less that the maximum alignment on the target machine.

  Status:     This was fixed in 5.04 on 2005-06-03

  Workaround: Remove alignment clause, or choose larger alignment.

KP-503a1-E526-011 gnatmake crashes when unable to change to obj dir

  Problem:    gnatmake crashes with Internal_Error when it is unable to change
              to the object directory of a project file, because this directory
              is not "executable". gnatmake will now fail gracefully.

  Status:     This was fixed in 5.04 on 2005-05-26

  Workaround: Make sure that all object directories are "executable".

KP-503a1-E526-002 no debug info generated for assembler file

  Problem:    When compiling an assembler file using a cross gcc with -g,
              no debug info is generated in the resulting object file.

  Status:     This was fixed in 5.04 on 2005-10-20

  Workaround: Use the option -Wa,-g to explicitely pass -g to the assembler.

KP-503a1-E524-012 complex static aggregate exhausts memory

  Problem:    Compiler aborts with a "memory exhausted" message, when
              compiling an aggregate for a very large multi-dimensional array
              whose component type is a record type with array subcomponents,
              when all components of the aggregate are static constants, and
              aggregate choices are given with subtype names.

  Status:     This was fixed in 5.04 on 2005-05-25

  Workaround: Replace the subtype names with an "others" clause in the outer
              aggregate.

KP-503a1-E524-003 Spurious error with private discriminant

  Problem:    Compiler rejects the declaration of tagged type when one of
              it components is of an untagged private type T, when the full
              view of T is a discriminated record and the type of the
              discriminant is private.

  Status:     This was fixed in 5.04 on 2005-07-06

  Workaround: Make the type of the discriminant non-private.

KP-503a1-E519-020 Incomplete debugger backtrace on HP/UX

  Problem:    On HP/UX, compiler optimizations can confuse the debugger
              and lead it to fail to produce a complete backtrace. The
              incomplete backtrace is usually accompanied by a warning.

  Status:     This was fixed in 5.04 on 2005-06-22

  Workaround: Recompile with no optimization the unit containing
              the subprogram referenced by the last frame displayed
              in the debugger callstack.

KP-503a1-E519-016 Incorrect value printed by debugger in "info locals"

  Problem:    The debugger sometimes print an incorrect value when
              using "info locals".

  Status:     This was fixed in 5.04 on 2005-06-20

  Workaround: Use the "print" command to print its value.

KP-503a1-E519-004 tool installation problem

  Problem:    Some tools (gnatelim, gnatmetric, gnatpp, gnatstub) may complain
              that they can not locate the needed libraries.

  Status:     This was fixed in 5.04 on 2005-23-05

  Workaround: Manually set LD_LIBRARY_PATH environment variable equal to
              gnat_install_dir/lib/gcc/<platform>/3.4.4/adalib/:  \
              gnat_install_dir/lib/
              where gnat_install_dir is the GNAT installation directory, and
              <platform> is the directory corresponding to your GNAT port.

KP-503a1-E518-014 Can not insert breakpoint before program is run (HP/UX)

  Problem:    On HP/UX, the debugger refuses to insert breakpoints at
              any address higher than 0x00FFFFFF, printing an error
              message saying that it can not insert the breakpoint
              without a running program.

  Status:     This was fixed in 5.04 on 2005-06-03

  Workaround: Start the program before inserting the breakpoint.

KP-503a1-E512-011 Package renamings cause incorrect debug info in GNAAMP

  Problem:    On the AAMP target, the compiler generates incorrect decl-ids
              in a unit's DST file for references to entities in other library
              units when the referencing unit contains package renamings.

  Status:     This was fixed in 5.04 on 2005-19-05

  Workaround: Remove package renamings (other than library-level renamings)
              and requalify declarations or add appropriate use clauses.
              Alternatively, to minimize editing of existing references
              to package renamings, move the package renamings into separate
              library-level packages and add with and use clauses for
              those packages.

KP-503a1-E512-006 Exception not caught with shared Stand-Alone Library on Tru64

  Problem:    On Tru64, exceptions raised during the elaboration of packages
              of an auto-initializable shared Stand-Alone Library are not
              caught.

  Status:     This was fixed in 5.04 on 2005-05-19

  Workaround: Do not use auto-initialization for the library. Instead, call the
              elaboration routine <library_name>init manually from the main
              program, imported using a pragma Import with C convention.

KP-503a1-E511-021 Simple/Static_HTable no way to free all memory

  Problem:    The Reset routines in GNAT..Dynamic_HTables do not release
              the table itself (only the elements were freed). So it is
              not possible to release all the memory associated with those
              hash tables.

  Status:     This was fixed in 5.04 on 2005-05-14

  Workaround: Use another hash table implementation like the new
              Ada.Containers.Hashed_Maps.

KP-503a1-E510-007 Variant part of record not visible in gdb

  Problem:    Under some circumstances, gdb does not display some fields in
              variant part of a record where the discrete choice list is
              expressed as a constant object.

  Status:     This was fixed in 5.04 on 2005-05-16

  Workaround: Do not use constant objects in the discrete choice list of the
              record declaration.

KP-503a1-E503-006 Debugger crash with non-standard section names

  Problem:    On VxWorks, the debugger crashes on loading a module
              if the elf special sections (e.g. text, data, bss) do not
              have standard names (e.g. ".text", ".data", ".bss").

  Status:     This was fixed in 5.04 on 2005-05-12

  Workaround: Use standard names.

KP-503a1-E502-016 Crash on misaligned discriminated component

  Problem:    Compiler aborts on a discriminated record declaration, when
              one of its component is a variable-size record constrained by
              an outer discriminant, and an alignment clause for the enclosing
              record is narrower that the default alignment for the component.

  Status:     This was fixed in 5.04 on 2005-02-05

  Workaround: Remove alignment clause.

KP-503a1-E505-007 Compiler crash on pragma Assert with no argument

  Problem:    An illegal pragma Assert with no arguments causes a compiler
              crash.

  Status:     This was fixed in 5.04 on 2005-02-05

  Workaround: Avoid writing such illegal pragmas.

KP-503a1-E504-005 Compiler crash on loop bound involving packed array component

  Problem:    Compiler crashes on a loop bound referencing a component of a
              packed array wrapped within a discriminated record and sized
              by one of the discriminants.

  Status:     This was fixed in 5.04 on 2005-02-04

  Workaround: Disable the array bound checks, or don't pack the array, or
              evaluate the loop bound into a temporary variable prior to the
              loop statement.

KP-503a1-E429-007 Visibility problem: -gnatn, child unit with same name

  Problem:    Compiler reports a spurious visibility problem when compiling
              a unit U whose context includes a child unit U1.U2, whose
              parent U1 contains a subunit, inline pragmas, and a with_clause
              on an unrelated unit called U2. The error only occurs when
              inlining is enabled.

  Status:     This was fixed in 5.04 on 2005-04-29

  Workaround: Compile the unit without inlining, or change the name of the
              child unit.

KP-503a1-E425-008 Wrong constants in Win32.Winsock

  Problem:    Values returned by FIONREAD, FIONBIO, FIOASYNC, SIOCSHIWAT,
              SIOCGHIWAT, SIOCSLOWAT, SIOCGLOWAT, SIOCATMARK functions are
              wrong.

  Status:     This was fixed in 5.04 on 2005-04-25

  Workaround: Use constants from GNAT.Sockets if possible or just redeclare
              those constants into the application.

KP-503a1-E425-007 Asis.Elements.Enclosing_Element problem on formal packages

  Problem:    Asis.Elements.Enclosing_Element may not work correctly when
              applied to a defining name of an expanded package created for a
              formal paclage with the box

  Status:     This was fixed in 5.04 on 2005-04-29

  Workaround: Find enclosing element by traversing the enclosing compilation
              unit.

KP-503a1-E425-006 GNAAMP compiler crashes on renamings of byte array components

  Problem:    On the AAMP target only, the compiler fails at the end of a
              subprogram that declares a renaming of record component that
              is a byte array. This problem can also arise when compiling
              the use of a Range attribute applied to a byte array component,
              since the compiler implicitly generates a renaming of the byte
              array.

  Status:     This was fixed in 5.04 on 2005-04-25

  Workaround: Use the renamed byte array component directly rather than
              referring to the renaming. In the Range attribute case,
              replace the attribute with explicit use of 'First and 'Last.

KP-503a1-E422-011 Asis.Declarations.Corresponding_Subprogram_Derivation problem

  Problem:    Asis.Declarations.Corresponding_Subprogram_Derivation returns
              wrong result in case if the result should be an implicit
              inherited subprogram.

  Status:     This was fixed in 5.04 on 2005-04-22

  Workaround: Check if the result of the query Us_Part_Of_Inherited, and if it
              is, discard this result and use other ASIS structural and
              semantic queries to compute the result manually.

KP-503a1-E421-017 Asis.Expressions.Corresponding_Name_Definition problem

  Problem:    Asis.Expressions.Corresponding_Name_Definition blows up when
              applied to a subtype mark from the specification of implicit
              inherited subprogram in case if this subprogram is inherited
              by a formal derived type.

  Status:     This was fixed in 5.04 on 2005-04-22

  Workaround: Use other ASIS structural and semantic queries to get the
              defining name.

KP-503a1-E421-002 Debugger detached when debugged program forks on linux

  Problem:    If the debugged program forks several processes and if, when
              reporting the fork event, the debugger hits the end of the output
              page and try to get inputs from the user (with the message
              "---Type <return> to continue, or q <return> to quit---"), the
              debugger will be detached from the current console.

  Status:     This was fixed in 5.04 on 2005-12-12

  Workaround: Use "set height 0" before starting the debugged program.

KP-503a1-E419-012 Asis.Expressions.Corresponding_Name_Definition problem

  Problem:    Asis.Expressions.Corresponding_Name_Definition may blow up when
              applied to a reference to type or subtype inside expanded
              generic.

  Status:     This was fixed in 5.04 on 2005-04-20

  Workaround: Use other ASIS structural and semantic queries to get the
              defining name.

KP-503a1-E418-015 Asis.Expressions.Corresponding_Name_Definition problem

  Problem:    Asis.Expressions.Corresponding_Name_Definition blows up when
              applied to a reference to a protected object defined by a
              single protected definition.

  Status:     This was fixed in 5.04 on 2005-04-19

  Workaround: Use other ASIS structural and semantic queries to get the
              defining name.

KP-503a1-E418-004 Asis.Elements.Enclosing_Element problem on inherited operator

  Problem:    Asis.Elements.Enclosing_Element blows up when applying to
              implicit inherited function having an operator sign as its
              designator.

  Status:     This was fixed in 5.04 on 2005-04-18

  Workaround: Find enclosing element by traversing the enclosing compilation
              unit.

KP-503a1-E412-016 GNAAMP compiler blows up on record-to-byte-array conversion

  Problem:    On the AAMP target only, the compiler fails when translating
              an unchecked conversion from a record type to a packed array
              of bytes.

  Status:     This was fixed in 5.04 on 2005-04-22

  Workaround: Replace the record-to-array unchecked conversion by an unchecked
              conversion from type address to an access type with a designated
              subtype given by the target byte array subtype, applying 'Address
              to the source and dereferencing the result of the conversion.

KP-503a1-E412-014 GNAAMP compiler blow up on 'Address applied to loop parameter

  Problem:    On the AAMP target only, the compiler blows up when the Address
              attribute is applied to the parameter of a for loop.

  Status:     This was fixed in 5.04 on 2005-04-21

  Workaround: Replace the for loop with an equivalent while loop using
              a declared variable as the loop index, and apply 'Address
              to the variable.

KP-503a1-E407-018 Debugger crash when displaying a deallocated string.

  Problem:    When trying to print a string variable that has been
              deallocated, the debugger may crash.

  Status:     This was fixed in 5.04 on 2005-05-11

  Workaround: Before printing the string variable, make sure that it is
              valid.

KP-503a1-E407-016 Asis.Elements.Enclosing_Element problem

  Problem:    Asis.Elements.Enclosing_Element blows up when applying to actual
              generic parameters of library-level package instantiation.

  Status:     This was fixed in 5.04 on 2005-04-08

  Workaround: Find enclosing element by traversing the enclosing compilation
              unit.

KP-503a1-E407-008 ASIS Corresponding_Name_Definition problem

  Problem:    Asis.Expressions.Corresponding_Name_Definition query may return
              wrong result when applied to a reference to a component name of a
              record type in case if the full view of the type is private, and
              this reference is from the body of a child unit.

  Status:     This was fixed in 5.04 on 2005-05-16

KP-503a1-E404-009 Generic_Actual_Part problem with pragmas

  Problem:    Asis.Declarations.Generic_Actual_Part query blows up when
              applying with the Normalized flag ON to an instantiation
              of a generic unit that has pragmas in the formal part.

  Status:     This was fixed in 5.04 on 2005-04-05

  Workaround: Use a wrapper function when applying
              Asis.Declarations.Generic_Actual_Part and in case of a blow-up
              compute the result manually by using other ASIS queries.

KP-503a1-E402-001 Generic_Actual_Part problem with formal packages

  Problem:    Asis.Declarations.Generic_Actual_Part query blows up when
              applying with the Normalized flag ON to an instantiation
              having package parameters.

  Status:     This was fixed in 5.04 on 2005-04-02

  Workaround: Use a wrapper function when applying
              Asis.Declarations.Generic_Actual_Part and in case of a blow-up
              compute the result manually by using other ASIS queries.

KP-503a1-E401-002 Bug in nested anonymous access to subprograms

  Problem:    In Ada 2005 mode, nested anonymous access to subprograms are not
              fully supported.

  Status:     This was fixed in 5.04 on 2005-04-14

  Workaround: Avoid nested declarations containing this new Ada 2005 construct.

KP-503a1-E331-004 Misleading warning on constant condition

  Problem:    When a condition is an inequality, its value is static, and
              warnings are enabled, the warning message gives the complement
              of the value of the expression (as if it were written as an
              equality instead).

  Status:     This was fixed in 5.04 on 2005-03-31.

  Workaround: Ignore value given in warning.

KP-503a1-E331-001 dirs from project files before dirs from env vars

  Problem:    The directories listed in the environment variables
              ADA_INCLUDE_PATH and ADA_OBJECTS_PATH are put before
              the source and the object directories of the project
              files in the search order. They should be after.

  Status:     This was fixed in 5.04 on 2005-03-31

  Workaround: Use a mapping file (switch -C of gnatmake)

KP-503a1-E330-023 Crash on packed array element with validity checks

  Problem:    Compiler aborts on an actual in a call that is an indexed
              component whose prefix is a bit-packed array, when the unit
              is compiled with -gnatVa.

  Status:     This was fixed in 5.04 on 2005-04-12

  Workaround: Use a temporary to hold the actual, or compile unit without
              validity checks.

KP-503a1-E330-004 Missing check for missing pragma argument identifier

  Problem:    There is a clear rule in the RM (2.8(4)) that forbids the use of
              a pragma argument without an identifier following an argument
              that does have an identifier. GNAT does not check for this error.

  Status:     This was fixed in 5.04 on 2005-04-12

  Workaround: Avoid writing such illegal pragmas.

KP-503a1-E329-016 gprmake -c compiles all non Ada sources

  Problem:    Invoking gprmake -c with one or several main on the command line
              results in the compilation of all non Ada sources in the project
              file if -u is not used.

  Status:     This was fixed in 5.04 on 2005-03-29

  Workaround: Use "gprmake -u -c".

KP-503a1-E324-010 Asis.Declarations.Generic_Actual_Part problem on box default

  Problem:    Asis.Declarations.Generic_Actual_Part query may blow up when
              applying with the Normalized flag ON to an instantiation where
              box default is used for a formal subprogram and there is no
              actual for this subprogram in the instantiation

  Status:     This was fixed in 5.04 on 2005-03-25

  Workaround: When applying Asis.Declarations.Generic_Actual_Part, use a
              wrapper function and in case of a blow-up compute the result
              manually by using other ASIS queries.

KP-503a1-E223-028 Debugger can not read or write FSR register (IRIX)

  Problem:    On mips-irix, the debugger prints the wrong value for the
              FSR register, and trying to set a different value for that
              register does not change it.

  Status:     This was fixed in 5.04 on 2005-03-25

  Workaround: Use "set remote-mips64-transfers-32bit-regs" just before
              printing or setting the register value. Revert this flag
              to its original value immediately afterwards using
              "set remote-mips64-transfers-32bit-regs off". User-defined
              commands can be used to encapsulate the commands used to
              read and to write the FSR register value.

KP-503a1-E322-019 GNAAMP emits bad code for formal array length with long index

  Problem:    On the AAMP target only, the compiler uses a size for the length
              of a formal array parameter that is inconsistent with what is
              passed for an actual when the array type has an index type that
              is wider than 16 bits.

  Status:     This was fixed in 5.04 on 2005-03-22

  Workaround: Change the index type to a 16-bit type. This will typically
              be feasible since the AAMP limits the size of data objects
              to fit in a 16-bit data segment.

KP-503a1-E322-014 Asis.Declarations.Generic_Actual_Part problem on renamings

  Problem:    Asis.Declarations.Generic_Actual_Part query blows up when
              applying with the Normalized flag ON to an instantiation where
              the name of the instantiated generic unit is declared by a
              generic renamimg declaration.

  Status:     This was fixed in 5.04 on 2005-03-23

  Workaround: Use a wrapper function when applying
              Asis.Declarations.Generic_Actual_Part and in case of a blow-up
              compute the result manually by using other ASIS queries.

KP-503a1-E317-014 Asis.Declarations.Names problem on expanded formal package

  Problem:    Asis.Declarations.Names query blows up when applying to an
              expanded package corresponding to a generic formal package

  Status:     This was fixed in 5.04 on 2005-03-18

  Workaround: Use a wrapper function when applying Asis.Declarations.Names
              such Elements, and in case of a blow-up compute the result
              manually from the declaration of the formal package by using
              other ASIS queries.

KP-503a1-E317-009 Asis.Expressions.Corresponding_Expression_Type problem

  Problem:    Asis.Expressions.Corresponding_Expression_Type query returns
              Nil_Element applied to a selector from an expended name
              representig some data object (the result of the query is correct
              when it is applied to a whole expanded name)

  Status:     This was fixed in 5.04 on 2005-03-21

  Workaround: Check the result of Corresponding_Expression_Type, and if it is
              nil, try to apply the query to the Enclosing_Element of the
              argument

KP-503a1-E317-007 Asis.Statements.Corresponding_Called_Entity problem

  Problem:    When applied to a call of a child subprogram, the ASIS query
              Asis.Statements.Corresponding_Called_Entity returns the defining
              program unit element instead of a subprogram declaration element

  Status:     This was fixed in 5.04 on 2005-03-19

  Workaround: Check the result of Corresponding_Called_Entity and apply
              Enclosing_Element if needed

KP-503a1-E317-001 Abort on overloaded prefix of explicit dereference

  Problem:    Compiler aborts on a construct of the form F.all, where F is
              overloaded, one of its interpretations yields an access_to_object
              and another yields a parameterless access_to_function.

  Status:     This was fixed in 5.04 on 2005-03-018

  Workaround: Rename one of the functions to avoid the overloading.

KP-503a1-E316-008 Bomb on illegal literal for derived character type

  Problem:    An attempt to use an undefined identifier as a literal for a type
              derived from standard [wide_[wide_]]character bombs instead of
              generating an error message.

  Status:     This was fixed in 5.04 on 2005-03-08

  Workaround: Correct the reference to the undefined literal.

KP-503a1-E316-009 ASIS problem with enum literals renamed as functions

  Problem:    ASIS can not correctly process references that denotes functions
              renaming enumeration literals. Such references are classified as
              An_Enumeration_Literal instead of An_Identifier, and
              Corresponding_Name_Definition blows up on them.

  Status:     This was fixed in 5.04 on 2005-03-18

  Workaround: Use a wrapper function when applying
              Corresponding_Name_Definition to An_Enumeration_Literal argument,
              and in case of a blow-up compute the result manually by using
              other ASIS queries.

KP-503a1-E315-015 Crash on loop bound with formal of protected operation

  Problem:    Compiler aborts on a loop whose upper bound is given by a
              complex expression that includes a selected component when the
              prefix is a formal parameter of an enclosing protected operation,
              and the type of the parameter is discriminated.

  Status:     This was fixed on 5.04 on 2005-03-24

  Workaround: Use a temporary to hold the bound.

KP-503a1-E315-002 GNAAMP linker reports unresolved syms for generic child units

  Problem:    For the AAMP target only, the linker reports unresolved symbols
              on the binder-generated calls to elaboration routines within
              generic child units, due to an inconsistency in the defining
              and referencing names.

  Status:     This was fixed in 5.04 on 2005-03-16

  Workaround: Nest the generic child unit within its parent unit.

KP-503a1-E309-001 Remote access-to-subprograms in non-distributed application

  Problem:    Incomplete code is generated for remote access-to-subprogram
              types in a non-distributed context.

  Status:     This was fixed in 5.04 on 2005-03-14

  Workaround: Strip Remote_Call_Interface pragmas when compiling a
              non-distributed application.

KP-503a1-E308-013 Run-time error with O2 and inlining of inherited primitive

  Problem:    Wrong code may be generated by the compiler when a primitive
              operation inherited by a derived array type is inlined in a
              context where a derived object is both accessed and passed by
              reference to the inlined subprogram.

  Status:     This was fixed in 5.04 on 2005-04-10

  Workaround: Avoid the inlining operation, by removing either the
              corresponding Inline pragma or -gnatn from the command line.
              Alternatively, reduce the optimization level to -O1, or add
              -fno-strict-aliasing to -O2.

KP-503a1-E307-002 Spurious error on derivation of type from formal package

  Problem:    Compiler rejects a derivation of a type declared in an
              instance of a package whose actual is itself a formal package
              of the current generic, when the parent type is a private
              type whose full view is derived from another formal type.

  Status:     This was fixed in 5.04 on 2005-03-07

  Workaround: Make the parent type non-private.

KP-503a1-E301-010 ASIS does not check that a tree file is created with -gnatc

  Problem:    ASIS does not check that a tree file is created in compile-only
              mode (that is, with '-gnatc' option). As a result, an ASIS
              application does not reject such tree files and blows up
              when trying to process them.

  Status:     This was fixed in 5.04 on 2005-03-04

  Workaround: Make sure that all the tree files created for use by ASIS
              applications are created with '-gnatc' option.

KP-503a1-E228-006 Win32.Winsock.FD_CLR call results in endless loop

  Problem:    Calling FD_CLR results in an endless loop when the socket to
              remove is not the first item in the array.

  Status:     This was fixed in 5.04 on 2005-02-28

  Workaround: Do not call FD_CLR in this situation. It is possible to remove
              the socket from the array without using this routine as the type
              definition is public.

KP-503a1-E226-003 Code generation bug with renaming and -gnatn

  Problem:    Compiler generates incorrect code that aborts at run-time,
              on a call to a subprogram S that is a renaming_as_body of
              an inherited operation, S is inlined, and the unit is compiled
              with -gnatn and some level of optimization.

  Status:     This was fixed in 5.04 on 2005-02-28

  Workaround: Remove Inline pragma.

KP-503a1-E225-016 Compiler accepts illegal renaming of unchecked_deallocation

  Problem:    Compiler fails to diagnose a renaming_as_body in a generic unit
              when the renamed entity is an intrinsic subprogram, and the new
              entity is already frozen.

  Status:     This was fixed in 5.04 on 2005-02-28

  Workaround: Do not use this illegal construct. If the renaming is needed
              to complete a declaration, write instead an explicit body for
              the new entity, and provide a pragma Inline_Always for it.

KP-503a1-E225-006 Compiler abort at -O3 on 'Value attribute

  Problem:    Compiler aborts on the evaluation of the 'Value attribute for
              a small-sized type, at -O3 on Windows.

  Status:     This was fixed in 5.04 on 2005-04-06

  Workaround: Compile the file where the attribute is evaluated at -O2 or
              -O3 -fno-rename-registers.

KP-503a1-E225-002 ASIS Name_Image problem on inherited subprograms

  Problem:    If the argument Element is a reference to an attribute designator
              that is a part of a subtype mark from the paramener specification
              from the specification of an inherited subprogram, the string
              image returned by the query corresponds to the attribute prefix,
              but not to the designator

  Status:     This was fixed in 5.04 on 2005-02-25

  Workaround: Check the argument element kind, and in case of the attribute
              designator that Is_Part_Of_Inherited, either use the attribute
              kind to generate the text image manually or get the image
              from the corresponding parent subprogram.

KP-503a1-E224-028 Upper half character in enum literal blows up using UTF-8

  Problem:    If a program uses UTF-8 encoding, or any other "upper half"
              encoding, then if an upper half (16#80# .. 16#FF#) character
              appears in an enumeration literal, the compilation may abort
              with a constraint error.

  Status:     This was fixed in 5.04 on 2005-03-14

  Workaround: Avoid the use of such characters in enumeration literals, or
              use one of the wide character encoding methods that avoids the
              use of upper half encoding.

KP-503a1-E224-024 ASIS Corresponding_Name_Definition problem on task names

  Problem:    If the argument Element is a reference to a task defined by a
              single task declaration, ASIS Corresponding_Name_Definition
              query returns the wrong result.

  Status:     This was fixed in 5.04 on 2005-02-25

  Workaround: Use other ASIS structural and semantic queries to compute the
              defining name manually

KP-503a1-E222-012 GNAAMP blows up on a for loop with a Range attribute

  Problem:    For the AAMP target only, the compiler blows up when compiling
              for loops whose discrete range is specified by a Range attribute
              whose prefix denotes the selection of a discriminant-dependent
              array component from a formal record parameter.

  Status:     This was fixed in 5.04 on 2005-02-24

  Workaround: Use a range with bounds explicitly specified by the First and
              and Last attributes in place of the Range attribute.

KP-503a1-E222-007 Nonstandard source file names with dots not handled by GNAAMP

  Problem:    On the AAMP target only, when source files follow a nonstandard
              naming convention including dots (for example, "main.2.ada"),
              the compiler generates incorrect names for assembly and object
              files, leading to reports of "ALI or object file not found"
              when attempting to build the program.

  Status:     This was fixed in 5.04 on 2005-02-22

  Workaround: Use the standard GNAT naming convention or a convention that
              does not include embedded dots.

KP-503a1-E221-018 GNAAMP blows up on aggregates with discriminated components

  Problem:    For the AAMP target only, the GNAAMP compiler blows up when
              compiling an array aggregate when the component type is a
              discriminated record type.

  Status:     This was fixed in 5.03 on 2005-02-24

  Workaround: Declare a wrapper type with the discriminated type as its only
              component and use that type as the array's component type.

KP-503a1-E221-003 Compiler abort on a dereference in an atomic access type

  Problem:    Compiler aborts on a dereference of an array component whose
              type is an atomic access type to a function type, when the
              dereference is the return value of a function that is inlined,
              at -gnatn -O and above.

  Status:     This was fixed in 5.04 on 2005-03-02

  Workaround: Remove pragma Atomic or compile without -gnatn or at -O0.

KP-503a1-E220-005 Improper visibility with instantiation of child unit

  Problem:    An instantiation of a package that contains an instance of
              a generic child unit may make visible (in the context of
              the instantiation) the non-generic parent of the generic
              child unit.

  Status:     This was fixed in 5.04 on 2005-02-22

  Workaround: Do not make illegal references to the package.

KP-503a1-E218-026 wrong detection of potentially blocking operations

  Problem:    Calls to protected procedures or functions belonging to
              protected objects with entries are considered potentially
              blocking. Hence, when pragma Detect_Blocking is in effect,
              Program_Error is raised when these protected procedures or
              functions are called from another protected action.

  Status:     This was fixed in 5.04 on 2005-03-10

  Workaround: Avoid using pragma Detect_Blocking in that case.

KP-503a1-E218-021 Crash on comparison with unchecked conversion of Null

  Problem:    Compiler aborts on an equality operation where one operand is
              an unchecked conversion of Null, and the target type is a
              derived type with a parent is a private type whose full view
              is an access type.

  Status:     This was fixed in 5.04 on 2005-03-04

  Workaround: Introduce a constant for the result of the unchecked conversion.

KP-503a1-E218-004 Spurious error on instantiation of child unit

  Problem:    Compiler rejects the instantiation of a child unit when some
              ancestor of the instance contains inlined subprograms and the
              unit is compiled with front-end inlining.

  Status:     This was fixed in 5.04 on 2005-02-20

  Workaround: Compile unit without -gnatN.

KP-503a1-E217-012 ASIS Corresponding_Expression_Type issue on record component

  Problem:    When applying to an Element representing a record component,
              this query may return the component declaration Element instead
              of the type or subtype declaration that should be returned by
              this query.

  Status:     This was fixed in 5.04 on 2005-02-21

  Workaround: Check the result of Corresponding_Expression_Type and in case if
              it is A_Component_Declaration Element, compute the type by
              analysing the component definition

KP-503a1-E216-022 Abort on complex instantiation with inlining

  Problem:    Compiler aborts when a unit contains an instantiation of a child
              unit, when the parent of the instance has been compiled with
              inlining because it contains pragma inlined subprograms.

  Status:     This was fixed in 5.04 on 2005-02-20

  Workaround: Compile unit without inlining.

KP-503a1-E215-009 Multiple .debug_frame sections in executable on mips-irix

  Problem:    An executable using the system traceback/exception library
              services (libexc) on mips-irix aborts with an error message
              saying that "only one .debug_frame section is allowed".

  Status:     This was fixed in 5.04 on 2005-03-07

  Workaround: Avoid linking with libexc. Use the GNAT.Traceback facilities for
              backtrace computation across Ada call chains for instance.

KP-503a1-E215-002 Spurious error on derivation in child unit with -gnatN

  Problem:    Compiler rejects a type derivation in the private part of
              a child unit, when the parent type is declared in a parent,
              there is an intervening instantiation of a generic unit
              that includes inlined subprograms, and the child unit is
              being compiled with front-end inlining (-gnatN).

  Status:     This was fixed in 5.04 on 2005-02-15

  Workaround: Compile the unit without -gnatN, or remove the inline
              pragmas from the generic unit.

KP-503a1-E211-008 Spurious context switch in nested interrupts on ERC32

  Problem:    An undesired context switch is executed while
              handling a higher priority interrupt. It can happen
              when the interrupt handlers are executed in the context
              of a low priority task and a higher priority task is
              made ready to execute. In that case, the context switch
              must be delayed until the interrupt handler finishes its
              execution, but that is not the case.

  Status:     This was fixed in 5.04 on 2005-02-14

  Workaround: Use the highest interrupt priority for the protected handlers.

KP-503a1-E207-008 Compiler abort when name Standard is used as enum literal

  Problem:    Compiler may abort in cases when the name Standard is used as
              an enumeration literal in a package for which there is a
              use_clause in another generic package.

  Status:     This was fixed in 5.04 on 2005-02-07

  Workaround: Change the name of enumeration literal to something other than
              Standard.

KP-503a1-E202-002 Compiler hangs compiling Float'Remainder (1.0, 0.0)

  Problem:    The Remainder attribute does not raise a compile-time
              constraint error when the second argument is known at
              compile time and has the value 0.0.

  Status:     This was fixed in 5.04 on 2005-02-02

  Workaround: No workaround is needed, it is an error to divide by zero.

KP-503a1-E126-013 Missing index checks on complex slice assignment

  Problem:    Compiler fails to apply the proper index checks on a slice
              assignment to a subcomponent of an array that is an access to
              an unconstrained string.

  Status:     This was fixed in 5.04 on 2005-01-027

  Workaround: Do not write out-of-bounds assignments.

KP-503a1-E126-005 Spurious validity check on assembly insertions

  Problem:    A legal program that contains assembly code insertions raises
              a constraint_error on a failed validity check, when compiled
              with optimization (-O2 -gnatn) and validity checks on parameters.

  Status:     This was fixed in 5.04 on 2005-02-02

  Workaround: Omit either validity checks or backend inlining from compilation
              flags.

KP-503a1-E125-015 Spurious type error with private subtype in child unit

  Problem:    Compiler incorrectly rejects the use of a subtype declared
              in some unit U, when the private parent type is declared in
              package P, and the context of the current compilation unit
              includes with_clauses for both U and some child unit of P.

  Status:     This was fixed in 5.04 on 2005-01-15

  Workaround: Exchange with_clauses for U and the child unit.

KP-503a1-E120-004 Incorrect code in aggregate assignment with sliding

  Problem:    Compiler generates incorrect code for an assignment to an array
              of arrays, when the right-hand side is a nested aggregate, and
              the subaggregate corresponding to one component is given with
              component associations whose bounds are not those of the index
              of the component subtype of the enclosing array.

  Status:     This was fixed in 5.04 on 2005-01-21

  Workaround: Use positional notation for the aggregate.

KP-503a1-E120-003 Memory explosion on records with multi-level variant parts

  Problem:    Compiler consumes all the available memory and eventually
              aborts on code manipulating discriminated record types with
              multiple levels of variant parts.

  Status:     This was fixed in 5.04 on 2005-01-29

  Workaround: Split the procedures manipulating these types based on the
              discriminant value into smaller specialized procedures,
              typically one for each value of the discriminant.

KP-502a1-E119-006 Debugger crash after warning for undefined symbols

  Problem:    On VxWorks, after trying to load a incomplete module, the
              debugger warns for undefined symbols. It may crash after printing
              the warning.

  Status:     This was fixed in 5.04 on 2005-01-20

  Workaround: Either fix the undefined symbols issue, or load the module
              from the wind shell.

KP-503a1-E118-001: Special character in pragma Obsolescent argument blows up

  Problem:    If the string argument to pragma Obsolescent contains a special
              character recognized by the internal compiler error message
              routine (see spec of errout in the GNAT sources), then the
              compiler may blow up processing this pragma.

  Status:     This was fixed in 5.04 on 2005-01-18

  Workaround: Avoid use of special characters other than comma and period
              in the argument to pragma Obsolescent.

KP-503a1-E114-012: Null item not handled correctly in Decimal_Conversions.Valid

  Problem:    Passing a null string to Decimal_Conversions.Valid can cause
              an erroneous result of True to be returned, or a run-time blowup.

  Status:     This was fixed in 5.04 on 2005-01-15

  Workaround: Explicitly test for the null case before calling Valid.

KP-503a1-E113-017: Implicit dereference of constant access to packed array

  Problem:    An implicit dereference of an access to packed array
              is considered a constant if the access value is constant,
              preventing it from being used in the left-hand side of
              an assignment or as actual for a formal parameter of mode
              out or in-out.

  Status:     This was fixed in 5.04 on 2005-01-14

  Workaround: Use an explicit dereference.

KP-503a1-E107-008 Crash on derivation from type with unknown discriminants

  Problem:    Compiler aborts on a derivation of a tagged type whose partial
              view has unknown discriminants, when the full view has actual
              discriminants.

  Status:     This was fixed in 5.04 on 2005-09-29

  Workaround: Make discriminants visible in partial view of parent type.

KP-503a1-E106-005: GNAT.Expect leaves pipes open in child

  Problem:    When spawning a process, GNAT.Expect creates pipes to exchange
              stdin, stdout and stderr data between the caller (parent) process
              and the created child process. However, it does not close in the
              child the descriptors used by the parent.

              Specifically, the write end of the pipe whose read end is the
              child's stdin is not closed. This means that the child inherits
              this open fd, and thus even if the parent subsequently closes its
              copy of that fd, the pipe remains open, and the child never sees
              EOF on its standard input.

  Status:     This was fixed in 5.04 on 2005-01-10

  Workaround: Signal the child process that it should not expect further
              input by another means than closing the corrsponding pipe file
              descriptor in the parent.

KP-503a1-DB15-022: Spurious error on object with initializer and address clause

  Problem:    Spurious error messages are sometimes emitted by the compiler
              on uses of objects declared with both an address clause and
              an initialization expression.

  Status:     This was fixed in 5.04 on 2005-09-23

  Workaround: Arrange for the object initialization not to be stated in
              the declaration, for instance by turning a full constant
              declaration into a deferred constant declaration.

KP-503a1-DC27-003: Asis.Elements.Hash blows up on Nil_Element

  Problem:    If the argument of the Asis.Elements.Hash is Nil_Element then
              this function blows up with generating the ASIS bug box

  Status:     This was fixed in 5.04 on 2005-01-17

  Workaround: Use a wrapper Hash function that checks is its argument is
              Nil_Element and then either calls Asis.Elements.Hash or just
              return some hash value.

KP-503a1-DC22-008: Compiler abort on deeply nested loops at -O3

  Problem:    Compiler aborts if the optimization level is -O3 and the code
              contains deeply nested loops and conditional constructs involving
              objects of floating point types.

  Status:     This was fixed in 5.04 on 2005-10-06

  Workaround: Compile the file at -O2 or -O3 -fno-unswitch-loops.

KP-503a1-DC20-018: GIGI abort 116 with out of range subtype bound

  Problem:    If a bound of a subtype is statically out of range (which
              causes Constraint_Error to be raised at subtype elaboration)
              and pragma Initialize_Scalars is in effect, a compiler crash
              (GIGI abort 116) may occur.

  Status:     This was fixed in 5.04 on 2005-02-11.

  Workaround: Ensure subtype bounds are not out-of-range values.

KP-503a1-DC20-016: Wrong order of elaboration with subtypes

  Problem:    If package P declares a type T with non-trivial initialization,
              package Q declares a subtype of T, and unit U declares an
              object of this subtype, the call to initialize the object might
              be executed before P is fully elaborated.

  Status:     This was fixed in 5.04 on 2005-01-05

  Workaround: Add a pragma Elaborate_All on Q in the context of U.

KP-503a1-DC20-020: ASIS problem with formal packages

  Problem:    ASIS Enclosing_Element query does not work correctly when applied
              to the defining name of the expanded package corresponding to
              a generic formal package

  Status:     This was fixed in 5.04 on 2004-12-23

  Workaround: When traversing the expanded package for a formal package, keep
              the trace of traversing in order to compute the enclosing
              elements manually.

KP-503a1-DC16-032: Surprising behavior of Update

  Problem:    The Update procedure in Interfaces.C.Strings that takes a string
              parameter has the unexpected and unintended effect of truncating
              the result just past the inserted string. This is definitely
              not intended, even though it is clearly specified this way in
              the RM. Ada 2005 AI-242 discusses this issue in detail.

  Status:     This was fixed in 5.04 on 2004-12-27

  Workaround: Replace the affected call Update (Item, Offset, Str, Check) by
              Update (Item, Offset, To_C(Str, Append_Nul => False, Check) as
              recommended in the AI-242 corrigendum section.

KP-503a1-DA25-019 Wrong code with pragma Component_Alignment (Storage_Unit)

  Problem:    On RISC platforms, wrong code may be generated when passing a
              record component as a by-reference parameter to a procedure,
              if the by-reference mechanism is specified by a special pragma
              on the procedure and doesn't come from the component type (for
              example in the DEC Starlet package), and if the record type is
              subject to a pragma Component_Alignment (Storage_Unit).

  Status:     This was fixed in 5.04 on 2005-06-14

  Workaround: Create a temporary of the appropriate component type around the
              procedure call and pass it to the procedure.

KP-503a1-DA25-016 Compiler crash with pragma Component_Alignment (Storage_Unit)

  Problem:    On RISC platforms, the compiler may crash on a procedure taking
              a record containing an array of variable-sized elements as one
              of its parameters, and passing one of these elements to another
              procedure, if a pragma Component_Alignment (Storage_Unit) was
              specified for the types.

  Status:     This was fixed in 5.04 on 2005-01-19

  Workaround: Create a temporary of the appropriate array type and use it to
              pass the element to the second procedure.

KP-503a1-DA19-005 Bogus alignment warning for array type with alignment clause

  Problem:    On RISC platforms, the compiler may issue a bogus warning for an
              unchecked conversion from an array type with an alignment clause
              to another type with the same alignment, if the conversion takes
              place inside a procedure one of the parameters of which is the
              object being converted.

  Status:     This was fixed in 5.04 on 2005-07-04

  Workaround: Silence the warning with pragma Warnings (Off) or -gnatws.

KP-503a1-DA15-009 Undefined symbol with imported procedure on VMS

  Problem:    Link fails with an undefined symbol on VMS when the address of
              a procedure declared and imported at procedure scope is taken.

  Status:     This was fixed in 5.04 on 2005-10-01

  Workaround: Move declaration and import from procedure into package scope.

KP-503a1-D722-008 Linker error from symbolic traceback facility on mips-irix

  Problem:    On mips-irix, using the GNAT.Traceback.Symbolic facility offered
              by the default shared run-time library triggers a linker error
              about a missing __gnat_locate_exec_on_path symbol.

  Status:     This is not yet fixed.

  Workaround: Use the static GNAT run-time library instead of the default
              dynamic one, adding -static to the gnatbind arguments (-bargs),
              or add '-Wl,-laddr2line' to the gnatlink arguments (-largs).

KP-503a1-D601-001 Formal parameter names hide outer homographs

  Problem:    Compiler fails to reject the use of a type name as the return
              type in a function specification, when the specification has a
              formal parameter that is homograph of the type.

  Status:     This was fixed in 5.04 on 2005-01-13

  Workaround: Do not use this illegal construction (which is not an uncommon
              idiom in C programs).

KP-503a1-D308-015 Exception message not propagated in protected entry

  Problem:    When propagating an exception raised during a protected entry
              call, the exception message is not taken into account.

  Status:     This was fixed in 5.04 on 2005-05-17

  Workaround: Do not set a message when raising exception from a protected
              entry, or use an alternate mechanism for passing the exception
              message.

KP-503a1-D123-007 Wrong Component_Size value for packed unconstrained array

  Problem:    When the Component_Size attribute is applied to a packed
              unconstrained array, the result is always returned incorrectly
              as 8, instead of giving the proper value (e.g. 1 for a packed
              array of boolean).

  Status:     This was fixed in 5.04 on 2005-07-07

  Workaround: Declare a constrained subtype of the unconstrained array type,
              and apply the Component_Size attribute to this subtype.

KP-503a1-D110-001 GDB problem reparsing breakpoint conditions and watches

  Problem:    GDB gets confused as to the proper language to use when
              reparsing some breakpoint conditions or watched expressions.
              As a result, the condition or watchpoint is not set properly
              and GDB eventually hangs.

  Status      This was fixed in 5.04 on 2005-04-21

  Workaround: Make sure that the current language at the time of issuing
              the "break" command is the same as that at the time of
              issuing the "condition" statement. When using watchpoints,
              try to use the same language for all breakpoint conditions
              and watchpoints.

KP-503a1-9416-011 Incorrect fixed-point code when Vax_Float used

  Problem:    On OpenVMS, if pragma Float_Representation (Vax_Float) is used,
              then in some cases, the code for fixed-point conversions may be
              incorrect, leading to wrong results or unexpected exceptions.

  Status      This was fixed in 5.04 on 2005-10-16

  Workaround: Do not convert directly between fixed-point and a Vax_Float
              type. Instead, introduce an intermediate IEEE float-type in
              the middle.
