sem_res.adb (Resolve_Short_Circuit): Do not use expression-with-actions when generati...
authorArnaud Charlet <charlet@adacore.com>
Mon, 18 Apr 2016 12:41:08 +0000 (12:41 +0000)
committerArnaud Charlet <charlet@gcc.gnu.org>
Mon, 18 Apr 2016 12:41:08 +0000 (14:41 +0200)
2016-04-18  Arnaud Charlet  <charlet@adacore.com>

* sem_res.adb (Resolve_Short_Circuit): Do not use
expression-with-actions when generating C.

From-SVN: r235140

gcc/ada/ChangeLog
gcc/ada/sem_res.adb

index 0a3c479415c17c1e92a28d691d2a2f4828a92a1b..2c0a31da35d1da2d7a8f8fbb4a8177e8fe598014 100644 (file)
@@ -1,3 +1,8 @@
+2016-04-18  Arnaud Charlet  <charlet@adacore.com>
+
+       * sem_res.adb (Resolve_Short_Circuit): Do not use
+       expression-with-actions when generating C.
+
 2016-04-18  Yannick Moy  <moy@adacore.com>
 
        * sem_util.adb (Apply_Compile_Time_Constraint_Error): Do not generate
index 67807723a920a273ef825e690139882e4f237c61..0471b14b9a14c22d928783bf3048ab01d42b974a 100644 (file)
@@ -10044,9 +10044,11 @@ package body Sem_Res is
       --  finalization of transient controlled objects) are fully evaluated
       --  locally within an expression with actions. This is particularly
       --  helpful for coverage analysis. However this should not happen in
-      --  generics.
+      --  generics. Similarly, we want to minimize use of expression with
+      --  actions when generating C code, and finalization is not supported
+      --  in this mode anyway.
 
-      if Expander_Active then
+      if Expander_Active and not Generate_C_Code then
          declare
             Reloc_L : constant Node_Id := Relocate_Node (L);
          begin