> But it's only ever computed for RECORD_TYPEs where DECL_QUALIFIER is
> unused.
OK, that could work indeed.
> For now giving up seems to be easiest (just give up when
> DECL_FIELD_OFFSET is not equal for all of the bitfield members).
> That will at most get you the miscompiles for the PRs back, for
> languages with funny structure layout.
I have another variant of the DECL_FIELD_OFFSET problem:
FAIL: gnat.dg/specs/pack8.ads (test for excess errors)
Excess errors:
+===========================GNAT BUG DETECTED==============================+
| 4.8.0 20120314 (experimental) [trunk revision 185395] (i586-suse-linux) GCC
error:|
| in finish_bitfield_representative, at stor-layout.c:1762 |
| Error detected at pack8.ads:17:4
Testcase attached:
gnat.dg/specs/pack8.ads
gnat.dg/specs/pack8_pkg.ads
I agree that giving up (for now) is a sensible option. Thanks.
--
Eric Botcazou
with Pack8_Pkg;
package Pack8 is
subtype Index_Type is Integer range 1 .. Pack8_Pkg.N;
subtype Str is String( Index_Type);
subtype Str2 is String (1 .. 11);
type Rec is record
S1 : Str;
S2 : Str;
B : Boolean;
S3 : Str2;
end record;
pragma Pack (Rec);
end Pack8;
package Pack8_Pkg is
N : Natural := 1;
end Pack8_Pkg;