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
This commit is contained in:
Eric Botcazou 2008-04-17 12:45:53 +00:00 committed by Eric Botcazou
parent e6477eaa4d
commit 90d6701ef8
8 changed files with 64 additions and 16 deletions

View 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

View 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.

View 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))

View 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

View 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.

View File

@ -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" } }

View File

@ -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" } }

View 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);