Commit d9e161ce by Eric Botcazou Committed by Eric Botcazou

decl.c (make_packable_type): If the new type has been given BLKmode, try again…

decl.c (make_packable_type): If the new type has been given BLKmode, try again to get an integral mode for it.

	* decl.c (make_packable_type): If the new type has been given BLKmode,
	try again to get an integral mode for it.

From-SVN: r128266
parent dab12601
2007-09-08 Eric Botcazou <ebotcazou@adacore.com>
* decl.c (make_packable_type): If the new type has been given BLKmode,
try again to get an integral mode for it.
2007-09-07 Eric Botcazou <ebotcazou@adacore.com>
Re-apply accidentally reverted change:
......@@ -5218,6 +5218,13 @@ make_packable_type (tree type)
finish_record_type (new_type, nreverse (field_list), 1, true);
copy_alias_set (new_type, type);
/* Try harder to get a packable type if necessary, for example
in case the record itself contains a BLKmode field. */
if (TYPE_MODE (new_type) == BLKmode)
TYPE_MODE (new_type)
= mode_for_size_tree (TYPE_SIZE (new_type), MODE_INT, 1);
return TYPE_MODE (new_type) == BLKmode ? type : new_type;
}
......
2007-09-08 Eric Botcazou <ebotcazou@adacore.com>
* gnat.dg/unaligned_rep_clause.adb: New testcase.
2007-09-08 Dorit Nuzman <dorit@il.ibm.com>
PR tree-optimization/33301
procedure Unaligned_Rep_Clause is
type One_Bit_Record is
record
B : Boolean;
end record;
Pragma Pack(One_Bit_Record);
subtype Version_Number_Type is String (1 .. 3);
type Inter is
record
Version : Version_Number_Type;
end record;
type Msg_Type is
record
Status : One_Bit_Record;
Version : Inter;
end record;
for Msg_Type use
record
Status at 0 range 0 .. 0;
Version at 0 range 1 .. 24;
end record;
for Msg_Type'Size use 25;
Data : Msg_Type;
Pragma Warnings (Off, Data);
Version : Inter;
begin
Version := Data.Version;
end;
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment