+2020-04-23 Jakub Jelinek <jakub@redhat.com>
+
+ PR middle-end/94724
+ * tree.c (get_narrower): Instead of creating COMPOUND_EXPRs
+ temporarily with non-final second operand and updating it later,
+ push COMPOUND_EXPRs into a vector and process it in reverse,
+ creating COMPOUND_EXPRs with the final operands.
+
2020-04-23 Szabolcs Nagy <szabolcs.nagy@arm.com>
PR target/94697
+2020-04-23 Jakub Jelinek <jakub@redhat.com>
+
+ PR middle-end/94724
+ * gcc.c-torture/execute/pr94724.c: New test.
+
2020-04-23 Thomas Koenig <tkoenig@gcc.gnu.org>
PR fortran/93956
* gfortran.dg/pointer_assign_13.f90: New test.
- 2020-04-23 Iain Sandoe <iain@sandoe.co.uk>
+2020-04-23 Iain Sandoe <iain@sandoe.co.uk>
* g++.dg/coroutines/coro-bad-alloc-00-bad-op-new.C: Adjust for
changed inline namespace.
if (TREE_CODE (op) == COMPOUND_EXPR)
{
- while (TREE_CODE (op) == COMPOUND_EXPR)
+ do
op = TREE_OPERAND (op, 1);
+ while (TREE_CODE (op) == COMPOUND_EXPR);
tree ret = get_narrower (op, unsignedp_ptr);
if (ret == op)
return win;
- op = win;
- for (tree *p = &win; TREE_CODE (op) == COMPOUND_EXPR;
- op = TREE_OPERAND (op, 1), p = &TREE_OPERAND (*p, 1))
- *p = build2_loc (EXPR_LOCATION (op), COMPOUND_EXPR,
- TREE_TYPE (ret), TREE_OPERAND (op, 0),
- ret);
- return win;
+ auto_vec <tree, 16> v;
+ unsigned int i;
+ for (tree op = win; TREE_CODE (op) == COMPOUND_EXPR;
+ op = TREE_OPERAND (op, 1))
+ v.safe_push (op);
+ FOR_EACH_VEC_ELT_REVERSE (v, i, op)
+ ret = build2_loc (EXPR_LOCATION (op), COMPOUND_EXPR,
+ TREE_TYPE (win), TREE_OPERAND (op, 0),
+ ret);
+ return ret;
}
while (TREE_CODE (op) == NOP_EXPR)
{