Quick Search:

Mode

Context

Displaying 3 lines of context. None | Less | More | Full

Other Diffs

Ignore

Blank Lines Whitespace: Expand:

Diff

1.58
 
1.59
 
MAIN:ragge:20030729200301
 
trees.c
_>14641464 andorbr(NODE *p, int true, int false)
 14651465 {
 14661466         NODE *q;
<>1467 -        int o, lab, flab, tlab;
  1467+        int o, lab;
14681468 
 14691469         lab = -1;
 14701470         switch (o = p->n_op) {
     
 !
14781478         case LT:
 14791479         case GE:
 14801480         case GT:
<>1481 -                if (true < 0) {
 1482 -                        p->n_op = negrel[o - EQ];
 1483 -                        true = false;
 1484 -                        false = -1;
 1485 -                }
14861481                 /*
 14871482                  * Remove redundant logop nodes.
 14881483                  */
 14891484                 while (clogop(o = p->n_left->n_op) &&
<>1490 -                    p->n_right->n_op == ICON && p->n_right->n_lval == 0) {
  1485+                    p->n_right->n_op == ICON) {
14911486                         if (o == ANDAND || o == OROR || o == NOT)
 14921487                                 break;
<>1493 -                        q = p->n_left;
 1494 -                        nfree(p->n_right);
 1495 -                        *p = *q;
 1496 -                        nfree(q);
 1497 -                        p->n_op = negrel[o - EQ];
  1488+                        if (p->n_right->n_lval == 0) {
  1489+                                o = p->n_op;
  1490+                                q = p->n_left;
  1491+                                nfree(p->n_right);
  1492+                                *p = *q;
  1493+                                nfree(q);
  1494+                                if (o != NE)
  1495+                                        p->n_op = negrel[p->n_op - EQ];
  1496+                        } else
  1497+                                break;
14981498                         
 14991499                 }
<>1500 -
 1501 -                rmcops(p);
 1502 -                if (clogop(p->n_op))
  1500+                if (true < 0) {
15031501                         p->n_op = negrel[p->n_op - EQ];
<> 1502+                        true = false;
  1503+                        false = -1;
  1504+                }
  1505+
  1506+                rmcops(p->n_left);
  1507+                rmcops(p->n_right);
  1508+                if (clogop(o = p->n_op))
  1509+                        p->n_op = negrel[o - EQ];
15041510                 else
 15051511                         p = buildtree(EQ, p, bcon(0));
 15061512                 ecode(buildtree(CBRANCH, p, bcon(true)));
     
 !
15561562  *      COMOPs are split into separate statements.
 15571563  *      QUEST/COLON are rewritten to branches.
 15581564  *      ANDAND/OROR/NOT are rewritten to branches for lazy-evaluation.
<>1559 - *      CBRANCH villkor are rewritten for lazy-evaluation.
  1565+ *      CBRANCH conditions are rewritten for lazy-evaluation.
15601566  */
 15611567 static void
 15621568 rmcops(NODE *p)
     
 !
16081614                 p->n_lval = tval;
 16091615                 break;
 16101616 
<> 1617+        case ULE:
  1618+        case ULT:
  1619+        case UGE:
  1620+        case UGT:
  1621+        case EQ:
  1622+        case NE:
  1623+        case LE:
  1624+        case LT:
  1625+        case GE:
  1626+        case GT:
16111627         case ANDAND:
 16121628         case OROR:
<>1613 -                rmcops(p->n_left);
16141629         case NOT:
 16151630 #ifdef SPECIAL_CCODES
 16161631 #error fix for private CCODES handling
 16171632 #else
 16181633                 tval = tvaloff++;
<>1619 -                q = block(TEMP, NIL, NIL, p->n_type, p->n_df, p->n_sue);
 1620 -                q->n_lval = tval;
16211634                 r = talloc();
 16221635                 *r = *p;
 16231636                 andorbr(r, -1, lbl = getlab());
<> 1637+                q = block(TEMP, NIL, NIL, p->n_type, p->n_df, p->n_sue);
  1638+                q->n_lval = tval;
16241639                 r = talloc();
 16251640                 *r = *q;
 16261641                 ecode(buildtree(ASSIGN, q, bcon(1)));
     
 !
18881903         default:
 18891904                 cerror("bad copst %d", op);
 18901905         }
<> 1906+        return 0; /* XXX gcc */
18911907 }
 18921908 
 18931909 int
     
 !
19141930         case NOT:
 19151931                 return UTYPE|LOGFLG;
 19161932         }
<> 1933+        return 0; /* XXX gcc */
<_19171934 }
FishEye: Open Source License registered to PCC.
Your maintenance has expired. You can renew your license at http://www.atlassian.com/fisheye/renew
Atlassian FishEye, CVS analysis. (Version:1.6.3 Build:build-336 2008-11-04) - Administration - Page generated 2014-11-01 08:03 +0100