======================================================
Known problems in GNAT version 5.04a as of Aug 7, 2006
======================================================

Copyright (c) 2005-2006, AdaCore

The following is a listing of known problems in release 5.04a. Except where
specifically noted, all these problems have been corrected in final release of
the 5.04 technology. It means they are corrected in release 5.04a1 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-504a-F712-021 VxWorks 6 debugger does not switch to ada mode

  Problem:    When an Ada module is loaded, the GPS/GDB debugger does not
              switch to Ada mode.

  Status:     This was fixed in 5.04a1 on 2006-08-07

  Workaround: Set it manually by typing "set language ada" in the debug
              console.

KP-504a-F712-008 Link error on VMS with DEClib generic I/O routines.

  Problem:    Instantiated I/O routines reference symbols from the Dec Ada
              Compatibility library that are missing from the shareable image
              symbol vector and therefore produce undefined external errors
              during linking.

  Status:     That was fixed in 5.04a1 on 2006-07-18

  Wordaround: Link with the static version of DECLib.

KP-504a-F626-001 GDB fails to suppress some non-Ada local names

  Problem:    In listings produced by 'info locals' and some other commands,
              GDB is supposed to suppress the printing of non-Ada symbols
              introduced by the compiler from Ada source files.  However,
              a bug currently causes it not to suppress alphanumeric names
              where only the first letter is capitalized.

  Status:     This was fixed in 5.04a1 on 2006-06-28

  Workaround: The extra symbols are easily identifiable, since they are
              printed in angle braces (<>), and can thus be ignored.

KP-504a-F608-021 gnatpp problem with pragma in generic formal part

  Problem:    gnatpp starts to corrupt the formatted code after
              processing a pragma that is the last element in a
              generic formal part.

  Status:     This was fixed in 5.04a1 on 2006-06-08

  Workaround: Comment out pragmas that are last elements in generic formal
              parts before applying gnatpp.

KP-504a-F531-025 Debugger crash after watchpoint inserted

  Problem:    The debugger can sometimes crash when running the program
              after having inserted a watchpoint. This can only occur if
              a shared library is loaded after the watchpoint has been
              inserted.

  Status:     This was fixed in 5.04a1 on 2006-05-31

  Workaround: Shared libraries are usually loaded at the very start
              of the program. So start your program first, and then
              insert the watchpoint.

KP-504a-F529-006 Spurious error with complex formal package structure.

  Problem:    Compiler rejects an instantiation with several formal package,
              when one of the formal packages is declared without a box, and
              its formal is itself declared in a previous formal package of
              the enclosing generic.

  Status:     This was fixed in 5.04a1 on 2006-06-02.

  Workaround: Simplify the formal part of the package, e.g. by declaring the
              later formal  without a box.

KP-504a-F528-001 Locate_Exec_On_Path does not always return a full path

  Problem:    The documentation of Locate_Exec_On_Path indicates that it
              always return a "full path" when successful. Howver, it does
              not always do that when the parameter is a relative path
              with directory information.

  Status:     This was fixed in 5.04a1 on 2006-06-16

  Workaround: Avoid calling Locate_Exec_On_Path with a relative path including
              directory information.

KP-504a-F525-006 GNAT.Ctrl_C not available on all Unix platforms

  Problem:    GNAT.Ctrl_C is not enabled on Darwin, HPPA, or LynxOS, so it
              is not possible to use this facility to trap ^C on these
              systems.

  Status:     This was fixed in 5.04a1 on 2006-06-15

  Workaround: Use Ada.Interrupts to install a handler for SIGINT, or
              import signal() or sigaction() directly.

KP-504a-F524-009 Useless recompilation with directories including spaces

  Problem:    gprmake always recompiles C or C++ sources when the directories
              include spaces in their names.

  Status:     This was fixed in 5.04a1 on 2006-06-15

  Workaround: Avoid directories with spaces

KP-504a-F523-015 GNAAMP fails on compiling 'Address of a bit-packed array

  Problem:    On the AAMP target only, the compiler blows up on uses of the
              Address attribute with a prefix that is a bit-packed array.

  Status:     This was fixed in 5.04a1 on 2006-05-31

  Workaround: Change the array type to an unpacked array or wrap the array
              object within a record and apply 'Address to the record.

KP-504a-F520-003 Renamings of variables may be optimized incorrectly

  Problem:    If a local variable is a renaming of a stand alone variable, and
              a sequence of statements contains direct modification to this
              variable, and indirect modification via the renamed variable,
              then incorrect optimization may assign a value that does not
              properly notice the latter modifications.

  Status:     This was fixed in 5.04a1 on 2006-06-27

  Workaround: This is a fairly rare occurrence (it has never been seen in a
              real application), but if it does occur, avoiding such mixtures
              of modifications to the two variables will eliminate the problem.

KP-504a-F517-005 Spurious visibility error on great-grandchild unit in context

  Problem:    If a child package declaration  A.B has a with_clause on a
              descendant of a sibling unit, such as A.C.D.E, the compiler
              reports that C is not immediately visible in the body of A.B.

  Status:     This was fixed in 5.04a1 on 2006-06-15

  Workaround: Use an expanded name to refer to the sibling.

KP-504a-F517-003 Failure to diagnose illegal instance of child unit

  Problem:    Compiler fails to reject a child instance unit, when an actual
              in the instance makes use of an operator that is visible in a
              withed package, but not use-visible..

  Status:     This was fixed in 5.04a1 on 2006-05-22

  Workaround: Do not write such illegal child instances.

KP-504a-F515-013 Spurious instantiation error on private index type

  Problem:    If package P declares a private type I whose full view is a
              discrete type, I is used as an index to an array type in
              the body of generic package G nested within P, and the body
              of G includes an iteration with literal bounds over an array
              of the type, the compiler may reject an instantiation of G.

  Status:     This was fixed in 5.04a1 on 2006-05-16

  Workaround: Make the type I non-private in P.

KP-504a-F515-010 Endless loop in integrated preprocessing

  Problem:    When using integrated preprocessing, specifying more than
              five source files in the preprocessing data file results
              in an endless loop in the compiler.

  Status:     This was fixed in 5.04a1 on 2006-06-16

  Workaround: Do not specify more than five sources files in the preprocessing
              data file.

KP-504a-F428-023 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 when deallocating.

  Status:     This was fixed in 5.04a1 on 2006-06-19

  Workaround: Avoid the use of debug pools in this environment.

KP-504a-F219-003 Inner while loop test incorrectly removed

  Problem:    If all the following conditions hold
                - There is an outer loop
                - Within this loop, there is an IF testing against null
                - Within this branch of the IF is a WHILE with the same test
                - There is no block within outer loop enclosing the while
              then the compiler incorrectly removes the inner loop condition

  Status:     This was fixed in 5.04a1 on 2006-06-19

  Workaround: Introduce a block for the body of the outer loop, negating the
              fourth of the necessary conditions above.

KP-504a-F227-021 Spurious constraint error on non-null pointer.

  Problem:    Constraint_Error is raised within code protected by a guard:
              (if Ptr /= 0...) when the non-null pointer denotes a strina,g
              and the dereference occurs whin a construct that needs
              finalization or involves debug pools.

  Status:     This was fixed in 5.04a1 on 2006-02-027

  Workaround: Use a declare block around the construct, and use a temporary
              for the value of the dereference.

KP-504a-F226-007 Wrong behavior of Wide_Character'Wide_Value

  Problem:    Wide_Character'Wide_Value incorrectly raises a Constraint_Error
              exception if the string is of the form quote-char-quote and
              char is not in the range of code values 0-127.

  Status:     This was fixed in 5.04a1 on 2006-06-16

  Workaround: If the string has this form, simply select the second character
              of the string, which is the proper result in this case.

KP-504a-F222-021 Incorrect code generation for some remote types

  Problem:    If a primitive operation of a remote object type has a
              controlling formal parameter that occurs after a constrained
              non-controlling one, the code generated for receiving stubs
              is inconsistent with that of calling stubs, causing a runtime
              error on the server side when the primitive is called.

  Status:     This was fixed in 5.04a1 on 2006-06-16

  Workaround: Move controlling formal to first position.

KP-504a-F519-010 OS_Lib.File_Time_Stamp returns wrong status on Win32

  Problem:    On Windows and when the file does not exist, the status returned
              by OS_Lib.File_Time_Stamp is not OS_Lib.Invalid_Time as expected.

  Status:     This was fixed in 5.04a1 on 2006-06-15

  Workaround: Check for file existence first using OS_Lib.Is_Regular_File.

KP-504a-F428-029 Object directories not forced for all virtual projects

  Problem:    There are cases when the object directory of a virtual extending
              project is not set up properly, resulting in object files being
              put in the wrong place.

  Status:     This was fixed in 5.04a1 on 2006-06-15

  Workaround: Use explicit extending projects, instead of virtual ones

KP-504a-F418-001 Misoptimization of nested floating-point multiplications
                 on PowerPC with -gnato

  Problem:    In certain rare cases, when compiling for a PowerPC target
              using the common subset of all processor chips, -gnato and
              and optimization level greater than -O0 is specified,
              a nested series of floating-point multiplications may be
              miscompiled.

  Status:     This was fixed in 5.04a1 on 2006-05-24

  Workaround: Specify -mcpu= on the command-line, giving the actual CPU
              used as the target.

KP-504a-F411-012 Shared library and stack checking trigger exception on Linux

  Problem:    On x86/GNU/Linux systems, the new implementation of stack
              checking may badly interact with shared libraries, resulting in
              the incorrect or unexpected propagation of exceptions.

  Status:     This was fixed in 5.04a1 on 2006-06-16

  Workaround: Revert to the old implementation by means of -fold-stack-check.

KP-504a-F405-008 Optimization plus stack checking triggers exception on Linux

  Problem:    On x86/Linux, the new implementation of stack checking may badly
              interact with some optimizations, resulting in the incorrect or
              unexpected propagation of exceptions.

  Status:     This was fixed in 5.04a1 on 2006-06-16

  Workaround: Revert to the old implementation by means of -fold-stack-check.

KP-504a-F330-024 gnatname fails when unknown attributes in project file

  Problem:    When there are unknown attributes defined in packages other
              that Naming, gnatname fails.

  Status:     This was fixed in 5.04a1 on 2006-06-15

  Workaround: Avoid unknown attributes

KP-504a-F331-006 Compiler crash on circularity in subprogram access type

  Problem:    The compiler crashes when generating the elaboration code of an
              access-to-protected-subprogram type that contains a reference to
              itself through a record type.

  Status:     This was fixed in 5.04a1 on 2006-06-15

  Workaround: Break the circularity or change the indirect calls to the
              subprogram through pointers to direct calls.

KP-504a-F330-002 Compiler loops on private use clause in generic parent

  Problem:    When a generic package contains a private use clause, and a
              generic child is instantiated as a child of a parent instance,
              the compiler gets stuck in an infinite loop.

  Status:     This was fixed in 5.04a1 on 2006-06-15

  Workaround: Instantiate the generic child outside of the scope of the
              parent instance.

KP-504a-F318-003 Crash on return of discriminated record with packed array

  Problem;    If a discriminated record type has a default discriminant, has
              no variable size components, and has a component that is a
              packed array subtype constrained by the discriminant is used
              as the return type for a function, the compiler will crash on
              return statements.

  Status:     This was fixed in 5.04a1 on 2006-05-15.

  Workaround: Wrap the discriminated record type in a non-discriminated one.

KP-504a-F322-015 Invoking a tool with a relative path

  Problem:    Invoking a GNAT tool with a relative path, as in
              "./gnatls -v" in the GNAT bin directory, may fail.

  Status:     This was fixed in 5.04a1 on 2006-06-16

  Workaround: Invoke the tool either with its simple name if its executable
              is on the path, or with its absolute path.

KP-504a-F310-023 Ada.Directories problem on VMS

  Problem:    On VMS, directories containing digits in their names are
              considered illegal by routines in Ada.Directories.

  Status:     This was fixed in 5.04a1 on 2006-03-11

  Workaround: Do not use digits in the directories names.

KP-504a-F308-012 Spurious error on component and enclosing alignment clause.

  Problem:    Compiler rejects a component declaration for a by-reference
              type when there is an alignment clause for the enclosing
              record that specifies an alignment smaaller than the maximum
              alignment for the target architecture. The error only appears
              on targets with strict alignment requirements.

  Status:     This was fixed in 5.04a1 on 2006-06-19

  Workaround: Remove alignment clause for enclosing record.

KP-504a-F307-014 Spurious error in instance of child unit

  Problem     Compiler reject an instantiation of a child unit with a formal
              array type, when the component type is a formal type of a
              parent unit.:

  Status:     This was fixed in 5.04a1 on 2006-03-09

  Workaround: Add a formal type to the child unit and instantiate with an
              actual that corresponds to the actual of the parent instance.

KP-504a-F224-014 Compiler loops on elaboration check for generic subunit

  Problem:    Compiler goes into an infinite loop when compiling a generic
              unit that has a subunit whose proper body contains a call or
              an instantiation in its elaboration code.

  Status      This was fixed in 5.04a1 on 2006-02-28

  Workaround: Compile generic unit without elaboration checks, or place
              subunit in body of parent.

KP-504a1-F222-002 Cannot compile Ada.Numerics with -gnatW8

  Problem:    If a unit that with's Ada.Numerics is compiled using a -gnatW
              switch specifying other than brackets notation, the declaration
              of Ada.Numerics.pi using the pi symbol is improperly rejected.

  Status:     This was fixed in 5.04a1 on 2006-02-22

  Workaround: Edit a local copy of Ada.Numerics with the offending line either
              removed, or edited to use the wide character encoding method that
              is being used for the compilation.

KP-504a-F215-051 Debugger cannot next/step/continue after finish

  Problem:    On Tornado, the debugger can no longer execute any next,
              step, or continue command and reports that the program
              is already running. This occurs after doing a "finish"
              that reports that the "Function return value [is] unknown".

  Status:     This was fixed in 5.04a1 on 2006-02-23

  Workaround: Do not use the finish command. Insert a breakpoint inside
              the caller, and use continue instead.

KP-504a-F215-046 Tornado system freeze during system-mode debugging session

  Problem:    The system sometimes freezes while debugging in system mode.
              This occurs when using commands that resume the system
              execution such as next, step, or continue for instance.

  Status:     This was fixed in 5.04a1 on 2006-02-23

  Workaround: Insert the following code at the beginning of taskInfoGet
              inside shelcore.tcl:

              if { $taskId == -1 } {
                 error "System CID not supported by this function"
                 }

KP-504a-F215-041 Exception on dispatch to inherited null interface procedures

  Problem:    When a type extension inherits null procedures from interfaces
              and the null procedures are not overridden, dispatching calls
              to the inherited null procedures result in an exception due to
              a failed access check.

  Status:     This was fixed in 5.04a1 on 2006-03-13

  Workaround: Add explicit overridings for the inherited null procedures.

KP-504a-F213-032 Can attach to reserved signals under AIX

  Problem:    Under AIX only using the Ada.Interrupts facility, it is
              possible to attach an interrupt handler to AIX reserved signals
              SIGALARM1, SIGWAITING and SIGCPUFAIL, possibly resulting in
              the application hanging.

  Status:     This was fixed in 5.04a1 on 2006-03-09

  Workaround: Do not try to attach to these signals, since they are reserved
              by the OS.

KP-504a-F213-013 Wrong Constraint_Error for fixed to modular conversion at -O

  Problem:    A wrong Constraint_Error is raised by the range check on the
              result of a fixed point to modular conversion, if the modulus
              is 2 raised to the power of a multiple of the word size and if
              the code is compiled with optimization.

  Status:     This was fixed in 5.04a1 on 2006-06-16

  Workaround: Compile the code without optimization.

KP-504a-F208-002 Spurious error on string assignments to packed components.

  Problem:    Compiler emits spurious errors when there are several string
              assignments to packed string components in the same scope.

  Status:     This was fixed in 5.04a1 on 2006-02-08

  Workaround: Expand assignments into explicit loops, or into individual
              character assignments when possible.

KP-504a-F203-030 Unexpected multiple-choice menu printed by debugger

  Problem:    On MacOS X, the debugger sometimes prints an unexpected
              multiple-choice menu during the execution of the "list"
              command.

  Status:     This was fixed in 5.04a1 on 2006-02-03

  Workaround: Select any of the menu choices except "all". The correct
              source code will be displayed.

KP-504a-F203-013 Ada.Synchronous_Task_Control and Abort incompatibility

  Problem:    The use of abort statements in conjunction with suspension
              objects provided by Ada.Synchronous_Task_Control can cause
              block behavior at run time. If a task that has just set to
              True a Suspension_Object is immediately aborted then the
              next task that tries to use the same Suspension_Object may
              get blocked.

  Status:     This was fixed in 5.04a1 on 2006-02-10

  Workaround:  Avoid using those 2 features conjointly.

KP-504a-F131-041 Incorrect tagged type value printed by MacOS debugger

  Problem:    On MacOS, the debugger sometimes prints an incorrect value
              for tagged types. The fields of the root tagged type are
              correctly printed, but the other fields are all replaced
              by one single empty array of bytes.

  Status:     This was fixed in 5.04a1 on 2006-02-08

  Workaround: Use the -readnow command line switch when starting the debugger.

KP-504a-F130-030 Debugger crash when using add-symbol-file command

  Problem:    Using an incorrect add-symbol-file command where the address
              is missing sometimes results in the crash of the debugger.

  Status:     This was fixed in 5.04a1 on 2006-02-01

  Workaround: Use correct add-symbol-file commands.

KP-504a-F125-012 Restriction/Profile_Warnings change generated code

  Problem:    There are cases where the use of the Profile and Restrictions
              pragmas change the generated code, based on the binder-enforced
              guarantee of consistency through the partition. Some of these
              same code modifications were occurring with the corresponding
              warning pragmas (Profile_Warnings and Restriction_Warnings).
              This could result in compiler blowups in cases where the
              restrictions were not adhered to throughout the partition.
              The warning pragmas should not affect code generation

  Status:     This was fixed in 5.04a1 on 2006-06-16

  Workaround: Do not use pragma Restriction_Warnings or Profile_Warnings for
              cases where code can be modified (Ravenscar is one example.) Use
              the corresponding Restrictions or Profile pragmas instead.

KP-504a-F118-028 Exception on string with lower bound > 1 in Fixed_IO.Put

  Problem:    The exception Layout_Error is raised when the version of
              procedure Fixed_IO.Put that takes a string parameter is passed
              an actual whose lower bound is greater than one.

  Status:     This was fixed in 5.04a1 on 2006-06-15

  Workaround: Declare a subtype of String with a lower bound of one and an
              upper bound equal to the length of the string actual and add
              a conversion of the actual to that subtype in the call.

KP-504a-F111-019 Compiler aborts when compiling with -gnatD option

  Problem:    Compiler aborts while creating the .dg file for the current
              compilation, in rare cases when the program generates internal
              types  that are subtypes of types declared in a different unit.
              In particular, the problem will show up on a reference to
              System.Address on a system where Address is a visible integer
              type, and the unit includes the pragma Initialize_Scalars.

  Status:     This was fixed in 5.04a1 on 2006-01-17

  Workaround: Do not use -gnatD when compiling the unit.

KP-504a-D614-018 Class-wide function issue with restriction No_Finalization

  Problem:    In the context of a No_Finalization restriction, enabled by
              default in HI runtimes (ZFP & CERT), the returned value from
              a function returning a class-wide type may be truncated to its
              root type part.

  Status:     This was fixed in 5.04a1 on 2006-07-03

  Workaround: Avoid the use of functions returning class-wide values in the
              presence of a No_Finalization restriction.

