Quick Search:

Mode

Context

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

Other Diffs

Ignore

Blank Lines Whitespace: Expand:

Diff

1.14
 
1.15
 
MAIN:gmcgarry:20080415004122
 
local.c
_>3434 #include <assert.h>
 3535 #include "pass1.h"
 3636 
<> 37+#define IALLOC(sz) (isinlining ? permalloc(sz) : tmpalloc(sz))
  38+
3739 static int inbits, inval;
 3840 
 3941 /* this is called to do local transformations on
     
 !
303305                         l->n_type = m;
 304306                         nfree(p);
 305307                         p = l;
<> 308+                } else if (o == FCON) {
  309+                        l->n_lval = l->n_dcon;
  310+                        l->n_sp = NULL;
  311+                        l->n_op = ICON;
  312+                        l->n_type = m;
  313+                        l->n_sue = MKSUE(m);
  314+                        nfree(p);
  315+                        p = clocal(l);
306316                 }
 307317                 break;
 308318 
     
 !
355365 
 356366         /* Write float constants to memory */
 357367  
<>358 -        sp = tmpalloc(sizeof(struct symtab));
  368+        sp = IALLOC(sizeof(struct symtab));
359369         sp->sclass = STATIC;
<> 370+        sp->ssue = MKSUE(p->n_type);
360371         sp->slevel = 1; /* fake numeric label */
 361372         sp->soffset = getlab();
 362373         sp->sflags = 0;
 363374         sp->stype = p->n_type;
 364375         sp->squal = (CON >> TSHIFT);
 365376 
 366377         defloc(sp);
<>367 -        ninval(0, btdims[p->n_type].suesize, p);
  378+        ninval(0, sp->ssue->suesize, p);
368379 
 369380         p->n_op = NAME;
 370381         p->n_lval = 0;
     
 !
695706 {
 696707         if (locc == lastloc && locc != STRNG)
 697708                 return;
<>698 -        if (locc == DATA && lastloc == STRNG)
  709+        if (locc == RDATA && lastloc == STRNG)
699710                 return;
 700711 
 701712         if (locc != lastloc) {
     
 !
779790 {
 780791         NODE *p, *q;
 781792         int sz = 1;
<>782 -        int i;
783793 
 784794         /* check num args and type */
 785795         if (a == NULL || a->n_op != CM || a->n_left->n_op == CM ||
 786796             !ISPTR(a->n_left->n_type))
 787797                 goto bad;
 788798 
<>789 -        /*
 790 -         * look at the offset of the last org to calculate the
 791 -         * number of remain registers that need to be written
 792 -         * to the stack.
 793 -         */
 794 -        if (xtemps) {
 795 -                for (i = 0; i < nargregs; i++) {
 796 -                        q = block(REG, NIL, NIL, PTR+INT, 0, MKSUE(INT));
 797 -                        q->n_rval = A0 + i;
 798 -                        p = block(REG, NIL, NIL, PTR+INT, 0, MKSUE(INT));
 799 -                        p->n_rval = SP;
 800 -                        p = block(PLUS, p, bcon(ARGINIT+i), PTR+INT, 0, MKSUE(INT));
 801 -                        p = buildtree(UMUL, p, NIL);
 802 -                        p = buildtree(ASSIGN, p, q);
 803 -                        ecomp(p);
 804 -                }
 805 -        }
 806 -
807799         /* must first deal with argument size; use int size */
 808800         p = a->n_right;
 809801         if (p->n_type < INT) {
 810802                 /* round up to word */
 811803                 sz = SZINT / tsize(p->n_type, p->n_df, p->n_sue);
 812804         }
 813805 
<>814 -        /*
 815 -         * Once again, if xtemps, the register is written to a
 816 -         * temp.  We cannot take the address of the temp and
 817 -         * walk from there.
 818 -         *
 819 -         * No solution at the moment...
 820 -         */
 821 -        assert(!xtemps);
 822 -
823806         p = buildtree(ADDROF, p, NIL);  /* address of last arg */
 824807         p = optim(buildtree(PLUS, p, bcon(sz)));
 825808         q = block(NAME, NIL, NIL, PTR+VOID, 0, 0);
     
 !
849832             !ISPTR(a->n_left->n_type) || a->n_right->n_op != TYPE)
 850833                 goto bad;
 851834 
<>852 -        /* create a copy to a temp node */
 853 -        p = tcopy(a->n_left);
 854 -        q = tempnode(0, p->n_type, p->n_df, p->n_sue);
 855 -        tmpnr = regno(q);
 856 -        p = buildtree(ASSIGN, q, p);
 857 -
858835         r = a->n_right;
<> 836+
  837+        /* get type size */
859838         sz = tsize(r->n_type, r->n_df, r->n_sue) / SZCHAR;
 860839         if (sz < SZINT/SZCHAR) {
 861840                 werror("%s%s promoted to int when passed through ...",
 862841                         r->n_type & 1 ? "unsigned " : "",
 863842                         DEUNSIGN(r->n_type) == SHORT ? "short" : "char");
 864843                 sz = SZINT/SZCHAR;
 865844         }
<>866 -        q = buildtree(PLUSEQ, a->n_left, bcon(sz));
  845+
  846+        /* alignment */
  847+        p = tcopy(a->n_left);
  848+        if (sz > SZINT/SZCHAR && r->n_type != UNIONTY && r->n_type != STRTY) {
  849+                p = buildtree(PLUS, p, bcon(7));
  850+                p = block(AND, p, bcon(-8), p->n_type, p->n_df, p->n_sue);
  851+        }
  852+
  853+        /* create a copy to a temp node */
  854+        q = tempnode(0, p->n_type, p->n_df, p->n_sue);
  855+        tmpnr = regno(q);
  856+        p = buildtree(ASSIGN, q, p);
  857+
  858+        q = tempnode(tmpnr, p->n_type, p->n_df,p->n_sue);
  859+        q = buildtree(PLUS, q, bcon(sz));
  860+        q = buildtree(ASSIGN, a->n_left, q);
  861+
867862         q = buildtree(COMOP, p, q);
 868863 
 869864         nfree(a->n_right);
     
 !
903898         uerror("bad argument to __buildtin_va_copy");
 904899         return bcon(0);
 905900 }
<> 901+
906902 /*
 907903  * Give target the opportunity of handling pragmas.
 908904  */
 909905 int
 910906 mypragma(char **ary)
 911907 {
<>912 -        return 0; }
  908+        return 0;
  909+}
913910 
 914911 /*
 915912  * Called when a identifier has been declared, to give target last word.
     
 !
918915 fixdef(struct symtab *sp)
 919916 {
 920917 }
<_921 -
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 03:38 +0100