utils2.c (gnat_rewrite_reference): Add another acceptable pattern for the RHS.
authorEric Botcazou <ebotcazou@adacore.com>
Mon, 14 Sep 2015 07:05:51 +0000 (07:05 +0000)
committerEric Botcazou <ebotcazou@gcc.gnu.org>
Mon, 14 Sep 2015 07:05:51 +0000 (07:05 +0000)
* gcc-interface/utils2.c (gnat_rewrite_reference) <COMPOUND_EXPR>: Add
another acceptable pattern for the RHS.

From-SVN: r227735

gcc/ada/ChangeLog
gcc/ada/gcc-interface/utils2.c

index 60a7e692d370410c66057814131bdc616a62b9fd..e8276a4b76cfd2cf95be6cca73857b33b456ffec 100644 (file)
@@ -1,3 +1,8 @@
+2015-09-14  Eric Botcazou  <ebotcazou@adacore.com>
+
+       * gcc-interface/utils2.c (gnat_rewrite_reference) <COMPOUND_EXPR>: Add
+       another acceptable pattern for the RHS.
+
 2015-07-24  Micahel Darling  <darlingm@gmail.com>
 
        PR other/66259
index 6a998d3ada909407ecc9aaa5df1e2cd61851a3e5..e5c685bd08ec6d1725f4f5c6bc64d9a271eea80f 100644 (file)
@@ -2807,7 +2807,9 @@ gnat_rewrite_reference (tree ref, rewrite_fn func, void *data, tree *init)
       gcc_assert (*init == NULL_TREE);
       *init = TREE_OPERAND (ref, 0);
       /* We expect only the pattern built in Call_to_gnu.  */
-      gcc_assert (DECL_P (TREE_OPERAND (ref, 1)));
+      gcc_assert (DECL_P (TREE_OPERAND (ref, 1))
+                 || (TREE_CODE (TREE_OPERAND (ref, 1)) == COMPONENT_REF
+                     && DECL_P (TREE_OPERAND (TREE_OPERAND (ref, 1), 0))));
       return TREE_OPERAND (ref, 1);
 
     case CALL_EXPR: