1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
|
.\" $OpenBSD: ccom.1,v 1.2 2007/10/20 18:23:35 otto Exp $
."\
.\" Copyright (c) 2007 Jeremy C. Reed <reed@reedmedia.net>
.\" Permission to use, copy, modify, and/or distribute this software for any
.\" purpose with or without fee is hereby granted, provided that the above
.\" copyright notice and this permission notice appear in all copies.
.\"
.\" THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR AND CONTRIBUTORS DISCLAIM
.\" ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
.\" WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL AUTHOR AND
.\" CONTRIBUTORS BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
.\" DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
.\" PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
.\" ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF
.\" THIS SOFTWARE.
.Dd September 14, 2007
.Dt ccom 1
.Os
.Sh NAME
.Nm ccom
.Nd C compiler
.Sh SYNOPSIS
.Nm
.Op Fl gs
.Op Fl W Ar flags
.Op Fl X Ar flags
.Op Fl x Ar optimizations
.Op Fl Z Ar flags
.Op infile
.Op outfile
.Pp
.Sh DESCRIPTION
The
.Nm
utility provides a C compiler.
The frontend is usually
.Xr pcc 1 .
It is \fBnot\fR intended to be run directly.
.Pp
.Nm
reads the C source from
.Ar infile
or standard input and writes the assembler source
to
.Ar outfile
or to standard output.
.Pp
The options are as follows:
.Bl -tag -width Ds
.It Fl g
Enable debugging.
.\" built into binary, explain stabs?
.It Fl k
Generate PIC code.
.It Fl s
Print statistics to standard error when complete.
This includes:
name table entries, name string size, permanent allocated memory,
temporary allocated memory, lost memory, argument list unions,
dimension/function unions, struct/union/enum blocks, inline node count,
inline control blocks, and permanent symtab entries.
.\" TODO: explain units for above?
.It Fl v
Display version.
.It Fl W Ar flags
Report warnings.
(Do some basic checks.)
NOTE! These are subject to change RSN!
.Ar flags
is one or more of the following:
.Bl -tag -width Ds
.It Sy implicit
Implies
.Sy implicit-function-declaration
and
.Sy implicit-int .
.It Sy implicit-function-declaration
Report if no prototype for function.
.It Sy implicit-int
TODO
.It Sy missing-prototypes
TODO
.It Sy strict-prototypes
TODO
.El
.\"
.It Fl X Ar flags
C specific debugging where
.Ar flags
is one or more of the following:
.Bl -tag -width Ds
.It Sy b
Building of parse trees
.It Sy d
Declarations (multiple
.Sy d
flags gives more output)
.It Sy e
Pass1 trees at exit
.It Sy i
Initializations
.It Sy n
Memory allocations
.It Sy o
Turn off optimisations
.It Sy p
Prototypes
.It Sy s
Inlining
.It Sy t
Type conversions
.It Sy x
Target-specific flag, used in machine-dependent code
.El
.\"
.It Fl x Ar optimizations
.Ar optimizations
is one or more of the following:
.\" TODO: reword this, since multiple terms don't go with one -x switch??
.Bl -tag -width deljumps
.It Sy deljumps
Delete redundant jumps and dead code.
.It Sy ssa
Convert statements into SSA form for optimization. Not yet finished.
.It Sy tailcall
Currently not implemented.
.It Sy temps
Setting this flag allows variables to be put into registers, for further
optimization by the register allocator.
.El
.\"
.It Fl Z Ar flags
Code generator (pass2) specific debugging where
.Ar flags
is one or more of the following:
.Bl -tag -width Ds
.It Sy b
Basic block and SSA building
.It Sy c
Code printout
.It Sy e
Trees when entering pass2
.It Sy f
Instruction matcher, may provide much output
.It Sy n
Memory allocation
.It Sy o
Instruction generator
.It Sy r
Register allocator
.It Sy s
Shape matching in instruction generator
.It Sy t
Type matching in instruction generator
.It Sy u
Sethi-Ullman computations
.It Sy x
Target-specific flag, used in machine-dependent code
.El
.El
.Sh SEE ALSO
.Xr as 1 ,
.Xr cpp 1 ,
.Xr pcc 1
.Sh HISTORY
The
.Nm
compiler is based on the original Portable C Compiler by S. C.
Johnson, written in the late 70's.
Even though much of the compiler has been rewritten, some of the
basics still remain.
About 50% of the frontend code and 80% of the backend code has been
rewritten.
Most is written by Anders Magnusson, with the exception of
the data-flow analysis part and the SSA conversion code which is
written by Peter A Jonsson, and the Mips port that were written as
part of a project by undergraduate students at Lulea University of
Technology.
.Pp
This product includes software developed or owned by Caldera
International, Inc.
|