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 to pcc snapshot 20160208. R...
details: https://anonhg.NetBSD.org/src/rev/33129a9729b4
branches: trunk
changeset: 343513:33129a9729b4
user: plunky <plunky%NetBSD.org@localhost>
date: Tue Feb 09 20:28:01 2016 +0000
description:
update to pcc snapshot 20160208. Rather than provide the full
list of changes, they can be found at
http://pcc.ludd.ltu.se/fisheye/changelog/pcc
Along with numerous bug fixes, the highlights might be a rewrite
of the CPP parser, updated backends for arm, pdp11, m68k, vax and
mips along with new backend for 8086. PCC now builds itself as a
2-pass compiler. There have been fixes for use with musl, C11
support added and use of UTF8 internally. PE/COFF target was fixed,
and Minix target added.
diffstat:
external/bsd/pcc/dist/pcc/DATESTAMP | 2 +-
external/bsd/pcc/dist/pcc/TODO | 11 +
external/bsd/pcc/dist/pcc/arch/amd64/macdefs.h | 24 +-
external/bsd/pcc/dist/pcc/arch/amd64/order.c | 14 +-
external/bsd/pcc/dist/pcc/arch/amd64/table.c | 6 +-
external/bsd/pcc/dist/pcc/arch/arm/code.c | 25 +-
external/bsd/pcc/dist/pcc/arch/arm/local.c | 374 ++--
external/bsd/pcc/dist/pcc/arch/arm/local2.c | 40 +-
external/bsd/pcc/dist/pcc/arch/arm/macdefs.h | 19 +-
external/bsd/pcc/dist/pcc/arch/hppa/local.c | 6 +-
external/bsd/pcc/dist/pcc/arch/hppa/local2.c | 13 +-
external/bsd/pcc/dist/pcc/arch/hppa/macdefs.h | 5 +-
external/bsd/pcc/dist/pcc/arch/i386/code.c | 156 +-
external/bsd/pcc/dist/pcc/arch/i386/local.c | 480 ++---
external/bsd/pcc/dist/pcc/arch/i386/local2.c | 174 +-
external/bsd/pcc/dist/pcc/arch/i386/macdefs.h | 27 +-
external/bsd/pcc/dist/pcc/arch/i386/order.c | 12 +-
external/bsd/pcc/dist/pcc/arch/i386/table.c | 14 +-
external/bsd/pcc/dist/pcc/arch/i86/TODO | 93 +
external/bsd/pcc/dist/pcc/arch/i86/code.c | 456 +++++
external/bsd/pcc/dist/pcc/arch/i86/flocal.c | 232 ++
external/bsd/pcc/dist/pcc/arch/i86/local.c | 635 +++++++
external/bsd/pcc/dist/pcc/arch/i86/local2.c | 1545 ++++++++++++++++++
external/bsd/pcc/dist/pcc/arch/i86/macdefs.h | 336 ++++
external/bsd/pcc/dist/pcc/arch/i86/order.c | 335 ++++
external/bsd/pcc/dist/pcc/arch/i86/table.c | 1565 +++++++++++++++++++
external/bsd/pcc/dist/pcc/arch/m16c/TODO | 2 +-
external/bsd/pcc/dist/pcc/arch/m16c/local.c | 6 +-
external/bsd/pcc/dist/pcc/arch/m16c/local2.c | 6 +-
external/bsd/pcc/dist/pcc/arch/m16c/macdefs.h | 5 +-
external/bsd/pcc/dist/pcc/arch/m68k/code.c | 37 +-
external/bsd/pcc/dist/pcc/arch/m68k/local.c | 218 ++-
external/bsd/pcc/dist/pcc/arch/m68k/local2.c | 117 +-
external/bsd/pcc/dist/pcc/arch/m68k/macdefs.h | 34 +-
external/bsd/pcc/dist/pcc/arch/m68k/order.c | 6 +-
external/bsd/pcc/dist/pcc/arch/m68k/table.c | 62 +-
external/bsd/pcc/dist/pcc/arch/mips/code.c | 21 +-
external/bsd/pcc/dist/pcc/arch/mips/local.c | 85 +-
external/bsd/pcc/dist/pcc/arch/mips/local2.c | 94 +-
external/bsd/pcc/dist/pcc/arch/mips/macdefs.h | 29 +-
external/bsd/pcc/dist/pcc/arch/mips/table.c | 334 +---
external/bsd/pcc/dist/pcc/arch/nova/local.c | 6 +-
external/bsd/pcc/dist/pcc/arch/nova/local2.c | 13 +-
external/bsd/pcc/dist/pcc/arch/nova/macdefs.h | 5 +-
external/bsd/pcc/dist/pcc/arch/pdp10/local2.c | 9 +-
external/bsd/pcc/dist/pcc/arch/pdp10/macdefs.h | 5 +-
external/bsd/pcc/dist/pcc/arch/pdp11/code.c | 130 +-
external/bsd/pcc/dist/pcc/arch/pdp11/local.c | 231 +--
external/bsd/pcc/dist/pcc/arch/pdp11/local2.c | 16 +-
external/bsd/pcc/dist/pcc/arch/pdp11/macdefs.h | 7 +-
external/bsd/pcc/dist/pcc/arch/powerpc/local2.c | 8 +-
external/bsd/pcc/dist/pcc/arch/powerpc/macdefs.h | 5 +-
external/bsd/pcc/dist/pcc/arch/sparc64/code.c | 28 +-
external/bsd/pcc/dist/pcc/arch/sparc64/local2.c | 12 +-
external/bsd/pcc/dist/pcc/arch/sparc64/macdefs.h | 5 +-
external/bsd/pcc/dist/pcc/arch/vax/code.c | 39 +-
external/bsd/pcc/dist/pcc/arch/vax/local.c | 23 +-
external/bsd/pcc/dist/pcc/arch/vax/local2.c | 42 +-
external/bsd/pcc/dist/pcc/arch/vax/macdefs.h | 22 +-
external/bsd/pcc/dist/pcc/arch/vax/order.c | 8 +-
external/bsd/pcc/dist/pcc/arch/vax/table.c | 14 +-
external/bsd/pcc/dist/pcc/cc/cc/Makefile.in | 24 +-
external/bsd/pcc/dist/pcc/cc/cc/cc.c | 268 ++-
external/bsd/pcc/dist/pcc/cc/ccom/Makefile.in | 90 +-
external/bsd/pcc/dist/pcc/cc/ccom/builtins.c | 419 +++-
external/bsd/pcc/dist/pcc/cc/ccom/init.c | 66 +-
external/bsd/pcc/dist/pcc/cc/ccom/inline.c | 161 +-
external/bsd/pcc/dist/pcc/cc/ccom/optim.c | 41 +-
external/bsd/pcc/dist/pcc/cc/ccom/stabs.c | 10 +-
external/bsd/pcc/dist/pcc/cc/ccom/symtabs.c | 230 ++-
external/bsd/pcc/dist/pcc/cc/cpp/Makefile.in | 40 +-
external/bsd/pcc/dist/pcc/cc/cpp/cpc.c | 321 +++
external/bsd/pcc/dist/pcc/cc/cpp/cpp.h | 84 +-
external/bsd/pcc/dist/pcc/cc/cpp/sample.h | 1 +
external/bsd/pcc/dist/pcc/cc/cpp/stuff/stdio.diff | 426 +++++
external/bsd/pcc/dist/pcc/cc/cpp/stuff/stdio2.diff | 232 ++
external/bsd/pcc/dist/pcc/cc/cpp/tests/res12 | 2 +-
external/bsd/pcc/dist/pcc/cc/cpp/tests/res15 | 8 +-
external/bsd/pcc/dist/pcc/cc/cpp/tests/res16 | 4 +-
external/bsd/pcc/dist/pcc/cc/cpp/tests/res16C | 9 +-
external/bsd/pcc/dist/pcc/cc/cpp/tests/res17 | 12 +
external/bsd/pcc/dist/pcc/cc/cpp/tests/res18 | 13 +
external/bsd/pcc/dist/pcc/cc/cpp/tests/res2 | 6 +-
external/bsd/pcc/dist/pcc/cc/cpp/tests/res3 | 2 +-
external/bsd/pcc/dist/pcc/cc/cpp/tests/test17 | 12 +
external/bsd/pcc/dist/pcc/cc/cpp/tests/test18 | 11 +
external/bsd/pcc/dist/pcc/cc/cpp/tests/test19 | 33 +
external/bsd/pcc/dist/pcc/cc/cpp/token.c | 1284 +++++++-------
external/bsd/pcc/dist/pcc/cc/cxxcom/Makefile.in | 7 +-
external/bsd/pcc/dist/pcc/cc/cxxcom/builtins.c | 14 +-
external/bsd/pcc/dist/pcc/cc/cxxcom/cgram.y | 37 +-
external/bsd/pcc/dist/pcc/cc/cxxcom/gcc_compat.c | 5 +-
external/bsd/pcc/dist/pcc/cc/cxxcom/init.c | 16 +-
external/bsd/pcc/dist/pcc/cc/cxxcom/inline.c | 12 +-
external/bsd/pcc/dist/pcc/cc/cxxcom/main.c | 6 +-
external/bsd/pcc/dist/pcc/cc/cxxcom/optim.c | 14 +-
external/bsd/pcc/dist/pcc/cc/cxxcom/pass1.h | 85 +-
external/bsd/pcc/dist/pcc/cc/cxxcom/pftn.c | 87 +-
external/bsd/pcc/dist/pcc/cc/cxxcom/scan.l | 27 +-
external/bsd/pcc/dist/pcc/cc/cxxcom/symtabs.c | 13 +-
external/bsd/pcc/dist/pcc/cc/cxxcom/trees.c | 215 +-
external/bsd/pcc/dist/pcc/cc/driver/strlist.c | 33 +-
external/bsd/pcc/dist/pcc/cc/driver/strlist.h | 6 +-
external/bsd/pcc/dist/pcc/config.guess | 793 ++++-----
external/bsd/pcc/dist/pcc/config.h.in | 24 +-
external/bsd/pcc/dist/pcc/config.sub | 381 +++-
external/bsd/pcc/dist/pcc/configure | 408 ++++-
external/bsd/pcc/dist/pcc/driver/Makefile.in | 106 +
external/bsd/pcc/dist/pcc/driver/cc.din | 517 ++++++
external/bsd/pcc/dist/pcc/driver/config.h | 179 ++
external/bsd/pcc/dist/pcc/driver/driver.c | 260 +++
external/bsd/pcc/dist/pcc/driver/driver.h | 148 +
external/bsd/pcc/dist/pcc/driver/driver.man | 351 ++++
external/bsd/pcc/dist/pcc/driver/list.c | 186 ++
external/bsd/pcc/dist/pcc/driver/mkopt.sh | 74 +
external/bsd/pcc/dist/pcc/driver/opt.c.in | 27 +
external/bsd/pcc/dist/pcc/driver/options.c | 301 +++
external/bsd/pcc/dist/pcc/driver/osdefs.h | 80 +
external/bsd/pcc/dist/pcc/driver/path.c | 154 +
external/bsd/pcc/dist/pcc/driver/platform.c | 203 ++
external/bsd/pcc/dist/pcc/driver/prog_asm.c | 124 +
external/bsd/pcc/dist/pcc/driver/prog_ccom.c | 70 +
external/bsd/pcc/dist/pcc/driver/prog_cpp.c | 190 ++
external/bsd/pcc/dist/pcc/driver/prog_cxxcom.c | 32 +
external/bsd/pcc/dist/pcc/driver/prog_fcom.c | 33 +
external/bsd/pcc/dist/pcc/driver/prog_link.c | 73 +
external/bsd/pcc/dist/pcc/driver/target.c | 410 ++++
external/bsd/pcc/dist/pcc/driver/wflag.c | 121 +
external/bsd/pcc/dist/pcc/driver/xalloc.c | 77 +
external/bsd/pcc/dist/pcc/mip/compat.c | 88 +-
external/bsd/pcc/dist/pcc/mip/compat.h | 8 +-
external/bsd/pcc/dist/pcc/mip/manifest.h | 38 +-
external/bsd/pcc/dist/pcc/mip/match.c | 40 +-
external/bsd/pcc/dist/pcc/mip/node.h | 51 +-
external/bsd/pcc/dist/pcc/mip/pass2.h | 19 +-
external/bsd/pcc/dist/pcc/mip/reader.c | 379 +++-
external/bsd/pcc/dist/pcc/mip/regs.c | 269 ++-
external/bsd/pcc/dist/pcc/mip/softfloat.h | 95 +
external/bsd/pcc/dist/pcc/mip/unicode.c | 222 +-
external/bsd/pcc/dist/pcc/mip/unicode.h | 12 +-
external/bsd/pcc/dist/pcc/os/android/ccconfig.h | 62 +
external/bsd/pcc/dist/pcc/os/dragonfly/ccconfig.h | 6 +-
external/bsd/pcc/dist/pcc/os/freebsd/ccconfig.h | 8 +-
external/bsd/pcc/dist/pcc/os/linux/ccconfig.h | 67 +-
external/bsd/pcc/dist/pcc/os/litebsd/ccconfig.h | 51 +
external/bsd/pcc/dist/pcc/os/midnightbsd/ccconfig.h | 67 +-
external/bsd/pcc/dist/pcc/os/minix/ccconfig.h | 94 +-
external/bsd/pcc/dist/pcc/os/mirbsd/ccconfig.h | 10 +-
external/bsd/pcc/dist/pcc/os/netbsd/ccconfig.h | 7 +-
external/bsd/pcc/dist/pcc/os/netbsd/osdefs.h | 28 +
external/bsd/pcc/dist/pcc/os/nextstep/ccconfig.h | 29 +-
external/bsd/pcc/dist/pcc/os/none/ccconfig.h | 9 +-
external/bsd/pcc/dist/pcc/os/openbsd/ccconfig.h | 8 +-
external/bsd/pcc/dist/pcc/os/sunos/ccconfig.h | 11 +-
external/bsd/pcc/dist/pcc/os/sysv4/ccconfig.h | 8 +-
external/bsd/pcc/dist/pcc/os/win32/ccconfig.h | 42 +-
156 files changed, 15688 insertions(+), 4031 deletions(-)
diffs (truncated from 27860 to 300 lines):
diff -r c0aad7fa7dae -r 33129a9729b4 external/bsd/pcc/dist/pcc/DATESTAMP
--- a/external/bsd/pcc/dist/pcc/DATESTAMP Tue Feb 09 14:43:16 2016 +0000
+++ b/external/bsd/pcc/dist/pcc/DATESTAMP Tue Feb 09 20:28:01 2016 +0000
@@ -1,1 +1,1 @@
-20140706
+20160208
diff -r c0aad7fa7dae -r 33129a9729b4 external/bsd/pcc/dist/pcc/TODO
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/external/bsd/pcc/dist/pcc/TODO Tue Feb 09 20:28:01 2016 +0000
@@ -0,0 +1,11 @@
+
+CHAR_UNSIGNED => move to ccconfig.h
+
+add -finput-charset=CHARSET option.
+ - pass -cCHARSET to cpp
+ - cpp handles charset (or default: UTF-8)
+ - cpp outputs in UTF-8
+
+add -fexec-charset=CHARSET
+ - ccom always inputs in UTF-8
+ - encode strings and constants as whatever
diff -r c0aad7fa7dae -r 33129a9729b4 external/bsd/pcc/dist/pcc/arch/amd64/macdefs.h
--- a/external/bsd/pcc/dist/pcc/arch/amd64/macdefs.h Tue Feb 09 14:43:16 2016 +0000
+++ b/external/bsd/pcc/dist/pcc/arch/amd64/macdefs.h Tue Feb 09 20:28:01 2016 +0000
@@ -1,5 +1,5 @@
-/* Id: macdefs.h,v 1.31 2014/06/01 11:35:02 ragge Exp */
-/* $NetBSD: macdefs.h,v 1.1.1.4 2014/07/24 19:15:38 plunky Exp $ */
+/* Id: macdefs.h,v 1.35 2015/11/24 17:35:11 ragge Exp */
+/* $NetBSD: macdefs.h,v 1.1.1.5 2016/02/09 20:28:10 plunky Exp $ */
/*
* Copyright (c) 2008 Michael Shalayeff
* Copyright (c) 2003 Anders Magnusson (ragge%ludd.luth.se@localhost).
@@ -279,11 +279,19 @@
{ "__builtin_va_end", amd64_builtin_va_end, 0, 1, 0, VOID }, \
{ "__builtin_va_copy", amd64_builtin_va_copy, 0, 2, 0, VOID },
-#define NODE struct node
+#ifdef LANG_CXX
+#define P1ND struct node
+#else
+#define P1ND struct p1node
+#endif
struct node;
struct bitable;
-NODE *amd64_builtin_stdarg_start(const struct bitable *, NODE *a);
-NODE *amd64_builtin_va_arg(const struct bitable *, NODE *a);
-NODE *amd64_builtin_va_end(const struct bitable *, NODE *a);
-NODE *amd64_builtin_va_copy(const struct bitable *, NODE *a);
-#undef NODE
+P1ND *amd64_builtin_stdarg_start(const struct bitable *, P1ND *a);
+P1ND *amd64_builtin_va_arg(const struct bitable *, P1ND *a);
+P1ND *amd64_builtin_va_end(const struct bitable *, P1ND *a);
+P1ND *amd64_builtin_va_copy(const struct bitable *, P1ND *a);
+#undef P1ND
+
+/* target specific attributes */
+#define ATTR_MI_TARGET ATTR_AMD64_CMPLRET, ATTR_AMD64_XORLBL
+#define NATIVE_FLOATING_POINT
diff -r c0aad7fa7dae -r 33129a9729b4 external/bsd/pcc/dist/pcc/arch/amd64/order.c
--- a/external/bsd/pcc/dist/pcc/arch/amd64/order.c Tue Feb 09 14:43:16 2016 +0000
+++ b/external/bsd/pcc/dist/pcc/arch/amd64/order.c Tue Feb 09 20:28:01 2016 +0000
@@ -1,5 +1,5 @@
-/* Id: order.c,v 1.17 2014/04/29 18:16:09 ragge Exp */
-/* $NetBSD: order.c,v 1.1.1.4 2014/07/24 19:15:41 plunky Exp $ */
+/* Id: order.c,v 1.18 2015/12/13 09:00:04 ragge Exp */
+/* $NetBSD: order.c,v 1.1.1.5 2016/02/09 20:28:10 plunky Exp $ */
/*
* Copyright (c) 2008 Michael Shalayeff
* Copyright (c) 2003 Anders Magnusson (ragge%ludd.luth.se@localhost).
@@ -60,7 +60,7 @@
p = p->n_left; /* Ignore pointless SCONVs here */
if (p->n_op != LS || p->n_right->n_op != ICON)
return 0;
- if ((c = p->n_right->n_lval) != 1 && c != 2 && c != 3)
+ if ((c = getlval(p->n_right)) != 1 && c != 2 && c != 3)
return 0;
if (check == 1 && p->n_left->n_op != REG)
return 0;
@@ -98,7 +98,7 @@
if ((p->n_op == PLUS || p->n_op == MINUS) &&
p->n_left->n_op == ICON &&
p->n_left->n_name[0] == '\0' &&
- notoff(0, 0, p->n_left->n_lval, 0) == 0) {
+ notoff(0, 0, getlval(p->n_left), 0) == 0) {
l = p->n_right;
if (isreg(l))
return; /* Matched 4(%rax) */
@@ -153,7 +153,7 @@
r = p = q->n_left;
if ((p->n_op == PLUS || p->n_op == MINUS) && p->n_left->n_op == ICON) {
- c = p->n_left->n_lval;
+ c = getlval(p->n_left);
n = p->n_left->n_name;
p = p->n_right;
}
@@ -166,7 +166,7 @@
if (findls(p, 1)) {
if (p->n_op == SCONV)
p = p->n_left;
- sh = shtbl[(int)p->n_right->n_lval];
+ sh = shtbl[(int)getlval(p->n_right)];
r2 = regno(p->n_left);
mkconv = 1;
} else if (risreg(p)) {
@@ -179,7 +179,7 @@
return;
q->n_op = OREG;
- q->n_lval = c;
+ setlval(q, c);
q->n_rval = R2PACK(r1, r2, sh);
q->n_name = n;
tfree(r);
diff -r c0aad7fa7dae -r 33129a9729b4 external/bsd/pcc/dist/pcc/arch/amd64/table.c
--- a/external/bsd/pcc/dist/pcc/arch/amd64/table.c Tue Feb 09 14:43:16 2016 +0000
+++ b/external/bsd/pcc/dist/pcc/arch/amd64/table.c Tue Feb 09 20:28:01 2016 +0000
@@ -1,5 +1,5 @@
-/* Id: table.c,v 1.54 2014/07/01 16:52:20 ragge Exp */
-/* $NetBSD: table.c,v 1.1.1.5 2014/07/24 19:15:52 plunky Exp $ */
+/* Id: table.c,v 1.55 2015/02/07 08:47:54 ragge Exp */
+/* $NetBSD: table.c,v 1.1.1.6 2016/02/09 20:28:10 plunky Exp $ */
/*
* Copyright (c) 2008 Michael Shalayeff
* Copyright (c) 2008 Anders Magnusson (ragge%ludd.ltu.se@localhost).
@@ -1527,7 +1527,7 @@
SBREG, TDOUBLE|TFLOAT,
SBREG, TDOUBLE|TFLOAT,
0, RLEFT,
- " xorpZf LC(%rip),AL\n", },
+ " xorpZf Zc(%rip),AL\n", },
{ UMINUS, INCREG,
SCREG, TLDOUBLE,
diff -r c0aad7fa7dae -r 33129a9729b4 external/bsd/pcc/dist/pcc/arch/arm/code.c
--- a/external/bsd/pcc/dist/pcc/arch/arm/code.c Tue Feb 09 14:43:16 2016 +0000
+++ b/external/bsd/pcc/dist/pcc/arch/arm/code.c Tue Feb 09 20:28:01 2016 +0000
@@ -1,5 +1,5 @@
-/* Id: code.c,v 1.28 2014/04/19 07:47:51 ragge Exp */
-/* $NetBSD: code.c,v 1.1.1.6 2014/07/24 19:16:08 plunky Exp $ */
+/* Id: code.c,v 1.29 2015/01/07 05:20:48 gmcgarry Exp */
+/* $NetBSD: code.c,v 1.1.1.7 2016/02/09 20:28:11 plunky Exp $ */
/*
* Copyright (c) 2007 Gregory McGarry (g.mcgarry%ieee.org@localhost).
* Copyright (c) 2003 Anders Magnusson (ragge%ludd.luth.se@localhost).
@@ -844,6 +844,27 @@
return p;
}
+NODE *
+builtin_frame_address(const struct bitable *bt, NODE *a)
+{
+ assert(0);
+ return NULL;
+}
+
+NODE *
+builtin_return_address(const struct bitable *bt, NODE *a)
+{
+ assert(0);
+ return NULL;
+}
+
+NODE *
+builtin_cfa(const struct bitable *bt, NODE *a)
+{
+ assert(0);
+ return NULL;
+}
+
/*
* Called with a function call with arguments as argument.
* This is done early in buildtree() and only done once.
diff -r c0aad7fa7dae -r 33129a9729b4 external/bsd/pcc/dist/pcc/arch/arm/local.c
--- a/external/bsd/pcc/dist/pcc/arch/arm/local.c Tue Feb 09 14:43:16 2016 +0000
+++ b/external/bsd/pcc/dist/pcc/arch/arm/local.c Tue Feb 09 20:28:01 2016 +0000
@@ -1,5 +1,5 @@
-/* Id: local.c,v 1.32 2011/11/13 22:30:18 gmcgarry Exp */
-/* $NetBSD: local.c,v 1.1.1.5 2012/01/11 20:32:42 plunky Exp $ */
+/* Id: local.c,v 1.33 2015/01/07 05:20:48 gmcgarry Exp */
+/* $NetBSD: local.c,v 1.1.1.6 2016/02/09 20:28:11 plunky Exp $ */
/*
* Copyright (c) 2007 Gregory McGarry (g.mcgarry%ieee.org@localhost).
* Copyright (c) 2003 Anders Magnusson (ragge%ludd.luth.se@localhost).
@@ -81,27 +81,27 @@
case CALL:
case STCALL:
case USTCALL:
- if (p->n_type == VOID)
- break;
- /*
- * if the function returns void*, ecode() invokes
- * delvoid() to convert it to uchar*.
- * We just let this happen on the ASSIGN to the temp,
- * and cast the pointer back to void* on access
- * from the temp.
- */
- if (p->n_type == PTR+VOID)
- isptrvoid = 1;
- r = tempnode(0, p->n_type, p->n_df, p->n_ap);
- tmpnr = regno(r);
- r = block(ASSIGN, r, p, p->n_type, p->n_df, p->n_ap);
+ if (p->n_type == VOID)
+ break;
+ /*
+ * if the function returns void*, ecode() invokes
+ * delvoid() to convert it to uchar*.
+ * We just let this happen on the ASSIGN to the temp,
+ * and cast the pointer back to void* on access
+ * from the temp.
+ */
+ if (p->n_type == PTR+VOID)
+ isptrvoid = 1;
+ r = tempnode(0, p->n_type, p->n_df, p->n_ap);
+ tmpnr = regno(r);
+ r = block(ASSIGN, r, p, p->n_type, p->n_df, p->n_ap);
- p = tempnode(tmpnr, r->n_type, r->n_df, r->n_ap);
- if (isptrvoid) {
- p = block(PCONV, p, NIL, PTR+VOID, p->n_df, 0);
- }
- p = buildtree(COMOP, r, p);
- break;
+ p = tempnode(tmpnr, r->n_type, r->n_df, r->n_ap);
+ if (isptrvoid) {
+ p = block(PCONV, p, NIL, PTR+VOID, p->n_df, 0);
+ }
+ p = buildtree(COMOP, r, p);
+ break;
case NAME:
if ((q = p->n_sp) == NULL)
@@ -112,19 +112,19 @@
switch (q->sclass) {
case PARAM:
case AUTO:
- /* fake up a structure reference */
- r = block(REG, NIL, NIL, PTR+STRTY, 0, 0);
- r->n_lval = 0;
- r->n_rval = FPREG;
- p = stref(block(STREF, r, p, 0, 0, 0));
- break;
- case REGISTER:
- p->n_op = REG;
- p->n_lval = 0;
- p->n_rval = q->soffset;
- break;
- case STATIC:
- if (q->slevel > 0) {
+ /* fake up a structure reference */
+ r = block(REG, NIL, NIL, PTR+STRTY, 0, 0);
+ r->n_lval = 0;
+ r->n_rval = FPREG;
+ p = stref(block(STREF, r, p, 0, 0, 0));
+ break;
+ case REGISTER:
+ p->n_op = REG;
+ p->n_lval = 0;
+ p->n_rval = q->soffset;
+ break;
+ case STATIC:
+ if (q->slevel > 0) {
p->n_lval = 0;
p->n_sp = q;
}
@@ -151,14 +151,14 @@
p = block(UMUL, p, NIL, ty, p->n_df, p->n_ap);
break;
- case FORCE:
- /* put return value in return reg */
- p->n_op = ASSIGN;
- p->n_right = p->n_left;
- p->n_left = block(REG, NIL, NIL, p->n_type, 0, 0);
- p->n_left->n_rval = p->n_left->n_type == BOOL ?
- RETREG(BOOL_TYPE) : RETREG(p->n_type);
- break;
+ case FORCE:
+ /* put return value in return reg */
+ p->n_op = ASSIGN;
+ p->n_right = p->n_left;
+ p->n_left = block(REG, NIL, NIL, p->n_type, 0, 0);
+ p->n_left->n_rval = p->n_left->n_type == BOOL ?
+ RETREG(BOOL_TYPE) : RETREG(p->n_type);
+ break;
case SCONV:
l = p->n_left;
@@ -166,70 +166,70 @@
nfree(p);
return l;
}
- if ((p->n_type & TMASK) == 0 && (l->n_type & TMASK) == 0 &&
- tsize(p->n_type, p->n_df, p->n_ap) == tsize(l->n_type, l->n_df, l->n_ap)) {
- if (p->n_type != FLOAT && p->n_type != DOUBLE &&
- l->n_type != FLOAT && l->n_type != DOUBLE &&
- l->n_type != LDOUBLE && p->n_type != LDOUBLE) {
- if (l->n_op == NAME || l->n_op == UMUL ||
- l->n_op == TEMP) {
- l->n_type = p->n_type;
Home |
Main Index |
Thread Index |
Old Index