On Wed, Mar 28, 2012 at 4:53 PM, Eric Botcazou <ebotca...@adacore.com> wrote:
> Hi,
>
> another kind of bit fields supported in Ada are floating-point bit fields.
> They work fine, except that varasm.c rejects static constants (CONSTRUCTORs)
> containing them.  The attached patch plugs this hole.
>
> Tested on x86_64-suse-linux, OK for mainline?

You should be able to use fold_unary instead of fold_build1.  make_signed_type
should also not be used, but build_nonstandard_integer_type (or even
better, get an integer mode of the same size of the float mode and then use
type_for_mode).

Thanks,
Richard.

> 2012-03-28  Eric Botcazou  <ebotca...@adacore.com>
>
>        * varasm.c (initializer_constant_valid_for_bitfield_p): Return true
>        for REAL_CST as well.
>        (output_constructor): Use RECORD_OR_UNION_TYPE_P predicate.
>        In the bitfield case, if the value is a REAL_CST, convert it first to
>        an INTEGER_CST.
>
>
> 2012-03-28  Eric Botcazou  <ebotca...@adacore.com>
>
>        * gnat.dg/specs/aggr5.ads: New test.
>
>
> --
> Eric Botcazou

Reply via email to