+2014-11-12 Richard Biener <rguenther@suse.de>
+
+ * genmatch.c (capture_info::capture_info): Add missing
+ COND_EXPR handling.
+ (capture_info::walk_match): Fix COND_EXPR handling.
+ (capture_info::walk_result): Likewise.
+
2014-11-12 Richard Biener <rguenther@suse.de>
PR middle-end/63821
info.safe_grow_cleared (s->capture_max + 1);
e = as_a <expr *> (s->match);
for (unsigned i = 0; i < e->ops.length (); ++i)
- walk_match (e->ops[i], i, false);
+ walk_match (e->ops[i], i,
+ (i != 0 && *e->operation == COND_EXPR)
+ || *e->operation == TRUTH_ANDIF_EXPR
+ || *e->operation == TRUTH_ORIF_EXPR);
walk_result (s->result, false);
for (unsigned i = 0; i < e->ops.length (); ++i)
{
bool cond_p = conditional_p;
- if (i == 0
- && *e->operation == COND_EXPR)
+ if (i != 0 && *e->operation == COND_EXPR)
cond_p = true;
else if (*e->operation == TRUTH_ANDIF_EXPR
|| *e->operation == TRUTH_ORIF_EXPR)
for (unsigned i = 0; i < e->ops.length (); ++i)
{
bool cond_p = conditional_p;
- if (i == 0
- && *e->operation == COND_EXPR)
+ if (i != 0 && *e->operation == COND_EXPR)
cond_p = true;
else if (*e->operation == TRUTH_ANDIF_EXPR
|| *e->operation == TRUTH_ORIF_EXPR)