Document flags to suppress unwanted info in core dumps.
[ghc-hetmet.git] / docs / users_guide / debugging.xml
1 <?xml version="1.0" encoding="iso-8859-1"?>
2 <sect1 id="options-debugging">
3   <title>Debugging the compiler</title>
4
5   <indexterm><primary>debugging options (for GHC)</primary></indexterm>
6
7   <para>HACKER TERRITORY. HACKER TERRITORY.  (You were warned.)</para>
8
9   <sect2 id="dumping-output">
10     <title>Dumping out compiler intermediate structures</title>
11     
12     <indexterm><primary>dumping GHC intermediates</primary></indexterm>
13     <indexterm><primary>intermediate passes, output</primary></indexterm>
14     
15     <variablelist>
16       <varlistentry>
17         <term>
18           <option>-ddump-</option><replaceable>pass</replaceable>
19           <indexterm><primary><option>-ddump</option> options</primary></indexterm>
20         </term>
21         <listitem>
22           <para>Make a debugging dump after pass
23         <literal>&lt;pass&gt;</literal> (may be common enough to need
24         a short form&hellip;).  You can get all of these at once
25         (<emphasis>lots</emphasis> of output) by using
26         <option>-v5</option>, or most of them with
27         <option>-v4</option>.  Some of the most useful ones
28         are:</para>
29
30           <variablelist>
31             <varlistentry>
32               <term>
33                 <option>-ddump-parsed</option>:
34                 <indexterm><primary><option>-ddump-parsed</option></primary></indexterm>
35               </term>
36               <listitem>
37                 <para>parser output</para>
38               </listitem>
39             </varlistentry>
40
41             <varlistentry>
42               <term>
43                 <option>-ddump-rn</option>:
44                 <indexterm><primary><option>-ddump-rn</option></primary></indexterm>
45               </term>
46               <listitem>
47                 <para>renamer output</para>
48               </listitem>
49             </varlistentry>
50
51             <varlistentry>
52               <term>
53                 <option>-ddump-tc</option>:
54                 <indexterm><primary><option>-ddump-tc</option></primary></indexterm>
55               </term>
56               <listitem>
57                 <para>typechecker output</para>
58               </listitem>
59             </varlistentry>
60
61             <varlistentry>
62               <term>
63                 <option>-ddump-splices</option>:
64                 <indexterm><primary><option>-ddump-splices</option></primary></indexterm>
65               </term>
66               <listitem>
67                 <para>Dump Template Haskell expressions that we splice in,
68                 and what Haskell code the expression evaluates to.</para>
69               </listitem>
70             </varlistentry>
71
72             <varlistentry>
73               <term>
74                 <option>-ddump-types</option>:
75                 <indexterm><primary><option>-ddump-types</option></primary></indexterm>
76               </term>
77               <listitem>
78                 <para>Dump a type signature for each value defined at
79               the top level of the module.  The list is sorted
80               alphabetically.  Using <option>-dppr-debug</option>
81               dumps a type signature for all the imported and
82               system-defined things as well; useful for debugging the
83               compiler.</para>
84               </listitem>
85             </varlistentry>
86
87             <varlistentry>
88               <term>
89                 <option>-ddump-deriv</option>:
90                 <indexterm><primary><option>-ddump-deriv</option></primary></indexterm>
91               </term>
92               <listitem>
93                 <para>derived instances</para>
94               </listitem>
95             </varlistentry>
96
97             <varlistentry>
98               <term>
99                 <option>-ddump-ds</option>:
100                 <indexterm><primary><option>-ddump-ds</option></primary></indexterm>
101               </term>
102               <listitem>
103                 <para>desugarer output</para>
104               </listitem>
105             </varlistentry>
106
107             <varlistentry>
108               <term>
109                 <option>-ddump-spec</option>:
110                 <indexterm><primary><option>-ddump-spec</option></primary></indexterm>
111               </term>
112               <listitem>
113                 <para>output of specialisation pass</para>
114               </listitem>
115             </varlistentry>
116
117             <varlistentry>
118               <term>
119                 <option>-ddump-rules</option>:
120                 <indexterm><primary><option>-ddump-rules</option></primary></indexterm>
121               </term>
122               <listitem>
123                 <para>dumps all rewrite rules specified in this module; 
124                       see <xref linkend="controlling-rules"/>.
125                 </para>
126               </listitem>
127             </varlistentry>
128
129             <varlistentry>
130               <term>
131                 <option>-ddump-rule-firings</option>:
132                 <indexterm><primary><option>-ddump-rule-firings</option></primary></indexterm>
133               </term>
134               <listitem>
135                 <para>dumps the names of all rules that fired in this module</para>
136               </listitem>
137             </varlistentry>
138
139             <varlistentry>
140               <term>
141                 <option>-ddump-rule-rewrites</option>:
142                 <indexterm><primary><option>-ddump-rule-rewrites</option></primary></indexterm>
143               </term>
144               <listitem>
145                 <para>dumps detailed information about all rules that fired in
146                       this module
147                 </para>
148               </listitem>
149             </varlistentry>
150
151             <varlistentry>
152               <term>
153                 <option>-ddump-vect</option>:
154                 <indexterm><primary><option>-ddump-vect</option></primary></indexterm>
155               </term>
156               <listitem>
157                 <para>dumps the output of the vectoriser.
158                 </para>
159               </listitem>
160             </varlistentry>
161
162             <varlistentry>
163               <term>
164                 <option>-ddump-simpl</option>:
165                 <indexterm><primary><option>-ddump-simpl</option></primary></indexterm>
166               </term>
167               <listitem>
168                 <para>simplifier output (Core-to-Core passes)</para>
169               </listitem>
170             </varlistentry>
171
172             <varlistentry>
173               <term>
174                 <option>-ddump-inlinings</option>:
175                 <indexterm><primary><option>-ddump-inlinings</option></primary></indexterm>
176               </term>
177               <listitem>
178                 <para>inlining info from the simplifier</para>
179               </listitem>
180             </varlistentry>
181
182             <varlistentry>
183               <term>
184                 <option>-ddump-cpranal</option>:
185                 <indexterm><primary><option>-ddump-cpranal</option></primary></indexterm>
186               </term>
187               <listitem>
188                 <para>CPR analyser output</para>
189               </listitem>
190             </varlistentry>
191
192             <varlistentry>
193               <term>
194                 <option>-ddump-stranal</option>:
195                 <indexterm><primary><option>-ddump-stranal</option></primary></indexterm>
196               </term>
197               <listitem>
198                 <para>strictness analyser output</para>
199               </listitem>
200             </varlistentry>
201
202             <varlistentry>
203               <term>
204                 <option>-ddump-cse</option>:
205                 <indexterm><primary><option>-ddump-cse</option></primary></indexterm>
206               </term>
207               <listitem>
208                 <para>CSE pass output</para>
209               </listitem>
210             </varlistentry>
211
212             <varlistentry>
213               <term>
214                 <option>-ddump-worker-wrapper</option>:
215                 <indexterm><primary><option>-ddump-worker-wrapper</option></primary></indexterm>
216               </term>
217               <listitem>
218                 <para>worker/wrapper split output</para>
219               </listitem>
220             </varlistentry>
221
222             <varlistentry>
223               <term>
224                 <option>-ddump-occur-anal</option>:
225                 <indexterm><primary><option>-ddump-occur-anal</option></primary></indexterm>
226               </term>
227               <listitem>
228                 <para>`occurrence analysis' output</para>
229               </listitem>
230             </varlistentry>
231
232             <varlistentry>
233               <term>
234                 <option>-ddump-prep</option>:
235                 <indexterm><primary><option>-ddump-prep</option></primary></indexterm>
236               </term>
237               <listitem>
238                 <para>output of core preparation pass</para>
239               </listitem>
240             </varlistentry>
241
242             <varlistentry>
243               <term>
244                 <option>-ddump-stg</option>:
245                 <indexterm><primary><option>-ddump-stg</option></primary></indexterm>
246               </term>
247               <listitem>
248                 <para>output of STG-to-STG passes</para>
249               </listitem>
250             </varlistentry>
251
252             <varlistentry>
253               <term>
254                 <option>-ddump-flatC</option>:
255                 <indexterm><primary><option>-ddump-flatC</option></primary></indexterm>
256               </term>
257               <listitem>
258                 <para><emphasis>flattened</emphasis> Abstract&nbsp;C</para>
259               </listitem>
260             </varlistentry>
261
262             <varlistentry>
263               <term>
264                 <option>-ddump-cmm</option>:
265                 <indexterm><primary><option>-ddump-cmm</option></primary></indexterm>
266               </term>
267               <listitem>
268                 <para>Print the C-- code out.</para>
269               </listitem>
270             </varlistentry>
271
272             <varlistentry>
273               <term>
274                 <option>-ddump-opt-cmm</option>:
275                 <indexterm><primary><option>-ddump-opt-cmm</option></primary></indexterm>
276               </term>
277               <listitem>
278                 <para>Dump the results of C-- to C-- optimising passes.</para>
279               </listitem>
280             </varlistentry>
281
282             <varlistentry>
283               <term>
284                 <option>-ddump-asm</option>:
285                 <indexterm><primary><option>-ddump-asm</option></primary></indexterm>
286               </term>
287               <listitem>
288                 <para>assembly language from the native-code generator</para>
289               </listitem>
290             </varlistentry>
291
292             <varlistentry>
293               <term>
294                 <option>-ddump-bcos</option>:
295                 <indexterm><primary><option>-ddump-bcos</option></primary></indexterm>
296               </term>
297               <listitem>
298                 <para>byte code compiler output</para>
299               </listitem>
300             </varlistentry>
301
302             <varlistentry>
303               <term>
304                 <option>-ddump-foreign</option>:
305                 <indexterm><primary><option>-ddump-foreign</option></primary></indexterm>
306               </term>
307               <listitem>
308                 <para>dump foreign export stubs</para>
309               </listitem>
310             </varlistentry>
311           </variablelist>
312         </listitem>
313       </varlistentry>
314       
315       <varlistentry>
316         <term>
317           <option>-ddump-simpl-phases</option>:
318           <indexterm><primary><option>-ddump-simpl-phases</option></primary></indexterm>
319         </term>
320         <listitem>
321           <para>Show the output of each run of the simplifier.  Used when even
322         <option>-dverbose-core2core</option> doesn't cut it.</para>
323         </listitem>
324       </varlistentry>
325
326       <varlistentry>
327         <term>
328           <option>-ddump-simpl-iterations</option>:
329           <indexterm><primary><option>-ddump-simpl-iterations</option></primary></indexterm>
330         </term>
331         <listitem>
332           <para>Show the output of each <emphasis>iteration</emphasis>
333         of the simplifier (each run of the simplifier has a maximum
334         number of iterations, normally 4).  This outputs even more information
335         than <option>-ddump-simpl-phases</option>.</para>
336         </listitem>
337       </varlistentry>
338
339       <varlistentry>
340         <term>
341           <option>-ddump-simpl-stats</option>
342           <indexterm><primary><option>-ddump-simpl-stats option</option></primary></indexterm>
343         </term>
344         <listitem>
345           <para>Dump statistics about how many of each kind of
346         transformation too place.  If you add
347         <option>-dppr-debug</option> you get more detailed
348         information.</para>
349         </listitem>
350       </varlistentry>
351
352       <varlistentry>
353         <term>
354           <option>-ddump-if-trace</option>
355           <indexterm><primary><option>-ddump-if-trace</option></primary></indexterm>
356         </term>
357         <listitem>
358           <para>Make the interface loader be *real* chatty about what it is
359         upto.</para>
360         </listitem>
361       </varlistentry>
362
363       <varlistentry>
364   <term>
365           <option>-ddump-tc-trace</option>
366           <indexterm><primary><option>-ddump-tc-trace</option></primary></indexterm>
367         </term>
368   <listitem>
369     <para>Make the type checker be *real* chatty about what it is
370   upto.</para>
371   </listitem>
372       </varlistentry>
373
374       <varlistentry>
375   <term>
376           <option>-ddump-vt-trace</option>
377           <indexterm><primary><option>-ddump-tv-trace</option></primary></indexterm>
378         </term>
379   <listitem>
380     <para>Make the vectoriser be *real* chatty about what it is
381   upto.</para>
382   </listitem>
383       </varlistentry>
384
385       <varlistentry>
386         <term>
387           <option>-ddump-rn-trace</option>
388           <indexterm><primary><option>-ddump-rn-trace</option></primary></indexterm>
389         </term>
390         <listitem>
391           <para>Make the renamer be *real* chatty about what it is
392         upto.</para>
393         </listitem>
394       </varlistentry>
395
396       <varlistentry>
397         <term>
398           <option>-ddump-rn-stats</option>
399           <indexterm><primary><option>-dshow-rn-stats</option></primary></indexterm>
400         </term>
401         <listitem>
402           <para>Print out summary of what kind of information the renamer
403         had to bring in.</para>
404         </listitem>
405       </varlistentry>
406
407       <varlistentry>
408         <term>
409           <option>-dverbose-core2core</option>
410           <indexterm><primary><option>-dverbose-core2core</option></primary></indexterm>
411         </term>
412         <term>
413           <option>-dverbose-stg2stg</option>
414           <indexterm><primary><option>-dverbose-stg2stg</option></primary></indexterm>
415         </term>
416         <listitem>
417           <para>Show the output of the intermediate Core-to-Core and
418         STG-to-STG passes, respectively.  (<emphasis>Lots</emphasis>
419         of output!) So: when we're really desperate:</para>
420
421           <screen>
422 % ghc -noC -O -ddump-simpl -dverbose-core2core -dcore-lint Foo.hs
423 </screen>
424
425         </listitem>
426       </varlistentry>
427       
428       <varlistentry>
429         <term>
430           <option>-dshow-passes</option>
431           <indexterm><primary><option>-dshow-passes</option></primary></indexterm>
432         </term>
433         <listitem>
434           <para>Print out each pass name as it happens.</para>
435         </listitem>
436       </varlistentry>
437
438       <varlistentry>
439         <term>
440           <option>-ddump-core-stats</option>
441           <indexterm><primary><option>-ddump-core-stats</option></primary></indexterm>
442         </term>
443         <listitem>
444           <para>Print a one-line summary of the size of the Core program
445                      at the end of the optimisation pipeline.</para>
446         </listitem>
447       </varlistentry>
448
449       <varlistentry>
450         <term>
451           <option>-dfaststring-stats</option>
452           <indexterm><primary><option>-dfaststring-stats</option></primary></indexterm>
453         </term>
454         <listitem>
455           <para>Show statistics for the usage of fast strings by the
456           compiler.</para>
457         </listitem>
458       </varlistentry>
459
460       <varlistentry>
461         <term>
462           <option>-dppr-debug</option>
463           <indexterm><primary><option>-dppr-debug</option></primary></indexterm>
464         </term>
465         <listitem>
466           <para>Debugging output is in one of several
467           &ldquo;styles.&rdquo; Take the printing of types, for
468           example.  In the &ldquo;user&rdquo; style (the default), the
469           compiler's internal ideas about types are presented in
470           Haskell source-level syntax, insofar as possible.  In the
471           &ldquo;debug&rdquo; style (which is the default for
472           debugging output), the types are printed in with explicit
473           foralls, and variables have their unique-id attached (so you
474           can check for things that look the same but aren't).  This
475           flag makes debugging output appear in the more verbose debug
476           style.</para>
477         </listitem>
478       </varlistentry>
479     </variablelist>
480   </sect2>
481
482   <sect2 id="formatting dumps">
483     <title>Formatting dumps</title>
484
485     <indexterm><primary>formatting dumps</primary></indexterm>
486
487      <variablelist>
488       <varlistentry>
489         <term>
490           <option>-dppr-user-length</option>
491           <indexterm><primary><option>-dppr-user-length</option></primary></indexterm>
492         </term>
493         <listitem>
494           <para>In error messages, expressions are printed to a
495           certain &ldquo;depth&rdquo;, with subexpressions beyond the
496           depth replaced by ellipses.  This flag sets the
497           depth.  Its default value is 5.</para>
498         </listitem>
499       </varlistentry>
500
501       <varlistentry>
502         <term>
503           <option>-dppr-colsNNN</option>
504           <indexterm><primary><option>-dppr-colsNNN</option></primary></indexterm>
505         </term>
506         <listitem>
507           <para>Set the width of debugging output. Use this if your code is wrapping too much.
508                 For example: <option>-dppr-cols200</option>.</para>
509         </listitem>
510       </varlistentry>
511
512       <varlistentry>
513         <term>
514           <option>-dppr-case-as-let</option>
515           <indexterm><primary><option>-dppr-case-as-let</option></primary></indexterm>
516         </term>
517         <listitem>
518           <para>Print single alternative case expressions as though they were strict 
519                 let expressions. This is helpful when your code does a lot of unboxing.</para>
520         </listitem>
521       </varlistentry>
522
523       <varlistentry>
524         <term>
525           <option>-dno-debug-output</option>
526           <indexterm><primary><option>-dno-debug-output</option></primary></indexterm>
527         </term>
528         <listitem>
529           <para>Suppress any unsolicited debugging output.  When GHC
530             has been built with the <literal>DEBUG</literal> option it
531             occasionally emits debug output of interest to developers.
532             The extra output can confuse the testing framework and
533             cause bogus test failures, so this flag is provided to
534             turn it off.</para>
535         </listitem>
536       </varlistentry>
537      </variablelist>
538
539   </sect2>
540
541   <sect2 id="supression">
542     <title>Suppressing unwanted information</title>
543
544     <indexterm><primary>suppression</primary></indexterm>
545
546     Core dumps contain a large amount of information. Depending on what you are doing, not all of it will be useful.
547     Use these flags to suppress the parts that you are not interested in.
548
549     <variablelist>
550       <varlistentry>
551         <term>
552           <option>-dsuppress-all</option>
553           <indexterm><primary><option>-dsuppress-all</option></primary></indexterm>
554         </term>
555         <listitem>
556           <para>Suppress everything that can be suppressed, except for unique ids as this often 
557                 makes the printout ambiguous. If you just want to see the overall structure of
558                 the code, then start here.</para>
559         </listitem>
560       </varlistentry>
561
562       <varlistentry>
563         <term>
564           <option>-dsuppress-uniques</option>
565           <indexterm><primary><option>-dsuppress-uniques</option></primary></indexterm>
566         </term>
567         <listitem>
568           <para>Suppress the printing of uniques. This may make 
569           the printout ambiguous (e.g. unclear where an occurrence of 'x' is bound), but
570           it makes the output of two compiler runs have many fewer gratuitous differences,
571             so you can realistically apply <command>diff</command>.  Once <command>diff</command>
572           has shown you where to look, you can try again without <option>-dsuppress-uniques</option></para>
573         </listitem>
574       </varlistentry>
575
576       <varlistentry>
577         <term>
578           <option>-dsuppress-idinfo</option>
579           <indexterm><primary><option>-dsuppress-idinfo</option></primary></indexterm>
580         </term>
581         <listitem>
582           <para>Suppress extended information about identifiers where they are bound. This includes
583                 strictness information and inliner templates. Using this flag can cut the size 
584                 of the core dump in half, due to the lack of inliner templates</para>
585         </listitem>
586       </varlistentry>
587
588       <varlistentry>
589         <term>
590           <option>-dsuppress-module-prefixes</option>
591           <indexterm><primary><option>-dsuppress-module-prefixes</option></primary></indexterm>
592         </term>
593         <listitem>
594           <para>Suppress the printing of module qualification prefixes.
595                 This is the <constant>Data.List</constant> in <constant>Data.List.length</constant>.</para>
596         </listitem>
597       </varlistentry>
598
599       <varlistentry>
600         <term>
601           <option>-dsuppress-type-signatures</option>
602           <indexterm><primary><option>-dsuppress-type-signatures</option></primary></indexterm>
603         </term>
604         <listitem>
605           <para>Suppress the printing of type signatures.</para>
606         </listitem>
607       </varlistentry>
608
609       <varlistentry>
610         <term>
611           <option>-dsuppress-type-applications</option>
612           <indexterm><primary><option>-dsuppress-type-applications</option></primary></indexterm>
613         </term>
614         <listitem>
615           <para>Suppress the printing of type applications.</para>
616         </listitem>
617       </varlistentry>
618
619       <varlistentry>
620         <term>
621           <option>-dsuppress-coercions</option>
622           <indexterm><primary><option>-dsuppress-coercions</option></primary></indexterm>
623         </term>
624         <listitem>
625           <para>Suppress the printing of type coercions.</para>
626         </listitem>
627       </varlistentry>
628     </variablelist>
629   </sect2>
630
631   <sect2 id="checking-consistency">
632     <title>Checking for consistency</title>
633
634     <indexterm><primary>consistency checks</primary></indexterm>
635     <indexterm><primary>lint</primary></indexterm>
636
637     <variablelist>
638
639       <varlistentry>
640         <term>
641           <option>-dcore-lint</option>
642           <indexterm><primary><option>-dcore-lint</option></primary></indexterm>
643         </term>
644         <listitem>
645           <para>Turn on heavyweight intra-pass sanity-checking within
646           GHC, at Core level.  (It checks GHC's sanity, not yours.)</para>
647         </listitem>
648       </varlistentry>
649
650       <varlistentry>
651         <term>
652           <option>-dstg-lint</option>:
653           <indexterm><primary><option>-dstg-lint</option></primary></indexterm>
654         </term>
655         <listitem>
656           <para>Ditto for STG level. (NOTE: currently doesn't work).</para>
657         </listitem>
658       </varlistentry>
659
660       <varlistentry>
661         <term>
662           <option>-dcmm-lint</option>:
663           <indexterm><primary><option>-dcmm-lint</option></primary></indexterm>
664         </term>
665         <listitem>
666           <para>Ditto for C-- level.</para>
667         </listitem>
668       </varlistentry>
669
670     </variablelist>
671   </sect2>
672
673   <sect2>
674     <title>How to read Core syntax (from some <option>-ddump</option>
675     flags)</title>
676
677     <indexterm><primary>reading Core syntax</primary></indexterm>
678     <indexterm><primary>Core syntax, how to read</primary></indexterm>
679
680     <para>Let's do this by commenting an example.  It's from doing
681     <option>-ddump-ds</option> on this code:
682
683 <programlisting>
684 skip2 m = m : skip2 (m+2)
685 </programlisting>
686
687     Before we jump in, a word about names of things.  Within GHC,
688     variables, type constructors, etc., are identified by their
689     &ldquo;Uniques.&rdquo; These are of the form `letter' plus
690     `number' (both loosely interpreted).  The `letter' gives some idea
691     of where the Unique came from; e.g., <literal>&lowbar;</literal>
692     means &ldquo;built-in type variable&rdquo;; <literal>t</literal>
693     means &ldquo;from the typechecker&rdquo;; <literal>s</literal>
694     means &ldquo;from the simplifier&rdquo;; and so on.  The `number'
695     is printed fairly compactly in a `base-62' format, which everyone
696     hates except me (WDP).</para>
697
698     <para>Remember, everything has a &ldquo;Unique&rdquo; and it is
699     usually printed out when debugging, in some form or another.  So
700     here we go&hellip;</para>
701
702 <programlisting>
703 Desugared:
704 Main.skip2{-r1L6-} :: _forall_ a$_4 =&#62;{{Num a$_4}} -&#62; a$_4 -&#62; [a$_4]
705
706 --# `r1L6' is the Unique for Main.skip2;
707 --# `_4' is the Unique for the type-variable (template) `a'
708 --# `{{Num a$_4}}' is a dictionary argument
709
710 _NI_
711
712 --# `_NI_' means "no (pragmatic) information" yet; it will later
713 --# evolve into the GHC_PRAGMA info that goes into interface files.
714
715 Main.skip2{-r1L6-} =
716     /\ _4 -&#62; \ d.Num.t4Gt -&#62;
717         let {
718           {- CoRec -}
719           +.t4Hg :: _4 -&#62; _4 -&#62; _4
720           _NI_
721           +.t4Hg = (+{-r3JH-} _4) d.Num.t4Gt
722
723           fromInt.t4GS :: Int{-2i-} -&#62; _4
724           _NI_
725           fromInt.t4GS = (fromInt{-r3JX-} _4) d.Num.t4Gt
726
727 --# The `+' class method (Unique: r3JH) selects the addition code
728 --# from a `Num' dictionary (now an explicit lambda'd argument).
729 --# Because Core is 2nd-order lambda-calculus, type applications
730 --# and lambdas (/\) are explicit.  So `+' is first applied to a
731 --# type (`_4'), then to a dictionary, yielding the actual addition
732 --# function that we will use subsequently...
733
734 --# We play the exact same game with the (non-standard) class method
735 --# `fromInt'.  Unsurprisingly, the type `Int' is wired into the
736 --# compiler.
737
738           lit.t4Hb :: _4
739           _NI_
740           lit.t4Hb =
741               let {
742                 ds.d4Qz :: Int{-2i-}
743                 _NI_
744                 ds.d4Qz = I#! 2#
745               } in  fromInt.t4GS ds.d4Qz
746
747 --# `I# 2#' is just the literal Int `2'; it reflects the fact that
748 --# GHC defines `data Int = I# Int#', where Int# is the primitive
749 --# unboxed type.  (see relevant info about unboxed types elsewhere...)
750
751 --# The `!' after `I#' indicates that this is a *saturated*
752 --# application of the `I#' data constructor (i.e., not partially
753 --# applied).
754
755           skip2.t3Ja :: _4 -&#62; [_4]
756           _NI_
757           skip2.t3Ja =
758               \ m.r1H4 -&#62;
759                   let { ds.d4QQ :: [_4]
760                         _NI_
761                         ds.d4QQ =
762                     let {
763                       ds.d4QY :: _4
764                       _NI_
765                       ds.d4QY = +.t4Hg m.r1H4 lit.t4Hb
766                     } in  skip2.t3Ja ds.d4QY
767                   } in
768                   :! _4 m.r1H4 ds.d4QQ
769
770           {- end CoRec -}
771         } in  skip2.t3Ja
772 </programlisting>
773
774     <para>(&ldquo;It's just a simple functional language&rdquo; is an
775     unregisterised trademark of Peyton Jones Enterprises, plc.)</para>
776
777   </sect2>
778
779   <sect2 id="unreg">
780     <title>Unregisterised compilation</title>
781     <indexterm><primary>unregisterised compilation</primary></indexterm>
782
783     <para>The term "unregisterised" really means "compile via vanilla
784     C", disabling some of the platform-specific tricks that GHC
785     normally uses to make programs go faster.  When compiling
786     unregisterised, GHC simply generates a C file which is compiled
787     via gcc.</para>
788
789     <para>Unregisterised compilation can be useful when porting GHC to
790     a new machine, since it reduces the prerequisite tools to
791     <command>gcc</command>, <command>as</command>, and
792     <command>ld</command> and nothing more, and furthermore the amount
793     of platform-specific code that needs to be written in order to get
794     unregisterised compilation going is usually fairly small.</para>
795
796    <para>Unregisterised compilation cannot be selected at
797    compile-time; you have to build GHC with the appropriate options
798    set.  Consult the GHC Building Guide for details.</para>
799   </sect2>
800
801 </sect1>
802
803 <!-- Emacs stuff:
804      ;;; Local Variables: ***
805      ;;; sgml-parent-document: ("users_guide.xml" "book" "chapter" "sect1") ***
806      ;;; End: ***
807  -->