Quick Search:

Mode

Context

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

Other Diffs

Ignore

Blank Lines Whitespace: Expand:

Diff

1.43
 
1.44
 
MAIN:ragge:20060620060243
 
optim2.c
_>6464 void findTemps(struct interpass *ip);
 6565 void placePhiFunctions(struct bblockinfo *bbinfo);
 6666 void remunreach(void);
 6767 
 6868 struct basicblock bblocks;
 6969 int nbblocks;
<> 70+static struct interpass *cvpole;
7071 
 7172 struct addrof {
 7273         struct addrof *next;
 7374         int tempnum;
 7475         int oregoff;
 7576 } *otlink;
     
 !
8384                 if (w->tempnum == num)
 8485                         return w->oregoff;
 8586         return 0;
 8687 }
 8788 
 8889 /*
<> 90+ * Use stack argument addresses instead of copying if & is used on a var.
  91+ */
  92+static int
  93+setargs(int tval, struct addrof *w)
  94+{
  95+        struct interpass *ip;
  96+        NODE *p;
  97+
  98+        ip = DLIST_NEXT(cvpole, qelem); /* PROLOG */
  99+        ip = DLIST_NEXT(ip, qelem); /* first DEFLAB */
  100+        ip = DLIST_NEXT(ip, qelem); /* first NODE */
  101+        for (; ip->type != IP_DEFLAB; ip = DLIST_NEXT(ip, qelem)) {
  102+                p = ip->ip_node;
  103+#ifdef PCC_DEBUG
  104+                if (p->n_op != ASSIGN || p->n_left->n_op != TEMP)
  105+                        comperr("temparg");
  106+#endif
  107+                if (p->n_right->n_op != OREG)
  108+                        continue; /* arg in register */
  109+                if (tval != p->n_left->n_lval)
  110+                        continue; /* wrong assign */
  111+                w->oregoff = p->n_right->n_lval;
  112+                tfree(p);
  113+                DLIST_REMOVE(ip, qelem);
  114+                return 1;
  115+        }
  116+        return 0;
  117+}
  118+
  119+/*
89120  * Search for ADDROF elements and, if found, record them.
 90121  */
 91122 static void
 92123 findaddrof(NODE *p)
 93124 {
 94125         struct addrof *w;
 95126 
 96127         if (p->n_op != ADDROF)
 97128                 return;
 98129         if (getoff(p->n_left->n_lval))
 99130                 return;
 100131         w = tmpalloc(sizeof(struct addrof));
 101132         w->tempnum = p->n_left->n_lval;
<>102 -        w->oregoff = BITOOR(freetemp(szty(p->n_left->n_type)));
  133+        if (setargs(p->n_left->n_lval, w) == 0)
  134+                w->oregoff = BITOOR(freetemp(szty(p->n_left->n_type)));
103135         w->next = otlink;
 104136         otlink = w;
 105137 }
 106138 
<> 139+
107140 /*
 108141  * Convert address-taken temps to OREGs.
 109142  */
 110143 static void
 111144 cvtaddrof(NODE *p)
 112145 {
     
 !
151184 
 152185         /*
 153186          * Convert ADDROF TEMP to OREGs.
 154187          */
 155188         if (xtemps) {
 156189                 otlink = NULL;
<> 190+                cvpole = ipole;
<_157191                 DLIST_FOREACH(ip, ipole, qelem) {
 158192                         if (ip->type != IP_NODE)
 159193                                 continue;
 160194                         walkf(ip->ip_node, findaddrof);
 161195                 }
 162196                 if (otlink) {
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-09-19 09:50 +0200