diff options
author | Eric Botcazou <ebotcazou@adacore.com> | 2016-11-13 18:29:45 +0000 |
---|---|---|
committer | Eric Botcazou <ebotcazou@gcc.gnu.org> | 2016-11-13 18:29:45 +0000 |
commit | 476053121ba5fc4840146ef05a89636f5d37178c (patch) | |
tree | e7d03bb4d03b470483c5605caecb4e3580a3c7cf | |
parent | c0c54de6a09b8b280f2b3091f0e2c0894eb6f9d8 (diff) | |
download | gcc-476053121ba5fc4840146ef05a89636f5d37178c.zip gcc-476053121ba5fc4840146ef05a89636f5d37178c.tar.gz gcc-476053121ba5fc4840146ef05a89636f5d37178c.tar.bz2 |
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
-rw-r--r-- | gcc/ada/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/ada/gcc-interface/decl.c | 2 | ||||
-rw-r--r-- | gcc/testsuite/ChangeLog | 4 | ||||
-rw-r--r-- | gcc/testsuite/gnat.dg/address_conv.adb | 19 |
4 files changed, 29 insertions, 1 deletions
diff --git a/gcc/ada/ChangeLog b/gcc/ada/ChangeLog index b3ac97c..695518d 100644 --- a/gcc/ada/ChangeLog +++ b/gcc/ada/ChangeLog @@ -1,5 +1,10 @@ 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. diff --git a/gcc/ada/gcc-interface/decl.c b/gcc/ada/gcc-interface/decl.c index b6fce3e..c023e31 100644 --- a/gcc/ada/gcc-interface/decl.c +++ b/gcc/ada/gcc-interface/decl.c @@ -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)) diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index a273920..0ae7b97 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,5 +1,9 @@ 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> diff --git a/gcc/testsuite/gnat.dg/address_conv.adb b/gcc/testsuite/gnat.dg/address_conv.adb new file mode 100644 index 0000000..27b3dad --- /dev/null +++ b/gcc/testsuite/gnat.dg/address_conv.adb @@ -0,0 +1,19 @@ +-- { 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; |