]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
exp_ch7.adb (Wrap_Transient_Expression): Add missing adjustment of SCIL node.
authorJavier Miranda <miranda@adacore.com>
Fri, 7 Aug 2009 09:58:18 +0000 (09:58 +0000)
committerArnaud Charlet <charlet@gcc.gnu.org>
Fri, 7 Aug 2009 09:58:18 +0000 (11:58 +0200)
2009-08-07  Javier Miranda  <miranda@adacore.com>

* exp_ch7.adb (Wrap_Transient_Expression): Add missing adjustment of
SCIL node.

From-SVN: r150565

gcc/ada/ChangeLog
gcc/ada/exp_ch7.adb

index 0a1e0e20d026bd3144243018045950ddb9e43dc8..87b5356ec2bc2309bf979060643be8bed0748c24 100644 (file)
@@ -1,3 +1,8 @@
+2009-08-07  Javier Miranda  <miranda@adacore.com>
+
+       * exp_ch7.adb (Wrap_Transient_Expression): Add missing adjustment of
+       SCIL node.
+
 2009-08-07  Robert Dewar  <dewar@adacore.com>
 
        * sem_warn.adb (Warn_On_Unreferenced_Entity): Fix obvious typo.
index 3e8fc6a7d7a7c0908d0ba615d90138b262a57cc3..a4f6a66fd9ba471b8a104afdfa66e9aa42dcd179 100644 (file)
@@ -3554,8 +3554,18 @@ package body Exp_Ch7 is
       Loc  : constant Source_Ptr := Sloc (N);
       E    : constant Entity_Id  := Make_Temporary (Loc, 'E', N);
       Etyp : constant Entity_Id  := Etype (N);
+      Expr : constant Node_Id    := Relocate_Node (N);
 
    begin
+      --  If the relocated node is a function call then check if some SCIL
+      --  node references it and needs readjustment.
+
+      if Generate_SCIL
+        and then Nkind (N) = N_Function_Call
+      then
+         Adjust_SCIL_Node (N, Expr);
+      end if;
+
       Insert_Actions (N, New_List (
         Make_Object_Declaration (Loc,
           Defining_Identifier => E,
@@ -3565,7 +3575,7 @@ package body Exp_Ch7 is
           Action =>
             Make_Assignment_Statement (Loc,
               Name       => New_Reference_To (E, Loc),
-              Expression => Relocate_Node (N)))));
+              Expression => Expr))));
 
       Rewrite (N, New_Reference_To (E, Loc));
       Analyze_And_Resolve (N, Etyp);