Commit 47605312 by Eric Botcazou Committed by Eric Botcazou

decl.c (gnat_to_gnu_entity): Look at the underlying type for the signedness of the type.

	* gcc-interface/decl.c (gnat_to_gnu_entity) <E_Signed_Integer_Subtype>:
	Look at the underlying type for the signedness of the type.

From-SVN: r242361
parent c0c54de6
2016-11-13 Eric Botcazou <ebotcazou@adacore.com>
* gcc-interface/decl.c (gnat_to_gnu_entity) <E_Signed_Integer_Subtype>:
Look at the underlying type for the signedness of the type.
2016-11-13 Eric Botcazou <ebotcazou@adacore.com>
* gcc-interface/decl.c (annotate_value) <INTEGER_CST>: Deal specially
with negative constants.
......
......@@ -1836,7 +1836,7 @@ gnat_to_gnu_entity (Entity_Id gnat_entity, tree gnu_expr, bool definition)
&& esize == CHAR_TYPE_SIZE
&& flag_signed_char)
gnu_type = make_signed_type (CHAR_TYPE_SIZE);
else if (Is_Unsigned_Type (Etype (gnat_entity))
else if (Is_Unsigned_Type (Underlying_Type (Etype (gnat_entity)))
|| (Esize (Etype (gnat_entity)) != Esize (gnat_entity)
&& Is_Unsigned_Type (gnat_entity))
|| Has_Biased_Representation (gnat_entity))
......
2016-11-13 Eric Botcazou <ebotcazou@adacore.com>
* gnat.dg/address_conv.adb: New test.
2016-11-13 Eric Botcazou <ebotcazou@adacore.com>
* gnat.dg/renaming11.ad[sb]: New test.
2016-11-13 Eric Botcazou <ebotcazou@adacore.com>
......
-- { dg-do compile }
with System.Storage_Elements; use System.Storage_Elements;
procedure Address_Conv is
subtype My_Address is System.Address;
type Rec is record
A : My_Address;
end record;
Addr : constant My_Address := To_Address (16#FACEFACE#);
R : constant Rec := (A => Addr);
begin
null;
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