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:gmcgarry:20071213042014
 
local.c
_>7777                 r = tempnode(0, p->n_type, p->n_df, p->n_sue);
 7878                 tmpnr = r->n_lval;
 7979                 r = block(ASSIGN, r, p, p->n_type, p->n_df, p->n_sue);
<>80 -                ecomp(r);
  80+
8181                 p = tempnode(tmpnr, r->n_type, r->n_df, r->n_sue);
 8282                 if (isptrvoid) {
 8383                         p = block(PCONV, p, NIL, PTR+VOID,
 8484                             p->n_df, MKSUE(PTR+VOID));
 8585                 }
<> 86+                p = buildtree(COMOP, r, p);
8687                 break;
 8788 
 8889         case NAME:
     
 !
232233                         p = l;
 233234                 }
 234235 
<> 236+                /* convert float/double to int before to (u)char/(u)short */
235237                 if ((DEUNSIGN(p->n_type) == CHAR ||
 236238                     DEUNSIGN(p->n_type) == SHORT) &&
 237239                     (l->n_type == FLOAT || l->n_type == DOUBLE ||
     
 !
241243                         break;
 242244                 }
 243245 
<> 246+                /* convert (u)char/(u)short to int before float/double */
  247+                if  ((p->n_type == FLOAT || p->n_type == DOUBLE ||
  248+                    p->n_type == LDOUBLE) && (DEUNSIGN(l->n_type) == CHAR ||
  249+                    DEUNSIGN(l->n_type) == SHORT)) {
  250+                        p = block(SCONV, p, NIL, p->n_type, p->n_df, p->n_sue);
  251+                        p->n_left->n_type = INT;
  252+                        break;
  253+                }
244254 
 245255                 o = l->n_op;
 246256                 m = p->n_type;
     
 !
410420 
 411421         /* save the address of sp */
 412422         sp = block(REG, NIL, NIL, PTR+INT, t->n_df, t->n_sue);
<>413 -        sp->n_lval = 0;
414423         sp->n_rval = SP;
 415424         t->n_type = sp->n_type;
 416425         ecomp(buildtree(ASSIGN, t, sp)); /* Emit! */
 417426 
<>418 -        /* add the size to sp */
  427+        /* subtract the size from sp */
419428         sp = block(REG, NIL, NIL, p->n_type, 0, 0);
 420429         sp->n_lval = 0;
 421430         sp->n_rval = SP;
<>422 -        ecomp(buildtree(PLUSEQ, sp, p));
  431+        ecomp(buildtree(MINUSEQ, sp, p));
423432 }
 424433 
 425434 /*
     
 !
493502                 printf("\t.byte %d\n", (int)p->n_lval & 0xff);
 494503                 break;
 495504         case LDOUBLE:
<>496 -                u.i[2] = 0;
 497 -                u.l = (long double)p->n_dcon;
 498 -                printf("\t.word\t0x%x,0x%x,0x%x\n", u.i[0], u.i[1], u.i[2]);
 499 -                break;
500505         case DOUBLE:
 501506                 u.d = (double)p->n_dcon;
<>502 -                printf("\t.word\t0x%x\n", u.i[0]);
 503 -                printf("\t.word\t0x%x\n", u.i[1]);
  507+                if (bigendian) {
  508+                        printf("\t.word\t0x%x\n", u.i[0]);
  509+                        printf("\t.word\t0x%x\n", u.i[1]);
  510+                } else {
  511+                        printf("\t.word\t0x%x\n", u.i[1]);
  512+                        printf("\t.word\t0x%x\n", u.i[0]);
  513+                }
504514                 break;
 505515         case FLOAT:
 506516                 u.f = (float)p->n_dcon;
     
 !
568578         off = (off+(SZCHAR-1))/SZCHAR;
 569579 
 570580 #ifdef GCC_COMPAT
<>571 -        printf("        .comm %s,0%o\n", gcc_findname(q), off);
  581+        printf("        .comm %s,%d\n", gcc_findname(q), off);
572582 #else
<>573 -        printf("        .comm %s,0%o\n", exname(q->sname), off);
  583+        printf("        .comm %s,%d\n", exname(q->sname), off);
574584 #endif
 575585 }
 576586 
     
 !
584594         off = (off+(SZCHAR-1))/SZCHAR;
 585595         if (q->slevel == 0)
 586596 #ifdef GCC_COMPAT
<>587 -                printf("\t.lcomm %s,0%o\n", gcc_findname(q), off);
  597+                printf("\t.lcomm %s,%d\n", gcc_findname(q), off);
588598 #else
<>589 -                printf("\t.lcomm %s,0%o\n", exname(q->sname), off);
  599+                printf("\t.lcomm %s,%d\n", exname(q->sname), off);
590600 #endif
 591601         else
<>592 -                printf("\t.lcomm " LABFMT ",0%o\n", q->soffset, off);
  602+                printf("\t.lcomm " LABFMT ",%d\n", q->soffset, off);
593603 }
 594604 
 595605 /*
     
 !
601611         printf(LABFMT ":\n", label);
 602612 }
 603613 
<>604 -/* ro-text, ro-data, rw-data, ro-strings */
 605 -static char *loctbl[] = { "text", "rdata", "data", "rdata" };
  614+/* ro-text, rw-data, ro-data, ro-strings */
  615+static char *loctbl[] = { "text", "data", "rdata", "rdata" };
606616 
 607617 void
 608618 setloc1(int locc)
     
 !
763773 
 764774         r = a->n_right;
 765775         sz = tsize(r->n_type, r->n_df, r->n_sue) / SZCHAR;
<> 776+        if (sz < SZINT/SZCHAR) {
  777+                werror("%s%s promoted to int when passed through ...",
  778+                        r->n_type & 1 ? "unsigned " : "",
  779+                        DEUNSIGN(r->n_type) == SHORT ? "short" : "char");
  780+                sz = SZINT/SZCHAR;
  781+        }
<_766782         q = buildtree(PLUSEQ, a->n_left, bcon(sz));
 767783         q = buildtree(COMOP, p, q);
 768784 
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-02 08:57 +0200