==========================================================
Known problems in GNAT version 5.02a as of August 23, 2005
==========================================================

Copyright (c) 2004, 2005, Ada Core Technologies

The following is a listing of known problems in release 5.02a. Except
where specifically noted, all these problems have been corrected in the
final release of the 5.02 technology, as well as in version 5.03w. It
means they are corrected in release 5.02a1 and in any wavefront issued
subsequent to the date specified (in ISO format YYYY-MM-DD) in the
status line.  This can be used to determine if a given wavefront has the
fix identified in the entry.

KP-502a-D604-013 Segmentation fault on SPARC at -O1

  Problem:    Wrong code may be generated, leading to a segmentation fault
              at runtime, for generic packages containing protected objects
              and/or concurrent types and whose formal parameters are of
              scalar type, when compiled at -O1 and above.

  Status:     This problem was fixed in 5.03 on 2004-06-08
              This will also be fixed in 5.02a1

  Workaround: Compile with -O1 -g and strip the executable.

KP-502a-D531-006 Crash with controlled symbol policy

  Problem:    In a project file, when the Symbol Policy is "controlled"
              and no Library_Symbol_File is specified, the Program
              Manager crashes. Symbol Policy is currently used only
              on VMS.

  Status:     This problem was fixed in 5.03 on 2004-05-31
              This will also be fixed in 5.02a1

  Workaround: Declare a Library_Symbol_File and make sure the
              specified Reference Symbol File effectively exists.

KP-502a-D524-015 Incorrect code for renames on SPARC/Solaris

  Problem:    Wrong code is generated for accessing a renamed element of a
              multi-dimensional array whose upper dimension bounds depend
              upon variables.

  Status:     This problem was fixed in 5.03 on 2004-06-02
              This will also be fixed in 5.02a1

  Workaround: Turn the upper dimension bounds into constants.

KP-502a-D514-011 Problems when dir ends with '/' in project files

  Problem:    When directory names in project files end with a
              directory separator ('/'), this may lead to incorrect
              build behaviour. For example, when Library_Dir is
              specified as "./", the library build will fail.

  Status:     This problem was fixed in 5.03 on 2004-05-15
              This will also be fixed in 5.02a1

  Workaround: Do not put trailing '/' in directory names

KP-502a-D507-015 Instrumentation for gcov leads to wrong code

  Problem:    The compiler may generate wrong code on x86 when -fprofile-arcs
              -fstack-check is passed on the command line.

  Status:     This problem was fixed in 5.03 on 2004-05-10
              This will also be fixed in 5.02a1

  Workaround: Do not use both options simultaneously. If doing so is required,
              additionally pass -fforce-mem, or optimize at -O2 or higher.

KP-502a-D506-002 New line incorrectly added to text_io file in append mode

  Problem:    If a file is opened in append mode, and then closed without
              writing any data, then a newline sequence is incorrectly
              added to the file.

  Status:     This problem was fixed in 5.03 on 2004-05-09
              This will also be fixed in 5.02a1

  Workaround: Remove the extra new line character after the program
              has terminated (e.g. using editor commands).

KP-502a-D505-017 gnatls crashes with disappearing sources

  Problem:    When gnatls is invoked and some of the source files have
              been deleted, gnatls may fail with an Assert_Failure.

  Status:     This problem was fixed in 5.03 on 2004-05-06
              This will also be fixed in 5.02a1

  Workaround: Do not use gnatls after deleting source files

KP-502a-D501-004 Bad interactions of GDB and signal handlers on RedHat Linux

  Problem:    On some recent versions of the Linux kernel, including
              those used in RedHat 9.0 and RedHat Enterprise Linux,
              GDB interacts badly with programs that bind signals to
              task entries (using representation clauses). First,
              running the program under GDB will trigger the task
              entries for all signals.  Second, GDB will fail to
              detect signals sent to the debugged process, despite any
              use of the 'handle' command. This includes the INT
              signal, so that ^C will not stop the inferior process.

  Status:     The first problem was fixed by a change in the GNAT runtime
              in 5.03 on 2004-04-28.
              This will also be fixed in 5.02a1.
              The second problem is due to a Linux kernel bug, and has
              not been fixed yet.

  Workaround: The second problem (GDB not noticing interrupts) may often
              be addressed by putting breakpoints in the handlers (and
              providing a handler for the INT (^C) signal as well).
              The only known workaround for the first problem is to
              rewrite your application to handle signals by a
              different mechanism, such as the Unix 'signal' function.

KP-502a-D428-010 Program may hang when no interface of SAL is used

  Problem:    When project files are used and there is a Stand-Alone
              Library, but no interface of this SAL is used,
              execution of the main may be incorrect. For example,
              the program may never terminate because finalization
              enters an endless loop.

  Status      This problem was fixed in 5.03 on 2004-04-28
              This will also be fixed in 5.02a1

  Workaround: Invoke gnatmake with -bargs -F

KP-502a-D428-008 Missing constraint checks with optimization

  Problem:    If the same variable is used as an index to different arrays
              that are unconstrained and dynamically allocated, and some
              level of optimization greater than 0 is specified, constraint
              checks on later occurrences of the variable may be missing.

  Status:     This problem was fixed in 5.03 on 2004-04-28
              This will also be fixed in 5.02a1

  Workaround: Compile the unit without optimization if you are not sure
              that all such array subscripts are in range.

KP-502a-D426-013 Unaligned access to packed floating point component

  Problem:    On some targets, assignments to a packed floating point
              record component may generate code performing unaligned
              memory accesses.

  Status:     This problem was fixed in 5.03 on 2004-04-30
              This will also be fixed in 5.02a1

  Workaround: Leave the containing record unpacked, or use an intermediate
              temporary instead of storing directly into the target component.

KP-502a-D422-002 Compiler error for small non-byte-aligned record field

  Problem:    If there is a record whose size is less than 64 bits and
              has a record rep clause and a field of another record has
              a type of the first record and is placed at a location that
              is not at a byte boundary by using a record representation
              clause, assigning to the entire field may cause a compiler
              error.

  Status:     This problem was fixed in 5.03 on 2004-04-29.
              This will also be fixed in 5.02a1

  Workaround: Assign to each field in the inner record individually.

KP-502a-D421-006 gnatpp does not put a space after an operator symbol

  Problem:    In some situations gnatpp does not output a space character
              after an operator symbol in an infix call. As a result,
              the reformatted code is syntacrically incorrect.

  Status:     This problem was fixed in 5.03 on 2004-04-25
              This will also be fixed in 5.02a1

  Workaround: Modify gnatpp options (maximum line length or indentation
              level) or manually fix gnatpp result.

 KP-502a-D416-005 Binder fails if GNAT installed in directory with spaces

  Problem:    The binder will not find the GNAT runtime library if
              installed in a directory containing spaces.

  Status:     This problem was fixed in 5.03 on 2004-04-19.
              This will also be fixed in 5.02a1

  Workaround: Install GNAT on a directory without a space in its name.

KP-502a-D406-013 gnatpp blows up on a null record aggregate

  Problem:    gnatpp blows up on a null record aggregate (null record)

  Status:     This problem was fixed in 5.03 on 2004-04-09
              This will also be fixed in 5.02a1

  Workaround: Comment out such a null record aggregate in the argument source
              and then uncomment and manually reformat it in the gnatpp result.

KP-502a-D405-008 Incorrect code for nested aggregate

  Problem:    If there are two records, each with record representation
              clause and one record is a field within another record and
              shares a byte with a field from the outer record and a value
              of that outer record is assigned using a nested aggregate,
              values set in the outer record may be clobbered.

  Status:     This problem was fixed in 5.03 on 2004-04-30.
              This will also be fixed in 5.02a1

  Workaround: Do individual assignments to each field.

KP-502a-D326-015 Compiler crashes with some array assignments.

  Problem:    If there is an array type whose Size is 16, 32, or 64 bits
              and there is an assignment from one variable of this type
              to another variable and both variables are also used in an
              array reference with one also referenced from a nested
              subprogram, the compiler may crash.

  Status:     This problem was fixed in 5.03 on 2004-03-29.
              This will also be fixed in 5.02a1

  Workaround: Do the assignment via a temporary variable that is only used
              for those two assignments.

KP-502a-D326-004 Compiler crashes with -march=pentium4

  Problem:    The compiler may crash during register allocation if the option
              -march=pentium4 is specified.

  Status:     This problem was fixed in 5.03 on 2004-03-29.
              This will also be fixed in 5.02a1

  Workaround: The option is not supported and should be removed. To schedule
              for the Intel Pentium 4 processor, use -mcpu=pentium4.

KP-502a-D319-013 Debugger unable to dump an array in optimized code

  Problem:    On x86-windows, the debugger may not be able to compute correctly
              the bounds of an unconstrained array in optimized code. An
              internal error may happen when trying to dump the content of the
              unconstrained array.

  Status:     This problem was fixed in 5.03 on 2004-04-28
              This will also be fixed in 5.02a1

  Workaround: The internal error can be safely ignored. Use x/s on the address
              of the string to display it, or re-compile without optimization.

KP-502a-D319-007 ASIS Is_Dispatching_Operation problem

  Problem:    ASIS Is_Dispatching_Operation query always returns False if
              a (dispatching) operation is declared by a body declaration with
              no separate spec.

  Status:     This problem was fixed in 5.03 on 2004-03-20
              This will also be fixed in 5.02a1

  Workaround: Use other ASIS queries to compute manually if the given body
              declaration defines a dispatching operation

KP-502a-D317-012 Debugger crashes when inserting exception breakpoint

  Problem:    The debugger sometimes crashes when trying to insert
              a breakpoint on a specific exception.

  Status:     This was fixed in 5.03 on 2004-03-19
              This will also be fixed in 5.02a1

  Workaround: Insert a breakpoint on all exceptions.

KP-502a-D315-008 Interfaces.Rotate returns wrong result on 64bit objects

  Problem:    Calls to Interfaces.Rotate on 64bit objects may generate wrong
              code when the return value of the call is assigned to the source
              object itself (possibly indirectly by way of another entity with
              an address clause), producing an unexpected result value.

  Status:     This was fixed in 5.03 on 2004-03-19
              This will also be fixed in 5.02a1

  Workaround: Perform the rotate operation on a temporary copy, or assign the
              result value to another object than the source one.

KP-502a-D311-001 Declaration with address clause and -gnatVa can cause crash

  Problem:    Compiler aborts on a local declaration of a constrained
              record, when the constraint is an in-parameter of the
              enclosing subprogram, and the local declaration has an address
              clause and a pragma Import (Ada).

  Status:     This was fixed in 5.03 on 2004-03-12
              This will also be fixed in 5.02a1

  Workaround: Compile with selected validity checks, excluding a, i, and p.

KP-502a-D309-008 GNAT.Sockets on VxWorks: wrong multicast options

  Problem:    The multicast options in GNAT.Sockets.Constants are wrong
              in GNAT Pro for VxWorks. That implies that the corresponding
              options in GNAT.Sockets will not work properly.

  Status:     This was fixed in 5.03 on 2004-03-10
              This will also be fixed in 5.02a1.

  Workaround: Copy g-socket.ads, g-socket.adb and g-soccon.ads into another
              directory. You can then edit g-soccon.ads, set IP_ADD_MEMBERSHIP
              to 12, IP_DROP_MEMBERSHIP to 13, IP_MULTICAST_TTL to 10 and
              IP_MULTICAST_LOOP to 11. You can then recompile GNAT.Sockets
              using the flag -gnatpg.

KP-502a-D303-017 Wrong library order when building a library

  Problem:    When building a library for a Library Project File,
              the options for the imported libraries were not put in the
              correct order.

  Status:     This was fixed in 5.03 on 2004-03-05
              This will also be fixed in 5.02a1

  Workaround: Add options manually for the imported libraries

KP-502a-D227-013 Wrong library order from gnatlink

  Problem:    In some cases, gnatlink was wrongly removing duplicate options
              which could cause problems in properly resolving all symbols
              when using shared libraries.

  Status:     This problem was fixed in 5.03 on 2004-03-31.
              This will also be fixed in 5.02a1

  Workaround: Specify the complete library options in the right order
              on gnatlink's command line.

KP-502a1-D227-008 GDB core dump printing attributes of integral types

  Problem:    When GDB debugs programs compiled with GNAT 5, certain
              type-attribute queries will cause it to segfault; for
              example:
                  print integer'last
                  print integer'first
              The problem does not occur on programs compiled with older
              versions of GNAT that are based on GCC 2.8.1 technology.

  Status:     This was fixed in 5.03 on 2004-03-01
              This will also be fixed in 5.02a1

  Workaround: The quantities in question are all known constants, so that
              you can simply use the appropriate literal (or an expression
              such as 2**31-1).

KP-502a-D213-015 Spurious constraint error on assignment with address clause

  Problem:    A constraint error is raised on a full-record assignment to a
              formal of an unconstrained discriminated type, when an address
              clause overlays the formal to a local variable of the type.

  Status:     This was fixed in 5.03 on 2004-02-24
              This will also be fixed in 5.02a1

  Workaround: Use a renaming declaration rather than an address clause.

KP-502a-D206-001 Compiler abort on overloaded literal in entry barrier

  Problem:    Compiler aborts on an entry barrier that mentions boolean
              literals explicitly, when these literals are overloaded because
              of visible derived boolean types.

  Status:     This was fixed in 5.03 on 2004-02-01
              This will also be fixed in 5.02a1

  Workaround: Qualify literal, or do not use literal explicitly in the
              barrier expression.

KP-502a-D205-023 Spurious error on instance with formal equality with default

  Problem:    If a generic formal subprogram has a default "=" for a formal
              type, and the actual type has several primitive operations of
              that name, the compiler may choose the wrong one and improperly
              reject the instantiation.

  Status:     This was fixed in 5.03 on 2004-02-06
              This will also be fixed in 5.02a1

  Workaround: Use an explicit name. Most likely the use of a named default is
              incorrect in any case, and a default box should be used instead.

KP-502a-D203-015 Incorrect result on misaligned packed slices as actuals

  Problem:    If a slice of a packed array that is a component of a record is
              passed as an in parameter and the slice may have an alignment
              that is not compatible with the alignment of the component, the
              compiler may generate incorrect code.

  Status:     This was fixed in 5.03 on 2004-02-08
              This will also be fixed in 5.02a1

  Workaround: declare an explicit temporary for the slice, and use it as the
              actual in the call.

KP-502a-D203-003 GCC crash on Solaris 2.8 with GNAT5

  Problem:    The compiler crashes when compiling, with optimization enabled
              and for a SPARC-based target, code that contains uninitialized
              variables of floating-point types.

  Status:     This was fixed in 5.03 on 2004-02-09.
              This will also be fixed in 5.02a1.

  Workaround: If the code is targeted to Sun UltraSPARC machines, compile
              with -mvis. Otherwise initialize the uninitialized variables
              in the code or compile without optimization.

KP-502a-D126-013 GNAT.OS_Lib.Errno task safety on SGI IRIX

  Problem:    GNAT.OS_Lib.Errno should be, but is not, task-safe on SGI IRIX
              systems.

  Status:     This was fixed in 5.03 on 2004-02-07.
              This will also be fixed in 5.02a1.

  Workaround: Copy errno.c from the GNAT source distribution into a local
              directory and compile it with -D_SGI_MP_SOURCE.  Linking with
              the newly generated errno.o will provide proper functionality.

KP-502a-D126-007 Problem with -O2 and overlaying with address in parameter

  Problem:    If a subprogram has a parameter of type System.Address and
              uses that as an address representation clause of some variable,
              it is possible that incorrect code may be generated on some
              systems.

  Status:     This was fixed in 5.03 on 2004-02-11.
              This will also be fixed in 5.02a1

  Workaround: Compile the affected file with -fno-strict-aliasing.

KP-502a-D129-010 Crash with front-end inlining and instantiation.

  Problem:    Compiler aborts when a complex type is used as the actual in
              a package instantiation, the corresponding generic has inlined
              functions, front-end inlining is enabled, and the instantiation
              occurs before the freezing point of the type.

  Status:     This was fixed in 5.03 on 2004-02-28
              This will also be fixed in 5.02a1

  Workaround: Remove Inline pragma from function in generic package.

KP-502a-D129-007 Junk empty line in gnatpp output

  Problem:    In some situations when gnatpp can not correctly reformat a
              long line, it adds an empty line when splitting this long
              line into two parts.

  Status:     This was fixed in 5.03 on 2004-02-01
              This will also be fixed in 5.02a1

  Workaround: Remove these empty lines from the code generated by gnatpp.

KP-502a-D128-012 ASIS Corresponding_Definition problem on implicit components

  Problem:    Corresponding_Definition may blow up if it is applied to a
              reference to the record component of a derived record type. It
              happens when the derived type definition contains a static
              discriminant constraint and the given component does not exist
              for this constraint. The problem also affects gnatpp

  Status:     This was fixed in 5.03 on 2004-01-29
              This will also be fixed in 5.02a1

  Workaround: Manually compute the result of Corresponding_Definition using
              other ASIS structural and semantic queries.

KP-502a-D128-003 Linkage failure with inconsistent stack checking

  Problems:   If several units are compiled with different setting of the
              fstack-check flag, the program may fail to link because of
              undefined symbols.

  Status:     This was fixed in 5.03 on 2004-03-12
              This will also be fixed in 5.02a1

  Workaround: Use a consistent setting of fstack-check for all units.

KP-502a-D127-015 gnatpp hangs up on abort statement enclosing by if statement

  Problem:    gnatpp hangs up on an abort statement if this abort statement is
              the first statement in a sequence of statements which is a part
              of IF statement.

  Status:     This was fixed in 5.03 on 2004-01-28
              This will also be fixed in 5.02a1

  Workaround: Comment out such an abort statement in the argument source
              and then uncomment and manually reformat it in the gnatpp result.

KP-502a-D127-014 gnatpp crashes on abort statement with several task names

  Problem:    gnatpp crashes on an abort statement if this statement contains
              several task names.

  Status:     This was fixed in 5.03 on 2004-01-28
              This will also be fixed in 5.02a1

  Workaround: Either comment out such an abort statement in the argument source
              and then uncomment and manually reformat it in the gnatpp result
              or split this statement into a sequence of abort statements
              containing only one task name.

KP-502a-D123-018 Failure to link with unusual characters in path names

  Problem:    When path names include some unusual characters such as ','
              or '!', the link of an executable may fail.

  Status:     This was fixed in 5.03 on 2004-01-24
              This will also be fixed in 5.02a1

  Workaround: Use only usual characters in path names

KP-502a-D122-003 gnatpp may add extra '(' in exit statement with loop name

  Problem:    If an exit statement contains a loop name and the exit condition
              expression is a parenthesized expression, gnatpp adds an extra
              (wrong) '(' before the condition. This makes the gnatpp output
              illegal.

  Status:     This was fixed in 5.03 on 2004-01-22
              This will also be fixed in 5.02a1

  Workaround: Manually remove this wrong '(' from gnatpp output

KP-502a-D116-002 ASIS Corresponding_Type_Structure problem

  Problem:    ASIS Corresponding_Type_Structure query may blow up if applied to
              a type declaration defining the type with discriminants in case
              if these discriminants are used in index constraints for type
              components

  Status:     This was fixed in 5.03 on 2004-01-15
              This will also be fixed in 5.02a1

  Workaround: Compute the result of this function manually by using other
              ASIS structural and semantic queries.

KP-502a-D108-009 Compilation failure on optimization of slice assignments.

  Problem:    When compiling with -O2, compiler runs out of memory on slice
              assignments when the component type has controlled components.

  Status:     This was fixed in 5.03 on 2004-01-25
              This will also be fixed in 5.02a1

  Workaround: Compile unit without optimization, or write an explicit loop
              for the slice assignment.

KP-502a-D108-003 Unaligned access warning emitted by the debugger

  Problem:    On alpha-tru64, the debugger sometimes emits some "Unaligned
              access[...]" warnings when trying to auto-complete a command,
              either via the <tab> key, or via the "complete" command.  The
              problem appears only when the number of possible completions
              is larger than 128.

  Status:     This was fixed in 5.03 on 2004-03-23
              This will also be fixed in 5.02a1

  Workaround: Reduce the number of possible completions by typing more
              characters before attempting to auto-complete.

KP-502a-CC22-011 ASIS/gnatpp Corresponding_Name_Definition problem

  Problem:    ASIS Corresponding_Name_Definition query blows up if applied to
              the reference to a name defined a child unit which is a
              library-level instantiation. gnatpp blows up on sources
              containing such references.

  Status:     This was fixed in 5.03 on 2003-12-25
              This will also be fixed in 5.02a1

  Workaround: When using ASIS, compute the defining names for such references
              manually, using other syntax and semantic queries. The only
              possible workaround for gnatpp is to get rid somehow of these
              references, and then put them back into reformatted source.

KP-502a-CB25-018 gnatelim may generate wrong pragmas Eliminate

  Problem:    gnatelim generates the Eliminate pragma for the given subprogram
              if the only reference to this subprogram is:
              - function call as the argument of the Task_Info pragma
                or
              - name in the attribute_definition_clause used to redefine 'Read
                or 'Write attribute.
              These pragmas are wrong, because the compiler needs the
              corresponding bodies

  Status:     This was fixed in 5.03 on 2004-01-16
              This will also be fixed in 5.02a1

  Workaround: Remove manually the wrong pragmas from the list of pragmas
              generated by gnatelim.

KP-502a-CB12-019 Exponential time/memory consumption at -O0

  Problem:    The compiler consumes all the available memory and aborts
              when compiling a package containing specific combinations of
              discriminated types with many variant parts.

  Status:     This was fixed in 5.03 on 2004-01-20
              This will also be fixed in 5.02a1

  Workaround: Try moving all static components before all dynamic
              components. If this does not work, simplify the types
              in question by removing some of the variant parts.

KP-502a-CA21-015 Compiler crashes on wrong delay until statement

  Problem:    If a delay until statement is a part of a delay alternative, and
              if this statement contains the expression of some non-time type,
              the compiler crashes instead of generating the corresponding
              diagnostic message

  Status:     This was fixed in 5.03 on 2004-01-20
              This will also be fixed in 5.02a1

  Workaround: No workaround is needed here, because this crash takes place only
              for illegal programs.

KP-502a-C721-005 Call is missed after asynchronous select

  Problem:    In some cases, using some asynchronous transfer of control
              (select ... then abort) constructs, the following entry
              (protected object or task) call will return immediately without
              being executed.

  Status:     This was fixed in 5.03 on 2004-03-04
              This will also be fixed in 5.02a1

  Workaround: Insert a dummy (non blocking) call to a protected object.
