2010-06-14 Robert Dewar <dewar@adacore.com>
authorcharlet <charlet@138bc75d-0d04-0410-961f-82ee72b054a4>
Mon, 14 Jun 2010 08:27:05 +0000 (08:27 +0000)
committercharlet <charlet@138bc75d-0d04-0410-961f-82ee72b054a4>
Mon, 14 Jun 2010 08:27:05 +0000 (08:27 +0000)
* a-convec.adb, sem_prag.adb, checks.adb: Minor reformatting

2010-06-14  Eric Botcazou  <ebotcazou@adacore.com>

* init.c: Code clean up.

2010-06-14  Ed Schonberg  <schonberg@adacore.com>

* sem_ch13.adb (Analyze_Attribute_Definition_Clause, case Address): Do
not insert address clause in table for later validation if type of
entity is generic, to prevent possible spurious errors.

* sem_ch8.adb: Code clean up.

2010-06-14  Ben Brosgol  <brosgol@adacore.com>

* gnat_ugn.texi: Expanded @ovar macro inline to solve problem with
texi2pdf and texi2html.
Document how to change scheduling properties on HP-UX.

2010-06-14  Thomas Quinot  <quinot@adacore.com>

* g-socket.ads: Remove misleading comments.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@160711 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/ada/ChangeLog
gcc/ada/a-convec.adb
gcc/ada/checks.adb
gcc/ada/g-socket.ads
gcc/ada/gnat_ugn.texi
gcc/ada/init.c
gcc/ada/sem_ch13.adb
gcc/ada/sem_ch8.adb
gcc/ada/sem_prag.adb

index a0b0f07..8a761ab 100644 (file)
@@ -1,3 +1,29 @@
+2010-06-14  Robert Dewar  <dewar@adacore.com>
+
+       * a-convec.adb, sem_prag.adb, checks.adb: Minor reformatting
+
+2010-06-14  Eric Botcazou  <ebotcazou@adacore.com>
+
+       * init.c: Code clean up.
+
+2010-06-14  Ed Schonberg  <schonberg@adacore.com>
+
+       * sem_ch13.adb (Analyze_Attribute_Definition_Clause, case Address): Do
+       not insert address clause in table for later validation if type of
+       entity is generic, to prevent possible spurious errors. 
+
+       * sem_ch8.adb: Code clean up.
+
+2010-06-14  Ben Brosgol  <brosgol@adacore.com>
+
+       * gnat_ugn.texi: Expanded @ovar macro inline to solve problem with
+       texi2pdf and texi2html.
+       Document how to change scheduling properties on HP-UX.
+
+2010-06-14  Thomas Quinot  <quinot@adacore.com>
+
+       * g-socket.ads: Remove misleading comments.
+
 2010-06-14  Jerome Lambourg  <lambourg@adacore.com>
 
        * sem_prag.adb (Check_Duplicated_Export_Name): Remove check for
index 73151bc..8d146b0 100644 (file)
@@ -103,10 +103,12 @@ package body Ada.Containers.Vectors is
          --  end of the range of Int.
 
          if Index_Type'First <= 0 then
+
             --  Compute the potential Last index value in the normal way, using
             --  Int as the type in which to perform intermediate
             --  calculations. Int is a 64-bit type, and Count_Type is a 32-bit
             --  type, so no overflow can occur.
+
             J := Int (Index_Type'First - 1) + N;
 
             if J > Int (Index_Type'Last) then
@@ -120,6 +122,7 @@ package body Ada.Containers.Vectors is
             --  greater than Index_Type'Last (as we do above), we work
             --  backwards by computing the potential First index value, and
             --  then checking whether that value is less than Index_Type'First.
+
             J := Int (Index_Type'Last) - N + 1;
 
             if J < Int (Index_Type'First) then
@@ -129,6 +132,7 @@ package body Ada.Containers.Vectors is
             --  We have determined that Length would not create a Last index
             --  value outside of the range of Index_Type, so we can now safely
             --  compute its value.
+
             J := Int (Index_Type'First - 1) + N;
          end if;
 
index 29689d1..a193c29 100644 (file)
@@ -1107,8 +1107,8 @@ package body Checks is
              or else
                (Is_Entity_Name (Obj)
                  and then Present (Renamed_Object (Entity (Obj)))
-                and then Nkind (Renamed_Object (Entity (Obj)))
-                  = N_Explicit_Dereference);
+                 and then Nkind (Renamed_Object (Entity (Obj))) =
+                                              N_Explicit_Dereference);
       end Denotes_Explicit_Dereference;
 
       ----------------------------------------
index 8d3138e..d81f7da 100644 (file)
@@ -459,8 +459,7 @@ package GNAT.Sockets is
 
    type Family_Type is (Family_Inet, Family_Inet6);
    --  Address family (or protocol family) identifies the communication domain
-   --  and groups protocols with similar address formats. IPv6 will soon be
-   --  supported.
+   --  and groups protocols with similar address formats.
 
    type Mode_Type is (Socket_Stream, Socket_Datagram);
    --  Stream sockets provide connection-oriented byte streams. Datagram
index 42ae195..d21606c 100644 (file)
@@ -107,6 +107,13 @@ Texts.  A copy of the license is included in the section entitled
 @macro ovar{varname}
 @r{[}@var{\varname\}@r{]}@c
 @end macro
+@c Status as of November 2009:
+@c Unfortunately texi2pdf and texi2html treat the trailing "@c"
+@c differently, and faulty output is produced by one or the other
+@c depending on whether the "@c" is present or absent.
+@c As a result, the @ovar macro is not used, and all invocations
+@c of the @ovar macro have been expanded inline.
+
 
 @settitle @value{EDITION} User's Guide @value{PLATFORM}
 @dircategory GNU Ada tools
@@ -597,6 +604,8 @@ Platform-Specific Information for the Run-Time Libraries
 * Linux-Specific Considerations::
 * AIX-Specific Considerations::
 * Irix-Specific Considerations::
+* RTX-Specific Considerations::
+* HP-UX-Specific Considerations::
 
 Example of Binder Output File
 
@@ -3873,7 +3882,9 @@ without generating code, then use the @option{-gnatc} switch.
 The basic command for compiling a file containing an Ada unit is
 
 @smallexample
-$ gcc -c @ovar{switches} @file{file name}
+@c $ gcc -c @ovar{switches} @file{file name}
+@c Expanding @ovar macro inline (explanation in macro def comments)
+$ gcc -c @r{[}@var{switches}@r{]} @file{file name}
 @end smallexample
 
 @noindent
@@ -4419,7 +4430,9 @@ Inhibit the search of the default location for the GNAT Run Time
 Library (RTL) ALI files.
 
 @ifclear vms
-@item -O@ovar{n}
+@c @item -O@ovar{n}
+@c Expanding @ovar macro inline (explanation in macro def comments)
+@item -O@r{[}@var{n}@r{]}
 @cindex @option{-O} (@command{gcc})
 @var{n} controls the optimization level.
 
@@ -7187,7 +7200,9 @@ Shows the storage pool associated with a @code{free} statement.
 Used to list an equivalent declaration for an internally generated
 type that is referenced elsewhere in the listing.
 
-@item freeze @var{type-name} @ovar{actions}
+@c @item freeze @var{type-name} @ovar{actions}
+@c Expanding @ovar macro inline (explanation in macro def comments)
+@item freeze @var{type-name} @r{[}@var{actions}@r{]}
 Shows the point at which @var{type-name} is frozen, with possible
 associated actions to be performed at the freeze point.
 
@@ -7886,7 +7901,9 @@ to be read by the @command{gnatlink} utility used to link the Ada application.
 The form of the @code{gnatbind} command is
 
 @smallexample
-$ gnatbind @ovar{switches} @var{mainprog}@r{[}.ali@r{]} @ovar{switches}
+@c $ gnatbind @ovar{switches} @var{mainprog}@r{[}.ali@r{]} @ovar{switches}
+@c Expanding @ovar macro inline (explanation in macro def comments)
+$ gnatbind @r{[}@var{switches}@r{]} @var{mainprog}@r{[}.ali@r{]} @r{[}@var{switches}@r{]}
 @end smallexample
 
 @noindent
@@ -8865,8 +8882,12 @@ driver (see @ref{The GNAT Driver and Project Files}).
 The form of the @command{gnatlink} command is
 
 @smallexample
-$ gnatlink @ovar{switches} @var{mainprog}@r{[}.ali@r{]}
-           @ovar{non-Ada objects} @ovar{linker options}
+@c $ gnatlink @ovar{switches} @var{mainprog}@r{[}.ali@r{]}
+@c            @ovar{non-Ada objects} @ovar{linker options}
+@c Expanding @ovar macro inline (explanation in macro def comments)
+$ gnatlink @r{[}@var{switches}@r{]} @var{mainprog}@r{[}.ali@r{]}
+           @r{[}@var{non-Ada objects}@r{]} @r{[}@var{linker options}@r{]}
+
 @end smallexample
 
 @noindent
@@ -9144,8 +9165,11 @@ dependencies, they will always be tracked exactly correctly by
 The usual form of the @command{gnatmake} command is
 
 @smallexample
-$ gnatmake @ovar{switches} @var{file_name}
-      @ovar{file_names} @ovar{mode_switches}
+@c $ gnatmake @ovar{switches} @var{file_name}
+@c       @ovar{file_names} @ovar{mode_switches}
+@c Expanding @ovar macro inline (explanation in macro def comments)
+$ gnatmake @r{[}@var{switches}@r{]} @var{file_name}
+      @r{[}@var{file_names}@r{]} @r{[}@var{mode_switches}@r{]}
 @end smallexample
 
 @noindent
@@ -10715,7 +10739,7 @@ Note that @code{gnatelim} needs neither object nor ALI files.
 @code{gnatelim} has the following command-line interface:
 
 @smallexample
-$ gnatelim @ovar{options} name
+$ gnatelim [@var{options}] name
 @end smallexample
 
 @noindent
@@ -11119,8 +11143,11 @@ in which GNAT processes the ACVC tests.
 The @code{gnatchop} command has the form:
 
 @smallexample
+@c $ gnatchop switches @var{file name} @r{[}@var{file name} @dots{}@r{]}
+@c      @ovar{directory}
+@c Expanding @ovar macro inline (explanation in macro def comments)
 $ gnatchop switches @var{file name} @r{[}@var{file name} @dots{}@r{]}
-      @ovar{directory}
+      @r{[}@var{directory}@r{]}
 @end smallexample
 
 @noindent
@@ -11546,8 +11573,11 @@ set of files.
 The usual form of the @code{gnatname} command is
 
 @smallexample
-$ gnatname @ovar{switches} @var{naming_pattern} @ovar{naming_patterns}
-      @r{[}--and @ovar{switches} @var{naming_pattern} @ovar{naming_patterns}@r{]}
+@c $ gnatname @ovar{switches} @var{naming_pattern} @ovar{naming_patterns}
+@c       @r{[}--and @ovar{switches} @var{naming_pattern} @ovar{naming_patterns}@r{]}
+@c Expanding @ovar macro inline (explanation in macro def comments)
+$ gnatname @r{[}@var{switches}@r{]} @var{naming_pattern} @r{[}@var{naming_patterns}@r{]}
+      @r{[}--and @r{[}@var{switches}@r{]} @var{naming_pattern} @r{[}@var{naming_patterns}@r{]}@r{]}
 @end smallexample
 
 @noindent
@@ -15403,7 +15433,9 @@ use the @code{gnat} driver (see @ref{The GNAT Driver and Project Files}).
 @noindent
 The command invocation for @code{gnatxref} is:
 @smallexample
-$ gnatxref @ovar{switches} @var{sourcefile1} @r{[}@var{sourcefile2} @dots{}@r{]}
+@c $ gnatxref @ovar{switches} @var{sourcefile1} @r{[}@var{sourcefile2} @dots{}@r{]}
+@c Expanding @ovar macro inline (explanation in macro def comments)
+$ gnatxref @r{[}@var{switches}@r{]} @var{sourcefile1} @r{[}@var{sourcefile2} @dots{}@r{]}
 @end smallexample
 
 @noindent
@@ -15535,8 +15567,11 @@ you can say @samp{gnatxref ^-ag^/ALL_FILES/IGNORE_LOCALS^} instead of
 The command line for @code{gnatfind} is:
 
 @smallexample
-$ gnatfind @ovar{switches} @var{pattern}@r{[}:@var{sourcefile}@r{[}:@var{line}@r{[}:@var{column}@r{]]]}
-      @r{[}@var{file1} @var{file2} @dots{}]
+@c $ gnatfind @ovar{switches} @var{pattern}@r{[}:@var{sourcefile}@r{[}:@var{line}@r{[}:@var{column}@r{]]]}
+@c       @r{[}@var{file1} @var{file2} @dots{}]
+@c Expanding @ovar macro inline (explanation in macro def comments)
+$ gnatfind @r{[}@var{switches}@r{]} @var{pattern}@r{[}:@var{sourcefile}@r{[}:@var{line}@r{[}:@var{column}@r{]]]}
+      @r{[}@var{file1} @var{file2} @dots{}@r{]}
 @end smallexample
 
 @noindent
@@ -16122,7 +16157,9 @@ call @command{gnatpp} through the @command{gnat} driver
 The @command{gnatpp} command has the form
 
 @smallexample
-$ gnatpp @ovar{switches} @var{filename}
+@c $ gnatpp @ovar{switches} @var{filename}
+@c Expanding @ovar macro inline (explanation in macro def comments)
+$ gnatpp @r{[}@var{switches}@r{]} @var{filename}
 @end smallexample
 
 @noindent
@@ -17224,7 +17261,9 @@ through the @command{gnat} driver.
 The @command{gnatmetric} command has the form
 
 @smallexample
-$ gnatmetric @ovar{switches} @{@var{filename}@} @r{[}-cargs @var{gcc_switches}@r{]}
+@c $ gnatmetric @ovar{switches} @{@var{filename}@} @r{[}-cargs @var{gcc_switches}@r{]}
+@c Expanding @ovar macro inline (explanation in macro def comments)
+$ gnatmetric @r{[}@var{switches}@r{]} @{@var{filename}@} @r{[}-cargs @var{gcc_switches}@r{]}
 @end smallexample
 
 @noindent
@@ -18006,7 +18045,9 @@ The @code{gnatkr} command has the form
 
 @ifclear vms
 @smallexample
-$ gnatkr @var{name} @ovar{length}
+@c $ gnatkr @var{name} @ovar{length}
+@c Expanding @ovar macro inline (explanation in macro def comments)
+$ gnatkr @var{name} @r{[}@var{length}@r{]}
 @end smallexample
 @end ifclear
 
@@ -18194,7 +18235,9 @@ all characters need to be in the ASCII set (no accented letters).
 To call @code{gnatprep} use
 
 @smallexample
-$ gnatprep @ovar{switches} @var{infile} @var{outfile} @ovar{deffile}
+@c $ gnatprep @ovar{switches} @var{infile} @var{outfile} @ovar{deffile}
+@c Expanding @ovar macro inline (explanation in macro def comments)
+$ gnatprep @r{[}@var{switches}@r{]} @var{infile} @var{outfile} @r{[}@var{deffile}@r{]}
 @end smallexample
 
 @noindent
@@ -20170,7 +20213,9 @@ Solaris and Windows NT/2000/XP (x86).
 The @code{gnatmem} command has the form
 
 @smallexample
-   $ gnatmem @ovar{switches} user_program
+@c    $ gnatmem @ovar{switches} user_program
+@c Expanding @ovar macro inline (explanation in macro def comments)
+      $ gnatmem @r{[}@var{switches}@r{]} @var{user_program}
 @end smallexample
 
 @noindent
@@ -20698,7 +20743,11 @@ driver (see @ref{The GNAT Driver and Project Files}).
 Invoking @command{gnatcheck} on the command line has the form:
 
 @smallexample
-$ gnatcheck @ovar{switches}  @{@var{filename}@}
+@c $ gnatcheck @ovar{switches}  @{@var{filename}@}
+@c       @r{[}^-files^/FILES^=@{@var{arg_list_filename}@}@r{]}
+@c       @r{[}-cargs @var{gcc_switches}@r{]} -rules @var{rule_options}
+@c Expanding @ovar macro inline (explanation in macro def comments)
+$ gnatcheck @r{[}@var{switches}@r{]}  @{@var{filename}@}
       @r{[}^-files^/FILES^=@{@var{arg_list_filename}@}@r{]}
       @r{[}-cargs @var{gcc_switches}@r{]} -rules @var{rule_options}
 @end smallexample
@@ -23157,7 +23206,9 @@ option @option{^--no-exception^/NO_EXCEPTION^} (see below).
 @command{gnatstub} has the command-line interface of the form
 
 @smallexample
-$ gnatstub @ovar{switches} @var{filename} @ovar{directory}
+@c $ gnatstub @ovar{switches} @var{filename} @ovar{directory}
+@c Expanding @ovar macro inline (explanation in macro def comments)
+$ gnatstub @r{[}@var{switches}@r{]} @var{filename} @r{[}@var{directory}@r{]}
 @end smallexample
 
 @noindent
@@ -23689,7 +23740,9 @@ be able to click on any identifier and go to its declaration.
 
 The command line is as follow:
 @smallexample
-$ perl gnathtml.pl @ovar{^switches^options^} @var{ada-files}
+@c $ perl gnathtml.pl @ovar{^switches^options^} @var{ada-files}
+@c Expanding @ovar macro inline (explanation in macro def comments)
+$ perl gnathtml.pl @r{[}@var{^switches^options^}@r{]} @var{ada-files}
 @end smallexample
 
 @noindent
@@ -23795,7 +23848,9 @@ is. The syntax of this line is:
 Alternatively, you may run the script using the following command line:
 
 @smallexample
-$ perl gnathtml.pl @ovar{switches} @var{files}
+@c $ perl gnathtml.pl @ovar{switches} @var{files}
+@c Expanding @ovar macro inline (explanation in macro def comments)
+$ perl gnathtml.pl @r{[}@var{switches}@r{]} @var{files}
 @end smallexample
 
 @ifset vms
@@ -26919,6 +26974,7 @@ information about several specific platforms.
 * AIX-Specific Considerations::
 * Irix-Specific Considerations::
 * RTX-Specific Considerations::
+* HP-UX-Specific Considerations::
 @end menu
 
 @node Summary of Run-Time Configurations
@@ -27282,6 +27338,42 @@ over all Windows applications (@emph{rts-rtx-rtss}).
 
 @end itemize
 
+@node HP-UX-Specific Considerations
+@section HP-UX-Specific Considerations
+@cindex HP-UX Scheduling
+
+@noindent
+On HP-UX, appropriate privileges are required to change the scheduling
+parameters of a task. The calling process must have appropriate
+privileges or be a member of a group having @code{PRIV_RTSCHED} access to
+successfully change the scheduling parameters.
+
+By default, GNAT uses the @code{SCHED_HPUX} policy. To have access to the
+priority range 0-31 either the @code{FIFO_Within_Priorities} or the
+@code{Round_Robin_Within_Priorities} scheduling policies need to be set.
+
+To specify the @code{FIFO_Within_Priorities} scheduling policy you can use
+one of the following:
+
+@itemize @bullet
+@item
+@code{pragma Time_Slice (0.0)}
+@cindex pragma Time_Slice
+@item
+the corresponding binder option @option{-T0}
+@cindex @option{-T0} option
+@item
+@code{pragma Task_Dispatching_Policy (FIFO_Within_Priorities)}
+@cindex pragma Task_Dispatching_Policy
+@end itemize
+
+@noindent
+To specify the @code{Round_Robin_Within_Priorities}, scheduling policy
+you should use @code{pragma Time_Slice} with a
+value greater than @code{0.0}, or use the corresponding @option{-T}
+binder option, or set the @code{pragma Task_Dispatching_Policy
+(Round_Robin_Within_Priorities)}.
+
 @c *******************************
 @node Example of Binder Output File
 @appendix Example of Binder Output File
@@ -33270,7 +33362,9 @@ static import library for the DLL and the actual DLL. The form of the
 
 @smallexample
 @cartouche
-$ gnatdll @ovar{switches} @var{list-of-files} @r{[}-largs @var{opts}@r{]}
+@c $ gnatdll @ovar{switches} @var{list-of-files} @r{[}-largs @var{opts}@r{]}
+@c Expanding @ovar macro inline (explanation in macro def comments)
+$ gnatdll @r{[}@var{switches}@r{]} @var{list-of-files} @r{[}-largs @var{opts}@r{]}
 @end cartouche
 @end smallexample
 
@@ -33286,7 +33380,9 @@ missing, only the static import library is generated.
 You may specify any of the following switches to @code{gnatdll}:
 
 @table @code
-@item -a@ovar{address}
+@c @item -a@ovar{address}
+@c Expanding @ovar macro inline (explanation in macro def comments)
+@item -a@r{[}@var{address}@r{]}
 @cindex @option{-a} (@code{gnatdll})
 Build a non-relocatable DLL at @var{address}. If @var{address} is not
 specified the default address @var{0x11000000} will be used. By default,
@@ -33489,7 +33585,9 @@ common @code{dlltool} switches. The form of the @code{dlltool} command
 is
 
 @smallexample
-$ dlltool @ovar{switches}
+@c $ dlltool @ovar{switches}
+@c Expanding @ovar macro inline (explanation in macro def comments)
+$ dlltool @r{[}@var{switches}@r{]}
 @end smallexample
 
 @noindent
index 551bdf9..ad4928d 100644 (file)
@@ -214,12 +214,10 @@ nanosleep (struct timestruc_t *Rqtp, struct timestruc_t *Rmtp)
 
 #endif /* _AIXVERSION_430 */
 
-static void __gnat_error_handler (int sig, siginfo_t * si, void * uc);
-
 static void
 __gnat_error_handler (int sig,
-                     siginfo_t * si ATTRIBUTE_UNUSED,
-                     void * uc ATTRIBUTE_UNUSED)
+                     siginfo_t *si ATTRIBUTE_UNUSED,
+                     void *ucontext ATTRIBUTE_UNUSED)
 {
   struct Exception_Data *exception;
   const char *msg;
@@ -287,7 +285,6 @@ __gnat_install_handler (void)
 #include <signal.h>
 #include <sys/siginfo.h>
 
-static void __gnat_error_handler (int, siginfo_t *, struct sigcontext *);
 extern char *__gnat_get_code_loc (struct sigcontext *);
 extern void __gnat_set_code_loc (struct sigcontext *, char *);
 extern size_t __gnat_machine_state_length (void);
@@ -310,7 +307,7 @@ __gnat_adjust_context_for_raise (int signo, void *ucontext)
 }
 
 static void
-__gnat_error_handler (int sig, siginfo_t *sip, struct sigcontext *context)
+__gnat_error_handler (int sig, siginfo_t *si, void *ucontext)
 {
   struct Exception_Data *exception;
   static int recurse = 0;
@@ -318,10 +315,10 @@ __gnat_error_handler (int sig, siginfo_t *sip, struct sigcontext *context)
 
   /* Adjusting is required for every fault context, so adjust for this one
      now, before we possibly trigger a recursive fault below.  */
-  __gnat_adjust_context_for_raise (sig, context);
+  __gnat_adjust_context_for_raise (sig, ucontext);
 
   /* If this was an explicit signal from a "kill", just resignal it.  */
-  if (SI_FROMUSER (sip))
+  if (SI_FROMUSER (si))
     {
       signal (sig, SIG_DFL);
       kill (getpid(), sig);
@@ -338,8 +335,9 @@ __gnat_error_handler (int sig, siginfo_t *sip, struct sigcontext *context)
         ??? Using a static variable here isn't task-safe, but it's
         much too hard to do anything else and we're just determining
         which exception to raise.  */
-      if (sip->si_code == SEGV_ACCERR
-         || (((long) sip->si_addr) & 3) != 0
+      if (si->si_code == SEGV_ACCERR
+         || (long) si->si_addr == 0
+         || (((long) si->si_addr) & 3) != 0
          || recurse)
        {
          exception = &constraint_error;
@@ -353,9 +351,9 @@ __gnat_error_handler (int sig, siginfo_t *sip, struct sigcontext *context)
             the actual address, just to be on the same page.  */
          recurse++;
          ((volatile char *)
-          ((long) sip->si_addr & - getpagesize ()))[getpagesize ()];
-         msg = "stack overflow (or erroneous memory access)";
+          ((long) si->si_addr & - getpagesize ()))[getpagesize ()];
          exception = &storage_error;
+         msg = "stack overflow (or erroneous memory access)";
        }
       break;
 
@@ -438,13 +436,9 @@ __gnat_machine_state_length (void)
 #include <sys/ucontext.h>
 
 static void
-__gnat_error_handler (int sig, siginfo_t *siginfo, void *ucontext);
-
-static void
-__gnat_error_handler
-  (int sig,
-   siginfo_t *siginfo ATTRIBUTE_UNUSED,
-   void *ucontext ATTRIBUTE_UNUSED)
+__gnat_error_handler (int sig,
+                     siginfo_t *si ATTRIBUTE_UNUSED,
+                     void *ucontext ATTRIBUTE_UNUSED)
 {
   struct Exception_Data *exception;
   const char *msg;
@@ -570,8 +564,6 @@ void fake_linux_sigemptyset (sigset_t *set) {
 
 #endif
 
-static void __gnat_error_handler (int, siginfo_t *siginfo, void *ucontext);
-
 #if defined (i386) || defined (__x86_64__) || defined (__ia64__)
 
 #define HAVE_GNAT_ADJUST_CONTEXT_FOR_RAISE
@@ -581,11 +573,7 @@ __gnat_adjust_context_for_raise (int signo ATTRIBUTE_UNUSED, void *ucontext)
 {
   mcontext_t *mcontext = &((ucontext_t *) ucontext)->uc_mcontext;
 
-  /* On the i386 and x86-64 architectures, we specifically detect calls to
-     the null address and entirely fold the not-yet-fully-established frame
-     to prevent it from stopping the unwinding.
-
-     On the i386 and x86-64 architectures, stack checking is performed by
+  /* On the i386 and x86-64 architectures, stack checking is performed by
      means of probes with moving stack pointer, that is to say the probed
      address is always the value of the stack pointer.  Upon hitting the
      guard page, the stack pointer therefore points to an inaccessible
@@ -605,25 +593,13 @@ __gnat_adjust_context_for_raise (int signo ATTRIBUTE_UNUSED, void *ucontext)
 
 #if defined (i386)
   unsigned long *pc = (unsigned long *)mcontext->gregs[REG_EIP];
-  /* The call insn pushes the return address onto the stack.  Pop it.  */
-  if (pc == NULL)
-    {
-      mcontext->gregs[REG_EIP] = *(unsigned long *)mcontext->gregs[REG_ESP];
-      mcontext->gregs[REG_ESP] += 4;
-    }
   /* The pattern is "orl $0x0,(%esp)" for a probe in 32-bit mode.  */
-  else if (signo == SIGSEGV && *pc == 0x00240c83)
+  if (signo == SIGSEGV && pc && *pc == 0x00240c83)
     mcontext->gregs[REG_ESP] += 4096 + 4 * sizeof (unsigned long);
 #elif defined (__x86_64__)
   unsigned long *pc = (unsigned long *)mcontext->gregs[REG_RIP];
-  /* The call insn pushes the return address onto the stack.  Pop it.  */
-  if (pc == NULL)
-    {
-      mcontext->gregs[REG_RIP] = *(unsigned long *)mcontext->gregs[REG_RSP];
-      mcontext->gregs[REG_RSP] += 8;
-    }
   /* The pattern is "orq $0x0,(%rsp)" for a probe in 64-bit mode.  */
-  else if (signo == SIGSEGV && (*pc & 0xffffffffff) == 0x00240c8348)
+  if (signo == SIGSEGV && pc && (*pc & 0xffffffffff) == 0x00240c8348)
     mcontext->gregs[REG_RSP] += 4096 + 4 * sizeof (unsigned long);
 #elif defined (__ia64__)
   /* ??? The IA-64 unwinder doesn't compensate for signals.  */
@@ -634,12 +610,9 @@ __gnat_adjust_context_for_raise (int signo ATTRIBUTE_UNUSED, void *ucontext)
 #endif
 
 static void
-__gnat_error_handler (int sig,
-                      siginfo_t *siginfo ATTRIBUTE_UNUSED,
-                      void *ucontext)
+__gnat_error_handler (int sig, siginfo_t *si ATTRIBUTE_UNUSED, void *ucontext)
 {
   struct Exception_Data *exception;
-  static int recurse = 0;
   const char *msg;
 
   /* Adjusting is required for every fault context, so adjust for this one
@@ -649,42 +622,24 @@ __gnat_error_handler (int sig,
   switch (sig)
     {
     case SIGSEGV:
-      /* If the problem was permissions, this is a constraint error.
-       Likewise if the failing address isn't maximally aligned or if
-       we've recursed.
-
-       ??? Using a static variable here isn't task-safe, but it's
-       much too hard to do anything else and we're just determining
-       which exception to raise.  */
-      if (recurse)
-      {
-        exception = &constraint_error;
-        msg = "SIGSEGV";
-      }
-      else
-      {
-        /* Here we would like a discrimination test to see whether the
-           page before the faulting address is accessible. Unfortunately
-           Linux seems to have no way of giving us the faulting address.
+      /* Here we would like a discrimination test to see whether the page
+        before the faulting address is accessible.  Unfortunately, Linux
+        seems to have no way of giving us the faulting address.
 
-           In versions of a-init.c before 1.95, we had a test of the page
-           before the stack pointer using:
+        In old versions of init.c, we had a test of the page before the
+        stack pointer:
 
-            recurse++;
-             ((volatile char *)
-              ((long) info->esp_at_signal & - getpagesize ()))[getpagesize ()];
+          ((volatile char *)
+           ((long) si->esp_at_signal & - getpagesize ()))[getpagesize ()];
 
-           but that's wrong, since it tests the stack pointer location, and
-           the current stack probe code does not move the stack pointer
-           until all probes succeed.
+        but that's wrong since it tests the stack pointer location and the
+        stack probing code may not move it until all probes succeed.
 
-           For now we simply do not attempt any discrimination at all. Note
-           that this is quite acceptable, since a "real" SIGSEGV can only
-           occur as the result of an erroneous program.  */
-
-        msg = "stack overflow (or erroneous memory access)";
-        exception = &storage_error;
-      }
+        For now we simply do not attempt any discrimination at all. Note
+        that this is quite acceptable, since a "real" SIGSEGV can only
+        occur as the result of an erroneous program.  */
+      exception = &storage_error;
+      msg = "stack overflow (or erroneous memory access)";
       break;
 
     case SIGBUS:
@@ -702,7 +657,6 @@ __gnat_error_handler (int sig,
       msg = "unhandled signal";
     }
 
-  recurse = 0;
   Raise_From_Signal_Handler (exception, msg);
 }
 
@@ -800,8 +754,6 @@ extern int (*Check_Abort_Status) (void);
 
 extern struct Exception_Data _abort_signal;
 
-static void __gnat_error_handler (int, int, sigcontext_t *);
-
 /* We are not setting the SA_SIGINFO bit in the sigaction flags when
    connecting that handler, with the effects described in the sigaction
    man page:
@@ -1007,58 +959,13 @@ __gnat_install_handler(void)
 #define RETURN_ADDR_OFFSET 0
 #endif
 
-/* Likewise regarding how the "instruction pointer" register slot can
-   be identified in signal machine contexts.  We have either "REG_PC"
-   or "PC" at hand, depending on the target CPU and Solaris version.  */
-#if !defined (REG_PC)
-#define REG_PC PC
-#endif
-
-static void __gnat_error_handler (int, siginfo_t *, void *);
-
-#define HAVE_GNAT_ADJUST_CONTEXT_FOR_RAISE
-
-void
-__gnat_adjust_context_for_raise (int signo ATTRIBUTE_UNUSED, void *ucontext)
-{
-  mcontext_t *mcontext = &((ucontext_t *) ucontext)->uc_mcontext;
-  unsigned long *pc = (unsigned long *)mcontext->gregs[REG_PC];
-
-  /* We specifically detect calls to the null address and entirely fold
-     the not-yet-fully-established frame to prevent it from stopping the
-     unwinding.  */
-  if (pc == NULL)
-#if defined (__sparc)
-    /* The call insn moves the return address into %o7.  Move it back.  */
-    mcontext->gregs[REG_PC] = mcontext->gregs[REG_O7];
-#elif defined (i386)
-    {
-      /* The call insn pushes the return address onto the stack.  Pop it.  */
-      mcontext->gregs[REG_PC] = *(unsigned long *)mcontext->gregs[UESP];
-      mcontext->gregs[UESP] += 4;
-    }
-#elif defined (__x86_64__)
-    {
-      /* The call insn pushes the return address onto the stack.  Pop it.  */
-      mcontext->gregs[REG_PC] = *(unsigned long *)mcontext->gregs[REG_RSP];
-      mcontext->gregs[REG_RSP] += 8;
-    }
-#else
-#error architecture not supported on Solaris
-#endif
-}
-
 static void
-__gnat_error_handler (int sig, siginfo_t *sip, void *ucontext)
+__gnat_error_handler (int sig, siginfo_t *si, void *ucontext ATTRIBUTE_UNUSED)
 {
   struct Exception_Data *exception;
   static int recurse = 0;
   const char *msg;
 
-  /* Adjusting is required for every fault context, so adjust for this one
-     now, before we possibly trigger a recursive fault below.  */
-  __gnat_adjust_context_for_raise (sig, ucontext);
-
   switch (sig)
     {
     case SIGSEGV:
@@ -1069,9 +976,9 @@ __gnat_error_handler (int sig, siginfo_t *sip, void *ucontext)
         ??? Using a static variable here isn't task-safe, but it's
         much too hard to do anything else and we're just determining
         which exception to raise.  */
-      if (sip->si_code == SEGV_ACCERR
-         || (long) sip->si_addr == 0
-         || (((long) sip->si_addr) & 3) != 0
+      if (si->si_code == SEGV_ACCERR
+         || (long) si->si_addr == 0
+         || (((long) si->si_addr) & 3) != 0
          || recurse)
        {
          exception = &constraint_error;
@@ -1085,7 +992,7 @@ __gnat_error_handler (int sig, siginfo_t *sip, void *ucontext)
             the actual address, just to be on the same page.  */
          recurse++;
          ((volatile char *)
-          ((long) sip->si_addr & - getpagesize ()))[getpagesize ()];
+          ((long) si->si_addr & - getpagesize ()))[getpagesize ()];
          exception = &storage_error;
          msg = "stack overflow (or erroneous memory access)";
        }
@@ -1719,11 +1626,10 @@ void __gnat_set_features ()
 #include <sys/ucontext.h>
 #include <unistd.h>
 
-static void __gnat_error_handler (int, siginfo_t *, ucontext_t *);
-
 static void
-__gnat_error_handler (int sig, siginfo_t *info __attribute__ ((unused)),
-                     ucontext_t *ucontext)
+__gnat_error_handler (int sig,
+                     siginfo_t *si ATTRIBUTE_UNUSED,
+                     void *ucontext ATTRIBUTE_UNUSED)
 {
   struct Exception_Data *exception;
   const char *msg;
@@ -1939,8 +1845,9 @@ __gnat_map_signal (int sig)
    propagation after the required low level adjustments.  */
 
 void
-__gnat_error_handler (int sig, void * si ATTRIBUTE_UNUSED,
-                     struct sigcontext * sc)
+__gnat_error_handler (int sig,
+                     void *si ATTRIBUTE_UNUSED,
+                     struct sigcontext *sc ATTRIBUTE_UNUSED)
 {
   sigset_t mask;
 
@@ -2176,8 +2083,6 @@ __gnat_install_handler(void)
 /* This must be in keeping with System.OS_Interface.Alternate_Stack_Size.  */
 char __gnat_alternate_stack[32 * 1024]; /* 1 * MINSIGSTKSZ */
 
-static void __gnat_error_handler (int sig, siginfo_t * si, void * uc);
-
 /* Defined in xnu unix_signal.c.
    Tell the kernel to re-use alt stack when delivering a signal.  */
 #define        UC_RESET_ALT_STACK      0x80000000
@@ -2208,7 +2113,7 @@ __gnat_is_stack_guard (mach_vm_address_t addr)
 }
 
 static void
-__gnat_error_handler (int sig, siginfo_t * si, void * uc ATTRIBUTE_UNUSED)
+__gnat_error_handler (int sig, siginfo_t *si, void *ucontext ATTRIBUTE_UNUSED)
 {
   struct Exception_Data *exception;
   const char *msg;
index 6542dd2..fe95611 100644 (file)
@@ -1026,13 +1026,19 @@ package body Sem_Ch13 is
                   --  check till after code generation to take full advantage
                   --  of the annotation done by the back end. This entry is
                   --  only made if the address clause comes from source.
+                  --  If the entity has a generic type, the check will be
+                  --  performed in the instance if the actual type justfies it,
+                  --  and we do not insert the clause in the table to prevent
+                  --  spurious warnings.
 
                   if Address_Clause_Overlay_Warnings
                     and then Comes_From_Source (N)
                     and then Present (O_Ent)
                     and then Is_Object (O_Ent)
                   then
-                     Address_Clause_Checks.Append ((N, U_Ent, O_Ent, Off));
+                     if not Is_Generic_Type (Etype (U_Ent)) then
+                        Address_Clause_Checks.Append ((N, U_Ent, O_Ent, Off));
+                     end if;
 
                      --  If variable overlays a constant view, and we are
                      --  warning on overlays, then mark the variable as
index a25d1d6..6a909c8 100644 (file)
@@ -7162,11 +7162,11 @@ package body Sem_Ch8 is
                --  we compare the scope depth of its scope with that of the
                --  current instance. However, a generic actual of a subprogram
                --  instance is declared in the wrapper package but will not be
-               --  hidden by a use-visible entity. Similarly, a generic actual
-               --  will not be hidden by an entity declared in another generic
-               --  actual, which can only have been use-visible in the generic.
-               --  Is this condition complete, and can the following complex
-               --  test be simplified ???
+               --  hidden by a use-visible entity. similarly, an entity that is
+               --  declared in an enclosing instance will not be hidden by an
+               --  an entity declared in a generic actual, which can only have
+               --  been use-visible in the generic and will not have hidden the
+               --  entity in the generic parent.
 
                --  If Id is called Standard, the predefined package with the
                --  same name is in the homonym chain. It has to be ignored
@@ -7181,8 +7181,8 @@ package body Sem_Ch8 is
                  and then (Scope (Prev) /= Standard_Standard
                             or else Sloc (Prev) > Standard_Location)
                then
-                  if Ekind (Prev) = E_Package
-                    and then Present (Associated_Formal_Package (Prev))
+                  if In_Open_Scopes (Scope (Prev))
+                    and then Is_Generic_Instance (Scope (Prev))
                     and then Present (Associated_Formal_Package (P))
                   then
                      null;
index 54823e2..4f2a8ec 100644 (file)
@@ -2589,7 +2589,7 @@ package body Sem_Prag is
            and then Ekind (E) /= E_Variable
            and then not
              (Is_Access_Type (E)
-                and then Ekind (Designated_Type (E)) = E_Subprogram_Type)
+               and then Ekind (Designated_Type (E)) = E_Subprogram_Type)
          then
             Error_Pragma_Arg
               ("second argument of pragma% must be subprogram (type)",
@@ -2602,7 +2602,6 @@ package body Sem_Prag is
             Set_Convention_From_Pragma (E);
 
             if Is_Type (E) then
-
                Check_First_Subtype (Arg2);
                Set_Convention_From_Pragma (Base_Type (E));