aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorRichard Biener <rguenther@suse.de>2014-11-12 11:59:40 +0000
committerRichard Biener <rguenth@gcc.gnu.org>2014-11-12 11:59:40 +0000
commit6a3cbe90926bbe62fcbce85dc735cbf077fd0f0b (patch)
treeaec0645d29ea41f868eb55874fbd4970b30f36fb /gcc
parentf871d7f9f458d833fc2c388d2756a7a82cf2be40 (diff)
downloadgcc-6a3cbe90926bbe62fcbce85dc735cbf077fd0f0b.zip
gcc-6a3cbe90926bbe62fcbce85dc735cbf077fd0f0b.tar.gz
gcc-6a3cbe90926bbe62fcbce85dc735cbf077fd0f0b.tar.bz2
genmatch.c (capture_info::capture_info): Add missing COND_EXPR handling.
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. From-SVN: r217414
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ChangeLog7
-rw-r--r--gcc/genmatch.c11
2 files changed, 13 insertions, 5 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 3184fc9..26eeaca 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,5 +1,12 @@
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
* match.pd: Add missing conversion to the -(T)-X pattern.
diff --git a/gcc/genmatch.c b/gcc/genmatch.c
index 234b1a7..3dcdb70 100644
--- a/gcc/genmatch.c
+++ b/gcc/genmatch.c
@@ -1940,7 +1940,10 @@ capture_info::capture_info (simplify *s)
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);
@@ -1971,8 +1974,7 @@ capture_info::walk_match (operand *o, unsigned toplevel_arg, bool conditional_p)
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)
@@ -2018,8 +2020,7 @@ capture_info::walk_result (operand *o, bool conditional_p)
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)