aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorEric Botcazou <ebotcazou@adacore.com>2008-04-17 12:45:53 +0000
committerEric Botcazou <ebotcazou@gcc.gnu.org>2008-04-17 12:45:53 +0000
commit90d6701ef8efaf2371bfa87ca70aee9ea69a9604 (patch)
tree8ad885a75002d1b5d7a2f81eda6351af2bba7848 /gcc
parente6477eaa4d5524e7d05975188e27e7b1a148df3b (diff)
downloadgcc-90d6701ef8efaf2371bfa87ca70aee9ea69a9604.zip
gcc-90d6701ef8efaf2371bfa87ca70aee9ea69a9604.tar.gz
gcc-90d6701ef8efaf2371bfa87ca70aee9ea69a9604.tar.bz2
decl.c (gnat_to_gnu_entity): Promote the alignment of objects by default.
* 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. From-SVN: r134390
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ada/ChangeLog7
-rw-r--r--gcc/ada/debug.adb8
-rw-r--r--gcc/ada/decl.c3
-rw-r--r--gcc/ada/fe.h3
-rw-r--r--gcc/testsuite/ChangeLog6
-rw-r--r--gcc/testsuite/gnat.dg/alignment4.adb15
-rw-r--r--gcc/testsuite/gnat.dg/alignment5.adb31
-rw-r--r--gcc/testsuite/gnat.dg/frame_overflow.adb7
8 files changed, 64 insertions, 16 deletions
diff --git a/gcc/ada/ChangeLog b/gcc/ada/ChangeLog
index e02847f..6bffe2a 100644
--- a/gcc/ada/ChangeLog
+++ b/gcc/ada/ChangeLog
@@ -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
diff --git a/gcc/ada/debug.adb b/gcc/ada/debug.adb
index 94dc219..3a6be98 100644
--- a/gcc/ada/debug.adb
+++ b/gcc/ada/debug.adb
@@ -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.
diff --git a/gcc/ada/decl.c b/gcc/ada/decl.c
index 2b2ec68..d127ca7 100644
--- a/gcc/ada/decl.c
+++ b/gcc/ada/decl.c
@@ -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))
diff --git a/gcc/ada/fe.h b/gcc/ada/fe.h
index 2a038d5..2e21af5 100644
--- a/gcc/ada/fe.h
+++ b/gcc/ada/fe.h
@@ -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
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index 3723bcf..4b66c95 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -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
index 0000000..ebc1053
--- /dev/null
+++ b/gcc/testsuite/gnat.dg/alignment4.adb
@@ -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
index 0000000..4cc2d18
--- /dev/null
+++ b/gcc/testsuite/gnat.dg/alignment5.adb
@@ -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" } }
diff --git a/gcc/testsuite/gnat.dg/frame_overflow.adb b/gcc/testsuite/gnat.dg/frame_overflow.adb
index 286c93d..a20fdd7 100644
--- a/gcc/testsuite/gnat.dg/frame_overflow.adb
+++ b/gcc/testsuite/gnat.dg/frame_overflow.adb
@@ -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);