Quick Search:

Mode

Context

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

Other Diffs

Ignore

Blank Lines Whitespace: Expand:

Diff

1.49
 
1.50
 
MAIN:ragge:20071230103150
 
optim2.c
_>3838 #ifndef MAX
 3939 #define MAX(a,b) (((a) > (b)) ? (a) : (b))
 4040 #endif
 4141 
 4242 #define BDEBUG(x)       if (b2debug) printf x
 4343 
<> 44+#define mktemp(n, t)    mklnode(TEMP, 0, n, t)
  45+
4446 static int dfsnum;
 4547 
 4648 void saveip(struct interpass *ip);
 4749 void deljumps(struct interpass *);
 4850 void optdump(struct interpass *ip);
 4951 void printip(struct interpass *pole);
     
 !
103105 #ifdef PCC_DEBUG
 104106                 if (p->n_op != ASSIGN || p->n_left->n_op != TEMP)
 105107                         comperr("temparg");
 106108 #endif
 107109                 if (p->n_right->n_op != OREG)
 108110                         continue; /* arg in register */
<>109 -                if (tval != p->n_left->n_lval)
  111+                if (tval != regno(p->n_left))
110112                         continue; /* wrong assign */
 111113                 w->oregoff = p->n_right->n_lval;
 112114                 tfree(p);
 113115                 DLIST_REMOVE(ip, qelem);
 114116                 return 1;
 115117         }
     
 !
120122  * Search for ADDROF elements and, if found, record them.
 121123  */
 122124 static void
 123125 findaddrof(NODE *p)
 124126 {
 125127         struct addrof *w;
<> 128+        int tnr;
126129 
 127130         if (p->n_op != ADDROF)
 128131                 return;
<>129 -        if (getoff(p->n_left->n_lval))
  132+        tnr = regno(p->n_left);
  133+        if (getoff(tnr))
130134                 return;
 131135         w = tmpalloc(sizeof(struct addrof));
<>132 -        w->tempnum = p->n_left->n_lval;
 133 -        if (setargs(p->n_left->n_lval, w) == 0)
  136+        w->tempnum = tnr;
  137+        if (setargs(tnr, w) == 0)
134138                 w->oregoff = BITOOR(freetemp(szty(p->n_left->n_type)));
 135139         w->next = otlink;
 136140         otlink = w;
 137141 }
 138142 
 139143 
     
 !
146150         NODE *l;
 147151         int n;
 148152 
 149153         if (p->n_op != ADDROF && p->n_op != TEMP)
 150154                 return;
 151155         if (p->n_op == TEMP) {
<>152 -                n = getoff(p->n_lval);
  156+                n = getoff(regno(p));
153157                 if (n == 0)
 154158                         return;
 155159                 p->n_op = OREG;
 156160                 p->n_lval = n;
<>157 -                p->n_rval = FPREG;
  161+                regno(p) = FPREG;
158162         } else {
 159163                 l = p->n_left;
 160164                 l->n_type = p->n_type;
 161165                 p->n_right = mklnode(ICON, l->n_lval, 0, l->n_type);
 162166                 p->n_op = PLUS;
 163167                 l->n_op = REG;
     
 !
884888                                 ntype = n->n->n_type;
 885889                                 k = 0;
 886890                                 /* Amount of predecessors for y */
 887891                                 SLIST_FOREACH(cnode, &n->bb->parents, cfgelem)
 888892                                         k++;
 889893                                 /* Construct phi(...) */
<>890 -                                p = mklnode(TEMP, i, 0, ntype);
  894+                                p = mktemp(i, ntype);
891895                                 for (l = 0; l < k-1; l++)
 892896                                         p = mkbinode(PHI, p,
<>893 -                                            mklnode(TEMP, i, 0, ntype), ntype);
  897+                                            mktemp(i, ntype), ntype);
894898                                 ip = ipnode(mkbinode(ASSIGN,
<>895 -                                    mklnode(TEMP, i, 0, ntype), p, ntype));
  899+                                    mktemp(i, ntype), p, ntype));
<_896900                                 /* Insert phi at top of basic block */
 897901                                 DLIST_INSERT_BEFORE(((struct interpass*)&n->bb->first), ip, qelem);
 898902                                 n->bb->first = ip;
 899903                                 BITSET(bbinfo->arr[j]->Aphi, i);
 900904                                 if (!TESTBIT(bbinfo->arr[j]->Aorig, i)) {
 901905                                         pv = tmpalloc(sizeof(struct pvarinfo));
FishEye: Open Source License registered to PCC.
Atlassian FishEye, CVS analysis. (Version:1.6.3 Build:build-336 2008-11-04) - Administration - Page generated 2014-12-22 10:57 +0100