utils.c (can_materialize_object_renaming_p): Synchronize with GNAT's Exp_Dbug.Debug_Renaming_Declaration...

* gcc-interface/utils.c (can_materialize_object_renaming_p):
	Synchronize with GNAT's Exp_Dbug.Debug_Renaming_Declaration:
	process Original_Node instead of expanded names.

From-SVN: r248054
This commit is contained in:
Pierre-Marie de Rodat 2017-05-15 08:58:56 +00:00 committed by Eric Botcazou
parent 13b6b77304
commit 0d5a0a33cd
4 changed files with 41 additions and 1 deletions

View File

@ -1,3 +1,9 @@
2017-05-15 Pierre-Marie de Rodat <derodat@adacore.com>
* gcc-interface/utils.c (can_materialize_object_renaming_p):
Synchronize with GNAT's Exp_Dbug.Debug_Renaming_Declaration:
process Original_Node instead of expanded names.
2017-05-15 Eric Botcazou <ebotcazou@adacore.com>
* gcc-interface/trans.c (return_value_ok_for_nrv_p): Only apply the

View File

@ -5431,11 +5431,16 @@ can_materialize_object_renaming_p (Node_Id expr)
{
while (true)
{
expr = Original_Node (expr);
switch Nkind (expr)
{
case N_Identifier:
case N_Expanded_Name:
return true;
if (!Present (Renamed_Object (Entity (expr))))
return true;
expr = Renamed_Object (Entity (expr));
break;
case N_Selected_Component:
{

View File

@ -1,3 +1,7 @@
2017-05-15 Pierre-Marie de Rodat <derodat@adacore.com>
* gnat.dg/specs/pack13.ads: New test.
2017-05-14 Martin Sebor <msebor@redhat.com>
PR middle-end/77671

View File

@ -0,0 +1,25 @@
-- { dg-do compile }
package Pack13 is
generic
type Value_Type is private;
Value : in out Value_Type;
package G is end G;
type Rec is record
B : Boolean;
end record;
for Rec use record
B at 0 range 8 .. 8;
end record;
for Rec'size use 9;
type Arr is array (Boolean) of Rec;
pragma Pack (Arr);
A : Arr;
package My_G is new G (Boolean, A(True).B);
end Pack13;