Commit 3b9c1abd by Eric Botcazou Committed by Eric Botcazou

decl.c (gnat_to_gnu_entity): Really strip only useless conversions around renamed objects.

	* gcc-interface/decl.c (gnat_to_gnu_entity) <object>: Really strip
	only useless conversions around renamed objects.

From-SVN: r143303
parent 406c72ce
2009-01-12 Eric Botcazou <ebotcazou@adacore.com>
* gcc-interface/decl.c (gnat_to_gnu_entity) <object>: Really strip
only useless conversions around renamed objects.
2009-01-11 Eric Botcazou <ebotcazou@adacore.com>
* gcc-interface/decl.c (gnat_to_gnu_entity) <E_Record_Subtype>: Put
......@@ -843,7 +843,10 @@ gnat_to_gnu_entity (Entity_Id gnat_entity, tree gnu_expr, int definition)
== RECORD_TYPE
&& TYPE_IS_PADDING_P (TREE_TYPE (TREE_OPERAND (gnu_expr, 0))))
/* Strip useless conversions around the object. */
|| TREE_CODE (gnu_expr) == NOP_EXPR)
|| (TREE_CODE (gnu_expr) == NOP_EXPR
&& gnat_types_compatible_p
(TREE_TYPE (gnu_expr),
TREE_TYPE (TREE_OPERAND (gnu_expr, 0)))))
{
gnu_expr = TREE_OPERAND (gnu_expr, 0);
gnu_type = TREE_TYPE (gnu_expr);
......
2009-01-12 Eric Botcazou <ebotcazou@adacore.com>
* gnat.dg/unchecked_convert3.adb: New test.
2009-01-12 Jakub Jelinek <jakub@redhat.com>
PR c++/38794
......
-- { dg-do run }
-- { dg-options "-gnatVa" }
with Unchecked_Conversion;
procedure Unchecked_Convert3 is
type Word is range -(2**15) .. (2**15) - 1;
type UWord is mod (2**16);
function To_Word is new unchecked_conversion (UWord, Word);
function F return UWord is
begin
return 65036;
end;
W : Word := To_Word(F);
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