SEC44.hss 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305
  1. [Main]
  2. Title=Options for Code Generation Conventions
  3. [Top]
  4. These machine-independent options control the interface conventions
  5. used in code generation.
  6. <BR><BR>
  7. Most of them have both positive and negative forms; the negative form
  8. of <B>'-ffoo'</B> would be <B>'-fno-foo'</B>. In the table below, only
  9. one of the forms is listed: the one which is not the default. You
  10. can figure out the other form by either removing <B>'no-'</B> or adding
  11. it.
  12. <DL>
  13. <DT><B>-fbounds-check</B>
  14. <DD>For front-ends that support it, generate additional code to check that
  15. indices used to access arrays are within the declared range. This is
  16. currently only supported by the Java and Fortran 77 front-ends, where
  17. this option defaults to true and false respectively.
  18. <BR><BR>
  19. <DT><B>-ftrapv</B>
  20. <DD>This option generates traps for signed overflow on addition, subtraction,
  21. multiplication operations.
  22. <BR><BR>
  23. <DT><B>-fexceptions</B>
  24. <DD>Enable exception handling. Generates extra code needed to propagate
  25. exceptions. In principle, you may need to enable this option when compiling
  26. C code that needs to interoperate properly with exception handlers, but this
  27. is useless in TIGCC, as the TIOS uses its own exception handling mechanism
  28. (see <A HREF="$$LINK(error.h/)">error.h</A>).
  29. <BR><BR>
  30. <DT><B>-fnon-call-exceptions</B>
  31. <DD>Generate code that allows trapping instructions to throw exceptions.
  32. Probably useless in TIGCC.
  33. <BR><BR>
  34. <DT><B>-funwind-tables</B>
  35. <DD>Similar to <B>'-fexceptions'</B>, except that it will just generate any needed
  36. static data, but will not affect the generated code in any other way.
  37. Probably useless in TIGCC.
  38. <BR><BR>
  39. <DT><B>-fasynchronous-unwind-tables</B>
  40. <DD>Generate unwind table in dwarf2 format, if supported by target machine. The
  41. table is exact at each instruction boundary, so it can be used for stack
  42. unwinding from asynchronous events (such as debugger or garbage collector).
  43. <BR><BR>
  44. <DT><B>-fpcc-struct-return</B>
  45. <DD>Return &quot;short&quot; <CODE>struct</CODE> and <CODE>union</CODE> values in memory like
  46. longer ones, rather than in registers. This convention is less
  47. efficient, but it has the advantage of allowing intercallability between
  48. GCC-compiled files and files compiled with other compilers, particularly
  49. the Portable C Compiler (pcc).
  50. <BR><BR>
  51. The precise convention for returning structures in memory depends
  52. on the target configuration macros.
  53. <BR><BR>
  54. Short structures and unions are those whose size and alignment match
  55. that of some integer type.
  56. <BR><BR>
  57. <B>Warning:</B> code compiled with the <B>'-fpcc-struct-return'</B>
  58. switch is not binary compatible with code compiled with the
  59. <B>'-freg-struct-return'</B> switch.
  60. Use it to conform to a non-default application binary interface.
  61. <BR><BR>
  62. <DT><B>-freg-struct-return</B>
  63. <DD>Return <CODE>struct</CODE> and <CODE>union</CODE> values in registers when possible.
  64. This is more efficient for small structures than
  65. <B>'-fpcc-struct-return'</B>.
  66. <BR><BR>
  67. If you specify neither <B>'-fpcc-struct-return'</B> nor
  68. <B>'-freg-struct-return'</B>, TIGCC defaults to <B>'-freg-struct-return'</B>.
  69. <BR><BR>
  70. <B>Warning:</B> code compiled with the <B>'-freg-struct-return'</B>
  71. switch is not binary compatible with code compiled with the
  72. <B>'-fpcc-struct-return'</B> switch.
  73. Use it to conform to a non-default application binary interface.
  74. <BR><BR>
  75. <DT><B>-fshort-enums</B>
  76. <DD>Allocate to an <CODE>enum</CODE> type only as many bytes as it needs for the
  77. declared range of possible values. Specifically, the <CODE>enum</CODE> type
  78. will be equivalent to the smallest integer type which has enough room.
  79. <BR><BR>
  80. <B>Warning:</B> the <B>'-fshort-enums'</B> switch causes GCC to generate
  81. code that is not binary compatible with code generated without that switch.
  82. Use it to conform to a non-default application binary interface.
  83. <BR><BR>
  84. <DT><B>-fshort-double</B>
  85. <DD>Use the same size for <CODE>double</CODE> as for <CODE>float</CODE>.
  86. This is always true in TIGCC, regardless of this switch.
  87. <BR><BR>
  88. <B>Warning:</B> the <B>'-fshort-double'</B> switch causes GCC to generate
  89. code that is not binary compatible with code generated without that switch.
  90. Use it to conform to a non-default application binary interface.
  91. <BR><BR>
  92. <DT><B>-fshort-wchar</B>
  93. <DD>Override the underlying type for <CODE>wchar_t</CODE> to be <CODE>short
  94. unsigned&nbsp;int</CODE> instead of the default for the target. This option is
  95. useful for building programs to run under WINE.
  96. <BR><BR>
  97. <B>Warning:</B> the <B>'-fshort-wchar'</B> switch causes GCC to generate
  98. code that is not binary compatible with code generated without that switch.
  99. Use it to conform to a non-default application binary interface.
  100. <BR><BR>
  101. <DT><B>-fshared-data</B>
  102. <DD>Requests that the data and non-<CODE>const</CODE> variables of this
  103. compilation be shared data rather than private data. The distinction
  104. makes sense only on certain operating systems, where shared data is
  105. shared between processes running the same program, while private data
  106. exists in one copy per process.
  107. <BR><BR>
  108. <DT><B>-fno-common</B>
  109. <DD>Allocate even uninitialized global variables in the data section of the
  110. object file, rather than generating them as common blocks. This has the
  111. effect that if the same variable is declared (without <CODE>extern</CODE>) in
  112. two different compilations, you will get an error when you link them.
  113. The only reason this might be useful is if you wish to verify that the
  114. program will work on other systems which always work this way. Currently,
  115. TIGCC does not support this option, since it needs common symbols to
  116. communicate with the linker.
  117. <BR><BR>
  118. <DT><B>-fno-ident</B>
  119. <DD>Ignore the <CODE>#ident</CODE> directive.
  120. <BR><BR>
  121. <DT><B>-fno-gnu-linker</B>
  122. <DD>Do not output global initializations in the form used by the GNU linker
  123. Useless in TIGCC, because global initializations are not implemented.
  124. <BR><BR>
  125. <DT><B>-finhibit-size-directive</B>
  126. <DD>Don't output a <CODE>.size</CODE> assembler directive, or anything else that
  127. would cause trouble if the function is split in the middle, and the
  128. two halves are placed at locations far apart in memory. This option is
  129. used when compiling <CODE>crtstuff.c</CODE>; you should not need to use it
  130. for anything else.
  131. <BR><BR>
  132. <DT><B>-fverbose-asm</B>
  133. <DD>Put extra commentary information in the generated assembly code to
  134. make it more readable. This option is generally only of use to those
  135. who actually need to read the generated assembly code (perhaps while
  136. debugging the compiler itself).
  137. <BR><BR>
  138. <B>'-fno-verbose-asm'</B>, the default, causes the
  139. extra information to be omitted and is useful when comparing two assembler
  140. files.
  141. <BR><BR>
  142. <DT><B>-fvolatile</B>
  143. <DD>Consider all memory references through pointers to be volatile.
  144. <BR><BR>
  145. <DT><B>-fvolatile-global</B>
  146. <DD>Consider all memory references to extern and global data items to
  147. be volatile. GCC does not consider static data items to be volatile
  148. because of this switch.
  149. <BR><BR>
  150. <DT><B>-fvolatile-static</B>
  151. <DD>Consider all memory references to static data to be volatile.
  152. <BR><BR>
  153. <DT><B>-fpic</B>
  154. <DD>Generate position-independent code (PIC) suitable for use in a shared
  155. library. However, it requires special support of the operating
  156. system (like dynamic loaders, etc.). So forget it with the TIOS; maybe
  157. some future ASM shells will support this. At the moment, forget this
  158. nice option.
  159. <BR><BR>
  160. <DT><B>-fPIC</B>
  161. <DD>If supported for the target machine, emit position-independent code,
  162. suitable for dynamic linking and avoiding any limit on the size of the
  163. global offset table.
  164. <BR><BR>
  165. <DT><B>-ffixed-<I>reg</I></B>
  166. <DD>Treat the register named <I>reg</I> as a fixed register; generated code
  167. should never refer to it (except perhaps as a stack pointer, frame
  168. pointer or in some other fixed role).
  169. <BR><BR>
  170. This flag does not have a negative form, because it specifies a
  171. three-way choice.
  172. <BR><BR>
  173. <DT><B>-fcall-used-<I>reg</I></B>
  174. <DD>Treat the register named <I>reg</I> as an allocable register that is
  175. clobbered by function calls. It may be allocated for temporaries or
  176. variables that do not live across a call. Functions compiled this way
  177. will not save and restore the register <I>reg</I>.
  178. <BR><BR>
  179. It is an error to used this flag with the frame pointer or stack pointer.
  180. Use of this flag for other registers that have fixed pervasive roles in
  181. the machine's execution model will produce disastrous results.
  182. <BR><BR>
  183. This flag does not have a negative form, because it specifies a
  184. three-way choice.
  185. <BR><BR>
  186. <DT><B>-fcall-saved-<I>reg</I></B>
  187. <DD>Treat the register named <I>reg</I> as an allocable register saved by
  188. functions. It may be allocated even for temporaries or variables that
  189. live across a call. Functions compiled this way will save and restore
  190. the register <I>reg</I> if they use it.
  191. <BR><BR>
  192. It is an error to used this flag with the frame pointer or stack pointer.
  193. Use of this flag for other registers that have fixed pervasive roles in
  194. the machine's execution model will produce disastrous results.
  195. <BR><BR>
  196. A different sort of disaster will result from the use of this flag for
  197. a register in which function values may be returned.
  198. <BR><BR>
  199. This flag does not have a negative form, because it specifies a
  200. three-way choice.
  201. <BR><BR>
  202. <DT><B>-freg-relative-<I>reg</I></B><DD>
  203. Refer to all labels only in relation to the register specified in
  204. <I>reg</I>. This can make the code somewhat smaller, but you should use this
  205. option with care as it is not fully supported.
  206. This option is implemented only in TIGCC.
  207. <BR><BR>
  208. <DT><B>-fpack-struct</B>
  209. <DD>Pack all structure members together without holes.
  210. <BR><BR>
  211. <B>Warning:</B> the <B>'-fpack-struct'</B> switch causes GCC to generate
  212. code that is not binary compatible with code generated without that switch.
  213. Additionally, it makes the code suboptimal.
  214. Use it to conform to a non-default application binary interface.
  215. <BR><BR>
  216. <DT><B>-finstrument-functions</B>
  217. <DD>Generate instrumentation calls for entry and exit to functions. Just
  218. after function entry and just before function exit, the following
  219. profiling functions will be called with the address of the current
  220. function and its call site. (On some platforms,
  221. <CODE>__builtin_return_address</CODE> does not work beyond the current
  222. function, so the call site information may not be available to the
  223. profiling functions otherwise.)
  224. <PRE>void __cyg_profile_func_enter (void *this_fn,
  225. void *call_site);
  226. void __cyg_profile_func_exit (void *this_fn,
  227. void *call_site);
  228. </PRE>
  229. The first argument is the address of the start of the current function,
  230. which may be looked up exactly in the symbol table.
  231. <BR><BR>
  232. This instrumentation is also done for functions expanded inline in other
  233. functions. The profiling calls will indicate where, conceptually, the
  234. inline function is entered and exited. This means that addressable
  235. versions of such functions must be available. If all your uses of a
  236. function are expanded inline, this may mean an additional expansion of
  237. code size. If you use <CODE>extern&nbsp;inline</CODE> in your C code, an
  238. addressable version of such functions must be provided. (This is
  239. normally the case anyways, but if you get lucky and the optimizer always
  240. expands the functions inline, you might have gotten away without
  241. providing static copies.)
  242. <BR><BR>
  243. A function may be given the attribute <CODE>no_instrument_function</CODE>, in
  244. which case this instrumentation will not be done. This can be used, for
  245. example, for the profiling functions listed above, high-priority
  246. interrupt routines, and any functions from which the profiling functions
  247. cannot safely be called (perhaps signal handlers, if the profiling
  248. routines generate output or allocate memory).
  249. <BR><BR>
  250. <DT><B>-fstack-check</B>
  251. <DD>Generate code to verify that you do not go beyond the boundary of the
  252. stack. As this requires support from the operating system, it probably does
  253. not work in TIGCC.
  254. <BR><BR>
  255. <DT><B>-fstack-limit-register=<I>reg</I></B>
  256. <BR><B>-fstack-limit-symbol=<I>sym</I></B>
  257. <BR><B>-fno-stack-limit</B>
  258. <DD>Generate code to ensure that the stack does not grow beyond a certain value,
  259. either the value of a register or the address of a symbol. If the stack
  260. would grow beyond the value, a signal is raised. For most targets,
  261. the signal is raised before the stack overruns the boundary, so
  262. it is possible to catch the signal without taking special precautions.
  263. <BR><BR>
  264. For instance, if the stack starts at absolute address <CODE>0x80000000</CODE>
  265. and grows downwards, you can use the flags
  266. <B>'-fstack-limit-symbol=__stack_limit'</B> and
  267. <B>'-Wl,--defsym,__stack_limit=0x7ffe0000'</B> to enforce a stack limit
  268. of 128KB. Note that this may only work with the GNU linker.
  269. <BR><BR>
  270. <DT><B>-fargument-alias</B>
  271. <BR><B>-fargument-noalias</B>
  272. <BR><B>-fargument-noalias-global</B>
  273. <DD>Specify the possible relationships among parameters and between
  274. parameters and global data.
  275. <UL>
  276. <LI><B>'-fargument-alias'</B> specifies that arguments (parameters) may
  277. alias each other and may alias global storage.</LI>
  278. <LI><B>'-fargument-noalias'</B> specifies that arguments do not alias
  279. each other, but may alias global storage.</LI>
  280. <LI><B>'-fargument-noalias-global'</B> specifies that arguments do not
  281. alias each other and do not alias global storage.</LI>
  282. </UL>
  283. Each language will automatically use whatever option is required by
  284. the language standard. You should not need to use these options yourself.
  285. <BR><BR>
  286. <DT><B>-fleading-underscore</B>
  287. <DD>This option and its counterpart, <B>'-fno-leading-underscore'</B>, forcibly
  288. change the way C symbols are represented in the object file. One use
  289. is to help link with legacy assembly code.
  290. <BR><BR>
  291. <B>Warning:</B> the <B>'-fleading-underscore'</B> switch causes GCC to
  292. generate code that is not binary compatible with code generated without that
  293. switch. Use it to conform to a non-default application binary interface.
  294. <BR><BR>
  295. <DT><B>-ftls-model=<I>model</I></B>
  296. <DD>Alter the thread-local storage model to be used.
  297. The <I>model</I> argument should be one of <CODE>global-dynamic</CODE>,
  298. <CODE>local-dynamic</CODE>, <CODE>initial-exec</CODE> or <CODE>local-exec</CODE>.
  299. <BR><BR>
  300. The default without <B>'-fpic'</B> is <CODE>initial-exec</CODE>; with
  301. <B>'-fpic'</B> the default is <CODE>global-dynamic</CODE>.
  302. <BR><BR>
  303. Useless in TIGCC, as threads are not supported.
  304. </DL>