========================================================
Known problems in GNAT version 5.03a as of June 20, 2005
========================================================

Copyright (c) 2004-2005, AdaCore

The following is a listing of known problems in release 5.03a. Except
where specifically noted, all these problems have been corrected in
final release of the 5.03 technology, as well as in version 5.04a. It
means they are corrected in release 5.03a1 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-503a-E530-011 gnatpp problem with comment blocks reformatting

 Problem:    gnatpp may blow up when called with -c4 option. It happens when
             the source contains a comment block with a line containing only
             one word after '--' and there is no space between '--' and this
             word.

 Status:     This was fixed in 5.04 on 2005-05-31
             This will also be fixed in 5.03a1

 Workaround: Do not call gnatpp with '-c4' or manually reformat a line causing
             gnatpp failure (add a space after '--')

KP-503a-E523-005 Compiler abort when emitting debug info for inlined functions

 Problem:    When using inlining of subprograms (-gnatn), dwarf-2 debug
             information, and -O2 optimization all at the same time, the
             compiler may abort during compilation of a function that is
             optimized away.

 Status:     This was fixed in 5.04 on 2005-05-24
             This will also be fixed in 5.03a1

 Workaround: Compile without -gnatn, or with -O1 instead of -O2.

KP-503a-E518-004 gnatpp duplicates '<<' for labels

 Problem:    gnatpp duplicates '<<' for labels in the pretty-printed source

 Status:     This was fixed in 5.04 on 2005-05-18
             This will also be fixed in 5.03a1

 Workaround: Remove these '<<' from the gnatpp results.

KP-503a-E514-003 Spurious error on stream attribute for dereferenced component

 Problem:    Compiler rejects an output attribute when the stream being written
             to is a component of a tagged record, and type is derived from
             Root_Stream_Type.

 Status:     This was fixed in 5.03 on 2005-05
             This will also be fixed in 5.03a1

 Workaround: Compile unit with -gnatp, that is to say with constraint checks
             disabled.

KP-503a-E513-012 Convoluted instantiation failure

 Problem:    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 an instantiation of a similar package that
             receives the same type as an actual.

 Status:     This was fixed in 5.04 on 2005-18-05-13
             This will also be fixed in 5.03a1

 Workaround: Make the actual non-private, or expose its discriminants in the
             partial view.

KP-503a-E512-007 Incorrect debugger behavior during next/step on Tru64.

 Problem:    On Tru64, the debugger sometimes does not perform correctly
             next/step operations. The problem occurs when trying to
             step a block of code that contains floating point control
             instructions, such as fbne, for instance. The symptoms
             are either a program that doesn't stop at the expected
             location, or a change in program behavior when run under
             the debugger.

 Status:     This was fixed in 5.04 on 2005-05-30
             This will also be fixed in 5.03a1

 Workaround: Use breakpoints and continue when next/step'ing on code
             that involve floating-point control instructions.

KP-503a-E510-019 Set_Col malfunctions for In file at end of line

 Problem:    If Set_Col is called when an input file is logically positioned
             just before the end of line, then the file may be left incorrectly
             positioned for subsequent input operations.

 Status:     This was fixed in 5.04 on 2005-05-15
             This will also be fixed in 5.03a1

 Workaround: Use Skip_Line and Get to position the file instead of Set_Col.

KP-503a-E507-003 Spurious error on use of access discriminant in task pragma

 Problem:    Compiler rejects a priority pragma when the expression involves
             a dereference of an access discriminant for the task type, when
             the designated type of the discriminant is still incomplete.

 Status:     This was fixed in 5.04 on 2005-02-09
             This will also be fixed in 5.03a1

 Workaround: Use a discrete discriminant to parametrize the task.

KP-503a-E502-019 Spurious error for private record type in packed record type

 Problem:    Compiler issues a bogus error message about the size of a
             component of a packed record type whose type is a private
             record type.

 Status:     This was fixed in 5.04 on 2005-05-17
             This will also be fixed in 5.03a1

 Workaround: Specify a representation clause for the private record type.

KP-503a-E422-014 gnatmake invoke compiler with wrong arguments

 Problem:    On Windows, when gnatmake is invoked with arguments that
             include spaces or double quotes, it may invoke the compiler
             with incorrect arguments.

 Status:     This was fixed in 5.04 on 2005-04-22
             This will also be fixed in 5.03a1

KP-503a-E422-008 gnatpp alignment is broken after record representation clause

 Problem:    If a declaration sequence contains a record representation clause,
             gnatpp does not correctly align declarations that follow this
             clause.

 Status:     This was fixed in 5.04 on 2005-04-24
             This will also be fixed in 5.03a1

 Workaround: Align declarations manually.

KP-503a-E414-017 Build error when GNAT installed in a directory with spaces

 Problem:    When GNAT is installed into a directory containing spaces it
             is not possible to build a project using GPS. The full path to
             some tools was not properly quoted.

 Status:     This was fixed in 5.04 on 2005-04-23
             This will also be fixed in 5.03a1

 Workaround: Install GNAT into a directory having no space.

KP-503a-E412-010 Compiler crash at -O -march={i686,pentium4} on FP code

 Problem:    Compiler crashes on a code pattern that computes the absolute
             value of a floating-point variable, if the pattern is inside
             an exception block, at -O -march=i686 or -O -march=pentium4.

 Status:     This was fixed in 5.04 on 2005-04-22
             This will also be fixed in 5.03a1

 Workaround: Compile the file with -O -mtune=i686 or -O -mtune=pentium4.

KP-503a-E405-015 Erratic behavior on return from foreign convention subprogram

 Problem:    On VxWorks/Tornado2.0.x for PowerPC, erratic behavior may be
             observed when leaving either an Ada suprogram to which a non-Ada
             convention applies or the binder generated entry point in Ada.
             This problem only occurs if the stack pointer is not aligned
             on a 16byte boundary upon entry in these subprograms, which is
             stricter than what the EABI mandates.

 Status:     This was fixed in 5.04 on 2005-06-01
             This will also be fixed in 5.03a1

 Workaround: Avoid non-Ada conventions and bind with -C to force the
             generation of a C file by the binder.
             Alternatively, ensure that the stack pointer is aligned on a
             16byte boundary when the affected subprograms get control.

KP-503a-E331-019 Abort on conditional entry call with complex actual

 Problem:    Compiler aborts on a conditional entry call when one of the
             actuals in the entry call involves a call to a function that
             returns an unconstrained or a controlled type.

 Status:     This was fixed in 5.04 on 2005-04-02
             This will also be fixed in 5.03a1

 Workaround: Introduce a temporary to hold the value of the actual.

KP-503a-E329-007 Can't obtain symbolic traceback on NT in some cases

 Problem:    When the program that generates symbolic traceback is launched in
             CMD console from current directory, it may fail to generate
             the traceback.

 Status:     This was fixed in 5.04 on 2005-03-31
             This will also be fixed in 5.03a1

 Workaround: Launch the program with the path specification, e.g. `.\program'.

KP-503a-E322-010  Spurious error with Bounded_String as formal package

 Problem:    Compiler rejects an instantiation with related actual types
             T1 and T2, where T1 is a subtype of a type declared in an
             instantiation of Bounded_String, and T2 is an array type whose
             component type is T1.

 Status:     This was fixed in 5.04 on 2005-3-22
             This will also be fixed in 5.03a1

 Workaround: Use the type declared in the instance of Bounded_String, rather
             than introducing a local subtype for it.

KP-503a-E318-009 Excessive stack usage in GNAT.Os_Lib.Copy_File

  Problem:   Copy_File uses a very large local buffer. This can
             potentially cause stack overflow problems in tasks using this
             subprogram.

 Status:     This was fixed in 5.04 on 2005-04-20
             This will also be fixed in 5.03a1

Workaround:  Do not use this subnprogram in a task or make sure that this task
             has at least 200k of additional stack available using pragma
             Storage_Size in the spec of the task.

KP-503a-E315-001 ASIS Corresponding_Name_Definition problem

 Problem:    If an argument of the ASIS Corresponding_Name_Definition query
             is the reference to the predefined System package, and if
             pragma Extend_System is in effect, the result of the query
             may be not the defining name of System, but the defining name
             of the child of System defined by the pragma.

 Status:     This was fixed in 5.04 on 2005-03-15
             This will also be fixed in 5.03a1

 Workaround: Write a wrapper function for Corresponding_Name_Definition that
             checks that if images of the argument and the result of
             Corresponding_Name_Definition are the same, and if not,
             corrects the result.

KP-503a-E311-008 Wrong code with range type and size representation clause

 Problem:    Compiler generates wrong code at -O and above when bounds of
             a loop are specified as results of a conversion, to a range
             type with a size representation clause, of non-constant values
             of this range type.

 Status:     This was fixed in 5.04 on 2005-03-13
             This will also be fixed in 5.03a1

 Workaround: Remove the useless conversion of bounds to the range type.
             Alternatively replace the type with a modular type without
             representation clause.

KP-503a-E310-013 Upper case in file names not supported by the debugger

 Problem:    On VxWorks, from a windows host, the debugger does not
             support file names in upper case properly; it reports that
             the file is not found.

 Status:     This was fixed in 5.04 on 2005-03-14
             This will also be fixed in 5.03a1

 Workaround: Use the lower case file name of the file. For example, when you
             refer to a file named Mixed_Case.adb, in the debugger use the
             name mixed_case.adb

KP-503a-E309-002 Debugger crashing on program with inlining

 Problem:    The debugger may report an internal error when loading a program
             which uses inlined routines.

 Status:     This was fixed in 5.04 on 2005-03-09
             This will also be fixed in 5.03a1

 Workaround: Compile without inlining.

KP-503a-E308-020 debugger crashing when re-starting the program

  Problem:    On Windows targets, if you run a program in the debugger,
              then kill it, then re-run it, the debugger may crash.

  Status:     This was fixed in 5.04 on 2005-03-18
             This will also be fixed in 5.03a1

  Workaround: Instead of killing the program in the debugger, detach,
              then kill it externally using the Windows Task Manager.
              You can then safely restart the program in the debugger.

KP-503a-E308-018 Missing frame in backtrace computed by debugger (HP/UX)

  Problem:    The debugger on HP/UX is sometimes showing a callstack where the
              second frame is missing. This happens when the program is
              stopped in the prologue of a function on the instruction that
              allocates the frame. This may result in an infinite backtrace
              being generated.

  Status:     This problem was fixed in 5.04 on 2005-03-18.
              This problem will also be fixed in 5.03a1

  Workaround: Step one instruction further, or stop the program one
              instruction earlier. The callstack at this location will
              be complete.

KP-503a-E308-004 Installation fails when fixincludes is empty

  Problem:    During installation, if fixinc.sh does not change any
              header files and the fixincludes directory is empty
	      the installation will abort because of a 'tar' error.

  Status:     This problem was fixed in 5.04 on 2005-03-10.
              This problem will also be fixed in 5.03a1

  Workaround: Edit the Makefile, change 'tar cf - *' to 'tar cf - .',
              and run ./doinstall again

KP-503a-E224-023 Wrong code for packed arrays in protected objects

  Problem:    Compiler generates wrong code when a packed array declared
              as a private component of a protected type is manipulated
              in the subprograms of the protected type, if the size in
              bits of the packed array is 8, 16 or 32.

  Status:     This was fixed in 5.04 on 2005-03-10
              This problem will also be fixed in 5.03a1

  Workaround: Wrap up the packed array in a record.

KP-503a-E222-008 gnatmetric problem with maximal construct nesting level

  Problem:    gnatmetric may fail with CONSTRAINT_ERROR when computing the
              maximal construct nesting level

  Status:     This was fixed in 5.04 on 2005-02-23
              This will also be fixed in 5.03a1

  Workaround: Disable this metric.

KP-503a-E222-002 Memory overrun in some controlled object assignments

  Problem:    When a controlled type has a discriminant with a
              default value, and value of an unconstrained subtype
              of this type is assigned to an object of a constrained
              subtype, under some circumstances the generated code
              may write to memory beyond the end of the target object.
              Such corruption may also occur when the expression in
              an assignment statement involves an upward tagged type
              conversion of an object with a controlled subcomponent.

  Status:     This was fixed in 5.04 on 2005-02-23.
              This will also be fixed in 5.03a1

  Workaround: Declare an intermediate constant of the appropriate
              constrained subtype, and initialize it with the
              unconstrained value. Then, assign this constant to
              the constrained object.

KP-503a-E221-028 Wrong code for 'Access to aliased component of record

  Problem:    Compiler generates wrong code if the 'Access attribute is
              evaluated on an aliased component with a representation
              clause, when the size in storage units of the type of the
              component is not equal to the size deduced from the clause.

  Status:     This case is rejected in 5.04 as of 2005-03-05
              This will also be fixed in 5.03a1

  Workaround: Modify the representation clause to match the size of the type
              or the type to match the representation clause.

KP-503a-E221-025 Compiler abort on multidimensional constrained component

  Problem:    Compiler aborts on an aggregate for a discriminated record that
              has a multidimensional array component, when a dimension other
              than the first is constrained by a discriminant of the record,
              and subaggregates along that dimension are given with an others
              component association.

  Status:     This was fixed in 5.04 on 2005-02-25
              This will also be fixed in 5.03a1

  Workaround: Whenever possible, interchange dimensions so that the first
              one is constrained by discriminants, or give explicit bounds
              for the aggregate.

KP-503a-E221-009 Compiler abort on complex record w. multidimensional array

  Problem:    Compiler aborts on a declaration of record that includes a
              constrained record component whose discriminant determines
              a bound of a multidimensional array component, when the other
              bounds are constrained by a subtype of an enumeration type.

  Status:     This was fixed in 5.03 on 2005-02-23
              This will also be fixed in 5.03a1

  Workaround: Introduce temporaries of the enumeration type before the
              record declaration.

KP-503a-E220-001 crash on private extension component in subtype

  Problem:    Compiler aborts on a subtype declaration of a discriminated
              type, when there is a component whose type is a private
              extension of an unrelated type with discriminants.

  Status:     This was fixed in 5.04 on 2005-03-01
              This will also be fixed in 5.03a1

  Workaround: Make type of component non-private.

KP-503a-E218-022 Spurious error with CERT runtime and user-defined Int function

  Problem:    Compiler rejects a program that uses indirectly interfaces.c,
              and has a use clause on a package that contains overloaded
              functions called Int.

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

  Workaround: Rename functions to avoid clash.

KP-503a-E217-011 Imported project not seen in project body

  Problem:    In some circumstances, when "limited with" is used,
              a project imported with a non limited with cannot be used
              in the project body.

  Status:     This was fixed in 5.04 on 2005-02-22
              This will also be fixed in 5.03a1

  Workaround: Restructure the projects and their sources to avoid
              limited withs.

KP-503a-E216-018 Compiler loops on illegal program

  Problem:    Compiler loops on a program where an undeclared variable
              appears in a Storage_Size pragma, and is subsequently used
              as an actual in an instantiation.

  Status:     This was fixed in 5.03 on 2005-02-017
              This will also be fixed in 5.03a1

  Workaround: Do not write such illegal programs. When the compiler loops
              it can often be due to a semantic error in the program. In
              that case, compiling with the -gnatd0 switch will display
              error messages as they are detected, rather than at the end
              of the compilation.

KP-503a-E214-002 Spurious diagnostic on component with controlled subcomponent

  Problem:    Compiler rejects a legal declaration for a tagged type T, when
              one of its components is a private discriminated type whose
              full view includes a controlled subcomponent.

  Status:     This was fixed in 5.04 on 2005-02-17
              This will also be fixed in 5.03a1

  Workaround: Make the component type non-private, or else make the
              enclosing type non-tagged.

KP-503a-E210-015 'as' complains about unknown options on mips-irix

 Problem:    Compiling sources on mips-irix triggers error messages from
             '/usr/bin/as' (the native assembler) about options it doesn't
             recognize. This is caused by wrong permissions on the assembler
             packaged with GNAT, which should be used instead of the native
             one.

 Status:     This was fixed in 5.04 on 2005-02-10
             This will also be fixed in 5.03a1

 Workaround: Adjust the permissions of the delivered assembler binaries to
             be readable and executable by everyone, e.g. by issuing a chmod
             755 on <install-path>/libexec/gcc/mips-sgi-irix6.5/3.4.4/as and
             <install-path>/bin/as.

KP-503a-E210-001 Compiler abort on call returning complex record

  Problem:    Compiler aborts on a function call that returns a private
              type with discriminants, when the full view is a record type
              that includes a component whose type is a named constrained
              subtype of an access to the enclosing record.

  Status:     This was fixed in 5.04 on 2005-02-12
              This will also be fixed in 5.03a1

  Workaround: Use the unconstrained access type in the component declaration.

KP-503a-E207-018 Race condition in Ada.Calendar.Split on AIX

  Problem:    The implementation of the run time support function
              __gnat_localtime_r is not thread safe on AIX and under some
              circumstances concurrent calls will return incorrect results.
              This results in incorrect results being generated by the routine
              Ada.Calendar.Split.

  Status:     This was fixed in 5.04 on 2005-02-15
              This will also be fixed in 5.03a1

  Workaround: Ensure calls to Ada.Calendar.Split are not concurrent.

KP-503a-E201-003 Race condition in nested interrupts on ERC32

  Problem:    When within an interrupt handler, the software priority
              is updated a few instructions after higher priority interrupts
              have been unmasked; if a high priority interrupt arrives within
              that window, priorities are in an inconsistent state, and a low
              priority task may preempt the high priority interrupt handler.
              This problem only affects the ERC32 run time.

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

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

KP-503a-E128-015 Wrong code at -O2 when elaborating an array of strings

  Problem:    Wrong code may be generated at -O2 for the elaboration of
              an array of strings that is an actual parameter of an
              instantiated generic package.

  Status:     This was fixed in 5.04 on 2005-02-01
              This will also be fixed in 5.03a1

  Workaround: Compile with -O2 -fno-strict-aliasing.

KP-503a-E128-008 Compiler crash on attribute evaluation in loop bound

  Problem:   Compiler crashes on an attribute evaluation in a loop bound
             involving a packed array.

  Status:    This was fixed in 5.04 on 2005-02-04
             This will also be fixed in 5.03a1

  Workaround: Declare a local variable, assign the attribute value to it and
              substitute it for the attribute evaluation in the loop bound.

KP-503a-E127-013 Improper order of elaboration with Elaborate pragma

  Problem:    If unit A and unit B make elaboration calls on a function
              declared in package P, A has a with_clause on unit B, and
              B contains a pragma Elaborate on P, the compiler may produce
              an improper order of elaboration for the partition, and
              elaborate A before P.

  Status:     This was fixed in 5.04 on 2005-02-01
              This will also be fixed in 5.03a1

  Workaround: Remove Elaborate pragma from B.

KP-503a-E127-007 Crash when calling Ada.Task_Identification.Image

  Problem:    When calling Ada.Task_Identification.Image from a foreign
              thread (a thread not declared as an Ada task), the application
              may get a SEGV or the function return garbage.

  Status:     This was fixed in 5.04 on 2005-01-31
              This will also be fixed in 5.03a1

  Workaround: Avoid calling Image from a foreign thread.

KP-503a-E124-011 Spurious exception with unchecked union component

  Problem:    A declaration of a tagged type that includes a component
              of an Unchecked_Union type generates an exception at the
              point of the type definition.

  Status:     This was fixed in 5.04 on 2005-01-24
              This will also be fixed in 5.03a1

  Workaround: Make the enclosing type non-tagged, or else limited, to
              prevent the generation of an equality operation for it.

KP-503a-E121-006 Debugger problem computing backtrace on HP/UX

  Problem:    Under certain circumstances, the debugger is unable to
              compute the full call stack. GDB repors a warning that
              it can not find the bounds of the current function.

  Status:     This was fixed in 5.04 on 2005-03-07
              This will also be fixed in 5.03a1

  Workaround: Use the GDB executable provided with 5.02a1, or obtain
              an updated version of GDB from AdaCore.

KP-503a-E119-010: Wait_For_A_Full_Reception restriction not documented

  Problem:    The documentation for GNAT.Sockets fails to note that the
              use of The Wait_For_A_Full_Reception request flag for
              Receive_Socket is supported only on platforms where the
              underlying sockets library provides the MSG_WAITALL flag.
              Specifically, Windows does not provide the necessary support
              and the documentation should note this restriction.

  Status:     This was fixed in 5.04 on 2005-01-19
              This will also be fixed in 5.03a1

  Workaround: This is a documentation change only. If you intend your program
              to be portable to Windows, do not use Wait_For_A_Full_Reception.

KP-503a-E118-012 gnatmake -U finds no sources

  Problem:    When gnatmake -U is invoked for a project files with the
              declaration "for Source_Dirs use ();", it reports that
              it finds no source to compile, even when there are sources
              in the imported project files.

  Status:     This was fixed in 5.04 on 2005-01-19
              This will also be fixed in 5.03a1

