gerph.org - Undocumented compiler features


CC_Undoc - Undocumented CC switches

  1. Introduction

  2. This document details what I believe to be the options available to Norcroft C version 5.06 and later. I reserve the right to be totally wrong.
  3. Formatting

  4. This document is currently being updated using tables rather than 'definitions'. If you would prefer to see a non-tables version of this document, please email me.
  5. Undocumented features

  6. SwitchMeaning
    -counts cannot trigger - should show the file 'counts' profiling info
    -verify check the command line used is being interpreted correctly
    -super <unknown>, converse is -arthur
    -L force linking, even if o file given
    -K <unknown>
    -M< <unknown>
    -M+ <unknown>
    -d <unknown>
    -lg <unknown>
    -fb display count of errors/warnings like amu even if none displayed
    -fl In leaf functions, don't stack r14 if you don't have to (?)
    -fn Embed function names
    -fo Warn about old style function detinitions
    -fq <unknown>
    -fr Allow longjmp to corrupt register variables
    -fs <unknown>
    -fz Inline __swi usage corrupts link register
    -pg include profiling information - seems to be the same as -px
    -Wb <unknown>
    -Wc <unknown>
    -Wd <unknown>
    -Wf <unknown>
    -Wg <unknown>
    -Wp <unknown>
    -Wr <unknown>
    -Ws <unknown>

    -z options are case insensitive, I think.

    -z[bjs] <unknown>
    -zc ensure that chars are signed (eg :
    char x[5]; char y; y=x[0];
    ->
    LDRB y,[v1,#0]
    MOV y,y,LSL #24
    MOV y,y,ASR #24
    )
    -zk[ARMUarmu] Calling standard to use
    • a/A
      APCS-A (r13=sl, r10=fp, r11=ip, r12=sp)
    • r/R/u/U
      APCS-R (r10=sl, r11=fp, r12=ip, r13=sp)
    • m/M
      APCS-? (r12=sl, r10=fp, r11=ip, r13=sp)
    -za[01] Change whether loads can be unaligned or not
    -zd[01] ?
    -zh<x> <x> =
    • AA/AR -> standard option
    • RA -> as RR (?)
    • RR -> generate 32bit,reentrant,FPIS3,NoSWStackCheck
      (interestingly the code I saw stacked only v1 and lr - NOTHING else - implies no backtrace is possible, though function names are embedded. This is a property of the implicit stack check I believe, the 32 bit code implies that functions corrupt PSR on return)
    -zf Warn about repeated #defines (if the same)
    -zu Strange... seems to cause a stack of a1-a3 (though they were not used - only a1 was required and that was moved in registers) looks like it gives an implicit ordering of the arguments on the stack. Might also be doing the same as -zc as well...
    -zi <f> Pre-include file
    -zo Split each function into seperate areas (bug - includes a null code area)
    -ze0/1 <unknown> seems to work with -C (maybe)
    -zpq32 disables assumption that values returned from allocator functions are interchangable
    -zpq16 appears to disable tail optimisations
    -zpq8 disable peephole optimisations
    -zqa debug - castings and symantics ?
    -zqb debug - variable assignments ?
    -zqc debug - CSE decoding
    -zqd debug - data segments
    -zqf debug - function definitions
    -zqg debug - intermediate code dump
    -zqh debug - higher level allocation info ?
    -zqi debug - included files
    -zqk debug - <unknown>
    -zql debug - symbol tokenisation ?
    -zqm debug - <unknown>
    -zqo debug - output decoding (output file contains hex data)
    -zqp debug - pre-processor debug
    -zqq debug - <unknown>
    -zqr debug - register allocation
    -zqs debug - <unknown>
    -zqt debug - typing
    -zqu debug - CSE, register allocation, and -zqk
    -zqw debug - syntax analysis allocation ?
    -zqx debug - <unknown>
    -zqy debug - intermediate code register matching
    -zqz debug - unknown
    -zt+ Optimise for time (-Otime)
    -zt- Optimise for space (-Ospace)
  7. Documented switches

  8. SwitchMeaning
    -help Give summary of details
    -pcc Compile (BSD 4.2) portable C compiler C
    -fussy Be strict about ANSI or PCC standards.
    -strict Be strict about ANSI or PCC standards.
    -list Create listing file as l.<file> or using the -f <file> switch
    -bigend Big-endian compilation
    -littleen Little-endian compilation (default)
    -apcs <qualifiers> Select variant of APCS
    /26[bit]
    (DEFAULT) 26 bit code
    /32[bit]
    32 bit code
    /reent[rant]
    Reentrant code
    /nonreent[rant]
    (DEFAULT) Non-reentrant code
    /swst[ackcheck]
    (DEFAULT) Software stack checking code added
    /noswst[ackcheck]
    No software stack checking code added
    /fpe2
    Floating point emulator 2 compatible
    /fpe3
    (DEFAULT) Floating point emulator 3 compatible
    /fp
    (DEFAULT) Use frame pointer (NOT "FP arguments passed in FP regs")
    /nofp
    Do not use frame pointer (NOT "FP arguments are not passed in FP regs") This option forcibly disables software stack checking.
    /fpr[egargs]
    (DEFAULT) FP arguments passed in FP regs
    /nofpr[egargs]
    FP arguments are not passed in FP regs
    Note: /nofp was previously documented as having the functionality of /nofpr. The documentation I have suggests that this was the case for CC v4. It is likely that the change appeared between version 4 and 5 of the compiler.
    -depend Create a dependency file (usually !Depend), like -M
    -throwback Use throwback output
    -desktop sets the working directory for output and relative source files
    -C++ C++ code is being processed (hack for C++/CFront executable)
    -c Do not link, use -o as the output AOF file
    -I<dir> specify an include directory to use for source files (eg "file.h")
    -j<dir> specify an include directory to use for system files (eg <stdio.h>)
    -E Pre-process the file only
    -C Retain comments when pre-processing (use with -E)
    -M Pre-process the file, and produce dependency tables for make
    -D<x>[=<y>] Define a symbols value, if <y> not given, defaults to 1
    -U<x> Undefine a pre-processor symbol
    -o<file> Specify the output file
    -g[f][l][v] Generate debug information (if -g, -gflv assumed]
    • f = generate function and top level variable debug
    • l = generate debug about each line of source
    • v = generate debug about each variable
    -p[x] Generate profiling code; x means include more debug information
    -S output assembler in s.<file>
    -zM Produce code suitable for relocatable modules
    -zM1 Produce code suitable for relocatable modules, as part of the SharedCLibrary (_Lib$Reloc$Off rather than _Mod$Reloc$Off)
    -W suppress all warnings
    -Wa suppress "Use of = in a condition context" warning
    -Wd suppress "Deprecated declaration foo() - give arg types" warning
    -Wf suppress "Inventing extern int foo()" warning
    -Wn suppress "Implicit narrowing cast" warning
    -Wv suppress "Implicit return in non-void context" warning
    -zp[a-z][0-9] Pragma options
    -zpa[01] warn_implicit_fn_decls; equivilent to -Wf
    -zpc[01] check_memory_accesses
    -zpd[01] warn_deprecated; equivilent to -Wd
    -zpe[01] continue_after_hash_error
    -zpf<0-4> FP register variable (?)
    -zpi[01] include_only_once
    -zpj[01] optimise_crossjump
    -zpm[01] optimise_multiple_loads
    -zpp[012] profile / profile_statements; -p / -px
    -zpr<1-7> integer register variable (?)
    -zps[01] check_stack
    -zpt[01] force_top_level
    -zpv[012] check_printf_formats / check_scanf_formats
    -zpy[01] side_effects
    -zpz[01] optimise_cse
    -fa Check for data flow anomalies (assignment before use)
    -fc Enable 'limited pcc' support (PCC headers, ANSI source)
    -fe Check for external uniqueness at 6 characters
    -ff Do not embed function names in code area
    -fh Check external objects are declared before use
    -fi In listing file (-list), list lines from included user files
    -fj In listing file (-list), list lines from included system files
    -fk Use K&R style searches for source (not stacked, relative)
    -fm Report unused pre-processor symbols
    -fn Embed function names
    -fp Report explicit casts of integers into pointers
    -fu In listing file (-list), do not expand pre-processor defines
    -fv Report unused declarations
    -fw Allow string literals to be written to
  9. History

  10. Version 1.00 : 15 Feb 1998
    Created from disassembly and experimentation.
    Version 1.01 : 29 Jun 1998
    Updated with documented features
    Version 1.02 : 08 Jan 1999
    Reformatted as HTML for the 'info' section of my website.
    Version 1.03 : 28 Apr 2000
    Added -zpq32 flag.
    Version 1.04 : 16 Aug 2002
    Added -zpq16 flag.
    Corrected VERY wrong documentation of /nofp.
    Version 1.05 : 28 Mar 2003
    Added -zM1 flag.
    Version 1.06 : 18 May 2006
    Documented -fz and -fr. Fixed email address.
    Version 1.07 : 14 Jan 2009
    Corrected documentation of -g to not specify -gg as being valid.

[Up]


This page is maintained by Justin Fletcher (gerph@gerph.org).
Last modified on 19 January, 2013.
This site is copyright . The accuracy of anything on this site is entirely limited by his belief system and memory at the time of publication - neither of which should be relied on. The opinions are entirely his, except where he's changed his mind. Quotations are copyright their respective authors and whereever possible attributions have been included.