]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
[multiple changes]
authorArnaud Charlet <charlet@gcc.gnu.org>
Wed, 8 Apr 2009 13:59:47 +0000 (15:59 +0200)
committerArnaud Charlet <charlet@gcc.gnu.org>
Wed, 8 Apr 2009 13:59:47 +0000 (15:59 +0200)
2009-04-08  Robert Dewar  <dewar@adacore.com>

* ug_words: Add /ASSUME_VALID for -gnatB

* vms_data.ads: Add /ASSUME_VALID for -gnatB

* sem_cat.adb: Add clarifying commment

* a-direio.ads (Bytes): Make sure value is non-zero

2009-04-08  Ed Schonberg  <schonberg@adacore.com>

* sem_util.adb (Is_Variable): If the prefix is an explicit dereference
that does not come from source, check for a rewritten function call in
prefixed notation before other forms of rewriting.

2009-04-08  Robert Dewar  <dewar@adacore.com>

* Makefile.rtl: Remove s-strops and s-sopco? from the run time, since
these are now obsolescent units used only for bootrapping with an
older compiler.

From-SVN: r145733

gcc/ada/ChangeLog
gcc/ada/Makefile.rtl
gcc/ada/a-direio.ads
gcc/ada/sem_cat.adb
gcc/ada/sem_util.adb
gcc/ada/ug_words
gcc/ada/vms_data.ads

index b6d0aca4a093f3fbc2b1653d0c7c5dfd5ea426dc..d844d08cedb671804ac324d21ab934e3e057f57a 100644 (file)
@@ -1,3 +1,25 @@
+2009-04-08  Robert Dewar  <dewar@adacore.com>
+
+       * ug_words: Add /ASSUME_VALID for -gnatB
+
+       * vms_data.ads: Add /ASSUME_VALID for -gnatB
+
+       * sem_cat.adb: Add clarifying commment
+
+       * a-direio.ads (Bytes): Make sure value is non-zero
+
+2009-04-08  Ed Schonberg  <schonberg@adacore.com>
+
+       * sem_util.adb (Is_Variable): If the prefix is an explicit dereference
+       that does not come from source, check for a rewritten function call in
+       prefixed notation before other forms of rewriting.
+
+2009-04-08  Robert Dewar  <dewar@adacore.com>
+
+       * Makefile.rtl: Remove s-strops and s-sopco? from the run time, since
+       these are now obsolescent units used only for bootrapping with an
+       older compiler.
+
 2009-04-08  Robert Dewar  <dewar@adacore.com>
 
        * gnat_rm.texi: Add documentation for pragma Thread_Local_Storage
index fd32cfe68984db851fb7c90f6e6d80ebfd34c1d8..1a85461669cc2547c2f8c2fbed9e3d6b9b18ac10 100644 (file)
@@ -545,9 +545,6 @@ GNATRTL_NONTASKING_OBJS= \
   s-secsta$(objext) \
   s-sequio$(objext) \
   s-shasto$(objext) \
-  s-sopco3$(objext) \
-  s-sopco4$(objext) \
-  s-sopco5$(objext) \
   s-stache$(objext) \
   s-stausa$(objext) \
   s-stchop$(objext) \
@@ -555,7 +552,6 @@ GNATRTL_NONTASKING_OBJS= \
   s-stoele$(objext) \
   s-stopoo$(objext) \
   s-stratt$(objext) \
-  s-strops$(objext) \
   s-ststop$(objext) \
   s-soflin$(objext) \
   s-memory$(objext) \
index 70ff5ed3ca9a3642090323331d9ac49ba84e1cc6..544a31a98e5d44f8acf6e8973db227a443d7ac6b 100644 (file)
@@ -167,8 +167,12 @@ private
    type File_Type is new System.Direct_IO.File_Type;
 
    Bytes : constant Interfaces.C_Streams.size_t :=
-             Element_Type'Max_Size_In_Storage_Elements;
-   --  Size of an element in storage units
+             Interfaces.C_Streams.size_t'Max
+               (1, Element_Type'Max_Size_In_Storage_Elements);
+   --  Size of an element in storage units. The Max operation here is to ensure
+   --  that we allocate a single byte for zero-sized elements. It's a bit weird
+   --  to instantiate Direct_IO with zero sized elements, but it is legal and
+   --  this adjustment ensures that we don't get anomolous behavior.
 
    pragma Inline (Close);
    pragma Inline (Create);
index 273c04f81859e8ff4d2879e1c9553f61eaa5af1e..03461d169cd7970a5cb2a4cbdd822fcbfef4653d 100644 (file)
@@ -199,7 +199,7 @@ package body Sem_Cat is
       if With_Category > Unit_Category then
 
          --  Special case: Remote_Types and Remote_Call_Interface are allowed
-         --  to be with'ed in package body.
+         --  with anything in the package body, per (RM E.2(5)).
 
          if (Unit_Category = Remote_Types
                or else Unit_Category = Remote_Call_Interface)
index 7535808076fecb1038ad4070209535ae00a23784..9f43f2f731538227d3025a7208f3cf55811bb690 100644 (file)
@@ -6802,10 +6802,11 @@ package body Sem_Util is
         and then Present (Etype (Orig_Node))
         and then Is_Access_Type (Etype (Orig_Node))
       then
-         return Is_Variable_Prefix (Original_Node (Prefix (N)))
+         return
+           (Nkind (Orig_Node) = N_Function_Call
+             and then not Is_Access_Constant (Etype (Prefix (N))))
            or else
-             (Nkind (Orig_Node) = N_Function_Call
-               and then not Is_Access_Constant (Etype (Prefix (N))));
+             Is_Variable_Prefix (Original_Node (Prefix (N)));
 
       --  A function call is never a variable
 
index 532bf0ae5136d21aa72a800d61bd3ba568d097dd..eb490b203becccd857473391ecdae5501a5d9736 100644 (file)
@@ -52,6 +52,7 @@ gcc -c          ^ GNAT COMPILE
 -gnata          ^ /CHECKS=ASSERTIONS
 -gnatA          ^ /NO_GNAT_ADC
 -gnatb          ^ /REPORT_ERRORS=BRIEF
+-gnatB          ^ /ASSUME_VALID
 -gnatc          ^ /NOLOAD
 -gnatdc         ^ /TRACE_UNITS
 -gnatdO         ^ /REPORT_ERRORS=IMMEDIATE
index 6795a0a51101ed0ef3b7b9837d8e54083c2b82a6..6af3479b191be2c50338aea8126ae6315a99d643 100644 (file)
@@ -1228,6 +1228,17 @@ package VMS_Data is
    --   filetype, instead of the object file. This may be useful if you need
    --   to examine the generated assembly code.
 
+   S_GCC_AValid  : aliased constant S := "/ASSUME_VALID "                  &
+                                             "-gnatB";
+   --        /NO_ASSUME_VALID (D)
+   --        /ASSUME_VALID
+   --
+   --   Use to tell the compiler to assume that all objects have valid values
+   --   except those occurring as prefixes to 'Valid attributes. In the default
+   --   mode, the compiler assumes that values may be invalid unless it can
+   --   be sure that they are valid, and code is generated to allow for this
+   --   possibility. The use of /ASSUME_VALID will improve the code.
+
    S_GCC_Checks  : aliased constant S := "/CHECKS="                        &
                                              "FULL "                       &
                                                 "-gnato,!-gnatE,!-gnatp "  &
@@ -3346,6 +3357,7 @@ package VMS_Data is
                      S_GCC_Ada_05  'Access,
                      S_GCC_Add     'Access,
                      S_GCC_Asm     'Access,
+                     S_GCC_AValid  'Access,
                      S_GCC_Checks  'Access,
                      S_GCC_ChecksX 'Access,
                      S_GCC_Compres 'Access,