Quick Search:

Mode

Context

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

Other Diffs

Ignore

Blank Lines Whitespace: Expand:

Diff

1.8
 
1.9
 
MAIN:ragge:20100407144549
 
local.c
_>9090 static NODE *
 9191 picext(NODE *p)
 9292 {
<>93 -        NODE *q, *r;
  93+        NODE *q;
9494         struct symtab *sp;
<> 95+        char *c;
9596 
<>96 -        q = tempnode(gotnr, PTR|VOID, 0, MKSUE(VOID));
 97 -        sp = picsymtab("", p->n_sp->soname, "@GOT");
 98 -        r = xbcon(0, sp, INT);
 99 -        q = buildtree(PLUS, q, r);
 100 -        q = block(UMUL, q, 0, PTR|VOID, 0, MKSUE(VOID));
  97+        c = p->n_sp->soname ? p->n_sp->soname : p->n_sp->sname;
  98+        sp = picsymtab("", c, "@GOTPCREL(%rip)");
  99+        q = block(NAME, NIL, NIL, INCREF(p->n_type), p->n_df, p->n_sue);
  100+        q->n_sp = sp;
101101         q = block(UMUL, q, 0, p->n_type, p->n_df, p->n_sue);
<>102 -        q->n_sp = p->n_sp; /* for init */
  102+        q->n_sp = sp;
103103         nfree(p);
 104104         return q;
 105105 }
     
 !
110110 static NODE *
 111111 picstatic(NODE *p)
 112112 {
<>113 -        NODE *q, *r;
114113         struct symtab *sp;
<> 114+        char *c, buf[32];
115115 
<>116 -        q = tempnode(gotnr, PTR|VOID, 0, MKSUE(VOID));
 117 -        if (p->n_sp->slevel > 0) {
 118 -                char buf[32];
 119 -                snprintf(buf, 32, LABFMT, (int)p->n_sp->soffset);
 120 -                sp = picsymtab("", buf, "@GOTOFF");
 121 -        } else
 122 -                sp = picsymtab("", p->n_sp->soname, "@GOTOFF");
  116+        if (p->n_sp->slevel > 0)
  117+                snprintf(c = buf, 32, LABFMT, (int)p->n_sp->soffset);
  118+        else
  119+                c = p->n_sp->soname ? p->n_sp->soname : p->n_sp->sname;
  120+        sp = picsymtab("", c, "(%rip)");
123121         sp->sclass = STATIC;
 124122         sp->stype = p->n_sp->stype;
<>125 -        r = xbcon(0, sp, INT);
 126 -        q = buildtree(PLUS, q, r);
 127 -        q = block(UMUL, q, 0, p->n_type, p->n_df, p->n_sue);
 128 -        q->n_sp = p->n_sp; /* for init */
 129 -        nfree(p);
 130 -        return q;
  123+        p->n_sp = sp;
  124+        return p;
131125 }
 132126 
 133127 #ifdef TLS
     
 !
315309         case STCALL:
 316310                 if (p->n_type == VOID)
 317311                         break; /* nothing to do */
<>318 -
319312                 /* have the call at left of a COMOP to avoid arg trashing */
 320313                 r = tempnode(0, p->n_type, p->n_df, p->n_sue);
 321314                 m = regno(r);
     
 !
326319 
 327320         case UCALL:
 328321         case USTCALL:
<>329 -                if (kflag == 0)
 330 -                        break;
 331 -                /* Change to CALL node with ebx as argument */
  322+                /* For now, always clear eax */
332323                 l = block(REG, NIL, NIL, INT, 0, MKSUE(INT));
<>333 -                l->n_rval = RBX;
 334 -                p->n_right = buildtree(ASSIGN, l,
 335 -                    tempnode(gotnr, INT, 0, MKSUE(INT)));
  324+                regno(l) = RAX;
  325+                p->n_right = clocal(buildtree(ASSIGN, l, bcon(0)));
336326                 p->n_op -= (UCALL-CALL);
 337327                 break;
 338328 
     
 !
556546                 p->n_right = block(SCONV, p->n_right, NIL,
 557547                     CHAR, 0, MKSUE(CHAR));
 558548                 break;
<> 549+
  550+        case STASG: /* Early conversion to memcpy */
  551+                l = buildtree(ADDROF, p->n_left, NIL);
  552+                r = p->n_right;
  553+                o = tsize(p->n_type, p->n_df, p->n_sue)/SZCHAR;
  554+#define  cmop(x,y) block(CM, x, y, INT, 0, MKSUE(INT))
  555+                r = cmop(cmop(l, r), bcon(o));
  556+
  557+                q = lookup(addname("memcpy"), 0);
  558+                if (q->stype == UNDEF) {
  559+                        p->n_op = NAME;
  560+                        p->n_sp = q;
  561+                        p->n_type = FTN|INT;
  562+                        defid(p, EXTERN);
  563+                }
  564+                nfree(p);
  565+                p = doacall(q, nametree(q), r);
  566+
  567+                break;
559568         }
 560569 #ifdef PCC_DEBUG
 561570         if (xdebug) {
     
 !
573582 fixnames(NODE *p, void *arg)
 574583 {
 575584         struct symtab *sp;
<>576 -        struct suedef *sue;
577585         NODE *q;
 578586         char *c;
<>579 -        int isu;
580587 
 581588         if ((cdope(p->n_op) & CALLFLG) == 0)
 582589                 return;
<>583 -        isu = 0;
 584 -        q = p->n_left;
 585 -        sue = q->n_sue;
 586 -        if (q->n_op == UMUL)
 587 -                q = q->n_left, isu = 1;
  590+        if (p->n_left->n_op != UMUL || p->n_left->n_left->n_op != NAME)
  591+                return;
  592+        q = p->n_left->n_left;
588593 
<>589 -        if (q->n_op == PLUS && q->n_left->n_op == TEMP &&
 590 -            q->n_right->n_op == ICON) {
 591 -                sp = q->n_right->n_sp;
592594 
<>593 -                if (sp == NULL)
 594 -                        return; /* nothing to do */
 595 -                if (sp->sclass == STATIC && !ISFTN(sp->stype))
 596 -                        return; /* function pointer */
  595+        sp = q->n_sp;
597596 
<>598 -                if (sp->sclass != STATIC && sp->sclass != EXTERN &&
 599 -                    sp->sclass != EXTDEF)
 600 -                        cerror("fixnames");
  597+        if (sp == NULL)
  598+                return; /* nothing to do */
  599+        if (sp->sclass == STATIC && !ISFTN(sp->stype))
  600+                return; /* function pointer */
601601 
<>602 -                if ((c = strstr(sp->soname, "@GOT")) == NULL)
 603 -                        cerror("fixnames2");
 604 -                if (isu) {
 605 -                        memcpy(c, "@PLT", sizeof("@PLT"));
 606 -                } else
 607 -                        *c = 0;
  602+        if (sp->sclass != STATIC && sp->sclass != EXTERN &&
  603+            sp->sclass != EXTDEF)
  604+                cerror("fixnames");
608605 
<>609 -                nfree(q->n_left);
 610 -                q = q->n_right;
 611 -                if (isu)
 612 -                        nfree(p->n_left->n_left);
 613 -                nfree(p->n_left);
 614 -                p->n_left = q;
 615 -                q->n_sue = sue;
 616 -        }
  606+        if ((c = strstr(sp->soname, "@GOT")) == NULL)
  607+                cerror("fixnames2");
  608+        if (sp->sclass == STATIC) {
  609+                *c = 0;
  610+        } else
  611+                memcpy(c, "@PLT", sizeof("@PLT"));
  612+
  613+        
  614+        *p->n_left = *q;
  615+        p->n_left->n_op = ICON;
  616+        nfree(q);
<_617617 }
 618618 
 619619 void
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-01 09:46 +0200