The assertion should accept all constructs built by Call_to_gnu.
Tested on x86_64-suse-linux, applied on the mainline.
2015-09-14 Eric Botcazou <ebotca...@adacore.com>
* gcc-interface/utils2.c (gnat_rewrite_reference) <COMPOUND_EXPR>: Add
another acceptable pattern for the RHS.
--
Eric Botcazou
Index: gcc-interface/utils2.c
===================================================================
--- gcc-interface/utils2.c (revision 227729)
+++ gcc-interface/utils2.c (working copy)
@@ -2807,7 +2807,9 @@ gnat_rewrite_reference (tree ref, rewrit
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: