OSDN Git Service

* decl.c (gnat_to_gnu_entity) <object>: Promote the alignment of
authorebotcazou <ebotcazou@138bc75d-0d04-0410-961f-82ee72b054a4>
Thu, 17 Apr 2008 12:45:53 +0000 (12:45 +0000)
committerebotcazou <ebotcazou@138bc75d-0d04-0410-961f-82ee72b054a4>
Thu, 17 Apr 2008 12:45:53 +0000 (12:45 +0000)
objects by default.
* fe.h (Debug_Flag_Dot_A): Delete.
* debug.adb (-gnatd.a): Update documentation.

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

gcc/ada/ChangeLog
gcc/ada/debug.adb
gcc/ada/decl.c
gcc/ada/fe.h
gcc/testsuite/ChangeLog
gcc/testsuite/gnat.dg/alignment4.adb [new file with mode: 0644]
gcc/testsuite/gnat.dg/alignment5.adb [new file with mode: 0644]
gcc/testsuite/gnat.dg/frame_overflow.adb

index e02847f..6bffe2a 100644 (file)
@@ -1,3 +1,10 @@
+2008-04-17  Eric Botcazou  <ebotcazou@adacore.com>
+
+       * decl.c (gnat_to_gnu_entity) <object>: Promote the alignment of
+       objects by default.
+       * fe.h (Debug_Flag_Dot_A): Delete.
+       * debug.adb (-gnatd.a): Update documentation.
+
 2008-04-17  Samuel Tardieu  <sam@rfc1149.net>
 
        * g-socket.ads, g-socket.adb (Get_Address): Make Stream a
index 94dc219..3a6be98 100644 (file)
@@ -93,7 +93,7 @@ package body Debug is
    --  dY   Enable configurable run-time mode
    --  dZ   Generate listing showing the contents of the dispatch tables
 
-   --  d.a  Enable alignment promotion for non-scalar stand-alone objects
+   --  d.a
    --  d.b
    --  d.c
    --  d.d
@@ -500,12 +500,6 @@ package body Debug is
    --         - In case of abstract subprograms the text "is abstract" is
    --           added at the end of the line.
 
-   --  d.a  Enable alignment promotion for non-VMS targets. On VMS, by default
-   --       (in Optimize_Alignment (Off) mode), the alignment of stand-alone
-   --       objects is increased in some cases to enable the generation of
-   --       better code. Use of this debug flag enables this transformation
-   --       on non-VMS targets.
-
    --  d.f  Suppress folding of static expressions. This of course results
    --       in seriously non-conforming behavior, but is useful sometimes
    --       when tracking down handling of complex expressions.
index 2b2ec68..d127ca7 100644 (file)
@@ -680,8 +680,7 @@ gnat_to_gnu_entity (Entity_Id gnat_entity, tree gnu_expr, int definition)
           size, or to the biggest meaningful one, whichever is smaller.  */
        if (!gnu_size && align == 0
            && (Is_Atomic (gnat_entity)
-               || (Debug_Flag_Dot_A
-                   && !Optimize_Alignment_Space (gnat_entity)
+               || (!Optimize_Alignment_Space (gnat_entity)
                    && kind == E_Variable
                    && AGGREGATE_TYPE_P (gnu_type)
                    && !const_flag && No (Renamed_Object (gnat_entity))
index 2a038d5..2e21af5 100644 (file)
@@ -47,10 +47,7 @@ extern char Fold_Lower[], Fold_Upper[];
 /* debug: */
 
 #define Debug_Flag_NN debug__debug_flag_nn
-#define Debug_Flag_Dot_A debug__debug_flag_dot_a
-
 extern Boolean Debug_Flag_NN;
-extern Boolean Debug_Flag_Dot_A;
 
 /* einfo: We will be setting Esize for types, Component_Bit_Offset for fields,
    Alignment for types and objects, Component_Size for array types, and
index 3723bcf..4b66c95 100644 (file)
@@ -1,3 +1,9 @@
+2008-04-17  Eric Botcazou  <ebotcazou@adacore.com>
+
+       * gnat.dg/alignment4.adb: New test.
+       * gnat.dg/alignment5.adb: Likewise.
+       * gnat.dg/frame_overflow.adb: Adjust.
+
 2008-04-17  Richard Guenther  <rguenther@suse.de>
 
        * gcc.dg/tree-ssa/ssa-fre-17.c: New testcase.
diff --git a/gcc/testsuite/gnat.dg/alignment4.adb b/gcc/testsuite/gnat.dg/alignment4.adb
new file mode 100644 (file)
index 0000000..ebc1053
--- /dev/null
@@ -0,0 +1,15 @@
+-- { dg-do compile }
+-- { dg-options "-gnatws -fdump-tree-gimple" }
+
+procedure Alignment4 is
+
+  type Stream is array (1..3) of Character;
+
+  S1, S2 : Stream;
+
+begin
+  S1 := S2;
+end;
+
+-- { dg-final { scan-tree-dump-not "VIEW_CONVERT_EXPR" "gimple" } }
+-- { dg-final { cleanup-tree-dump "gimple" } }
diff --git a/gcc/testsuite/gnat.dg/alignment5.adb b/gcc/testsuite/gnat.dg/alignment5.adb
new file mode 100644 (file)
index 0000000..4cc2d18
--- /dev/null
@@ -0,0 +1,31 @@
+-- { dg-do compile }
+-- { dg-options "-gnatws -fdump-tree-gimple" }
+
+procedure Alignment5 is
+
+   type MY_REC is
+     record
+       A1 : INTEGER range -3 .. 3 ; -- symmetric
+       A2 : BOOLEAN ;
+       A3 : INTEGER range 0 .. 15 ; -- positive
+       A4 : INTEGER range 10 .. 100 ; -- arbitrary
+       A5 : BOOLEAN ;  --5
+     end record ;
+
+   for MY_REC use
+     record
+       A1 at 0 range 0 .. 2 ;
+       A2 at 0 range 3 .. 3 ;
+       A3 at 0 range 4 .. 7 ;
+       A4 at 0 range 8 .. 15 ;
+       A5 at 0 range 16 .. 16 ;
+     end record ;
+
+   A_REC, B_REC : MY_REC;
+
+begin
+   A_REC := B_REC;
+end;
+
+-- { dg-final { scan-tree-dump-not "VIEW_CONVERT_EXPR" "gimple" } }
+-- { dg-final { cleanup-tree-dump "gimple" } }
index 286c93d..a20fdd7 100644 (file)
@@ -14,15 +14,14 @@ procedure frame_overflow is
    function -- { dg-error "too large" }
      Set_In (Bitmap : Bitmap_T; Bitpos : Bitpos_Range_T)  return Bitmap_T
    is
-      Result: Bitmap_T := Bitmap;
+      Result: Bitmap_T := Bitmap; -- { dg-error "Storage_Error" }
    begin
       Result.Bits (Bitpos) := True;
       return Result;
    end;
 
-   function -- { dg-error "too large" }
-     Negate (Bitmap : Bitmap_T) return Bitmap_T is
-      Result: Bitmap_T;
+   function Negate (Bitmap : Bitmap_T) return Bitmap_T is
+      Result: Bitmap_T; -- { dg-error "Storage_Error" }
    begin
       for E in Bitpos_Range_T loop
         Result.Bits (E) := not Bitmap.Bits (E);