exp_smem.adb, [...]: Remove OK_For_Stream flag, not used, not needed.
authorRobert Dewar <dewar@adacore.com>
Tue, 15 Mar 2005 16:01:34 +0000 (17:01 +0100)
committerArnaud Charlet <charlet@gcc.gnu.org>
Tue, 15 Mar 2005 16:01:34 +0000 (17:01 +0100)
2005-03-08  Robert Dewar  <dewar@adacore.com>

* exp_smem.adb, sem_attr.adb: Remove OK_For_Stream flag, not used,
not needed.
Add documentation to replace the use of this flag
Fix kludge for Maximum_Alignment on x86 so that it does not apply to
the x86_64.

From-SVN: r96496

gcc/ada/exp_smem.adb
gcc/ada/sem_attr.adb

index 65ed01e4a57efb1ca2bf4d98f281ef9b31197b55..6898cbea35435b9c1f688942f1d53e5c5bb634c8 100644 (file)
@@ -6,7 +6,7 @@
 --                                                                          --
 --                                 B o d y                                  --
 --                                                                          --
---          Copyright (C) 1998-2000 Free Software Foundation, Inc.          --
+--          Copyright (C) 1998-2005 Free Software Foundation, Inc.          --
 --                                                                          --
 -- GNAT is free software;  you can  redistribute it  and/or modify it under --
 -- terms of the  GNU General Public License as published  by the Free Soft- --
@@ -344,8 +344,6 @@ package body Exp_Smem is
             New_Reference_To (S, Loc),
             New_Occurrence_Of (Ent, Loc)));
 
-      Set_OK_For_Stream (Atr, True);
-
       Insert_After_And_Analyze (N,
         Make_Subprogram_Body (Loc,
           Specification =>
@@ -408,8 +406,6 @@ package body Exp_Smem is
             New_Reference_To (S, Loc),
             New_Occurrence_Of (Ent, Loc)));
 
-      Set_OK_For_Stream (Atr, True);
-
       Insert_After_And_Analyze (N,
         Make_Subprogram_Body (Loc,
           Specification =>
index 8780f6b08f8dafe44335be07b1eb76900e2a5fe5..a3911138a0bac403a01d80815ad0ad8e6cf5f700 100644 (file)
@@ -1244,7 +1244,8 @@ package body Sem_Attr is
          Btyp := Implementation_Base_Type (P_Type);
 
          --  Stream attributes not allowed on limited types unless the
-         --  special OK_For_Stream flag is set.
+         --  stream attribute was generated by the expander (in which
+         --  case the underlying type will be used, as described in Sinfo).
 
          if Is_Limited_Type (P_Type)
            and then Comes_From_Source (N)
@@ -1460,10 +1461,14 @@ package body Sem_Attr is
                --  There is no clean way to check this. That's not surprising,
                --  the front end should not be doing this kind of test ???. The
                --  way we do it is test for either "86" or "pentium" being in
-               --  the string for the target name.
+               --  the string for the target name. However, we need to exclude
+               --  x86_64 for this check.
 
                for J in T'First .. T'Last - 1 loop
-                  if T (J .. J + 1) = "86"
+                  if (T (J .. J + 1) = "86"
+                      and then
+                        (J + 4 > T'Last
+                           or else T (J + 2 .. J + 4) /= "_64"))
                     or else (J <= T'Last - 6
                                and then T (J .. J + 6) = "pentium")
                   then