Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/external/bsd/pcc/dist/pcc Update pcc snapshot to 1.1.0.DEVEL...



details:   https://anonhg.NetBSD.org/src/rev/59563b912fa4
branches:  trunk
changeset: 769146:59563b912fa4
user:      plunky <plunky%NetBSD.org@localhost>
date:      Thu Sep 01 12:46:15 2011 +0000

description:
Update pcc snapshot to 1.1.0.DEVEL 20110901

Continual development has happened since the previous 0.9.9
snapshot of 20100603 and the full commit log is too long to
include here, but can be seen at

 http://pcc.ludd.ltu.se/fisheye/changelog/~date=2011-09-01T06%3A00%3A00/pcc

Many bugs were reported and fixed, along with reworks of the compiler
internals in several areas, notable milestones were

 * more builtins, libpcc is no longer required on NetBSD
 * improved gcc compatibility (eg gnu-inline semantics)
 * NetBSD/VAX kernel compiles and boots
 * using cpp as backend for lint now fully working
 * PIC support seems complete
 * NetBSD/i386 kernel can be compiled and booted
 * better float/double/complex support
 * amd64 support on OSX
 * reworked Makefiles
 * pcc 1.0.0 was release on April 1 2011
 * several xasm improvements
 * FreeBSD/amd64 system can be compiled with very few changes
 * DragonFly fixes from downstream
 * rewritten #pragma support
 * TLS support added
 * many regression tests
 * rewrite of internal attribute handling

diffstat:

 external/bsd/pcc/dist/pcc/DATESTAMP                 |     1 +
 external/bsd/pcc/dist/pcc/Makefile.in               |    49 +-
 external/bsd/pcc/dist/pcc/arch/amd64/code.c         |   729 +++++--
 external/bsd/pcc/dist/pcc/arch/amd64/local.c        |   797 +++-----
 external/bsd/pcc/dist/pcc/arch/amd64/local2.c       |   632 +++---
 external/bsd/pcc/dist/pcc/arch/amd64/macdefs.h      |    74 +-
 external/bsd/pcc/dist/pcc/arch/amd64/order.c        |    73 +-
 external/bsd/pcc/dist/pcc/arch/amd64/table.c        |   411 +++-
 external/bsd/pcc/dist/pcc/arch/arm/code.c           |   129 +-
 external/bsd/pcc/dist/pcc/arch/arm/local.c          |   186 +-
 external/bsd/pcc/dist/pcc/arch/arm/macdefs.h        |     8 +-
 external/bsd/pcc/dist/pcc/arch/hppa/code.c          |    34 +-
 external/bsd/pcc/dist/pcc/arch/hppa/local.c         |   245 +--
 external/bsd/pcc/dist/pcc/arch/hppa/local2.c        |     3 +-
 external/bsd/pcc/dist/pcc/arch/hppa/macdefs.h       |     6 +-
 external/bsd/pcc/dist/pcc/arch/hppa/order.c         |     3 +-
 external/bsd/pcc/dist/pcc/arch/hppa/table.c         |     2 +
 external/bsd/pcc/dist/pcc/arch/i386/code.c          |   200 +-
 external/bsd/pcc/dist/pcc/arch/i386/local.c         |   597 +----
 external/bsd/pcc/dist/pcc/arch/i386/local2.c        |   297 +-
 external/bsd/pcc/dist/pcc/arch/i386/macdefs.h       |    19 +-
 external/bsd/pcc/dist/pcc/arch/i386/order.c         |    23 +-
 external/bsd/pcc/dist/pcc/arch/i386/table.c         |   195 +-
 external/bsd/pcc/dist/pcc/arch/m16c/code.c          |    32 +-
 external/bsd/pcc/dist/pcc/arch/m16c/local.c         |    81 +-
 external/bsd/pcc/dist/pcc/arch/m16c/macdefs.h       |     6 +-
 external/bsd/pcc/dist/pcc/arch/m16c/table.c         |     3 +
 external/bsd/pcc/dist/pcc/arch/mips/code.c          |   214 +-
 external/bsd/pcc/dist/pcc/arch/mips/local.c         |   224 +--
 external/bsd/pcc/dist/pcc/arch/mips/macdefs.h       |    27 +-
 external/bsd/pcc/dist/pcc/arch/mips/table.c         |     6 +-
 external/bsd/pcc/dist/pcc/arch/nova/code.c          |    33 +-
 external/bsd/pcc/dist/pcc/arch/nova/local.c         |    80 +-
 external/bsd/pcc/dist/pcc/arch/nova/macdefs.h       |    11 +-
 external/bsd/pcc/dist/pcc/arch/pdp10/code.c         |    23 +-
 external/bsd/pcc/dist/pcc/arch/pdp10/local.c        |    61 +-
 external/bsd/pcc/dist/pcc/arch/pdp10/macdefs.h      |    11 +-
 external/bsd/pcc/dist/pcc/arch/pdp11/code.c         |    23 +-
 external/bsd/pcc/dist/pcc/arch/pdp11/local.c        |   101 +-
 external/bsd/pcc/dist/pcc/arch/pdp11/macdefs.h      |     9 +-
 external/bsd/pcc/dist/pcc/arch/powerpc/code.c       |   339 +-
 external/bsd/pcc/dist/pcc/arch/powerpc/local.c      |   324 +--
 external/bsd/pcc/dist/pcc/arch/powerpc/local2.c     |     6 +-
 external/bsd/pcc/dist/pcc/arch/powerpc/macdefs.h    |    21 +-
 external/bsd/pcc/dist/pcc/arch/powerpc/table.c      |     6 +-
 external/bsd/pcc/dist/pcc/arch/sparc64/code.c       |   108 +-
 external/bsd/pcc/dist/pcc/arch/sparc64/local.c      |   158 +-
 external/bsd/pcc/dist/pcc/arch/sparc64/local2.c     |     7 +-
 external/bsd/pcc/dist/pcc/arch/sparc64/macdefs.h    |     6 +-
 external/bsd/pcc/dist/pcc/arch/sparc64/order.c      |     3 +
 external/bsd/pcc/dist/pcc/arch/sparc64/table.c      |     3 +
 external/bsd/pcc/dist/pcc/arch/vax/code.c           |   310 ++-
 external/bsd/pcc/dist/pcc/arch/vax/local.c          |   454 +---
 external/bsd/pcc/dist/pcc/arch/vax/local2.c         |   737 ++++++--
 external/bsd/pcc/dist/pcc/arch/vax/macdefs.h        |    55 +-
 external/bsd/pcc/dist/pcc/arch/vax/order.c          |    74 +-
 external/bsd/pcc/dist/pcc/arch/vax/table.c          |   612 ++++--
 external/bsd/pcc/dist/pcc/cc/cc/Makefile.in         |    17 +-
 external/bsd/pcc/dist/pcc/cc/cc/cc.c                |   562 ++++-
 external/bsd/pcc/dist/pcc/cc/ccom/Makefile.in       |   202 +-
 external/bsd/pcc/dist/pcc/cc/ccom/builtins.c        |   533 ++++-
 external/bsd/pcc/dist/pcc/cc/ccom/cgram.y           |   788 +++++---
 external/bsd/pcc/dist/pcc/cc/ccom/gcc_compat.c      |   400 ++--
 external/bsd/pcc/dist/pcc/cc/ccom/init.c            |   298 ++-
 external/bsd/pcc/dist/pcc/cc/ccom/inline.c          |   110 +-
 external/bsd/pcc/dist/pcc/cc/ccom/main.c            |   229 +-
 external/bsd/pcc/dist/pcc/cc/ccom/optim.c           |    98 +-
 external/bsd/pcc/dist/pcc/cc/ccom/pass1.h           |   213 +-
 external/bsd/pcc/dist/pcc/cc/ccom/stabs.c           |    39 +-
 external/bsd/pcc/dist/pcc/cc/ccom/symtabs.c         |   101 +-
 external/bsd/pcc/dist/pcc/cc/ccom/trees.c           |  1397 ++++++++++----
 external/bsd/pcc/dist/pcc/cc/cpp/Makefile.in        |    34 +-
 external/bsd/pcc/dist/pcc/cc/cpp/cpp.c              |  1695 ++++++++++--------
 external/bsd/pcc/dist/pcc/cc/cpp/cpp.h              |    67 +-
 external/bsd/pcc/dist/pcc/cc/cpp/scanner.l          |     6 +-
 external/bsd/pcc/dist/pcc/cc/cpp/tests/res1         |     1 +
 external/bsd/pcc/dist/pcc/cc/cpp/tests/res10        |    16 +
 external/bsd/pcc/dist/pcc/cc/cpp/tests/res11        |    22 +
 external/bsd/pcc/dist/pcc/cc/cpp/tests/res12        |    21 +
 external/bsd/pcc/dist/pcc/cc/cpp/tests/res13        |    13 +
 external/bsd/pcc/dist/pcc/cc/cpp/tests/res2         |     4 +-
 external/bsd/pcc/dist/pcc/cc/cpp/tests/res3         |     2 +-
 external/bsd/pcc/dist/pcc/cc/cpp/tests/res4         |     1 +
 external/bsd/pcc/dist/pcc/cc/cpp/tests/res5         |     1 +
 external/bsd/pcc/dist/pcc/cc/cpp/tests/res6         |     3 +-
 external/bsd/pcc/dist/pcc/cc/cpp/tests/res7         |     1 +
 external/bsd/pcc/dist/pcc/cc/cpp/tests/res8         |     1 +
 external/bsd/pcc/dist/pcc/cc/cpp/tests/res9         |     1 +
 external/bsd/pcc/dist/pcc/cc/cpp/tests/test10       |    14 +
 external/bsd/pcc/dist/pcc/cc/cpp/tests/test11       |    20 +
 external/bsd/pcc/dist/pcc/cc/cpp/tests/test12       |    19 +
 external/bsd/pcc/dist/pcc/cc/cpp/tests/test13       |    11 +
 external/bsd/pcc/dist/pcc/cc/cpp/token.c            |   342 ++-
 external/bsd/pcc/dist/pcc/cc/driver/Makefile.in     |    66 +
 external/bsd/pcc/dist/pcc/cc/driver/driver.c        |   882 +++++++++
 external/bsd/pcc/dist/pcc/cc/driver/driver.h        |    65 +
 external/bsd/pcc/dist/pcc/cc/driver/platform.c      |   301 +++
 external/bsd/pcc/dist/pcc/cc/driver/strlist.c       |   171 +
 external/bsd/pcc/dist/pcc/cc/driver/strlist.h       |    74 +
 external/bsd/pcc/dist/pcc/cc/driver/xalloc.c        |    84 +
 external/bsd/pcc/dist/pcc/cc/driver/xalloc.h        |    43 +
 external/bsd/pcc/dist/pcc/config.h.in               |    11 +-
 external/bsd/pcc/dist/pcc/configure                 |   140 +-
 external/bsd/pcc/dist/pcc/f77/f77/Makefile.in       |    28 +-
 external/bsd/pcc/dist/pcc/f77/f77/f77.c             |    19 +-
 external/bsd/pcc/dist/pcc/f77/fcom/Makefile.in      |   240 +-
 external/bsd/pcc/dist/pcc/f77/fcom/main.c           |     9 +-
 external/bsd/pcc/dist/pcc/mip/compat.c              |    26 +-
 external/bsd/pcc/dist/pcc/mip/compat.h              |    12 +-
 external/bsd/pcc/dist/pcc/mip/manifest.h            |    64 +-
 external/bsd/pcc/dist/pcc/mip/match.c               |    30 +-
 external/bsd/pcc/dist/pcc/mip/mkext.c               |    19 +-
 external/bsd/pcc/dist/pcc/mip/node.h                |    27 +-
 external/bsd/pcc/dist/pcc/mip/optim2.c              |    92 +-
 external/bsd/pcc/dist/pcc/mip/pass2.h               |    33 +-
 external/bsd/pcc/dist/pcc/mip/reader.c              |   228 +-
 external/bsd/pcc/dist/pcc/mip/regs.c                |   228 +-
 external/bsd/pcc/dist/pcc/os/darwin/ccconfig.h      |    10 +-
 external/bsd/pcc/dist/pcc/os/dragonfly/ccconfig.h   |    22 +-
 external/bsd/pcc/dist/pcc/os/freebsd/ccconfig.h     |    14 +-
 external/bsd/pcc/dist/pcc/os/linux/ccconfig.h       |    19 +-
 external/bsd/pcc/dist/pcc/os/midnightbsd/ccconfig.h |     7 +-
 external/bsd/pcc/dist/pcc/os/minix/ccconfig.h       |    84 +
 external/bsd/pcc/dist/pcc/os/mirbsd/ccconfig.h      |     7 +-
 external/bsd/pcc/dist/pcc/os/netbsd/ccconfig.h      |    20 +-
 external/bsd/pcc/dist/pcc/os/nextstep/ccconfig.h    |     6 +-
 external/bsd/pcc/dist/pcc/os/openbsd/ccconfig.h     |     7 +-
 external/bsd/pcc/dist/pcc/os/sunos/ccconfig.h       |     6 +-
 external/bsd/pcc/dist/pcc/os/win32/build.bat        |     6 +-
 external/bsd/pcc/dist/pcc/os/win32/ccconfig.h       |     5 +-
 external/bsd/pcc/dist/pcc/os/win32/config.h         |    17 +-
 131 files changed, 11646 insertions(+), 7639 deletions(-)

diffs (truncated from 31426 to 300 lines):

diff -r c7d1a16294bf -r 59563b912fa4 external/bsd/pcc/dist/pcc/DATESTAMP
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/external/bsd/pcc/dist/pcc/DATESTAMP       Thu Sep 01 12:46:15 2011 +0000
@@ -0,0 +1,1 @@
+20110901
diff -r c7d1a16294bf -r 59563b912fa4 external/bsd/pcc/dist/pcc/Makefile.in
--- a/external/bsd/pcc/dist/pcc/Makefile.in     Thu Sep 01 12:44:10 2011 +0000
+++ b/external/bsd/pcc/dist/pcc/Makefile.in     Thu Sep 01 12:46:15 2011 +0000
@@ -1,35 +1,30 @@
-#      Id: Makefile.in,v 1.6 2008/07/18 14:00:38 gmcgarry Exp  
-#      $NetBSD: Makefile.in,v 1.1.1.2 2010/06/03 18:57:00 plunky Exp $
+#      Id: Makefile.in,v 1.9 2011/06/07 13:56:05 plunky Exp    
+#      $NetBSD: Makefile.in,v 1.1.1.3 2011/09/01 12:46:15 plunky Exp $
 #
 # Makefile.in for top-level of pcc.
 #
 
 @SET_MAKE@
-VPATH=@srcdir@
-CC=@CC@
-CFLAGS=@CFLAGS@ @ADD_CFLAGS@
-LDFLAGS=@LDFLAGS@
-CPPFLAGS=@CPPFLAGS@
-YACC=@YACC@
-LEX=@LEX@
+
+ALL_SUBDIRS=   cc
+DIST_SUBDIRS=  $(ALL_SUBDIRS) f77
 
-SUBDIR=cc
-
-all: ${SUBDIR}
-
-install:
-       cd cc && ${MAKE} install
-
-clean:
-       cd cc && ${MAKE} clean
+all install clean:
+       @for subdir in $(ALL_SUBDIRS); do \
+               _nextdir_=$${_thisdir_+$$_thisdir_/}$$subdir; \
+               echo "===> $$_nextdir_"; \
+               (_thisdir_=$$_nextdir_; export _thisdir_; cd $$subdir && \
+                   exec $(MAKE) $(MFLAGS) $@) || exit $$?; \
+               echo "<=== $$_nextdir_"; \
+       done
 
 distclean:
-       cd cc && ${MAKE} distclean
-       cd f77 && ${MAKE} distclean
-       /bin/rm -rf Makefile config.log stamp-h1 config.status \
-       configure.lineno config.h autom4te.cache
-
-${SUBDIR}: nonexistant
-       cd $@ && $(MAKE) all $(MFLAGS)
-
-nonexistant:
+       @for subdir in $(DIST_SUBDIRS); do \
+               _nextdir_=$${_thisdir_+$$_thisdir_/}$$subdir; \
+               echo "===> $$_nextdir_"; \
+               (_thisdir_=$$_nextdir_; export _thisdir_; cd $$subdir && \
+                   exec $(MAKE) $(MFLAGS) $@) || exit $$?; \
+               echo "<=== $$_nextdir_"; \
+       done
+       rm -rf Makefile config.log stamp-h1 config.status \
+           configure.lineno config.h autom4te.cache
diff -r c7d1a16294bf -r 59563b912fa4 external/bsd/pcc/dist/pcc/arch/amd64/code.c
--- a/external/bsd/pcc/dist/pcc/arch/amd64/code.c       Thu Sep 01 12:44:10 2011 +0000
+++ b/external/bsd/pcc/dist/pcc/arch/amd64/code.c       Thu Sep 01 12:46:15 2011 +0000
@@ -1,5 +1,5 @@
-/*     Id: code.c,v 1.22 2010/05/30 19:00:04 ragge Exp         */      
-/*     $NetBSD: code.c,v 1.1.1.2 2010/06/03 18:57:07 plunky Exp $      */
+/*     Id: code.c,v 1.62 2011/08/20 12:54:27 ragge Exp         */      
+/*     $NetBSD: code.c,v 1.1.1.3 2011/09/01 12:46:27 plunky Exp $      */
 /*
  * Copyright (c) 2008 Michael Shalayeff
  * Copyright (c) 2003 Anders Magnusson (ragge%ludd.luth.se@localhost).
@@ -33,7 +33,7 @@
 
 static int nsse, ngpr, nrsp, rsaoff;
 static int thissse, thisgpr, thisrsp;
-enum { INTEGER = 1, INTMEM, SSE, SSEMEM, X87, STRREG, STRMEM };
+enum { INTEGER = 1, INTMEM, SSE, SSEMEM, X87, STRREG, STRMEM, STRCPX };
 static const int argregsi[] = { RDI, RSI, RDX, RCX, R08, R09 };
 /*
  * The Register Save Area looks something like this.
@@ -53,12 +53,52 @@
 #define        VAOFA(x)        (x-SZINT-SZINT)
 #define        VARSA(x)        (x-SZINT-SZINT-SZPOINT(0))
 
-int lastloc = -1;
 static int stroffset;
 
-static int argtyp(TWORD t, union dimfun *df, struct suedef *sue);
+static int varneeds;
+#define        NEED_GPNEXT     001
+#define        NEED_FPNEXT     002
+#define        NEED_1REGREF    004
+#define        NEED_2REGREF    010
+#define        NEED_MEMREF     020
+
+static int argtyp(TWORD t, union dimfun *df, struct attr *ap);
 static NODE *movtomem(NODE *p, int off, int reg);
 static NODE *movtoreg(NODE *p, int rno);
+void varattrib(char *name, struct attr *sap);
+
+/*
+ * Print out assembler segment name.
+ */
+void
+setseg(int seg, char *name)
+{
+       switch (seg) {
+       case PROG: name = ".text"; break;
+       case DATA:
+       case LDATA: name = ".data"; break;
+       case STRNG:
+       case RDATA: name = ".section .rodata"; break;
+       case UDATA: break;
+#ifdef MACHOABI
+       case PICLDATA:
+       case PICDATA: name = ".section .data.rel.rw,\"aw\""; break;
+       case PICRDATA: name = ".section .data.rel.ro,\"aw\""; break;
+#else
+       case PICLDATA:
+       case PICDATA: name = ".section .data.rel.rw,\"aw\",@progbits"; break;
+       case PICRDATA: name = ".section .data.rel.ro,\"aw\",@progbits"; break;
+#endif
+       case TLSDATA: name = ".section .tdata,\"awT\",@progbits"; break;
+       case TLSUDATA: name = ".section .tbss,\"awT\",@nobits"; break;
+       case CTORS: name = ".section\t.ctors,\"aw\",@progbits"; break;
+       case DTORS: name = ".section\t.dtors,\"aw\",@progbits"; break;
+       case NMSEG: 
+               printf("\t.section %s,\"aw\",@progbits\n", name);
+               return;
+       }
+       printf("\t%s\n", name);
+}
 
 /*
  * Define everything needed to print out some data (or text).
@@ -67,70 +107,17 @@
 void
 defloc(struct symtab *sp)
 {
-       extern char *nextsect;
-       static char *loctbl[] = { "text", "data", "section .rodata" };
-       int weak = 0;
        char *name;
-       TWORD t;
-       int s;
 
-       if (sp == NULL) {
-               lastloc = -1;
-               return;
-       }
-       t = sp->stype;
-       s = ISFTN(t) ? PROG : ISCON(cqual(t, sp->squal)) ? RDATA : DATA;
        if ((name = sp->soname) == NULL)
                name = exname(sp->sname);
-#ifdef TLS
-       if (sp->sflags & STLS) {
-               if (s != DATA)
-                       cerror("non-data symbol in tls section");
-               nextsect = ".tdata";
-       }
+
+       if (sp->sclass == EXTDEF) {
+               printf("\t.globl %s\n", name);
+#ifndef MACHOABI
+               printf("\t.type %s,@%s\n", name,
+                   ISFTN(sp->stype)? "function" : "object");
 #endif
-#ifdef GCC_COMPAT
-       {
-               struct gcc_attrib *ga;
-
-               if ((ga = gcc_get_attr(sp->ssue, GCC_ATYP_SECTION)) != NULL)
-                       nextsect = ga->a1.sarg;
-               if ((ga = gcc_get_attr(sp->ssue, GCC_ATYP_WEAK)) != NULL)
-                       weak = 1;
-               if (gcc_get_attr(sp->ssue, GCC_ATYP_DESTRUCTOR)) {
-                       printf("\t.section\t.dtors,\"aw\",@progbits\n");
-                       printf("\t.align 8\n\t.quad\t%s\n", name);
-                       lastloc = -1;
-               }
-               if (gcc_get_attr(sp->ssue, GCC_ATYP_CONSTRUCTOR)) {
-                       printf("\t.section\t.ctors,\"aw\",@progbits\n");
-                       printf("\t.align 8\n\t.quad\t%s\n", name);
-                       lastloc = -1;
-               }
-               if ((ga = gcc_get_attr(sp->ssue, GCC_ATYP_VISIBILITY)) &&
-                   strcmp(ga->a1.sarg, "default"))
-                       printf("\t.%s %s\n", ga->a1.sarg, name);
-       }
-#endif
-
-       if (nextsect) {
-               printf("        .section %s\n", nextsect);
-               nextsect = NULL;
-               s = -1;
-       } else if (s != lastloc)
-               printf("        .%s\n", loctbl[s]);
-       lastloc = s;
-       while (ISARY(t))
-               t = DECREF(t);
-       s = ISFTN(t) ? ALINT : talign(t, sp->ssue);
-       if (s > ALCHAR)
-               printf("        .align %d\n", s/ALCHAR);
-       if (weak)
-               printf("        .weak %s\n", name);
-       else if (sp->sclass == EXTDEF) {
-               printf("\t.globl %s\n", name);
-               printf("\t.type %s,@%s\n", name,
-                   ISFTN(t)? "function" : "object");
        }
        if (sp->slevel == 0)
                printf("%s:\n", name);
@@ -141,6 +128,7 @@
 /*
  * code for the end of a function
  * deals with struct return here
+ * The return value is in (or pointed to by) RETREG.
  */
 void
 efcode()
@@ -149,43 +137,54 @@
        extern int gotnr;
        TWORD t;
        NODE *p, *r, *l;
-       int o;
+       int typ, ssz, rno;
 
        gotnr = 0;      /* new number for next fun */
        sp = cftnsp;
        t = DECREF(sp->stype);
        if (t != STRTY && t != UNIONTY)
                return;
-       if (argtyp(t, sp->sdf, sp->ssue) != STRMEM)
-               return;
 
-       /* call memcpy() to put return struct at destination */
-#define  cmop(x,y) block(CM, x, y, INT, 0, MKSUE(INT))
-       r = tempnode(stroffset, INCREF(t), sp->sdf, sp->ssue);
-       l = block(REG, NIL, NIL, INCREF(t), sp->sdf, sp->ssue);
-       regno(l) = RAX;
-       o = tsize(t, sp->sdf, sp->ssue)/SZCHAR;
-       r = cmop(cmop(r, l), bcon(o));
+       /* XXX should have one routine for this */
+       ngpr = nsse = 0;
+       if ((typ = argtyp(t, sp->sdf, sp->sap)) == STRREG || typ == STRCPX) {
+               /* Cast to long pointer and move to the registers */
+               /* XXX can overrun struct size */
+               /* XXX check carefully for SSE members */
+
+               if ((ssz = tsize(t, sp->sdf, sp->sap)) > SZLONG*2)
+                       cerror("efcode1");
 
-       blevel++; /* Remove prototype at exit of function */
-       sp = lookup(addname("memcpy"), 0);
-       if (sp->stype == UNDEF) {
-               sp->ssue = MKSUE(VOID);
-               p = talloc();
-               p->n_op = NAME;
-               p->n_sp = sp;
-               p->n_sue = sp->ssue;
-               p->n_type = VOID|FTN|(PTR<<TSHIFT);
-               defid(p, EXTERN);
-               nfree(p);
-       }
-       blevel--;
-
-       p = doacall(sp, nametree(sp), r);
-       ecomp(p);
-       
-
-       /* RAX contains destination after memcpy() */
+               if (typ == STRCPX) {
+                       t = DOUBLE;
+                       rno = XMM0;
+               } else {
+                       t = LONG;
+                       rno = RAX;
+               }
+               if (ssz > SZLONG) {
+                       p = block(REG, NIL, NIL, INCREF(t), 0, 0);
+                       regno(p) = RAX;
+                       p = buildtree(UMUL, buildtree(PLUS, p, bcon(1)), NIL);
+                       ecomp(movtoreg(p, rno+1));
+               }
+               p = block(REG, NIL, NIL, INCREF(t), 0, 0);
+               regno(p) = RAX;
+               p = buildtree(UMUL, p, NIL);
+               ecomp(movtoreg(p, rno));
+       } else if (typ == STRMEM) {
+               r = block(REG, NIL, NIL, INCREF(t), sp->sdf, sp->sap);
+               regno(r) = RAX;
+               r = buildtree(UMUL, r, NIL);
+               l = tempnode(stroffset, INCREF(t), sp->sdf, sp->sap);
+               l = buildtree(UMUL, l, NIL);



Home | Main Index | Thread Index | Old Index