utils2.c (gnat_stabilize_reference): Fix thinko.
authorEric Botcazou <ebotcazou@adacore.com>
Mon, 6 Jun 2011 10:32:11 +0000 (10:32 +0000)
committerEric Botcazou <ebotcazou@gcc.gnu.org>
Mon, 6 Jun 2011 10:32:11 +0000 (10:32 +0000)
* gcc-interface/utils2.c (gnat_stabilize_reference) <COMPOUND_EXPR>:
Fix thinko.

From-SVN: r174690

gcc/ada/ChangeLog
gcc/ada/gcc-interface/utils2.c
gcc/testsuite/ChangeLog
gcc/testsuite/gnat.dg/specs/cond_expr1.ads [new file with mode: 0644]

index 6587ffd..ac77086 100644 (file)
@@ -1,5 +1,10 @@
 2011-06-06  Eric Botcazou  <ebotcazou@adacore.com>
 
+       * gcc-interface/utils2.c (gnat_stabilize_reference) <COMPOUND_EXPR>:
+       Fix thinko.
+
+2011-06-06  Eric Botcazou  <ebotcazou@adacore.com>
+
        * gcc-interface/trans.c (Identifier_to_gnu): Also handle deferred
        constants whose full view has discriminants specially.
 
index db19032..2a455d1 100644 (file)
@@ -2518,8 +2518,8 @@ gnat_stabilize_reference (tree ref, bool force, bool *success)
       result = build2 (COMPOUND_EXPR, type,
                       gnat_stabilize_reference (TREE_OPERAND (ref, 0), force,
                                                 success),
-                      gnat_stabilize_reference_1 (TREE_OPERAND (ref, 1),
-                                                  force));
+                      gnat_stabilize_reference (TREE_OPERAND (ref, 1), force,
+                                                success));
       break;
 
     case CONSTRUCTOR:
index 131da5e..1e904e6 100644 (file)
@@ -1,5 +1,9 @@
 2011-06-06  Eric Botcazou  <ebotcazou@adacore.com>
 
+       * gnat.dg/specs/cond_expr1.ads: New test.
+
+2011-06-06  Eric Botcazou  <ebotcazou@adacore.com>
+
        * gnat.dg/deferred_const4.ad[sb]: New test.
        * gnat.dg/deferred_const4_pkg.ads: New helper.
 
diff --git a/gcc/testsuite/gnat.dg/specs/cond_expr1.ads b/gcc/testsuite/gnat.dg/specs/cond_expr1.ads
new file mode 100644 (file)
index 0000000..01d76d0
--- /dev/null
@@ -0,0 +1,9 @@
+-- { dg-do compile }
+-- { dg-options "-gnat12 -gnato" }
+
+package Cond_Expr1 is
+
+   function Tail (S : String) return String is
+     (if S'Last <= S'First then "" else S (S'First + 1 .. S'Last));
+
+end Cond_Expr1;