• Home
  • History
  • Annotate
Name Date Size #Lines LOC

..03-May-2022-

cpp/H03-May-2022-26,43518,921

oldnews/H17-Aug-2014-6,5264,849

test2/H17-Aug-2014-2,0581,455

tests/H17-Aug-2014-12,1499,162

COPYINGH A D17-Aug-20141.3 KiB2420

CREDITSH A D17-Aug-2014799 3421

CROSSCOMPH A D17-Aug-20148 KiB227176

MakefileH A D17-Aug-201448 32

Makefile.skelH A D03-May-20225.5 KiB284199

Makefile.skel.newH A D17-Aug-20145.2 KiB272205

NEWSH A D17-Aug-20142.2 KiB5237

README.firstH A D17-Aug-20148.4 KiB214159

USAGEH A D17-Aug-201412.8 KiB395277

abigen.cH A D17-Aug-20146.2 KiB320249

abitest.shH A D17-Aug-2014521 4633

amd64_emit_gas.cH A D17-Aug-201439.5 KiB1,7241,369

amd64_emit_gas.hH A D17-Aug-20141.6 KiB429

amd64_emit_yasm.cH A D17-Aug-201436 KiB1,5801,278

amd64_emit_yasm.hH A D17-Aug-20141.6 KiB429

amd64_gen.cH A D17-Aug-201447.6 KiB1,8791,294

amd64_gen.hH A D17-Aug-20143.7 KiB10157

analyze.cH A D17-Aug-201419.3 KiB778524

analyze.hH A D17-Aug-20141.6 KiB405

archdefs.hH A D17-Aug-20142.3 KiB7429

attribute.cH A D17-Aug-201422.3 KiB924694

attribute.hH A D17-Aug-20145.5 KiB187130

backend.cH A D17-Aug-201463.3 KiB2,6711,849

backend.hH A D17-Aug-201421.1 KiB668507

bfgen.cH A D17-Aug-20142 KiB9163

bftest.shH A D17-Aug-2014436 3827

builtins.cH A D17-Aug-201455.9 KiB2,2821,636

builtins.hH A D17-Aug-20142.4 KiB7941

cc1_main.cH A D17-Aug-201426 KiB1,115856

cc1_main.hH A D17-Aug-2014588 3425

cc_main.cH A D17-Aug-201432 KiB1,2691,018

cc_main.hH A D17-Aug-20141.1 KiB6446

cfgfile.cH A D17-Aug-201412.8 KiB614463

cfgfile.hH A D17-Aug-2014342 1510

check80.cH A D17-Aug-20141.6 KiB9275

configureH A D17-Aug-201419 KiB614439

control.cH A D17-Aug-201424.8 KiB1,052698

control.hH A D17-Aug-20143.7 KiB13551

crosssnap.shH A D17-Aug-20141.2 KiB5934

crt1-sparc.sH A D17-Aug-20142.1 KiB8871

debug.cH A D17-Aug-201413.7 KiB626536

debug.hH A D17-Aug-20144 KiB12475

decl.cH A D17-Aug-201471.6 KiB2,9841,972

decl.hH A D17-Aug-20144.2 KiB13443

decl_adv.cH A D17-Aug-201443.2 KiB1,8061,143

decl_adv.hH A D17-Aug-20141.8 KiB4817

defs.cH A D17-Aug-201413.2 KiB488325

defs.hH A D17-Aug-20142.9 KiB9651

diffc.shH A D17-Aug-2014443 2923

driver.cH A D03-May-202223.5 KiB895687

driver.hH A D17-Aug-20141.5 KiB376

dwarf.cH A D17-Aug-2014857 4637

dwarf.hH A D17-Aug-2014210 1610

error.cH A D17-Aug-20146.6 KiB342234

error.hH A D17-Aug-20142.5 KiB8219

evalexpr.cH A D17-Aug-201455.7 KiB2,2691,465

evalexpr.hH A D17-Aug-20141.8 KiB4716

exectools.cH A D17-Aug-20144 KiB13793

exectools.hH A D17-Aug-20141.5 KiB355

expr.cH A D17-Aug-201472.1 KiB3,0622,028

expr.hH A D17-Aug-20145.6 KiB20096

fcatalogH A D17-Aug-20144.5 KiB177166

fcatalog.cH A D17-Aug-201416.9 KiB783576

fcatalog.hH A D17-Aug-2014540 3323

features.hH A D17-Aug-20143.8 KiB14625

functions.cH A D17-Aug-20142.8 KiB11059

functions.hH A D17-Aug-20143.8 KiB12764

icode.cH A D17-Aug-2014134.9 KiB5,5183,665

icode.hH A D17-Aug-201420.1 KiB844566

icodeinstr.cH A D17-Aug-201456.2 KiB2,3291,578

inlineasm.cH A D03-May-202232.5 KiB1,4901,249

inlineasm.hH A D17-Aug-20142.4 KiB11188

install.shH A D17-Aug-20143.7 KiB138109

lex.cH A D17-Aug-201413.1 KiB596454

lex.hH A D17-Aug-20141.5 KiB397

libnwcc.cH A D17-Aug-201420.5 KiB1,024751

libnwcc.hH A D17-Aug-20141.4 KiB5434

mips_emit_as.cH A D17-Aug-201462.7 KiB2,6512,195

mips_emit_as.hH A D17-Aug-20141.5 KiB407

mips_gen.cH A D17-Aug-201451.4 KiB2,1521,533

mips_gen.hH A D17-Aug-20141.9 KiB5520

misc.cH A D03-May-202218.6 KiB873678

misc.hH A D17-Aug-20142.5 KiB7230

n_libc.cH A D17-Aug-201412.5 KiB634465

n_libc.hH A D17-Aug-20143.3 KiB11467

news-0.7.7H A D17-Aug-20146.6 KiB218152

news-0.7.8H A D17-Aug-201418 KiB556416

news-0.7.9H A D17-Aug-201413.3 KiB421317

news-0.8H A D17-Aug-20141.1 KiB2821

news-0.8.2H A D17-Aug-20141.1 KiB2519

numlimits.cH A D17-Aug-201413.1 KiB601371

numlimits.hH A D17-Aug-20141.5 KiB366

nwcc.conf.sampleH A D17-Aug-2014349 1712

power_emit_as.cH A D17-Aug-201495.3 KiB3,9753,126

power_emit_as.hH A D17-Aug-20141.5 KiB407

power_gen.cH A D17-Aug-201486.4 KiB3,3942,271

power_gen.hH A D17-Aug-20142.7 KiB7539

reg.cH A D17-Aug-201435 KiB1,461980

reg.hH A D17-Aug-20145.5 KiB243144

scope.cH A D17-Aug-201441 KiB1,666994

scope.hH A D17-Aug-20145.2 KiB217120

snake_driver.cH A D17-Aug-20146.6 KiB376315

snake_driver.hH A D17-Aug-201479 84

snake_main.cH A D17-Aug-20141.1 KiB6046

sparc_emit_as.cH A D17-Aug-201466 KiB2,8092,303

sparc_emit_as.hH A D17-Aug-20141.5 KiB407

sparc_gen.cH A D17-Aug-201468.1 KiB2,7731,892

sparc_gen.hH A D17-Aug-20141.8 KiB4814

stack.cH A D17-Aug-20143.6 KiB13488

stack.hH A D17-Aug-20142.4 KiB7729

standards.cH A D17-Aug-20141.1 KiB6452

standards.hH A D17-Aug-2014334 2114

subexpr.cH A D17-Aug-201471.8 KiB2,9332,076

subexpr.hH A D17-Aug-20145.1 KiB18586

sweeper.cH A D17-Aug-201413.4 KiB651522

symlist.cH A D17-Aug-201413 KiB556382

symlist.hH A D17-Aug-20142.8 KiB9149

sysdeps.cH A D17-Aug-20141.1 KiB5644

sysdeps.hH A D17-Aug-2014112 95

test.shH A D03-May-20224.4 KiB187155

token.cH A D17-Aug-201446.4 KiB2,0981,494

token.hH A D17-Aug-201413.7 KiB500298

type.cH A D17-Aug-201432 KiB1,4641,108

type.hH A D17-Aug-201412.5 KiB446224

typemap.cH A D17-Aug-2014132.7 KiB4,0523,279

typemap.hH A D17-Aug-20143.5 KiB11872

x86_emit_gas.cH A D17-Aug-201488.2 KiB3,6462,856

x86_emit_gas.hH A D17-Aug-20141.6 KiB419

x86_emit_nasm.cH A D17-Aug-201473.6 KiB3,1752,531

x86_emit_nasm.hH A D17-Aug-20141.6 KiB4210

x86_gen.cH A D17-Aug-201496.7 KiB4,0452,839

x86_gen.hH A D17-Aug-20143.2 KiB11063

x87_nonsense.cH A D17-Aug-20143.8 KiB14181

x87_nonsense.hH A D17-Aug-20141.9 KiB5015

zalloc.cH A D17-Aug-20148.7 KiB397264

zalloc.hH A D17-Aug-20141.1 KiB5745

README.first

1
2The nwcc C compiler (http://nwcc.sourceforge.net)
3  ... version 0.8.3
4  ... (c) Nils Weller 2003 - 2014
5=================================
6
7
81. Introduction
92. Building nwcc & supported platforms
103. Usage
114. The future of nwcc
125. Feedback, bug reports & contact
13
14  __________________
15,/                   \,
16| 1. Introduction     |
17`\___________________/'
18
19nwcc is a small C compiler for Unix systems that I wrote in my freetime,
20for fun and to prove to myself that I could. I started the project in
21August 2003, but because I had a job and a life and a few other hobby
22code projects, it took me until autumn 2005 to make it work with various
23constructs of the C language.
24
25So what new things does nwcc bring to the table? Most importantly, new code:
26I wrote everything from scratch - including the lexer, parser and backend.
27The code is written in C, is currently around 60.000 lines in size, and
28I'm releasing it under the BSD license.
29
30This release is not necessarily useful for software development, but at
31least nwcc is strong enough to compile itself (the result of which can
32compile nwcc as well) and should thus be capable of dealing with at least
33some medium sized programs. There are still some things missing/broken,
34but things are improving almost every day (I upload my changes to SF
35whenever I add/fix something of interest.)
36
37Feature-wise, there is little interesting to be had in nwcc yet:
38
39       - Support for various C language features is incomplete or broken;
40Most notably support for constant expressions, bitfields and a few other
41things. There's a more detailed list on the website:
42	http://nwcc.sf.net/bugs.html
43
44       - There are no features a power developer used to established
45mainstream compilers would consider interesting, yet (apart from, maybe,
46cross-compilation.) Sorry. There is little beyond plain dumb compilation.
47Especially support for debugging and profiling are still missing
48
49       - There is absolutely no optimization, meaning the generated code
50is very slow compared to the output of established compilers. I will work
51on this soon, but you should understand that my primary concerns right now
52are code correctness and portability rather than speed (it's hard enough to
53make slow code work!)
54
55It takes a lot of work to get even a subset of the C language to compile,
56so the fact that something is missing or done wrong in nwcc does not mean
57that I don't care about that particular area of the C language or compiler
58design; It only means that I haven't gotten around to doing it right, or
59indeed at all, yet.
60
61  ________________________________________
62,/                                        \,
63| 2. Building nwcc & supported platforms   |
64`\________________________________________/'
65
66nwcc currently supports Linux/Mac OS X/*BSD/Solaris on 80x86, Linux/Mac OS
67X/FreeBSD/OpenBSD on AMD64, AIX/Linux on PowerPC, IRIX on MIPS (64bit-only),
68and Solaris/Linux on SPARC (64bit-only.)
69
70Just type ``./configure'' and ``make'' to build the compiler, then ``make
71install'' to install it to /usr/local/nwcc. To install nwcc to a different
72directory, use
73
74	./configure --installprefix=/path/to/dir
75
76Other configurable options:
77
78	--color		Make nwcc display colored warnings/errors. This
79			can also be enabled with the "-color" command
80			line option instead (which can also be put into
81			the configuration file)
82	--gnu		Make nwcc pretend to be gcc to applications (by
83			defining __GNUC__). The default is not to do
84			this. The -gnu command line option can be used
85			as well
86	--notgnu	Opposite of --gnu. The -notgnu command line
87			option can be used as well
88
89If you are building nwcc on a 64bit AIX system, note that you have a choice
90between 32bit and 64bit. If you just type ``make'', you'll get a 32bit
91compiler; for 64bit, type ``make ABI=-maix64'' (unfortunately the test
92script invoked by the Makefile reports more errors than there really are...
93use ``./test.sh -maix64'' to get the real status on PPC64.)
94
95(Note that 32bit and 64bit binaries can both generate 32bit and 64bit code;
96You just have to use the -abi=aix32 and -abi=aix64 command line options.)
97
98To build an N64 nwcc on IRIX, type ``make ABI=-mabi=64''.
99
100(Note that N32 and N64 binaries can both generate N32 and N64 code;
101You just have to use the -abi=n32 and -abi=n64 command line options.)
102
103To build an AMD64 nwcc on Mac OS X, type ``make ABI=-m64''.
104
105(On OSX, nwcc can always generate x86 or AMD64 code using the ``-arch=x86''
106and ``-arch=amd64'' command line options.)
107
108gcc and GNU cpp are currently needed for compiling and using nwcc. Please
109refer to the USAGE file for instructions on using nwcc without installing
110it.
111
112nwcc is capable of cross-compilation - Please refer to the CROSSCOMP file
113for more information on this feature.
114
115I have been developing nwcc on SuSE Linux 8.2, FreeBSD 5.4, OpenBSD 3.7,
116AIX 5.3, IRIX 6.5.25 and Solaris 10.
117
118The test programs in the tests sub directory all work on the x86 and AMD64
119systems. Some that relate to floating point, variadic functions and inline
120assembly fail on MIPS, PowerPC and SPARC.
121
122---
123
124  ___________________
125,/                   \,
126| 3. Usage            |
127`\___________________/'
128
129Please read the USAGE file.
130
131  ___________________
132,/                   \,
133| 4. Future of nwcc   |
134`\___________________/'
135
136Obviously, this is only the beginning, and I intend to do much more
137with nwcc in the near future.
138
139I need to improve:
140
141      - Code correctness. Invariably, there are many bugs I haven't
142found yet, and that people who try out this early version will run
143into, or that I will run into myself while using nwcc myself
144
145I need to add:
146
147      - All missing C language features
148
149      - All sorts of optimizations. Instruction scheduling, dataflow
150analysis, exploitation of cache characteristics, compiler-intrinsic
151functions and even simple micro optimizations (such as using bitwise
152instructions instead of more expensive arithmetic instructions where
153possible) still need to be done
154
155      - Backends for all common desktop and server architectures in use,
156and perhaps a few embedded ones too. ARM, PA-RISC and Alpha are high on
157my wishlist right now
158
159      - Support for various debugging and compatibility features, such
160as guarded variables (variables that may only be accessed from certain
161functions), emulation of misaligned memory access on architectures that
162yield bus errors for that, zeroing out stack space before first use,
163placing ``const'' variables into read-only memory, and so on
164
165      - Support for one or more debuggers and profilers. This may involve
166writing my own debugger and profiler because this is a fun project and it may
167be easier to start from scratch than to understand a huge program like say
168gdb in-depth enough to generate compatible output, after all
169
170      - Support for creating position-independent code for shared libraries
171
172  _______________________________
173,/                               \,
174| 5. Feedback/Bug reports/Contact |
175`\_______________________________/'
176
177I am open to all sorts of feedback and would love to hear from you. I
178would particularly appreciate bug reports, code criticism and future
179suggestions, though I'd also be happy to answer questions and give
180support. I also enjoy discussing Unix systems programming and computer
181architecture in general.
182
183You can mail me at
184
185    nweller<at>tzi<dot>de
186
187In particular, I would be highly appreciative of bug reports. The test.sh
188script is expected to pass fully on most Linux/glibc systems from between
1892003 and 2007. If any tests fail on your Linux or BSD system, please mail
190me the output of
191
192./test.sh --verbose
193
194(this will also give you many warnings, but those are good and intended.)
195
196If you've found any bugs while experimenting with nwcc, please try to
197create a minimal C program that reproduces the problem and mail it to me,
198along with a description of the problem.
199
200It's no secret that any program containing more than a few thousand lines
201of code is unlikely to work with nwcc, so I'm not interested in ALL
202uncompilable code, but mostly in code that yields a compiler crash or a
203cryptic error messages that indicates a genuine bug (as opposed to just
204an unimplemented feature.) Of course, I also want to hear about valid
205C code that is rejected as being invalid by nwcc. Note that nwcc only
206implements a subset of GNU C, so some error messages may be correct from
207a standard ISO C perspective and indicate some nonportability in the
208input. Also see the section ``Using nwcc in a GNU world'' in the USAGE
209file.
210
211
212  -- Nils R. Weller, Bremen (Germany), August 04 2011
213
214