You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

4738 line
201KB

  1. <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
  2. <html>
  3. <!-- Copyright (C) 1988-2020 Free Software Foundation, Inc.
  4. Permission is granted to copy, distribute and/or modify this document
  5. under the terms of the GNU Free Documentation License, Version 1.3 or
  6. any later version published by the Free Software Foundation; with the
  7. Invariant Sections being "Funding Free Software", the Front-Cover
  8. Texts being (a) (see below), and with the Back-Cover Texts being (b)
  9. (see below). A copy of the license is included in the section entitled
  10. "GNU Free Documentation License".
  11. (a) The FSF's Front-Cover Text is:
  12. A GNU Manual
  13. (b) The FSF's Back-Cover Text is:
  14. You have freedom to copy and modify this GNU Manual, like GNU
  15. software. Copies published by the Free Software Foundation raise
  16. funds for GNU development. -->
  17. <!-- Created by GNU Texinfo 6.5, http://www.gnu.org/software/texinfo/ -->
  18. <head>
  19. <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
  20. <title>Optimize Options (Using the GNU Compiler Collection (GCC))</title>
  21. <meta name="description" content="Optimize Options (Using the GNU Compiler Collection (GCC))">
  22. <meta name="keywords" content="Optimize Options (Using the GNU Compiler Collection (GCC))">
  23. <meta name="resource-type" content="document">
  24. <meta name="distribution" content="global">
  25. <meta name="Generator" content="makeinfo">
  26. <link href="index.html#Top" rel="start" title="Top">
  27. <link href="Option-Index.html#Option-Index" rel="index" title="Option Index">
  28. <link href="index.html#SEC_Contents" rel="contents" title="Table of Contents">
  29. <link href="Invoking-GCC.html#Invoking-GCC" rel="up" title="Invoking GCC">
  30. <link href="Instrumentation-Options.html#Instrumentation-Options" rel="next" title="Instrumentation Options">
  31. <link href="Debugging-Options.html#Debugging-Options" rel="prev" title="Debugging Options">
  32. <style type="text/css">
  33. <!--
  34. a.summary-letter {text-decoration: none}
  35. blockquote.indentedblock {margin-right: 0em}
  36. blockquote.smallindentedblock {margin-right: 0em; font-size: smaller}
  37. blockquote.smallquotation {font-size: smaller}
  38. div.display {margin-left: 3.2em}
  39. div.example {margin-left: 3.2em}
  40. div.lisp {margin-left: 3.2em}
  41. div.smalldisplay {margin-left: 3.2em}
  42. div.smallexample {margin-left: 3.2em}
  43. div.smalllisp {margin-left: 3.2em}
  44. kbd {font-style: oblique}
  45. pre.display {font-family: inherit}
  46. pre.format {font-family: inherit}
  47. pre.menu-comment {font-family: serif}
  48. pre.menu-preformatted {font-family: serif}
  49. pre.smalldisplay {font-family: inherit; font-size: smaller}
  50. pre.smallexample {font-size: smaller}
  51. pre.smallformat {font-family: inherit; font-size: smaller}
  52. pre.smalllisp {font-size: smaller}
  53. span.nolinebreak {white-space: nowrap}
  54. span.roman {font-family: initial; font-weight: normal}
  55. span.sansserif {font-family: sans-serif; font-weight: normal}
  56. ul.no-bullet {list-style: none}
  57. -->
  58. </style>
  59. </head>
  60. <body lang="en">
  61. <a name="Optimize-Options"></a>
  62. <div class="header">
  63. <p>
  64. Next: <a href="Instrumentation-Options.html#Instrumentation-Options" accesskey="n" rel="next">Instrumentation Options</a>, Previous: <a href="Debugging-Options.html#Debugging-Options" accesskey="p" rel="prev">Debugging Options</a>, Up: <a href="Invoking-GCC.html#Invoking-GCC" accesskey="u" rel="up">Invoking GCC</a> &nbsp; [<a href="index.html#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="Option-Index.html#Option-Index" title="Index" rel="index">Index</a>]</p>
  65. </div>
  66. <hr>
  67. <a name="Options-That-Control-Optimization"></a>
  68. <h3 class="section">3.11 Options That Control Optimization</h3>
  69. <a name="index-optimize-options"></a>
  70. <a name="index-options_002c-optimization"></a>
  71. <p>These options control various sorts of optimizations.
  72. </p>
  73. <p>Without any optimization option, the compiler&rsquo;s goal is to reduce the
  74. cost of compilation and to make debugging produce the expected
  75. results. Statements are independent: if you stop the program with a
  76. breakpoint between statements, you can then assign a new value to any
  77. variable or change the program counter to any other statement in the
  78. function and get exactly the results you expect from the source
  79. code.
  80. </p>
  81. <p>Turning on optimization flags makes the compiler attempt to improve
  82. the performance and/or code size at the expense of compilation time
  83. and possibly the ability to debug the program.
  84. </p>
  85. <p>The compiler performs optimization based on the knowledge it has of the
  86. program. Compiling multiple files at once to a single output file mode allows
  87. the compiler to use information gained from all of the files when compiling
  88. each of them.
  89. </p>
  90. <p>Not all optimizations are controlled directly by a flag. Only
  91. optimizations that have a flag are listed in this section.
  92. </p>
  93. <p>Most optimizations are completely disabled at <samp>-O0</samp> or if an
  94. <samp>-O</samp> level is not set on the command line, even if individual
  95. optimization flags are specified. Similarly, <samp>-Og</samp> suppresses
  96. many optimization passes.
  97. </p>
  98. <p>Depending on the target and how GCC was configured, a slightly different
  99. set of optimizations may be enabled at each <samp>-O</samp> level than
  100. those listed here. You can invoke GCC with <samp>-Q --help=optimizers</samp>
  101. to find out the exact set of optimizations that are enabled at each level.
  102. See <a href="Overall-Options.html#Overall-Options">Overall Options</a>, for examples.
  103. </p>
  104. <dl compact="compact">
  105. <dt><code>-O</code></dt>
  106. <dt><code>-O1</code></dt>
  107. <dd><a name="index-O"></a>
  108. <a name="index-O1"></a>
  109. <p>Optimize. Optimizing compilation takes somewhat more time, and a lot
  110. more memory for a large function.
  111. </p>
  112. <p>With <samp>-O</samp>, the compiler tries to reduce code size and execution
  113. time, without performing any optimizations that take a great deal of
  114. compilation time.
  115. </p>
  116. <p><samp>-O</samp> turns on the following optimization flags:
  117. </p>
  118. <div class="smallexample">
  119. <pre class="smallexample">-fauto-inc-dec
  120. -fbranch-count-reg
  121. -fcombine-stack-adjustments
  122. -fcompare-elim
  123. -fcprop-registers
  124. -fdce
  125. -fdefer-pop
  126. -fdelayed-branch
  127. -fdse
  128. -fforward-propagate
  129. -fguess-branch-probability
  130. -fif-conversion
  131. -fif-conversion2
  132. -finline-functions-called-once
  133. -fipa-profile
  134. -fipa-pure-const
  135. -fipa-reference
  136. -fipa-reference-addressable
  137. -fmerge-constants
  138. -fmove-loop-invariants
  139. -fomit-frame-pointer
  140. -freorder-blocks
  141. -fshrink-wrap
  142. -fshrink-wrap-separate
  143. -fsplit-wide-types
  144. -fssa-backprop
  145. -fssa-phiopt
  146. -ftree-bit-ccp
  147. -ftree-ccp
  148. -ftree-ch
  149. -ftree-coalesce-vars
  150. -ftree-copy-prop
  151. -ftree-dce
  152. -ftree-dominator-opts
  153. -ftree-dse
  154. -ftree-forwprop
  155. -ftree-fre
  156. -ftree-phiprop
  157. -ftree-pta
  158. -ftree-scev-cprop
  159. -ftree-sink
  160. -ftree-slsr
  161. -ftree-sra
  162. -ftree-ter
  163. -funit-at-a-time
  164. </pre></div>
  165. </dd>
  166. <dt><code>-O2</code></dt>
  167. <dd><a name="index-O2"></a>
  168. <p>Optimize even more. GCC performs nearly all supported optimizations
  169. that do not involve a space-speed tradeoff.
  170. As compared to <samp>-O</samp>, this option increases both compilation time
  171. and the performance of the generated code.
  172. </p>
  173. <p><samp>-O2</samp> turns on all optimization flags specified by <samp>-O</samp>. It
  174. also turns on the following optimization flags:
  175. </p>
  176. <div class="smallexample">
  177. <pre class="smallexample">-falign-functions -falign-jumps
  178. -falign-labels -falign-loops
  179. -fcaller-saves
  180. -fcode-hoisting
  181. -fcrossjumping
  182. -fcse-follow-jumps -fcse-skip-blocks
  183. -fdelete-null-pointer-checks
  184. -fdevirtualize -fdevirtualize-speculatively
  185. -fexpensive-optimizations
  186. -ffinite-loops
  187. -fgcse -fgcse-lm
  188. -fhoist-adjacent-loads
  189. -finline-functions
  190. -finline-small-functions
  191. -findirect-inlining
  192. -fipa-bit-cp -fipa-cp -fipa-icf
  193. -fipa-ra -fipa-sra -fipa-vrp
  194. -fisolate-erroneous-paths-dereference
  195. -flra-remat
  196. -foptimize-sibling-calls
  197. -foptimize-strlen
  198. -fpartial-inlining
  199. -fpeephole2
  200. -freorder-blocks-algorithm=stc
  201. -freorder-blocks-and-partition -freorder-functions
  202. -frerun-cse-after-loop
  203. -fschedule-insns -fschedule-insns2
  204. -fsched-interblock -fsched-spec
  205. -fstore-merging
  206. -fstrict-aliasing
  207. -fthread-jumps
  208. -ftree-builtin-call-dce
  209. -ftree-pre
  210. -ftree-switch-conversion -ftree-tail-merge
  211. -ftree-vrp
  212. </pre></div>
  213. <p>Please note the warning under <samp>-fgcse</samp> about
  214. invoking <samp>-O2</samp> on programs that use computed gotos.
  215. </p>
  216. </dd>
  217. <dt><code>-O3</code></dt>
  218. <dd><a name="index-O3"></a>
  219. <p>Optimize yet more. <samp>-O3</samp> turns on all optimizations specified
  220. by <samp>-O2</samp> and also turns on the following optimization flags:
  221. </p>
  222. <div class="smallexample">
  223. <pre class="smallexample">-fgcse-after-reload
  224. -fipa-cp-clone
  225. -floop-interchange
  226. -floop-unroll-and-jam
  227. -fpeel-loops
  228. -fpredictive-commoning
  229. -fsplit-loops
  230. -fsplit-paths
  231. -ftree-loop-distribution
  232. -ftree-loop-vectorize
  233. -ftree-partial-pre
  234. -ftree-slp-vectorize
  235. -funswitch-loops
  236. -fvect-cost-model
  237. -fvect-cost-model=dynamic
  238. -fversion-loops-for-strides
  239. </pre></div>
  240. </dd>
  241. <dt><code>-O0</code></dt>
  242. <dd><a name="index-O0"></a>
  243. <p>Reduce compilation time and make debugging produce the expected
  244. results. This is the default.
  245. </p>
  246. </dd>
  247. <dt><code>-Os</code></dt>
  248. <dd><a name="index-Os"></a>
  249. <p>Optimize for size. <samp>-Os</samp> enables all <samp>-O2</samp> optimizations
  250. except those that often increase code size:
  251. </p>
  252. <div class="smallexample">
  253. <pre class="smallexample">-falign-functions -falign-jumps
  254. -falign-labels -falign-loops
  255. -fprefetch-loop-arrays -freorder-blocks-algorithm=stc
  256. </pre></div>
  257. <p>It also enables <samp>-finline-functions</samp>, causes the compiler to tune for
  258. code size rather than execution speed, and performs further optimizations
  259. designed to reduce code size.
  260. </p>
  261. </dd>
  262. <dt><code>-Ofast</code></dt>
  263. <dd><a name="index-Ofast"></a>
  264. <p>Disregard strict standards compliance. <samp>-Ofast</samp> enables all
  265. <samp>-O3</samp> optimizations. It also enables optimizations that are not
  266. valid for all standard-compliant programs.
  267. It turns on <samp>-ffast-math</samp>, <samp>-fallow-store-data-races</samp>
  268. and the Fortran-specific <samp>-fstack-arrays</samp>, unless
  269. <samp>-fmax-stack-var-size</samp> is specified, and <samp>-fno-protect-parens</samp>.
  270. </p>
  271. </dd>
  272. <dt><code>-Og</code></dt>
  273. <dd><a name="index-Og"></a>
  274. <p>Optimize debugging experience. <samp>-Og</samp> should be the optimization
  275. level of choice for the standard edit-compile-debug cycle, offering
  276. a reasonable level of optimization while maintaining fast compilation
  277. and a good debugging experience. It is a better choice than <samp>-O0</samp>
  278. for producing debuggable code because some compiler passes
  279. that collect debug information are disabled at <samp>-O0</samp>.
  280. </p>
  281. <p>Like <samp>-O0</samp>, <samp>-Og</samp> completely disables a number of
  282. optimization passes so that individual options controlling them have
  283. no effect. Otherwise <samp>-Og</samp> enables all <samp>-O1</samp>
  284. optimization flags except for those that may interfere with debugging:
  285. </p>
  286. <div class="smallexample">
  287. <pre class="smallexample">-fbranch-count-reg -fdelayed-branch
  288. -fdse -fif-conversion -fif-conversion2
  289. -finline-functions-called-once
  290. -fmove-loop-invariants -fssa-phiopt
  291. -ftree-bit-ccp -ftree-dse -ftree-pta -ftree-sra
  292. </pre></div>
  293. </dd>
  294. </dl>
  295. <p>If you use multiple <samp>-O</samp> options, with or without level numbers,
  296. the last such option is the one that is effective.
  297. </p>
  298. <p>Options of the form <samp>-f<var>flag</var></samp> specify machine-independent
  299. flags. Most flags have both positive and negative forms; the negative
  300. form of <samp>-ffoo</samp> is <samp>-fno-foo</samp>. In the table
  301. below, only one of the forms is listed&mdash;the one you typically
  302. use. You can figure out the other form by either removing &lsquo;<samp>no-</samp>&rsquo;
  303. or adding it.
  304. </p>
  305. <p>The following options control specific optimizations. They are either
  306. activated by <samp>-O</samp> options or are related to ones that are. You
  307. can use the following flags in the rare cases when &ldquo;fine-tuning&rdquo; of
  308. optimizations to be performed is desired.
  309. </p>
  310. <dl compact="compact">
  311. <dt><code>-fno-defer-pop</code></dt>
  312. <dd><a name="index-fno_002ddefer_002dpop"></a>
  313. <a name="index-fdefer_002dpop"></a>
  314. <p>For machines that must pop arguments after a function call, always pop
  315. the arguments as soon as each function returns.
  316. At levels <samp>-O1</samp> and higher, <samp>-fdefer-pop</samp> is the default;
  317. this allows the compiler to let arguments accumulate on the stack for several
  318. function calls and pop them all at once.
  319. </p>
  320. </dd>
  321. <dt><code>-fforward-propagate</code></dt>
  322. <dd><a name="index-fforward_002dpropagate"></a>
  323. <p>Perform a forward propagation pass on RTL. The pass tries to combine two
  324. instructions and checks if the result can be simplified. If loop unrolling
  325. is active, two passes are performed and the second is scheduled after
  326. loop unrolling.
  327. </p>
  328. <p>This option is enabled by default at optimization levels <samp>-O</samp>,
  329. <samp>-O2</samp>, <samp>-O3</samp>, <samp>-Os</samp>.
  330. </p>
  331. </dd>
  332. <dt><code>-ffp-contract=<var>style</var></code></dt>
  333. <dd><a name="index-ffp_002dcontract"></a>
  334. <p><samp>-ffp-contract=off</samp> disables floating-point expression contraction.
  335. <samp>-ffp-contract=fast</samp> enables floating-point expression contraction
  336. such as forming of fused multiply-add operations if the target has
  337. native support for them.
  338. <samp>-ffp-contract=on</samp> enables floating-point expression contraction
  339. if allowed by the language standard. This is currently not implemented
  340. and treated equal to <samp>-ffp-contract=off</samp>.
  341. </p>
  342. <p>The default is <samp>-ffp-contract=fast</samp>.
  343. </p>
  344. </dd>
  345. <dt><code>-fomit-frame-pointer</code></dt>
  346. <dd><a name="index-fomit_002dframe_002dpointer"></a>
  347. <p>Omit the frame pointer in functions that don&rsquo;t need one. This avoids the
  348. instructions to save, set up and restore the frame pointer; on many targets
  349. it also makes an extra register available.
  350. </p>
  351. <p>On some targets this flag has no effect because the standard calling sequence
  352. always uses a frame pointer, so it cannot be omitted.
  353. </p>
  354. <p>Note that <samp>-fno-omit-frame-pointer</samp> doesn&rsquo;t guarantee the frame pointer
  355. is used in all functions. Several targets always omit the frame pointer in
  356. leaf functions.
  357. </p>
  358. <p>Enabled by default at <samp>-O</samp> and higher.
  359. </p>
  360. </dd>
  361. <dt><code>-foptimize-sibling-calls</code></dt>
  362. <dd><a name="index-foptimize_002dsibling_002dcalls"></a>
  363. <p>Optimize sibling and tail recursive calls.
  364. </p>
  365. <p>Enabled at levels <samp>-O2</samp>, <samp>-O3</samp>, <samp>-Os</samp>.
  366. </p>
  367. </dd>
  368. <dt><code>-foptimize-strlen</code></dt>
  369. <dd><a name="index-foptimize_002dstrlen"></a>
  370. <p>Optimize various standard C string functions (e.g. <code>strlen</code>,
  371. <code>strchr</code> or <code>strcpy</code>) and
  372. their <code>_FORTIFY_SOURCE</code> counterparts into faster alternatives.
  373. </p>
  374. <p>Enabled at levels <samp>-O2</samp>, <samp>-O3</samp>.
  375. </p>
  376. </dd>
  377. <dt><code>-fno-inline</code></dt>
  378. <dd><a name="index-fno_002dinline"></a>
  379. <a name="index-finline"></a>
  380. <p>Do not expand any functions inline apart from those marked with
  381. the <code>always_inline</code> attribute. This is the default when not
  382. optimizing.
  383. </p>
  384. <p>Single functions can be exempted from inlining by marking them
  385. with the <code>noinline</code> attribute.
  386. </p>
  387. </dd>
  388. <dt><code>-finline-small-functions</code></dt>
  389. <dd><a name="index-finline_002dsmall_002dfunctions"></a>
  390. <p>Integrate functions into their callers when their body is smaller than expected
  391. function call code (so overall size of program gets smaller). The compiler
  392. heuristically decides which functions are simple enough to be worth integrating
  393. in this way. This inlining applies to all functions, even those not declared
  394. inline.
  395. </p>
  396. <p>Enabled at levels <samp>-O2</samp>, <samp>-O3</samp>, <samp>-Os</samp>.
  397. </p>
  398. </dd>
  399. <dt><code>-findirect-inlining</code></dt>
  400. <dd><a name="index-findirect_002dinlining"></a>
  401. <p>Inline also indirect calls that are discovered to be known at compile
  402. time thanks to previous inlining. This option has any effect only
  403. when inlining itself is turned on by the <samp>-finline-functions</samp>
  404. or <samp>-finline-small-functions</samp> options.
  405. </p>
  406. <p>Enabled at levels <samp>-O2</samp>, <samp>-O3</samp>, <samp>-Os</samp>.
  407. </p>
  408. </dd>
  409. <dt><code>-finline-functions</code></dt>
  410. <dd><a name="index-finline_002dfunctions"></a>
  411. <p>Consider all functions for inlining, even if they are not declared inline.
  412. The compiler heuristically decides which functions are worth integrating
  413. in this way.
  414. </p>
  415. <p>If all calls to a given function are integrated, and the function is
  416. declared <code>static</code>, then the function is normally not output as
  417. assembler code in its own right.
  418. </p>
  419. <p>Enabled at levels <samp>-O2</samp>, <samp>-O3</samp>, <samp>-Os</samp>. Also enabled
  420. by <samp>-fprofile-use</samp> and <samp>-fauto-profile</samp>.
  421. </p>
  422. </dd>
  423. <dt><code>-finline-functions-called-once</code></dt>
  424. <dd><a name="index-finline_002dfunctions_002dcalled_002donce"></a>
  425. <p>Consider all <code>static</code> functions called once for inlining into their
  426. caller even if they are not marked <code>inline</code>. If a call to a given
  427. function is integrated, then the function is not output as assembler code
  428. in its own right.
  429. </p>
  430. <p>Enabled at levels <samp>-O1</samp>, <samp>-O2</samp>, <samp>-O3</samp> and <samp>-Os</samp>,
  431. but not <samp>-Og</samp>.
  432. </p>
  433. </dd>
  434. <dt><code>-fearly-inlining</code></dt>
  435. <dd><a name="index-fearly_002dinlining"></a>
  436. <p>Inline functions marked by <code>always_inline</code> and functions whose body seems
  437. smaller than the function call overhead early before doing
  438. <samp>-fprofile-generate</samp> instrumentation and real inlining pass. Doing so
  439. makes profiling significantly cheaper and usually inlining faster on programs
  440. having large chains of nested wrapper functions.
  441. </p>
  442. <p>Enabled by default.
  443. </p>
  444. </dd>
  445. <dt><code>-fipa-sra</code></dt>
  446. <dd><a name="index-fipa_002dsra"></a>
  447. <p>Perform interprocedural scalar replacement of aggregates, removal of
  448. unused parameters and replacement of parameters passed by reference
  449. by parameters passed by value.
  450. </p>
  451. <p>Enabled at levels <samp>-O2</samp>, <samp>-O3</samp> and <samp>-Os</samp>.
  452. </p>
  453. </dd>
  454. <dt><code>-finline-limit=<var>n</var></code></dt>
  455. <dd><a name="index-finline_002dlimit"></a>
  456. <p>By default, GCC limits the size of functions that can be inlined. This flag
  457. allows coarse control of this limit. <var>n</var> is the size of functions that
  458. can be inlined in number of pseudo instructions.
  459. </p>
  460. <p>Inlining is actually controlled by a number of parameters, which may be
  461. specified individually by using <samp>--param <var>name</var>=<var>value</var></samp>.
  462. The <samp>-finline-limit=<var>n</var></samp> option sets some of these parameters
  463. as follows:
  464. </p>
  465. <dl compact="compact">
  466. <dt><code>max-inline-insns-single</code></dt>
  467. <dd><p>is set to <var>n</var>/2.
  468. </p></dd>
  469. <dt><code>max-inline-insns-auto</code></dt>
  470. <dd><p>is set to <var>n</var>/2.
  471. </p></dd>
  472. </dl>
  473. <p>See below for a documentation of the individual
  474. parameters controlling inlining and for the defaults of these parameters.
  475. </p>
  476. <p><em>Note:</em> there may be no value to <samp>-finline-limit</samp> that results
  477. in default behavior.
  478. </p>
  479. <p><em>Note:</em> pseudo instruction represents, in this particular context, an
  480. abstract measurement of function&rsquo;s size. In no way does it represent a count
  481. of assembly instructions and as such its exact meaning might change from one
  482. release to an another.
  483. </p>
  484. </dd>
  485. <dt><code>-fno-keep-inline-dllexport</code></dt>
  486. <dd><a name="index-fno_002dkeep_002dinline_002ddllexport"></a>
  487. <a name="index-fkeep_002dinline_002ddllexport"></a>
  488. <p>This is a more fine-grained version of <samp>-fkeep-inline-functions</samp>,
  489. which applies only to functions that are declared using the <code>dllexport</code>
  490. attribute or declspec. See <a href="Function-Attributes.html#Function-Attributes">Declaring Attributes of
  491. Functions</a>.
  492. </p>
  493. </dd>
  494. <dt><code>-fkeep-inline-functions</code></dt>
  495. <dd><a name="index-fkeep_002dinline_002dfunctions"></a>
  496. <p>In C, emit <code>static</code> functions that are declared <code>inline</code>
  497. into the object file, even if the function has been inlined into all
  498. of its callers. This switch does not affect functions using the
  499. <code>extern inline</code> extension in GNU C90. In C++, emit any and all
  500. inline functions into the object file.
  501. </p>
  502. </dd>
  503. <dt><code>-fkeep-static-functions</code></dt>
  504. <dd><a name="index-fkeep_002dstatic_002dfunctions"></a>
  505. <p>Emit <code>static</code> functions into the object file, even if the function
  506. is never used.
  507. </p>
  508. </dd>
  509. <dt><code>-fkeep-static-consts</code></dt>
  510. <dd><a name="index-fkeep_002dstatic_002dconsts"></a>
  511. <p>Emit variables declared <code>static const</code> when optimization isn&rsquo;t turned
  512. on, even if the variables aren&rsquo;t referenced.
  513. </p>
  514. <p>GCC enables this option by default. If you want to force the compiler to
  515. check if a variable is referenced, regardless of whether or not
  516. optimization is turned on, use the <samp>-fno-keep-static-consts</samp> option.
  517. </p>
  518. </dd>
  519. <dt><code>-fmerge-constants</code></dt>
  520. <dd><a name="index-fmerge_002dconstants"></a>
  521. <p>Attempt to merge identical constants (string constants and floating-point
  522. constants) across compilation units.
  523. </p>
  524. <p>This option is the default for optimized compilation if the assembler and
  525. linker support it. Use <samp>-fno-merge-constants</samp> to inhibit this
  526. behavior.
  527. </p>
  528. <p>Enabled at levels <samp>-O</samp>, <samp>-O2</samp>, <samp>-O3</samp>, <samp>-Os</samp>.
  529. </p>
  530. </dd>
  531. <dt><code>-fmerge-all-constants</code></dt>
  532. <dd><a name="index-fmerge_002dall_002dconstants"></a>
  533. <p>Attempt to merge identical constants and identical variables.
  534. </p>
  535. <p>This option implies <samp>-fmerge-constants</samp>. In addition to
  536. <samp>-fmerge-constants</samp> this considers e.g. even constant initialized
  537. arrays or initialized constant variables with integral or floating-point
  538. types. Languages like C or C++ require each variable, including multiple
  539. instances of the same variable in recursive calls, to have distinct locations,
  540. so using this option results in non-conforming
  541. behavior.
  542. </p>
  543. </dd>
  544. <dt><code>-fmodulo-sched</code></dt>
  545. <dd><a name="index-fmodulo_002dsched"></a>
  546. <p>Perform swing modulo scheduling immediately before the first scheduling
  547. pass. This pass looks at innermost loops and reorders their
  548. instructions by overlapping different iterations.
  549. </p>
  550. </dd>
  551. <dt><code>-fmodulo-sched-allow-regmoves</code></dt>
  552. <dd><a name="index-fmodulo_002dsched_002dallow_002dregmoves"></a>
  553. <p>Perform more aggressive SMS-based modulo scheduling with register moves
  554. allowed. By setting this flag certain anti-dependences edges are
  555. deleted, which triggers the generation of reg-moves based on the
  556. life-range analysis. This option is effective only with
  557. <samp>-fmodulo-sched</samp> enabled.
  558. </p>
  559. </dd>
  560. <dt><code>-fno-branch-count-reg</code></dt>
  561. <dd><a name="index-fno_002dbranch_002dcount_002dreg"></a>
  562. <a name="index-fbranch_002dcount_002dreg"></a>
  563. <p>Disable the optimization pass that scans for opportunities to use
  564. &ldquo;decrement and branch&rdquo; instructions on a count register instead of
  565. instruction sequences that decrement a register, compare it against zero, and
  566. then branch based upon the result. This option is only meaningful on
  567. architectures that support such instructions, which include x86, PowerPC,
  568. IA-64 and S/390. Note that the <samp>-fno-branch-count-reg</samp> option
  569. doesn&rsquo;t remove the decrement and branch instructions from the generated
  570. instruction stream introduced by other optimization passes.
  571. </p>
  572. <p>The default is <samp>-fbranch-count-reg</samp> at <samp>-O1</samp> and higher,
  573. except for <samp>-Og</samp>.
  574. </p>
  575. </dd>
  576. <dt><code>-fno-function-cse</code></dt>
  577. <dd><a name="index-fno_002dfunction_002dcse"></a>
  578. <a name="index-ffunction_002dcse"></a>
  579. <p>Do not put function addresses in registers; make each instruction that
  580. calls a constant function contain the function&rsquo;s address explicitly.
  581. </p>
  582. <p>This option results in less efficient code, but some strange hacks
  583. that alter the assembler output may be confused by the optimizations
  584. performed when this option is not used.
  585. </p>
  586. <p>The default is <samp>-ffunction-cse</samp>
  587. </p>
  588. </dd>
  589. <dt><code>-fno-zero-initialized-in-bss</code></dt>
  590. <dd><a name="index-fno_002dzero_002dinitialized_002din_002dbss"></a>
  591. <a name="index-fzero_002dinitialized_002din_002dbss"></a>
  592. <p>If the target supports a BSS section, GCC by default puts variables that
  593. are initialized to zero into BSS. This can save space in the resulting
  594. code.
  595. </p>
  596. <p>This option turns off this behavior because some programs explicitly
  597. rely on variables going to the data section&mdash;e.g., so that the
  598. resulting executable can find the beginning of that section and/or make
  599. assumptions based on that.
  600. </p>
  601. <p>The default is <samp>-fzero-initialized-in-bss</samp>.
  602. </p>
  603. </dd>
  604. <dt><code>-fthread-jumps</code></dt>
  605. <dd><a name="index-fthread_002djumps"></a>
  606. <p>Perform optimizations that check to see if a jump branches to a
  607. location where another comparison subsumed by the first is found. If
  608. so, the first branch is redirected to either the destination of the
  609. second branch or a point immediately following it, depending on whether
  610. the condition is known to be true or false.
  611. </p>
  612. <p>Enabled at levels <samp>-O2</samp>, <samp>-O3</samp>, <samp>-Os</samp>.
  613. </p>
  614. </dd>
  615. <dt><code>-fsplit-wide-types</code></dt>
  616. <dd><a name="index-fsplit_002dwide_002dtypes"></a>
  617. <p>When using a type that occupies multiple registers, such as <code>long
  618. long</code> on a 32-bit system, split the registers apart and allocate them
  619. independently. This normally generates better code for those types,
  620. but may make debugging more difficult.
  621. </p>
  622. <p>Enabled at levels <samp>-O</samp>, <samp>-O2</samp>, <samp>-O3</samp>,
  623. <samp>-Os</samp>.
  624. </p>
  625. </dd>
  626. <dt><code>-fsplit-wide-types-early</code></dt>
  627. <dd><a name="index-fsplit_002dwide_002dtypes_002dearly"></a>
  628. <p>Fully split wide types early, instead of very late.
  629. This option has no effect unless <samp>-fsplit-wide-types</samp> is turned on.
  630. </p>
  631. <p>This is the default on some targets.
  632. </p>
  633. </dd>
  634. <dt><code>-fcse-follow-jumps</code></dt>
  635. <dd><a name="index-fcse_002dfollow_002djumps"></a>
  636. <p>In common subexpression elimination (CSE), scan through jump instructions
  637. when the target of the jump is not reached by any other path. For
  638. example, when CSE encounters an <code>if</code> statement with an
  639. <code>else</code> clause, CSE follows the jump when the condition
  640. tested is false.
  641. </p>
  642. <p>Enabled at levels <samp>-O2</samp>, <samp>-O3</samp>, <samp>-Os</samp>.
  643. </p>
  644. </dd>
  645. <dt><code>-fcse-skip-blocks</code></dt>
  646. <dd><a name="index-fcse_002dskip_002dblocks"></a>
  647. <p>This is similar to <samp>-fcse-follow-jumps</samp>, but causes CSE to
  648. follow jumps that conditionally skip over blocks. When CSE
  649. encounters a simple <code>if</code> statement with no else clause,
  650. <samp>-fcse-skip-blocks</samp> causes CSE to follow the jump around the
  651. body of the <code>if</code>.
  652. </p>
  653. <p>Enabled at levels <samp>-O2</samp>, <samp>-O3</samp>, <samp>-Os</samp>.
  654. </p>
  655. </dd>
  656. <dt><code>-frerun-cse-after-loop</code></dt>
  657. <dd><a name="index-frerun_002dcse_002dafter_002dloop"></a>
  658. <p>Re-run common subexpression elimination after loop optimizations are
  659. performed.
  660. </p>
  661. <p>Enabled at levels <samp>-O2</samp>, <samp>-O3</samp>, <samp>-Os</samp>.
  662. </p>
  663. </dd>
  664. <dt><code>-fgcse</code></dt>
  665. <dd><a name="index-fgcse"></a>
  666. <p>Perform a global common subexpression elimination pass.
  667. This pass also performs global constant and copy propagation.
  668. </p>
  669. <p><em>Note:</em> When compiling a program using computed gotos, a GCC
  670. extension, you may get better run-time performance if you disable
  671. the global common subexpression elimination pass by adding
  672. <samp>-fno-gcse</samp> to the command line.
  673. </p>
  674. <p>Enabled at levels <samp>-O2</samp>, <samp>-O3</samp>, <samp>-Os</samp>.
  675. </p>
  676. </dd>
  677. <dt><code>-fgcse-lm</code></dt>
  678. <dd><a name="index-fgcse_002dlm"></a>
  679. <p>When <samp>-fgcse-lm</samp> is enabled, global common subexpression elimination
  680. attempts to move loads that are only killed by stores into themselves. This
  681. allows a loop containing a load/store sequence to be changed to a load outside
  682. the loop, and a copy/store within the loop.
  683. </p>
  684. <p>Enabled by default when <samp>-fgcse</samp> is enabled.
  685. </p>
  686. </dd>
  687. <dt><code>-fgcse-sm</code></dt>
  688. <dd><a name="index-fgcse_002dsm"></a>
  689. <p>When <samp>-fgcse-sm</samp> is enabled, a store motion pass is run after
  690. global common subexpression elimination. This pass attempts to move
  691. stores out of loops. When used in conjunction with <samp>-fgcse-lm</samp>,
  692. loops containing a load/store sequence can be changed to a load before
  693. the loop and a store after the loop.
  694. </p>
  695. <p>Not enabled at any optimization level.
  696. </p>
  697. </dd>
  698. <dt><code>-fgcse-las</code></dt>
  699. <dd><a name="index-fgcse_002dlas"></a>
  700. <p>When <samp>-fgcse-las</samp> is enabled, the global common subexpression
  701. elimination pass eliminates redundant loads that come after stores to the
  702. same memory location (both partial and full redundancies).
  703. </p>
  704. <p>Not enabled at any optimization level.
  705. </p>
  706. </dd>
  707. <dt><code>-fgcse-after-reload</code></dt>
  708. <dd><a name="index-fgcse_002dafter_002dreload"></a>
  709. <p>When <samp>-fgcse-after-reload</samp> is enabled, a redundant load elimination
  710. pass is performed after reload. The purpose of this pass is to clean up
  711. redundant spilling.
  712. </p>
  713. <p>Enabled by <samp>-fprofile-use</samp> and <samp>-fauto-profile</samp>.
  714. </p>
  715. </dd>
  716. <dt><code>-faggressive-loop-optimizations</code></dt>
  717. <dd><a name="index-faggressive_002dloop_002doptimizations"></a>
  718. <p>This option tells the loop optimizer to use language constraints to
  719. derive bounds for the number of iterations of a loop. This assumes that
  720. loop code does not invoke undefined behavior by for example causing signed
  721. integer overflows or out-of-bound array accesses. The bounds for the
  722. number of iterations of a loop are used to guide loop unrolling and peeling
  723. and loop exit test optimizations.
  724. This option is enabled by default.
  725. </p>
  726. </dd>
  727. <dt><code>-funconstrained-commons</code></dt>
  728. <dd><a name="index-funconstrained_002dcommons"></a>
  729. <p>This option tells the compiler that variables declared in common blocks
  730. (e.g. Fortran) may later be overridden with longer trailing arrays. This
  731. prevents certain optimizations that depend on knowing the array bounds.
  732. </p>
  733. </dd>
  734. <dt><code>-fcrossjumping</code></dt>
  735. <dd><a name="index-fcrossjumping"></a>
  736. <p>Perform cross-jumping transformation.
  737. This transformation unifies equivalent code and saves code size. The
  738. resulting code may or may not perform better than without cross-jumping.
  739. </p>
  740. <p>Enabled at levels <samp>-O2</samp>, <samp>-O3</samp>, <samp>-Os</samp>.
  741. </p>
  742. </dd>
  743. <dt><code>-fauto-inc-dec</code></dt>
  744. <dd><a name="index-fauto_002dinc_002ddec"></a>
  745. <p>Combine increments or decrements of addresses with memory accesses.
  746. This pass is always skipped on architectures that do not have
  747. instructions to support this. Enabled by default at <samp>-O</samp> and
  748. higher on architectures that support this.
  749. </p>
  750. </dd>
  751. <dt><code>-fdce</code></dt>
  752. <dd><a name="index-fdce"></a>
  753. <p>Perform dead code elimination (DCE) on RTL.
  754. Enabled by default at <samp>-O</samp> and higher.
  755. </p>
  756. </dd>
  757. <dt><code>-fdse</code></dt>
  758. <dd><a name="index-fdse"></a>
  759. <p>Perform dead store elimination (DSE) on RTL.
  760. Enabled by default at <samp>-O</samp> and higher.
  761. </p>
  762. </dd>
  763. <dt><code>-fif-conversion</code></dt>
  764. <dd><a name="index-fif_002dconversion"></a>
  765. <p>Attempt to transform conditional jumps into branch-less equivalents. This
  766. includes use of conditional moves, min, max, set flags and abs instructions, and
  767. some tricks doable by standard arithmetics. The use of conditional execution
  768. on chips where it is available is controlled by <samp>-fif-conversion2</samp>.
  769. </p>
  770. <p>Enabled at levels <samp>-O</samp>, <samp>-O2</samp>, <samp>-O3</samp>, <samp>-Os</samp>, but
  771. not with <samp>-Og</samp>.
  772. </p>
  773. </dd>
  774. <dt><code>-fif-conversion2</code></dt>
  775. <dd><a name="index-fif_002dconversion2"></a>
  776. <p>Use conditional execution (where available) to transform conditional jumps into
  777. branch-less equivalents.
  778. </p>
  779. <p>Enabled at levels <samp>-O</samp>, <samp>-O2</samp>, <samp>-O3</samp>, <samp>-Os</samp>, but
  780. not with <samp>-Og</samp>.
  781. </p>
  782. </dd>
  783. <dt><code>-fdeclone-ctor-dtor</code></dt>
  784. <dd><a name="index-fdeclone_002dctor_002ddtor"></a>
  785. <p>The C++ ABI requires multiple entry points for constructors and
  786. destructors: one for a base subobject, one for a complete object, and
  787. one for a virtual destructor that calls operator delete afterwards.
  788. For a hierarchy with virtual bases, the base and complete variants are
  789. clones, which means two copies of the function. With this option, the
  790. base and complete variants are changed to be thunks that call a common
  791. implementation.
  792. </p>
  793. <p>Enabled by <samp>-Os</samp>.
  794. </p>
  795. </dd>
  796. <dt><code>-fdelete-null-pointer-checks</code></dt>
  797. <dd><a name="index-fdelete_002dnull_002dpointer_002dchecks"></a>
  798. <p>Assume that programs cannot safely dereference null pointers, and that
  799. no code or data element resides at address zero.
  800. This option enables simple constant
  801. folding optimizations at all optimization levels. In addition, other
  802. optimization passes in GCC use this flag to control global dataflow
  803. analyses that eliminate useless checks for null pointers; these assume
  804. that a memory access to address zero always results in a trap, so
  805. that if a pointer is checked after it has already been dereferenced,
  806. it cannot be null.
  807. </p>
  808. <p>Note however that in some environments this assumption is not true.
  809. Use <samp>-fno-delete-null-pointer-checks</samp> to disable this optimization
  810. for programs that depend on that behavior.
  811. </p>
  812. <p>This option is enabled by default on most targets. On Nios II ELF, it
  813. defaults to off. On AVR, CR16, and MSP430, this option is completely disabled.
  814. </p>
  815. <p>Passes that use the dataflow information
  816. are enabled independently at different optimization levels.
  817. </p>
  818. </dd>
  819. <dt><code>-fdevirtualize</code></dt>
  820. <dd><a name="index-fdevirtualize"></a>
  821. <p>Attempt to convert calls to virtual functions to direct calls. This
  822. is done both within a procedure and interprocedurally as part of
  823. indirect inlining (<samp>-findirect-inlining</samp>) and interprocedural constant
  824. propagation (<samp>-fipa-cp</samp>).
  825. Enabled at levels <samp>-O2</samp>, <samp>-O3</samp>, <samp>-Os</samp>.
  826. </p>
  827. </dd>
  828. <dt><code>-fdevirtualize-speculatively</code></dt>
  829. <dd><a name="index-fdevirtualize_002dspeculatively"></a>
  830. <p>Attempt to convert calls to virtual functions to speculative direct calls.
  831. Based on the analysis of the type inheritance graph, determine for a given call
  832. the set of likely targets. If the set is small, preferably of size 1, change
  833. the call into a conditional deciding between direct and indirect calls. The
  834. speculative calls enable more optimizations, such as inlining. When they seem
  835. useless after further optimization, they are converted back into original form.
  836. </p>
  837. </dd>
  838. <dt><code>-fdevirtualize-at-ltrans</code></dt>
  839. <dd><a name="index-fdevirtualize_002dat_002dltrans"></a>
  840. <p>Stream extra information needed for aggressive devirtualization when running
  841. the link-time optimizer in local transformation mode.
  842. This option enables more devirtualization but
  843. significantly increases the size of streamed data. For this reason it is
  844. disabled by default.
  845. </p>
  846. </dd>
  847. <dt><code>-fexpensive-optimizations</code></dt>
  848. <dd><a name="index-fexpensive_002doptimizations"></a>
  849. <p>Perform a number of minor optimizations that are relatively expensive.
  850. </p>
  851. <p>Enabled at levels <samp>-O2</samp>, <samp>-O3</samp>, <samp>-Os</samp>.
  852. </p>
  853. </dd>
  854. <dt><code>-free</code></dt>
  855. <dd><a name="index-free-1"></a>
  856. <p>Attempt to remove redundant extension instructions. This is especially
  857. helpful for the x86-64 architecture, which implicitly zero-extends in 64-bit
  858. registers after writing to their lower 32-bit half.
  859. </p>
  860. <p>Enabled for Alpha, AArch64 and x86 at levels <samp>-O2</samp>,
  861. <samp>-O3</samp>, <samp>-Os</samp>.
  862. </p>
  863. </dd>
  864. <dt><code>-fno-lifetime-dse</code></dt>
  865. <dd><a name="index-fno_002dlifetime_002ddse"></a>
  866. <a name="index-flifetime_002ddse"></a>
  867. <p>In C++ the value of an object is only affected by changes within its
  868. lifetime: when the constructor begins, the object has an indeterminate
  869. value, and any changes during the lifetime of the object are dead when
  870. the object is destroyed. Normally dead store elimination will take
  871. advantage of this; if your code relies on the value of the object
  872. storage persisting beyond the lifetime of the object, you can use this
  873. flag to disable this optimization. To preserve stores before the
  874. constructor starts (e.g. because your operator new clears the object
  875. storage) but still treat the object as dead after the destructor, you
  876. can use <samp>-flifetime-dse=1</samp>. The default behavior can be
  877. explicitly selected with <samp>-flifetime-dse=2</samp>.
  878. <samp>-flifetime-dse=0</samp> is equivalent to <samp>-fno-lifetime-dse</samp>.
  879. </p>
  880. </dd>
  881. <dt><code>-flive-range-shrinkage</code></dt>
  882. <dd><a name="index-flive_002drange_002dshrinkage"></a>
  883. <p>Attempt to decrease register pressure through register live range
  884. shrinkage. This is helpful for fast processors with small or moderate
  885. size register sets.
  886. </p>
  887. </dd>
  888. <dt><code>-fira-algorithm=<var>algorithm</var></code></dt>
  889. <dd><a name="index-fira_002dalgorithm"></a>
  890. <p>Use the specified coloring algorithm for the integrated register
  891. allocator. The <var>algorithm</var> argument can be &lsquo;<samp>priority</samp>&rsquo;, which
  892. specifies Chow&rsquo;s priority coloring, or &lsquo;<samp>CB</samp>&rsquo;, which specifies
  893. Chaitin-Briggs coloring. Chaitin-Briggs coloring is not implemented
  894. for all architectures, but for those targets that do support it, it is
  895. the default because it generates better code.
  896. </p>
  897. </dd>
  898. <dt><code>-fira-region=<var>region</var></code></dt>
  899. <dd><a name="index-fira_002dregion"></a>
  900. <p>Use specified regions for the integrated register allocator. The
  901. <var>region</var> argument should be one of the following:
  902. </p>
  903. <dl compact="compact">
  904. <dt>&lsquo;<samp>all</samp>&rsquo;</dt>
  905. <dd><p>Use all loops as register allocation regions.
  906. This can give the best results for machines with a small and/or
  907. irregular register set.
  908. </p>
  909. </dd>
  910. <dt>&lsquo;<samp>mixed</samp>&rsquo;</dt>
  911. <dd><p>Use all loops except for loops with small register pressure
  912. as the regions. This value usually gives
  913. the best results in most cases and for most architectures,
  914. and is enabled by default when compiling with optimization for speed
  915. (<samp>-O</samp>, <samp>-O2</samp>, &hellip;).
  916. </p>
  917. </dd>
  918. <dt>&lsquo;<samp>one</samp>&rsquo;</dt>
  919. <dd><p>Use all functions as a single region.
  920. This typically results in the smallest code size, and is enabled by default for
  921. <samp>-Os</samp> or <samp>-O0</samp>.
  922. </p>
  923. </dd>
  924. </dl>
  925. </dd>
  926. <dt><code>-fira-hoist-pressure</code></dt>
  927. <dd><a name="index-fira_002dhoist_002dpressure"></a>
  928. <p>Use IRA to evaluate register pressure in the code hoisting pass for
  929. decisions to hoist expressions. This option usually results in smaller
  930. code, but it can slow the compiler down.
  931. </p>
  932. <p>This option is enabled at level <samp>-Os</samp> for all targets.
  933. </p>
  934. </dd>
  935. <dt><code>-fira-loop-pressure</code></dt>
  936. <dd><a name="index-fira_002dloop_002dpressure"></a>
  937. <p>Use IRA to evaluate register pressure in loops for decisions to move
  938. loop invariants. This option usually results in generation
  939. of faster and smaller code on machines with large register files (&gt;= 32
  940. registers), but it can slow the compiler down.
  941. </p>
  942. <p>This option is enabled at level <samp>-O3</samp> for some targets.
  943. </p>
  944. </dd>
  945. <dt><code>-fno-ira-share-save-slots</code></dt>
  946. <dd><a name="index-fno_002dira_002dshare_002dsave_002dslots"></a>
  947. <a name="index-fira_002dshare_002dsave_002dslots"></a>
  948. <p>Disable sharing of stack slots used for saving call-used hard
  949. registers living through a call. Each hard register gets a
  950. separate stack slot, and as a result function stack frames are
  951. larger.
  952. </p>
  953. </dd>
  954. <dt><code>-fno-ira-share-spill-slots</code></dt>
  955. <dd><a name="index-fno_002dira_002dshare_002dspill_002dslots"></a>
  956. <a name="index-fira_002dshare_002dspill_002dslots"></a>
  957. <p>Disable sharing of stack slots allocated for pseudo-registers. Each
  958. pseudo-register that does not get a hard register gets a separate
  959. stack slot, and as a result function stack frames are larger.
  960. </p>
  961. </dd>
  962. <dt><code>-flra-remat</code></dt>
  963. <dd><a name="index-flra_002dremat"></a>
  964. <p>Enable CFG-sensitive rematerialization in LRA. Instead of loading
  965. values of spilled pseudos, LRA tries to rematerialize (recalculate)
  966. values if it is profitable.
  967. </p>
  968. <p>Enabled at levels <samp>-O2</samp>, <samp>-O3</samp>, <samp>-Os</samp>.
  969. </p>
  970. </dd>
  971. <dt><code>-fdelayed-branch</code></dt>
  972. <dd><a name="index-fdelayed_002dbranch"></a>
  973. <p>If supported for the target machine, attempt to reorder instructions
  974. to exploit instruction slots available after delayed branch
  975. instructions.
  976. </p>
  977. <p>Enabled at levels <samp>-O</samp>, <samp>-O2</samp>, <samp>-O3</samp>, <samp>-Os</samp>,
  978. but not at <samp>-Og</samp>.
  979. </p>
  980. </dd>
  981. <dt><code>-fschedule-insns</code></dt>
  982. <dd><a name="index-fschedule_002dinsns"></a>
  983. <p>If supported for the target machine, attempt to reorder instructions to
  984. eliminate execution stalls due to required data being unavailable. This
  985. helps machines that have slow floating point or memory load instructions
  986. by allowing other instructions to be issued until the result of the load
  987. or floating-point instruction is required.
  988. </p>
  989. <p>Enabled at levels <samp>-O2</samp>, <samp>-O3</samp>.
  990. </p>
  991. </dd>
  992. <dt><code>-fschedule-insns2</code></dt>
  993. <dd><a name="index-fschedule_002dinsns2"></a>
  994. <p>Similar to <samp>-fschedule-insns</samp>, but requests an additional pass of
  995. instruction scheduling after register allocation has been done. This is
  996. especially useful on machines with a relatively small number of
  997. registers and where memory load instructions take more than one cycle.
  998. </p>
  999. <p>Enabled at levels <samp>-O2</samp>, <samp>-O3</samp>, <samp>-Os</samp>.
  1000. </p>
  1001. </dd>
  1002. <dt><code>-fno-sched-interblock</code></dt>
  1003. <dd><a name="index-fno_002dsched_002dinterblock"></a>
  1004. <a name="index-fsched_002dinterblock"></a>
  1005. <p>Disable instruction scheduling across basic blocks, which
  1006. is normally enabled when scheduling before register allocation, i.e.
  1007. with <samp>-fschedule-insns</samp> or at <samp>-O2</samp> or higher.
  1008. </p>
  1009. </dd>
  1010. <dt><code>-fno-sched-spec</code></dt>
  1011. <dd><a name="index-fno_002dsched_002dspec"></a>
  1012. <a name="index-fsched_002dspec"></a>
  1013. <p>Disable speculative motion of non-load instructions, which
  1014. is normally enabled when scheduling before register allocation, i.e.
  1015. with <samp>-fschedule-insns</samp> or at <samp>-O2</samp> or higher.
  1016. </p>
  1017. </dd>
  1018. <dt><code>-fsched-pressure</code></dt>
  1019. <dd><a name="index-fsched_002dpressure"></a>
  1020. <p>Enable register pressure sensitive insn scheduling before register
  1021. allocation. This only makes sense when scheduling before register
  1022. allocation is enabled, i.e. with <samp>-fschedule-insns</samp> or at
  1023. <samp>-O2</samp> or higher. Usage of this option can improve the
  1024. generated code and decrease its size by preventing register pressure
  1025. increase above the number of available hard registers and subsequent
  1026. spills in register allocation.
  1027. </p>
  1028. </dd>
  1029. <dt><code>-fsched-spec-load</code></dt>
  1030. <dd><a name="index-fsched_002dspec_002dload"></a>
  1031. <p>Allow speculative motion of some load instructions. This only makes
  1032. sense when scheduling before register allocation, i.e. with
  1033. <samp>-fschedule-insns</samp> or at <samp>-O2</samp> or higher.
  1034. </p>
  1035. </dd>
  1036. <dt><code>-fsched-spec-load-dangerous</code></dt>
  1037. <dd><a name="index-fsched_002dspec_002dload_002ddangerous"></a>
  1038. <p>Allow speculative motion of more load instructions. This only makes
  1039. sense when scheduling before register allocation, i.e. with
  1040. <samp>-fschedule-insns</samp> or at <samp>-O2</samp> or higher.
  1041. </p>
  1042. </dd>
  1043. <dt><code>-fsched-stalled-insns</code></dt>
  1044. <dt><code>-fsched-stalled-insns=<var>n</var></code></dt>
  1045. <dd><a name="index-fsched_002dstalled_002dinsns"></a>
  1046. <p>Define how many insns (if any) can be moved prematurely from the queue
  1047. of stalled insns into the ready list during the second scheduling pass.
  1048. <samp>-fno-sched-stalled-insns</samp> means that no insns are moved
  1049. prematurely, <samp>-fsched-stalled-insns=0</samp> means there is no limit
  1050. on how many queued insns can be moved prematurely.
  1051. <samp>-fsched-stalled-insns</samp> without a value is equivalent to
  1052. <samp>-fsched-stalled-insns=1</samp>.
  1053. </p>
  1054. </dd>
  1055. <dt><code>-fsched-stalled-insns-dep</code></dt>
  1056. <dt><code>-fsched-stalled-insns-dep=<var>n</var></code></dt>
  1057. <dd><a name="index-fsched_002dstalled_002dinsns_002ddep"></a>
  1058. <p>Define how many insn groups (cycles) are examined for a dependency
  1059. on a stalled insn that is a candidate for premature removal from the queue
  1060. of stalled insns. This has an effect only during the second scheduling pass,
  1061. and only if <samp>-fsched-stalled-insns</samp> is used.
  1062. <samp>-fno-sched-stalled-insns-dep</samp> is equivalent to
  1063. <samp>-fsched-stalled-insns-dep=0</samp>.
  1064. <samp>-fsched-stalled-insns-dep</samp> without a value is equivalent to
  1065. <samp>-fsched-stalled-insns-dep=1</samp>.
  1066. </p>
  1067. </dd>
  1068. <dt><code>-fsched2-use-superblocks</code></dt>
  1069. <dd><a name="index-fsched2_002duse_002dsuperblocks"></a>
  1070. <p>When scheduling after register allocation, use superblock scheduling.
  1071. This allows motion across basic block boundaries,
  1072. resulting in faster schedules. This option is experimental, as not all machine
  1073. descriptions used by GCC model the CPU closely enough to avoid unreliable
  1074. results from the algorithm.
  1075. </p>
  1076. <p>This only makes sense when scheduling after register allocation, i.e. with
  1077. <samp>-fschedule-insns2</samp> or at <samp>-O2</samp> or higher.
  1078. </p>
  1079. </dd>
  1080. <dt><code>-fsched-group-heuristic</code></dt>
  1081. <dd><a name="index-fsched_002dgroup_002dheuristic"></a>
  1082. <p>Enable the group heuristic in the scheduler. This heuristic favors
  1083. the instruction that belongs to a schedule group. This is enabled
  1084. by default when scheduling is enabled, i.e. with <samp>-fschedule-insns</samp>
  1085. or <samp>-fschedule-insns2</samp> or at <samp>-O2</samp> or higher.
  1086. </p>
  1087. </dd>
  1088. <dt><code>-fsched-critical-path-heuristic</code></dt>
  1089. <dd><a name="index-fsched_002dcritical_002dpath_002dheuristic"></a>
  1090. <p>Enable the critical-path heuristic in the scheduler. This heuristic favors
  1091. instructions on the critical path. This is enabled by default when
  1092. scheduling is enabled, i.e. with <samp>-fschedule-insns</samp>
  1093. or <samp>-fschedule-insns2</samp> or at <samp>-O2</samp> or higher.
  1094. </p>
  1095. </dd>
  1096. <dt><code>-fsched-spec-insn-heuristic</code></dt>
  1097. <dd><a name="index-fsched_002dspec_002dinsn_002dheuristic"></a>
  1098. <p>Enable the speculative instruction heuristic in the scheduler. This
  1099. heuristic favors speculative instructions with greater dependency weakness.
  1100. This is enabled by default when scheduling is enabled, i.e.
  1101. with <samp>-fschedule-insns</samp> or <samp>-fschedule-insns2</samp>
  1102. or at <samp>-O2</samp> or higher.
  1103. </p>
  1104. </dd>
  1105. <dt><code>-fsched-rank-heuristic</code></dt>
  1106. <dd><a name="index-fsched_002drank_002dheuristic"></a>
  1107. <p>Enable the rank heuristic in the scheduler. This heuristic favors
  1108. the instruction belonging to a basic block with greater size or frequency.
  1109. This is enabled by default when scheduling is enabled, i.e.
  1110. with <samp>-fschedule-insns</samp> or <samp>-fschedule-insns2</samp> or
  1111. at <samp>-O2</samp> or higher.
  1112. </p>
  1113. </dd>
  1114. <dt><code>-fsched-last-insn-heuristic</code></dt>
  1115. <dd><a name="index-fsched_002dlast_002dinsn_002dheuristic"></a>
  1116. <p>Enable the last-instruction heuristic in the scheduler. This heuristic
  1117. favors the instruction that is less dependent on the last instruction
  1118. scheduled. This is enabled by default when scheduling is enabled,
  1119. i.e. with <samp>-fschedule-insns</samp> or <samp>-fschedule-insns2</samp> or
  1120. at <samp>-O2</samp> or higher.
  1121. </p>
  1122. </dd>
  1123. <dt><code>-fsched-dep-count-heuristic</code></dt>
  1124. <dd><a name="index-fsched_002ddep_002dcount_002dheuristic"></a>
  1125. <p>Enable the dependent-count heuristic in the scheduler. This heuristic
  1126. favors the instruction that has more instructions depending on it.
  1127. This is enabled by default when scheduling is enabled, i.e.
  1128. with <samp>-fschedule-insns</samp> or <samp>-fschedule-insns2</samp> or
  1129. at <samp>-O2</samp> or higher.
  1130. </p>
  1131. </dd>
  1132. <dt><code>-freschedule-modulo-scheduled-loops</code></dt>
  1133. <dd><a name="index-freschedule_002dmodulo_002dscheduled_002dloops"></a>
  1134. <p>Modulo scheduling is performed before traditional scheduling. If a loop
  1135. is modulo scheduled, later scheduling passes may change its schedule.
  1136. Use this option to control that behavior.
  1137. </p>
  1138. </dd>
  1139. <dt><code>-fselective-scheduling</code></dt>
  1140. <dd><a name="index-fselective_002dscheduling"></a>
  1141. <p>Schedule instructions using selective scheduling algorithm. Selective
  1142. scheduling runs instead of the first scheduler pass.
  1143. </p>
  1144. </dd>
  1145. <dt><code>-fselective-scheduling2</code></dt>
  1146. <dd><a name="index-fselective_002dscheduling2"></a>
  1147. <p>Schedule instructions using selective scheduling algorithm. Selective
  1148. scheduling runs instead of the second scheduler pass.
  1149. </p>
  1150. </dd>
  1151. <dt><code>-fsel-sched-pipelining</code></dt>
  1152. <dd><a name="index-fsel_002dsched_002dpipelining"></a>
  1153. <p>Enable software pipelining of innermost loops during selective scheduling.
  1154. This option has no effect unless one of <samp>-fselective-scheduling</samp> or
  1155. <samp>-fselective-scheduling2</samp> is turned on.
  1156. </p>
  1157. </dd>
  1158. <dt><code>-fsel-sched-pipelining-outer-loops</code></dt>
  1159. <dd><a name="index-fsel_002dsched_002dpipelining_002douter_002dloops"></a>
  1160. <p>When pipelining loops during selective scheduling, also pipeline outer loops.
  1161. This option has no effect unless <samp>-fsel-sched-pipelining</samp> is turned on.
  1162. </p>
  1163. </dd>
  1164. <dt><code>-fsemantic-interposition</code></dt>
  1165. <dd><a name="index-fsemantic_002dinterposition"></a>
  1166. <p>Some object formats, like ELF, allow interposing of symbols by the
  1167. dynamic linker.
  1168. This means that for symbols exported from the DSO, the compiler cannot perform
  1169. interprocedural propagation, inlining and other optimizations in anticipation
  1170. that the function or variable in question may change. While this feature is
  1171. useful, for example, to rewrite memory allocation functions by a debugging
  1172. implementation, it is expensive in the terms of code quality.
  1173. With <samp>-fno-semantic-interposition</samp> the compiler assumes that
  1174. if interposition happens for functions the overwriting function will have
  1175. precisely the same semantics (and side effects).
  1176. Similarly if interposition happens
  1177. for variables, the constructor of the variable will be the same. The flag
  1178. has no effect for functions explicitly declared inline
  1179. (where it is never allowed for interposition to change semantics)
  1180. and for symbols explicitly declared weak.
  1181. </p>
  1182. </dd>
  1183. <dt><code>-fshrink-wrap</code></dt>
  1184. <dd><a name="index-fshrink_002dwrap"></a>
  1185. <p>Emit function prologues only before parts of the function that need it,
  1186. rather than at the top of the function. This flag is enabled by default at
  1187. <samp>-O</samp> and higher.
  1188. </p>
  1189. </dd>
  1190. <dt><code>-fshrink-wrap-separate</code></dt>
  1191. <dd><a name="index-fshrink_002dwrap_002dseparate"></a>
  1192. <p>Shrink-wrap separate parts of the prologue and epilogue separately, so that
  1193. those parts are only executed when needed.
  1194. This option is on by default, but has no effect unless <samp>-fshrink-wrap</samp>
  1195. is also turned on and the target supports this.
  1196. </p>
  1197. </dd>
  1198. <dt><code>-fcaller-saves</code></dt>
  1199. <dd><a name="index-fcaller_002dsaves"></a>
  1200. <p>Enable allocation of values to registers that are clobbered by
  1201. function calls, by emitting extra instructions to save and restore the
  1202. registers around such calls. Such allocation is done only when it
  1203. seems to result in better code.
  1204. </p>
  1205. <p>This option is always enabled by default on certain machines, usually
  1206. those which have no call-preserved registers to use instead.
  1207. </p>
  1208. <p>Enabled at levels <samp>-O2</samp>, <samp>-O3</samp>, <samp>-Os</samp>.
  1209. </p>
  1210. </dd>
  1211. <dt><code>-fcombine-stack-adjustments</code></dt>
  1212. <dd><a name="index-fcombine_002dstack_002dadjustments"></a>
  1213. <p>Tracks stack adjustments (pushes and pops) and stack memory references
  1214. and then tries to find ways to combine them.
  1215. </p>
  1216. <p>Enabled by default at <samp>-O1</samp> and higher.
  1217. </p>
  1218. </dd>
  1219. <dt><code>-fipa-ra</code></dt>
  1220. <dd><a name="index-fipa_002dra"></a>
  1221. <p>Use caller save registers for allocation if those registers are not used by
  1222. any called function. In that case it is not necessary to save and restore
  1223. them around calls. This is only possible if called functions are part of
  1224. same compilation unit as current function and they are compiled before it.
  1225. </p>
  1226. <p>Enabled at levels <samp>-O2</samp>, <samp>-O3</samp>, <samp>-Os</samp>, however the option
  1227. is disabled if generated code will be instrumented for profiling
  1228. (<samp>-p</samp>, or <samp>-pg</samp>) or if callee&rsquo;s register usage cannot be known
  1229. exactly (this happens on targets that do not expose prologues
  1230. and epilogues in RTL).
  1231. </p>
  1232. </dd>
  1233. <dt><code>-fconserve-stack</code></dt>
  1234. <dd><a name="index-fconserve_002dstack"></a>
  1235. <p>Attempt to minimize stack usage. The compiler attempts to use less
  1236. stack space, even if that makes the program slower. This option
  1237. implies setting the <samp>large-stack-frame</samp> parameter to 100
  1238. and the <samp>large-stack-frame-growth</samp> parameter to 400.
  1239. </p>
  1240. </dd>
  1241. <dt><code>-ftree-reassoc</code></dt>
  1242. <dd><a name="index-ftree_002dreassoc"></a>
  1243. <p>Perform reassociation on trees. This flag is enabled by default
  1244. at <samp>-O</samp> and higher.
  1245. </p>
  1246. </dd>
  1247. <dt><code>-fcode-hoisting</code></dt>
  1248. <dd><a name="index-fcode_002dhoisting"></a>
  1249. <p>Perform code hoisting. Code hoisting tries to move the
  1250. evaluation of expressions executed on all paths to the function exit
  1251. as early as possible. This is especially useful as a code size
  1252. optimization, but it often helps for code speed as well.
  1253. This flag is enabled by default at <samp>-O2</samp> and higher.
  1254. </p>
  1255. </dd>
  1256. <dt><code>-ftree-pre</code></dt>
  1257. <dd><a name="index-ftree_002dpre"></a>
  1258. <p>Perform partial redundancy elimination (PRE) on trees. This flag is
  1259. enabled by default at <samp>-O2</samp> and <samp>-O3</samp>.
  1260. </p>
  1261. </dd>
  1262. <dt><code>-ftree-partial-pre</code></dt>
  1263. <dd><a name="index-ftree_002dpartial_002dpre"></a>
  1264. <p>Make partial redundancy elimination (PRE) more aggressive. This flag is
  1265. enabled by default at <samp>-O3</samp>.
  1266. </p>
  1267. </dd>
  1268. <dt><code>-ftree-forwprop</code></dt>
  1269. <dd><a name="index-ftree_002dforwprop"></a>
  1270. <p>Perform forward propagation on trees. This flag is enabled by default
  1271. at <samp>-O</samp> and higher.
  1272. </p>
  1273. </dd>
  1274. <dt><code>-ftree-fre</code></dt>
  1275. <dd><a name="index-ftree_002dfre"></a>
  1276. <p>Perform full redundancy elimination (FRE) on trees. The difference
  1277. between FRE and PRE is that FRE only considers expressions
  1278. that are computed on all paths leading to the redundant computation.
  1279. This analysis is faster than PRE, though it exposes fewer redundancies.
  1280. This flag is enabled by default at <samp>-O</samp> and higher.
  1281. </p>
  1282. </dd>
  1283. <dt><code>-ftree-phiprop</code></dt>
  1284. <dd><a name="index-ftree_002dphiprop"></a>
  1285. <p>Perform hoisting of loads from conditional pointers on trees. This
  1286. pass is enabled by default at <samp>-O</samp> and higher.
  1287. </p>
  1288. </dd>
  1289. <dt><code>-fhoist-adjacent-loads</code></dt>
  1290. <dd><a name="index-fhoist_002dadjacent_002dloads"></a>
  1291. <p>Speculatively hoist loads from both branches of an if-then-else if the
  1292. loads are from adjacent locations in the same structure and the target
  1293. architecture has a conditional move instruction. This flag is enabled
  1294. by default at <samp>-O2</samp> and higher.
  1295. </p>
  1296. </dd>
  1297. <dt><code>-ftree-copy-prop</code></dt>
  1298. <dd><a name="index-ftree_002dcopy_002dprop"></a>
  1299. <p>Perform copy propagation on trees. This pass eliminates unnecessary
  1300. copy operations. This flag is enabled by default at <samp>-O</samp> and
  1301. higher.
  1302. </p>
  1303. </dd>
  1304. <dt><code>-fipa-pure-const</code></dt>
  1305. <dd><a name="index-fipa_002dpure_002dconst"></a>
  1306. <p>Discover which functions are pure or constant.
  1307. Enabled by default at <samp>-O</samp> and higher.
  1308. </p>
  1309. </dd>
  1310. <dt><code>-fipa-reference</code></dt>
  1311. <dd><a name="index-fipa_002dreference"></a>
  1312. <p>Discover which static variables do not escape the
  1313. compilation unit.
  1314. Enabled by default at <samp>-O</samp> and higher.
  1315. </p>
  1316. </dd>
  1317. <dt><code>-fipa-reference-addressable</code></dt>
  1318. <dd><a name="index-fipa_002dreference_002daddressable"></a>
  1319. <p>Discover read-only, write-only and non-addressable static variables.
  1320. Enabled by default at <samp>-O</samp> and higher.
  1321. </p>
  1322. </dd>
  1323. <dt><code>-fipa-stack-alignment</code></dt>
  1324. <dd><a name="index-fipa_002dstack_002dalignment"></a>
  1325. <p>Reduce stack alignment on call sites if possible.
  1326. Enabled by default.
  1327. </p>
  1328. </dd>
  1329. <dt><code>-fipa-pta</code></dt>
  1330. <dd><a name="index-fipa_002dpta"></a>
  1331. <p>Perform interprocedural pointer analysis and interprocedural modification
  1332. and reference analysis. This option can cause excessive memory and
  1333. compile-time usage on large compilation units. It is not enabled by
  1334. default at any optimization level.
  1335. </p>
  1336. </dd>
  1337. <dt><code>-fipa-profile</code></dt>
  1338. <dd><a name="index-fipa_002dprofile"></a>
  1339. <p>Perform interprocedural profile propagation. The functions called only from
  1340. cold functions are marked as cold. Also functions executed once (such as
  1341. <code>cold</code>, <code>noreturn</code>, static constructors or destructors) are identified. Cold
  1342. functions and loop less parts of functions executed once are then optimized for
  1343. size.
  1344. Enabled by default at <samp>-O</samp> and higher.
  1345. </p>
  1346. </dd>
  1347. <dt><code>-fipa-cp</code></dt>
  1348. <dd><a name="index-fipa_002dcp"></a>
  1349. <p>Perform interprocedural constant propagation.
  1350. This optimization analyzes the program to determine when values passed
  1351. to functions are constants and then optimizes accordingly.
  1352. This optimization can substantially increase performance
  1353. if the application has constants passed to functions.
  1354. This flag is enabled by default at <samp>-O2</samp>, <samp>-Os</samp> and <samp>-O3</samp>.
  1355. It is also enabled by <samp>-fprofile-use</samp> and <samp>-fauto-profile</samp>.
  1356. </p>
  1357. </dd>
  1358. <dt><code>-fipa-cp-clone</code></dt>
  1359. <dd><a name="index-fipa_002dcp_002dclone"></a>
  1360. <p>Perform function cloning to make interprocedural constant propagation stronger.
  1361. When enabled, interprocedural constant propagation performs function cloning
  1362. when externally visible function can be called with constant arguments.
  1363. Because this optimization can create multiple copies of functions,
  1364. it may significantly increase code size
  1365. (see <samp>--param ipa-cp-unit-growth=<var>value</var></samp>).
  1366. This flag is enabled by default at <samp>-O3</samp>.
  1367. It is also enabled by <samp>-fprofile-use</samp> and <samp>-fauto-profile</samp>.
  1368. </p>
  1369. </dd>
  1370. <dt><code>-fipa-bit-cp</code></dt>
  1371. <dd><a name="index-fipa_002dbit_002dcp"></a>
  1372. <p>When enabled, perform interprocedural bitwise constant
  1373. propagation. This flag is enabled by default at <samp>-O2</samp> and
  1374. by <samp>-fprofile-use</samp> and <samp>-fauto-profile</samp>.
  1375. It requires that <samp>-fipa-cp</samp> is enabled.
  1376. </p>
  1377. </dd>
  1378. <dt><code>-fipa-vrp</code></dt>
  1379. <dd><a name="index-fipa_002dvrp"></a>
  1380. <p>When enabled, perform interprocedural propagation of value
  1381. ranges. This flag is enabled by default at <samp>-O2</samp>. It requires
  1382. that <samp>-fipa-cp</samp> is enabled.
  1383. </p>
  1384. </dd>
  1385. <dt><code>-fipa-icf</code></dt>
  1386. <dd><a name="index-fipa_002dicf"></a>
  1387. <p>Perform Identical Code Folding for functions and read-only variables.
  1388. The optimization reduces code size and may disturb unwind stacks by replacing
  1389. a function by equivalent one with a different name. The optimization works
  1390. more effectively with link-time optimization enabled.
  1391. </p>
  1392. <p>Although the behavior is similar to the Gold Linker&rsquo;s ICF optimization, GCC ICF
  1393. works on different levels and thus the optimizations are not same - there are
  1394. equivalences that are found only by GCC and equivalences found only by Gold.
  1395. </p>
  1396. <p>This flag is enabled by default at <samp>-O2</samp> and <samp>-Os</samp>.
  1397. </p>
  1398. </dd>
  1399. <dt><code>-flive-patching=<var>level</var></code></dt>
  1400. <dd><a name="index-flive_002dpatching"></a>
  1401. <p>Control GCC&rsquo;s optimizations to produce output suitable for live-patching.
  1402. </p>
  1403. <p>If the compiler&rsquo;s optimization uses a function&rsquo;s body or information extracted
  1404. from its body to optimize/change another function, the latter is called an
  1405. impacted function of the former. If a function is patched, its impacted
  1406. functions should be patched too.
  1407. </p>
  1408. <p>The impacted functions are determined by the compiler&rsquo;s interprocedural
  1409. optimizations. For example, a caller is impacted when inlining a function
  1410. into its caller,
  1411. cloning a function and changing its caller to call this new clone,
  1412. or extracting a function&rsquo;s pureness/constness information to optimize
  1413. its direct or indirect callers, etc.
  1414. </p>
  1415. <p>Usually, the more IPA optimizations enabled, the larger the number of
  1416. impacted functions for each function. In order to control the number of
  1417. impacted functions and more easily compute the list of impacted function,
  1418. IPA optimizations can be partially enabled at two different levels.
  1419. </p>
  1420. <p>The <var>level</var> argument should be one of the following:
  1421. </p>
  1422. <dl compact="compact">
  1423. <dt>&lsquo;<samp>inline-clone</samp>&rsquo;</dt>
  1424. <dd>
  1425. <p>Only enable inlining and cloning optimizations, which includes inlining,
  1426. cloning, interprocedural scalar replacement of aggregates and partial inlining.
  1427. As a result, when patching a function, all its callers and its clones&rsquo;
  1428. callers are impacted, therefore need to be patched as well.
  1429. </p>
  1430. <p><samp>-flive-patching=inline-clone</samp> disables the following optimization flags:
  1431. </p><div class="smallexample">
  1432. <pre class="smallexample">-fwhole-program -fipa-pta -fipa-reference -fipa-ra
  1433. -fipa-icf -fipa-icf-functions -fipa-icf-variables
  1434. -fipa-bit-cp -fipa-vrp -fipa-pure-const -fipa-reference-addressable
  1435. -fipa-stack-alignment
  1436. </pre></div>
  1437. </dd>
  1438. <dt>&lsquo;<samp>inline-only-static</samp>&rsquo;</dt>
  1439. <dd>
  1440. <p>Only enable inlining of static functions.
  1441. As a result, when patching a static function, all its callers are impacted
  1442. and so need to be patched as well.
  1443. </p>
  1444. <p>In addition to all the flags that <samp>-flive-patching=inline-clone</samp>
  1445. disables,
  1446. <samp>-flive-patching=inline-only-static</samp> disables the following additional
  1447. optimization flags:
  1448. </p><div class="smallexample">
  1449. <pre class="smallexample">-fipa-cp-clone -fipa-sra -fpartial-inlining -fipa-cp
  1450. </pre></div>
  1451. </dd>
  1452. </dl>
  1453. <p>When <samp>-flive-patching</samp> is specified without any value, the default value
  1454. is <var>inline-clone</var>.
  1455. </p>
  1456. <p>This flag is disabled by default.
  1457. </p>
  1458. <p>Note that <samp>-flive-patching</samp> is not supported with link-time optimization
  1459. (<samp>-flto</samp>).
  1460. </p>
  1461. </dd>
  1462. <dt><code>-fisolate-erroneous-paths-dereference</code></dt>
  1463. <dd><a name="index-fisolate_002derroneous_002dpaths_002ddereference"></a>
  1464. <p>Detect paths that trigger erroneous or undefined behavior due to
  1465. dereferencing a null pointer. Isolate those paths from the main control
  1466. flow and turn the statement with erroneous or undefined behavior into a trap.
  1467. This flag is enabled by default at <samp>-O2</samp> and higher and depends on
  1468. <samp>-fdelete-null-pointer-checks</samp> also being enabled.
  1469. </p>
  1470. </dd>
  1471. <dt><code>-fisolate-erroneous-paths-attribute</code></dt>
  1472. <dd><a name="index-fisolate_002derroneous_002dpaths_002dattribute"></a>
  1473. <p>Detect paths that trigger erroneous or undefined behavior due to a null value
  1474. being used in a way forbidden by a <code>returns_nonnull</code> or <code>nonnull</code>
  1475. attribute. Isolate those paths from the main control flow and turn the
  1476. statement with erroneous or undefined behavior into a trap. This is not
  1477. currently enabled, but may be enabled by <samp>-O2</samp> in the future.
  1478. </p>
  1479. </dd>
  1480. <dt><code>-ftree-sink</code></dt>
  1481. <dd><a name="index-ftree_002dsink"></a>
  1482. <p>Perform forward store motion on trees. This flag is
  1483. enabled by default at <samp>-O</samp> and higher.
  1484. </p>
  1485. </dd>
  1486. <dt><code>-ftree-bit-ccp</code></dt>
  1487. <dd><a name="index-ftree_002dbit_002dccp"></a>
  1488. <p>Perform sparse conditional bit constant propagation on trees and propagate
  1489. pointer alignment information.
  1490. This pass only operates on local scalar variables and is enabled by default
  1491. at <samp>-O1</samp> and higher, except for <samp>-Og</samp>.
  1492. It requires that <samp>-ftree-ccp</samp> is enabled.
  1493. </p>
  1494. </dd>
  1495. <dt><code>-ftree-ccp</code></dt>
  1496. <dd><a name="index-ftree_002dccp"></a>
  1497. <p>Perform sparse conditional constant propagation (CCP) on trees. This
  1498. pass only operates on local scalar variables and is enabled by default
  1499. at <samp>-O</samp> and higher.
  1500. </p>
  1501. </dd>
  1502. <dt><code>-fssa-backprop</code></dt>
  1503. <dd><a name="index-fssa_002dbackprop"></a>
  1504. <p>Propagate information about uses of a value up the definition chain
  1505. in order to simplify the definitions. For example, this pass strips
  1506. sign operations if the sign of a value never matters. The flag is
  1507. enabled by default at <samp>-O</samp> and higher.
  1508. </p>
  1509. </dd>
  1510. <dt><code>-fssa-phiopt</code></dt>
  1511. <dd><a name="index-fssa_002dphiopt"></a>
  1512. <p>Perform pattern matching on SSA PHI nodes to optimize conditional
  1513. code. This pass is enabled by default at <samp>-O1</samp> and higher,
  1514. except for <samp>-Og</samp>.
  1515. </p>
  1516. </dd>
  1517. <dt><code>-ftree-switch-conversion</code></dt>
  1518. <dd><a name="index-ftree_002dswitch_002dconversion"></a>
  1519. <p>Perform conversion of simple initializations in a switch to
  1520. initializations from a scalar array. This flag is enabled by default
  1521. at <samp>-O2</samp> and higher.
  1522. </p>
  1523. </dd>
  1524. <dt><code>-ftree-tail-merge</code></dt>
  1525. <dd><a name="index-ftree_002dtail_002dmerge"></a>
  1526. <p>Look for identical code sequences. When found, replace one with a jump to the
  1527. other. This optimization is known as tail merging or cross jumping. This flag
  1528. is enabled by default at <samp>-O2</samp> and higher. The compilation time
  1529. in this pass can
  1530. be limited using <samp>max-tail-merge-comparisons</samp> parameter and
  1531. <samp>max-tail-merge-iterations</samp> parameter.
  1532. </p>
  1533. </dd>
  1534. <dt><code>-ftree-dce</code></dt>
  1535. <dd><a name="index-ftree_002ddce"></a>
  1536. <p>Perform dead code elimination (DCE) on trees. This flag is enabled by
  1537. default at <samp>-O</samp> and higher.
  1538. </p>
  1539. </dd>
  1540. <dt><code>-ftree-builtin-call-dce</code></dt>
  1541. <dd><a name="index-ftree_002dbuiltin_002dcall_002ddce"></a>
  1542. <p>Perform conditional dead code elimination (DCE) for calls to built-in functions
  1543. that may set <code>errno</code> but are otherwise free of side effects. This flag is
  1544. enabled by default at <samp>-O2</samp> and higher if <samp>-Os</samp> is not also
  1545. specified.
  1546. </p>
  1547. </dd>
  1548. <dt><code>-ffinite-loops</code></dt>
  1549. <dd><a name="index-ffinite_002dloops"></a>
  1550. <a name="index-fno_002dfinite_002dloops"></a>
  1551. <p>Assume that a loop with an exit will eventually take the exit and not loop
  1552. indefinitely. This allows the compiler to remove loops that otherwise have
  1553. no side-effects, not considering eventual endless looping as such.
  1554. </p>
  1555. <p>This option is enabled by default at <samp>-O2</samp> for C++ with -std=c++11
  1556. or higher.
  1557. </p>
  1558. </dd>
  1559. <dt><code>-ftree-dominator-opts</code></dt>
  1560. <dd><a name="index-ftree_002ddominator_002dopts"></a>
  1561. <p>Perform a variety of simple scalar cleanups (constant/copy
  1562. propagation, redundancy elimination, range propagation and expression
  1563. simplification) based on a dominator tree traversal. This also
  1564. performs jump threading (to reduce jumps to jumps). This flag is
  1565. enabled by default at <samp>-O</samp> and higher.
  1566. </p>
  1567. </dd>
  1568. <dt><code>-ftree-dse</code></dt>
  1569. <dd><a name="index-ftree_002ddse"></a>
  1570. <p>Perform dead store elimination (DSE) on trees. A dead store is a store into
  1571. a memory location that is later overwritten by another store without
  1572. any intervening loads. In this case the earlier store can be deleted. This
  1573. flag is enabled by default at <samp>-O</samp> and higher.
  1574. </p>
  1575. </dd>
  1576. <dt><code>-ftree-ch</code></dt>
  1577. <dd><a name="index-ftree_002dch"></a>
  1578. <p>Perform loop header copying on trees. This is beneficial since it increases
  1579. effectiveness of code motion optimizations. It also saves one jump. This flag
  1580. is enabled by default at <samp>-O</samp> and higher. It is not enabled
  1581. for <samp>-Os</samp>, since it usually increases code size.
  1582. </p>
  1583. </dd>
  1584. <dt><code>-ftree-loop-optimize</code></dt>
  1585. <dd><a name="index-ftree_002dloop_002doptimize"></a>
  1586. <p>Perform loop optimizations on trees. This flag is enabled by default
  1587. at <samp>-O</samp> and higher.
  1588. </p>
  1589. </dd>
  1590. <dt><code>-ftree-loop-linear</code></dt>
  1591. <dt><code>-floop-strip-mine</code></dt>
  1592. <dt><code>-floop-block</code></dt>
  1593. <dd><a name="index-ftree_002dloop_002dlinear"></a>
  1594. <a name="index-floop_002dstrip_002dmine"></a>
  1595. <a name="index-floop_002dblock"></a>
  1596. <p>Perform loop nest optimizations. Same as
  1597. <samp>-floop-nest-optimize</samp>. To use this code transformation, GCC has
  1598. to be configured with <samp>--with-isl</samp> to enable the Graphite loop
  1599. transformation infrastructure.
  1600. </p>
  1601. </dd>
  1602. <dt><code>-fgraphite-identity</code></dt>
  1603. <dd><a name="index-fgraphite_002didentity"></a>
  1604. <p>Enable the identity transformation for graphite. For every SCoP we generate
  1605. the polyhedral representation and transform it back to gimple. Using
  1606. <samp>-fgraphite-identity</samp> we can check the costs or benefits of the
  1607. GIMPLE -&gt; GRAPHITE -&gt; GIMPLE transformation. Some minimal optimizations
  1608. are also performed by the code generator isl, like index splitting and
  1609. dead code elimination in loops.
  1610. </p>
  1611. </dd>
  1612. <dt><code>-floop-nest-optimize</code></dt>
  1613. <dd><a name="index-floop_002dnest_002doptimize"></a>
  1614. <p>Enable the isl based loop nest optimizer. This is a generic loop nest
  1615. optimizer based on the Pluto optimization algorithms. It calculates a loop
  1616. structure optimized for data-locality and parallelism. This option
  1617. is experimental.
  1618. </p>
  1619. </dd>
  1620. <dt><code>-floop-parallelize-all</code></dt>
  1621. <dd><a name="index-floop_002dparallelize_002dall"></a>
  1622. <p>Use the Graphite data dependence analysis to identify loops that can
  1623. be parallelized. Parallelize all the loops that can be analyzed to
  1624. not contain loop carried dependences without checking that it is
  1625. profitable to parallelize the loops.
  1626. </p>
  1627. </dd>
  1628. <dt><code>-ftree-coalesce-vars</code></dt>
  1629. <dd><a name="index-ftree_002dcoalesce_002dvars"></a>
  1630. <p>While transforming the program out of the SSA representation, attempt to
  1631. reduce copying by coalescing versions of different user-defined
  1632. variables, instead of just compiler temporaries. This may severely
  1633. limit the ability to debug an optimized program compiled with
  1634. <samp>-fno-var-tracking-assignments</samp>. In the negated form, this flag
  1635. prevents SSA coalescing of user variables. This option is enabled by
  1636. default if optimization is enabled, and it does very little otherwise.
  1637. </p>
  1638. </dd>
  1639. <dt><code>-ftree-loop-if-convert</code></dt>
  1640. <dd><a name="index-ftree_002dloop_002dif_002dconvert"></a>
  1641. <p>Attempt to transform conditional jumps in the innermost loops to
  1642. branch-less equivalents. The intent is to remove control-flow from
  1643. the innermost loops in order to improve the ability of the
  1644. vectorization pass to handle these loops. This is enabled by default
  1645. if vectorization is enabled.
  1646. </p>
  1647. </dd>
  1648. <dt><code>-ftree-loop-distribution</code></dt>
  1649. <dd><a name="index-ftree_002dloop_002ddistribution"></a>
  1650. <p>Perform loop distribution. This flag can improve cache performance on
  1651. big loop bodies and allow further loop optimizations, like
  1652. parallelization or vectorization, to take place. For example, the loop
  1653. </p><div class="smallexample">
  1654. <pre class="smallexample">DO I = 1, N
  1655. A(I) = B(I) + C
  1656. D(I) = E(I) * F
  1657. ENDDO
  1658. </pre></div>
  1659. <p>is transformed to
  1660. </p><div class="smallexample">
  1661. <pre class="smallexample">DO I = 1, N
  1662. A(I) = B(I) + C
  1663. ENDDO
  1664. DO I = 1, N
  1665. D(I) = E(I) * F
  1666. ENDDO
  1667. </pre></div>
  1668. <p>This flag is enabled by default at <samp>-O3</samp>.
  1669. It is also enabled by <samp>-fprofile-use</samp> and <samp>-fauto-profile</samp>.
  1670. </p>
  1671. </dd>
  1672. <dt><code>-ftree-loop-distribute-patterns</code></dt>
  1673. <dd><a name="index-ftree_002dloop_002ddistribute_002dpatterns"></a>
  1674. <p>Perform loop distribution of patterns that can be code generated with
  1675. calls to a library. This flag is enabled by default at <samp>-O2</samp> and
  1676. higher, and by <samp>-fprofile-use</samp> and <samp>-fauto-profile</samp>.
  1677. </p>
  1678. <p>This pass distributes the initialization loops and generates a call to
  1679. memset zero. For example, the loop
  1680. </p><div class="smallexample">
  1681. <pre class="smallexample">DO I = 1, N
  1682. A(I) = 0
  1683. B(I) = A(I) + I
  1684. ENDDO
  1685. </pre></div>
  1686. <p>is transformed to
  1687. </p><div class="smallexample">
  1688. <pre class="smallexample">DO I = 1, N
  1689. A(I) = 0
  1690. ENDDO
  1691. DO I = 1, N
  1692. B(I) = A(I) + I
  1693. ENDDO
  1694. </pre></div>
  1695. <p>and the initialization loop is transformed into a call to memset zero.
  1696. This flag is enabled by default at <samp>-O3</samp>.
  1697. It is also enabled by <samp>-fprofile-use</samp> and <samp>-fauto-profile</samp>.
  1698. </p>
  1699. </dd>
  1700. <dt><code>-floop-interchange</code></dt>
  1701. <dd><a name="index-floop_002dinterchange"></a>
  1702. <p>Perform loop interchange outside of graphite. This flag can improve cache
  1703. performance on loop nest and allow further loop optimizations, like
  1704. vectorization, to take place. For example, the loop
  1705. </p><div class="smallexample">
  1706. <pre class="smallexample">for (int i = 0; i &lt; N; i++)
  1707. for (int j = 0; j &lt; N; j++)
  1708. for (int k = 0; k &lt; N; k++)
  1709. c[i][j] = c[i][j] + a[i][k]*b[k][j];
  1710. </pre></div>
  1711. <p>is transformed to
  1712. </p><div class="smallexample">
  1713. <pre class="smallexample">for (int i = 0; i &lt; N; i++)
  1714. for (int k = 0; k &lt; N; k++)
  1715. for (int j = 0; j &lt; N; j++)
  1716. c[i][j] = c[i][j] + a[i][k]*b[k][j];
  1717. </pre></div>
  1718. <p>This flag is enabled by default at <samp>-O3</samp>.
  1719. It is also enabled by <samp>-fprofile-use</samp> and <samp>-fauto-profile</samp>.
  1720. </p>
  1721. </dd>
  1722. <dt><code>-floop-unroll-and-jam</code></dt>
  1723. <dd><a name="index-floop_002dunroll_002dand_002djam"></a>
  1724. <p>Apply unroll and jam transformations on feasible loops. In a loop
  1725. nest this unrolls the outer loop by some factor and fuses the resulting
  1726. multiple inner loops. This flag is enabled by default at <samp>-O3</samp>.
  1727. It is also enabled by <samp>-fprofile-use</samp> and <samp>-fauto-profile</samp>.
  1728. </p>
  1729. </dd>
  1730. <dt><code>-ftree-loop-im</code></dt>
  1731. <dd><a name="index-ftree_002dloop_002dim"></a>
  1732. <p>Perform loop invariant motion on trees. This pass moves only invariants that
  1733. are hard to handle at RTL level (function calls, operations that expand to
  1734. nontrivial sequences of insns). With <samp>-funswitch-loops</samp> it also moves
  1735. operands of conditions that are invariant out of the loop, so that we can use
  1736. just trivial invariantness analysis in loop unswitching. The pass also includes
  1737. store motion.
  1738. </p>
  1739. </dd>
  1740. <dt><code>-ftree-loop-ivcanon</code></dt>
  1741. <dd><a name="index-ftree_002dloop_002divcanon"></a>
  1742. <p>Create a canonical counter for number of iterations in loops for which
  1743. determining number of iterations requires complicated analysis. Later
  1744. optimizations then may determine the number easily. Useful especially
  1745. in connection with unrolling.
  1746. </p>
  1747. </dd>
  1748. <dt><code>-ftree-scev-cprop</code></dt>
  1749. <dd><a name="index-ftree_002dscev_002dcprop"></a>
  1750. <p>Perform final value replacement. If a variable is modified in a loop
  1751. in such a way that its value when exiting the loop can be determined using
  1752. only its initial value and the number of loop iterations, replace uses of
  1753. the final value by such a computation, provided it is sufficiently cheap.
  1754. This reduces data dependencies and may allow further simplifications.
  1755. Enabled by default at <samp>-O</samp> and higher.
  1756. </p>
  1757. </dd>
  1758. <dt><code>-fivopts</code></dt>
  1759. <dd><a name="index-fivopts"></a>
  1760. <p>Perform induction variable optimizations (strength reduction, induction
  1761. variable merging and induction variable elimination) on trees.
  1762. </p>
  1763. </dd>
  1764. <dt><code>-ftree-parallelize-loops=n</code></dt>
  1765. <dd><a name="index-ftree_002dparallelize_002dloops"></a>
  1766. <p>Parallelize loops, i.e., split their iteration space to run in n threads.
  1767. This is only possible for loops whose iterations are independent
  1768. and can be arbitrarily reordered. The optimization is only
  1769. profitable on multiprocessor machines, for loops that are CPU-intensive,
  1770. rather than constrained e.g. by memory bandwidth. This option
  1771. implies <samp>-pthread</samp>, and thus is only supported on targets
  1772. that have support for <samp>-pthread</samp>.
  1773. </p>
  1774. </dd>
  1775. <dt><code>-ftree-pta</code></dt>
  1776. <dd><a name="index-ftree_002dpta"></a>
  1777. <p>Perform function-local points-to analysis on trees. This flag is
  1778. enabled by default at <samp>-O1</samp> and higher, except for <samp>-Og</samp>.
  1779. </p>
  1780. </dd>
  1781. <dt><code>-ftree-sra</code></dt>
  1782. <dd><a name="index-ftree_002dsra"></a>
  1783. <p>Perform scalar replacement of aggregates. This pass replaces structure
  1784. references with scalars to prevent committing structures to memory too
  1785. early. This flag is enabled by default at <samp>-O1</samp> and higher,
  1786. except for <samp>-Og</samp>.
  1787. </p>
  1788. </dd>
  1789. <dt><code>-fstore-merging</code></dt>
  1790. <dd><a name="index-fstore_002dmerging"></a>
  1791. <p>Perform merging of narrow stores to consecutive memory addresses. This pass
  1792. merges contiguous stores of immediate values narrower than a word into fewer
  1793. wider stores to reduce the number of instructions. This is enabled by default
  1794. at <samp>-O2</samp> and higher as well as <samp>-Os</samp>.
  1795. </p>
  1796. </dd>
  1797. <dt><code>-ftree-ter</code></dt>
  1798. <dd><a name="index-ftree_002dter"></a>
  1799. <p>Perform temporary expression replacement during the SSA-&gt;normal phase. Single
  1800. use/single def temporaries are replaced at their use location with their
  1801. defining expression. This results in non-GIMPLE code, but gives the expanders
  1802. much more complex trees to work on resulting in better RTL generation. This is
  1803. enabled by default at <samp>-O</samp> and higher.
  1804. </p>
  1805. </dd>
  1806. <dt><code>-ftree-slsr</code></dt>
  1807. <dd><a name="index-ftree_002dslsr"></a>
  1808. <p>Perform straight-line strength reduction on trees. This recognizes related
  1809. expressions involving multiplications and replaces them by less expensive
  1810. calculations when possible. This is enabled by default at <samp>-O</samp> and
  1811. higher.
  1812. </p>
  1813. </dd>
  1814. <dt><code>-ftree-vectorize</code></dt>
  1815. <dd><a name="index-ftree_002dvectorize"></a>
  1816. <p>Perform vectorization on trees. This flag enables <samp>-ftree-loop-vectorize</samp>
  1817. and <samp>-ftree-slp-vectorize</samp> if not explicitly specified.
  1818. </p>
  1819. </dd>
  1820. <dt><code>-ftree-loop-vectorize</code></dt>
  1821. <dd><a name="index-ftree_002dloop_002dvectorize"></a>
  1822. <p>Perform loop vectorization on trees. This flag is enabled by default at
  1823. <samp>-O3</samp> and by <samp>-ftree-vectorize</samp>, <samp>-fprofile-use</samp>,
  1824. and <samp>-fauto-profile</samp>.
  1825. </p>
  1826. </dd>
  1827. <dt><code>-ftree-slp-vectorize</code></dt>
  1828. <dd><a name="index-ftree_002dslp_002dvectorize"></a>
  1829. <p>Perform basic block vectorization on trees. This flag is enabled by default at
  1830. <samp>-O3</samp> and by <samp>-ftree-vectorize</samp>, <samp>-fprofile-use</samp>,
  1831. and <samp>-fauto-profile</samp>.
  1832. </p>
  1833. </dd>
  1834. <dt><code>-fvect-cost-model=<var>model</var></code></dt>
  1835. <dd><a name="index-fvect_002dcost_002dmodel"></a>
  1836. <p>Alter the cost model used for vectorization. The <var>model</var> argument
  1837. should be one of &lsquo;<samp>unlimited</samp>&rsquo;, &lsquo;<samp>dynamic</samp>&rsquo; or &lsquo;<samp>cheap</samp>&rsquo;.
  1838. With the &lsquo;<samp>unlimited</samp>&rsquo; model the vectorized code-path is assumed
  1839. to be profitable while with the &lsquo;<samp>dynamic</samp>&rsquo; model a runtime check
  1840. guards the vectorized code-path to enable it only for iteration
  1841. counts that will likely execute faster than when executing the original
  1842. scalar loop. The &lsquo;<samp>cheap</samp>&rsquo; model disables vectorization of
  1843. loops where doing so would be cost prohibitive for example due to
  1844. required runtime checks for data dependence or alignment but otherwise
  1845. is equal to the &lsquo;<samp>dynamic</samp>&rsquo; model.
  1846. The default cost model depends on other optimization flags and is
  1847. either &lsquo;<samp>dynamic</samp>&rsquo; or &lsquo;<samp>cheap</samp>&rsquo;.
  1848. </p>
  1849. </dd>
  1850. <dt><code>-fsimd-cost-model=<var>model</var></code></dt>
  1851. <dd><a name="index-fsimd_002dcost_002dmodel"></a>
  1852. <p>Alter the cost model used for vectorization of loops marked with the OpenMP
  1853. simd directive. The <var>model</var> argument should be one of
  1854. &lsquo;<samp>unlimited</samp>&rsquo;, &lsquo;<samp>dynamic</samp>&rsquo;, &lsquo;<samp>cheap</samp>&rsquo;. All values of <var>model</var>
  1855. have the same meaning as described in <samp>-fvect-cost-model</samp> and by
  1856. default a cost model defined with <samp>-fvect-cost-model</samp> is used.
  1857. </p>
  1858. </dd>
  1859. <dt><code>-ftree-vrp</code></dt>
  1860. <dd><a name="index-ftree_002dvrp"></a>
  1861. <p>Perform Value Range Propagation on trees. This is similar to the
  1862. constant propagation pass, but instead of values, ranges of values are
  1863. propagated. This allows the optimizers to remove unnecessary range
  1864. checks like array bound checks and null pointer checks. This is
  1865. enabled by default at <samp>-O2</samp> and higher. Null pointer check
  1866. elimination is only done if <samp>-fdelete-null-pointer-checks</samp> is
  1867. enabled.
  1868. </p>
  1869. </dd>
  1870. <dt><code>-fsplit-paths</code></dt>
  1871. <dd><a name="index-fsplit_002dpaths"></a>
  1872. <p>Split paths leading to loop backedges. This can improve dead code
  1873. elimination and common subexpression elimination. This is enabled by
  1874. default at <samp>-O3</samp> and above.
  1875. </p>
  1876. </dd>
  1877. <dt><code>-fsplit-ivs-in-unroller</code></dt>
  1878. <dd><a name="index-fsplit_002divs_002din_002dunroller"></a>
  1879. <p>Enables expression of values of induction variables in later iterations
  1880. of the unrolled loop using the value in the first iteration. This breaks
  1881. long dependency chains, thus improving efficiency of the scheduling passes.
  1882. </p>
  1883. <p>A combination of <samp>-fweb</samp> and CSE is often sufficient to obtain the
  1884. same effect. However, that is not reliable in cases where the loop body
  1885. is more complicated than a single basic block. It also does not work at all
  1886. on some architectures due to restrictions in the CSE pass.
  1887. </p>
  1888. <p>This optimization is enabled by default.
  1889. </p>
  1890. </dd>
  1891. <dt><code>-fvariable-expansion-in-unroller</code></dt>
  1892. <dd><a name="index-fvariable_002dexpansion_002din_002dunroller"></a>
  1893. <p>With this option, the compiler creates multiple copies of some
  1894. local variables when unrolling a loop, which can result in superior code.
  1895. </p>
  1896. <p>This optimization is enabled by default for PowerPC targets, but disabled
  1897. by default otherwise.
  1898. </p>
  1899. </dd>
  1900. <dt><code>-fpartial-inlining</code></dt>
  1901. <dd><a name="index-fpartial_002dinlining"></a>
  1902. <p>Inline parts of functions. This option has any effect only
  1903. when inlining itself is turned on by the <samp>-finline-functions</samp>
  1904. or <samp>-finline-small-functions</samp> options.
  1905. </p>
  1906. <p>Enabled at levels <samp>-O2</samp>, <samp>-O3</samp>, <samp>-Os</samp>.
  1907. </p>
  1908. </dd>
  1909. <dt><code>-fpredictive-commoning</code></dt>
  1910. <dd><a name="index-fpredictive_002dcommoning"></a>
  1911. <p>Perform predictive commoning optimization, i.e., reusing computations
  1912. (especially memory loads and stores) performed in previous
  1913. iterations of loops.
  1914. </p>
  1915. <p>This option is enabled at level <samp>-O3</samp>.
  1916. It is also enabled by <samp>-fprofile-use</samp> and <samp>-fauto-profile</samp>.
  1917. </p>
  1918. </dd>
  1919. <dt><code>-fprefetch-loop-arrays</code></dt>
  1920. <dd><a name="index-fprefetch_002dloop_002darrays"></a>
  1921. <p>If supported by the target machine, generate instructions to prefetch
  1922. memory to improve the performance of loops that access large arrays.
  1923. </p>
  1924. <p>This option may generate better or worse code; results are highly
  1925. dependent on the structure of loops within the source code.
  1926. </p>
  1927. <p>Disabled at level <samp>-Os</samp>.
  1928. </p>
  1929. </dd>
  1930. <dt><code>-fno-printf-return-value</code></dt>
  1931. <dd><a name="index-fno_002dprintf_002dreturn_002dvalue"></a>
  1932. <a name="index-fprintf_002dreturn_002dvalue"></a>
  1933. <p>Do not substitute constants for known return value of formatted output
  1934. functions such as <code>sprintf</code>, <code>snprintf</code>, <code>vsprintf</code>, and
  1935. <code>vsnprintf</code> (but not <code>printf</code> of <code>fprintf</code>). This
  1936. transformation allows GCC to optimize or even eliminate branches based
  1937. on the known return value of these functions called with arguments that
  1938. are either constant, or whose values are known to be in a range that
  1939. makes determining the exact return value possible. For example, when
  1940. <samp>-fprintf-return-value</samp> is in effect, both the branch and the
  1941. body of the <code>if</code> statement (but not the call to <code>snprint</code>)
  1942. can be optimized away when <code>i</code> is a 32-bit or smaller integer
  1943. because the return value is guaranteed to be at most 8.
  1944. </p>
  1945. <div class="smallexample">
  1946. <pre class="smallexample">char buf[9];
  1947. if (snprintf (buf, &quot;%08x&quot;, i) &gt;= sizeof buf)
  1948. &hellip;
  1949. </pre></div>
  1950. <p>The <samp>-fprintf-return-value</samp> option relies on other optimizations
  1951. and yields best results with <samp>-O2</samp> and above. It works in tandem
  1952. with the <samp>-Wformat-overflow</samp> and <samp>-Wformat-truncation</samp>
  1953. options. The <samp>-fprintf-return-value</samp> option is enabled by default.
  1954. </p>
  1955. </dd>
  1956. <dt><code>-fno-peephole</code></dt>
  1957. <dt><code>-fno-peephole2</code></dt>
  1958. <dd><a name="index-fno_002dpeephole"></a>
  1959. <a name="index-fpeephole"></a>
  1960. <a name="index-fno_002dpeephole2"></a>
  1961. <a name="index-fpeephole2"></a>
  1962. <p>Disable any machine-specific peephole optimizations. The difference
  1963. between <samp>-fno-peephole</samp> and <samp>-fno-peephole2</samp> is in how they
  1964. are implemented in the compiler; some targets use one, some use the
  1965. other, a few use both.
  1966. </p>
  1967. <p><samp>-fpeephole</samp> is enabled by default.
  1968. <samp>-fpeephole2</samp> enabled at levels <samp>-O2</samp>, <samp>-O3</samp>, <samp>-Os</samp>.
  1969. </p>
  1970. </dd>
  1971. <dt><code>-fno-guess-branch-probability</code></dt>
  1972. <dd><a name="index-fno_002dguess_002dbranch_002dprobability"></a>
  1973. <a name="index-fguess_002dbranch_002dprobability"></a>
  1974. <p>Do not guess branch probabilities using heuristics.
  1975. </p>
  1976. <p>GCC uses heuristics to guess branch probabilities if they are
  1977. not provided by profiling feedback (<samp>-fprofile-arcs</samp>). These
  1978. heuristics are based on the control flow graph. If some branch probabilities
  1979. are specified by <code>__builtin_expect</code>, then the heuristics are
  1980. used to guess branch probabilities for the rest of the control flow graph,
  1981. taking the <code>__builtin_expect</code> info into account. The interactions
  1982. between the heuristics and <code>__builtin_expect</code> can be complex, and in
  1983. some cases, it may be useful to disable the heuristics so that the effects
  1984. of <code>__builtin_expect</code> are easier to understand.
  1985. </p>
  1986. <p>It is also possible to specify expected probability of the expression
  1987. with <code>__builtin_expect_with_probability</code> built-in function.
  1988. </p>
  1989. <p>The default is <samp>-fguess-branch-probability</samp> at levels
  1990. <samp>-O</samp>, <samp>-O2</samp>, <samp>-O3</samp>, <samp>-Os</samp>.
  1991. </p>
  1992. </dd>
  1993. <dt><code>-freorder-blocks</code></dt>
  1994. <dd><a name="index-freorder_002dblocks"></a>
  1995. <p>Reorder basic blocks in the compiled function in order to reduce number of
  1996. taken branches and improve code locality.
  1997. </p>
  1998. <p>Enabled at levels <samp>-O</samp>, <samp>-O2</samp>, <samp>-O3</samp>, <samp>-Os</samp>.
  1999. </p>
  2000. </dd>
  2001. <dt><code>-freorder-blocks-algorithm=<var>algorithm</var></code></dt>
  2002. <dd><a name="index-freorder_002dblocks_002dalgorithm"></a>
  2003. <p>Use the specified algorithm for basic block reordering. The
  2004. <var>algorithm</var> argument can be &lsquo;<samp>simple</samp>&rsquo;, which does not increase
  2005. code size (except sometimes due to secondary effects like alignment),
  2006. or &lsquo;<samp>stc</samp>&rsquo;, the &ldquo;software trace cache&rdquo; algorithm, which tries to
  2007. put all often executed code together, minimizing the number of branches
  2008. executed by making extra copies of code.
  2009. </p>
  2010. <p>The default is &lsquo;<samp>simple</samp>&rsquo; at levels <samp>-O</samp>, <samp>-Os</samp>, and
  2011. &lsquo;<samp>stc</samp>&rsquo; at levels <samp>-O2</samp>, <samp>-O3</samp>.
  2012. </p>
  2013. </dd>
  2014. <dt><code>-freorder-blocks-and-partition</code></dt>
  2015. <dd><a name="index-freorder_002dblocks_002dand_002dpartition"></a>
  2016. <p>In addition to reordering basic blocks in the compiled function, in order
  2017. to reduce number of taken branches, partitions hot and cold basic blocks
  2018. into separate sections of the assembly and <samp>.o</samp> files, to improve
  2019. paging and cache locality performance.
  2020. </p>
  2021. <p>This optimization is automatically turned off in the presence of
  2022. exception handling or unwind tables (on targets using setjump/longjump or target specific scheme), for linkonce sections, for functions with a user-defined
  2023. section attribute and on any architecture that does not support named
  2024. sections. When <samp>-fsplit-stack</samp> is used this option is not
  2025. enabled by default (to avoid linker errors), but may be enabled
  2026. explicitly (if using a working linker).
  2027. </p>
  2028. <p>Enabled for x86 at levels <samp>-O2</samp>, <samp>-O3</samp>, <samp>-Os</samp>.
  2029. </p>
  2030. </dd>
  2031. <dt><code>-freorder-functions</code></dt>
  2032. <dd><a name="index-freorder_002dfunctions"></a>
  2033. <p>Reorder functions in the object file in order to
  2034. improve code locality. This is implemented by using special
  2035. subsections <code>.text.hot</code> for most frequently executed functions and
  2036. <code>.text.unlikely</code> for unlikely executed functions. Reordering is done by
  2037. the linker so object file format must support named sections and linker must
  2038. place them in a reasonable way.
  2039. </p>
  2040. <p>This option isn&rsquo;t effective unless you either provide profile feedback
  2041. (see <samp>-fprofile-arcs</samp> for details) or manually annotate functions with
  2042. <code>hot</code> or <code>cold</code> attributes (see <a href="Common-Function-Attributes.html#Common-Function-Attributes">Common Function Attributes</a>).
  2043. </p>
  2044. <p>Enabled at levels <samp>-O2</samp>, <samp>-O3</samp>, <samp>-Os</samp>.
  2045. </p>
  2046. </dd>
  2047. <dt><code>-fstrict-aliasing</code></dt>
  2048. <dd><a name="index-fstrict_002daliasing"></a>
  2049. <p>Allow the compiler to assume the strictest aliasing rules applicable to
  2050. the language being compiled. For C (and C++), this activates
  2051. optimizations based on the type of expressions. In particular, an
  2052. object of one type is assumed never to reside at the same address as an
  2053. object of a different type, unless the types are almost the same. For
  2054. example, an <code>unsigned int</code> can alias an <code>int</code>, but not a
  2055. <code>void*</code> or a <code>double</code>. A character type may alias any other
  2056. type.
  2057. </p>
  2058. <a name="Type_002dpunning"></a><p>Pay special attention to code like this:
  2059. </p><div class="smallexample">
  2060. <pre class="smallexample">union a_union {
  2061. int i;
  2062. double d;
  2063. };
  2064. int f() {
  2065. union a_union t;
  2066. t.d = 3.0;
  2067. return t.i;
  2068. }
  2069. </pre></div>
  2070. <p>The practice of reading from a different union member than the one most
  2071. recently written to (called &ldquo;type-punning&rdquo;) is common. Even with
  2072. <samp>-fstrict-aliasing</samp>, type-punning is allowed, provided the memory
  2073. is accessed through the union type. So, the code above works as
  2074. expected. See <a href="Structures-unions-enumerations-and-bit_002dfields-implementation.html#Structures-unions-enumerations-and-bit_002dfields-implementation">Structures unions enumerations and bit-fields implementation</a>. However, this code might not:
  2075. </p><div class="smallexample">
  2076. <pre class="smallexample">int f() {
  2077. union a_union t;
  2078. int* ip;
  2079. t.d = 3.0;
  2080. ip = &amp;t.i;
  2081. return *ip;
  2082. }
  2083. </pre></div>
  2084. <p>Similarly, access by taking the address, casting the resulting pointer
  2085. and dereferencing the result has undefined behavior, even if the cast
  2086. uses a union type, e.g.:
  2087. </p><div class="smallexample">
  2088. <pre class="smallexample">int f() {
  2089. double d = 3.0;
  2090. return ((union a_union *) &amp;d)-&gt;i;
  2091. }
  2092. </pre></div>
  2093. <p>The <samp>-fstrict-aliasing</samp> option is enabled at levels
  2094. <samp>-O2</samp>, <samp>-O3</samp>, <samp>-Os</samp>.
  2095. </p>
  2096. </dd>
  2097. <dt><code>-falign-functions</code></dt>
  2098. <dt><code>-falign-functions=<var>n</var></code></dt>
  2099. <dt><code>-falign-functions=<var>n</var>:<var>m</var></code></dt>
  2100. <dt><code>-falign-functions=<var>n</var>:<var>m</var>:<var>n2</var></code></dt>
  2101. <dt><code>-falign-functions=<var>n</var>:<var>m</var>:<var>n2</var>:<var>m2</var></code></dt>
  2102. <dd><a name="index-falign_002dfunctions"></a>
  2103. <p>Align the start of functions to the next power-of-two greater than or
  2104. equal to <var>n</var>, skipping up to <var>m</var>-1 bytes. This ensures that at
  2105. least the first <var>m</var> bytes of the function can be fetched by the CPU
  2106. without crossing an <var>n</var>-byte alignment boundary.
  2107. </p>
  2108. <p>If <var>m</var> is not specified, it defaults to <var>n</var>.
  2109. </p>
  2110. <p>Examples: <samp>-falign-functions=32</samp> aligns functions to the next
  2111. 32-byte boundary, <samp>-falign-functions=24</samp> aligns to the next
  2112. 32-byte boundary only if this can be done by skipping 23 bytes or less,
  2113. <samp>-falign-functions=32:7</samp> aligns to the next
  2114. 32-byte boundary only if this can be done by skipping 6 bytes or less.
  2115. </p>
  2116. <p>The second pair of <var>n2</var>:<var>m2</var> values allows you to specify
  2117. a secondary alignment: <samp>-falign-functions=64:7:32:3</samp> aligns to
  2118. the next 64-byte boundary if this can be done by skipping 6 bytes or less,
  2119. otherwise aligns to the next 32-byte boundary if this can be done
  2120. by skipping 2 bytes or less.
  2121. If <var>m2</var> is not specified, it defaults to <var>n2</var>.
  2122. </p>
  2123. <p>Some assemblers only support this flag when <var>n</var> is a power of two;
  2124. in that case, it is rounded up.
  2125. </p>
  2126. <p><samp>-fno-align-functions</samp> and <samp>-falign-functions=1</samp> are
  2127. equivalent and mean that functions are not aligned.
  2128. </p>
  2129. <p>If <var>n</var> is not specified or is zero, use a machine-dependent default.
  2130. The maximum allowed <var>n</var> option value is 65536.
  2131. </p>
  2132. <p>Enabled at levels <samp>-O2</samp>, <samp>-O3</samp>.
  2133. </p>
  2134. </dd>
  2135. <dt><code>-flimit-function-alignment</code></dt>
  2136. <dd><p>If this option is enabled, the compiler tries to avoid unnecessarily
  2137. overaligning functions. It attempts to instruct the assembler to align
  2138. by the amount specified by <samp>-falign-functions</samp>, but not to
  2139. skip more bytes than the size of the function.
  2140. </p>
  2141. </dd>
  2142. <dt><code>-falign-labels</code></dt>
  2143. <dt><code>-falign-labels=<var>n</var></code></dt>
  2144. <dt><code>-falign-labels=<var>n</var>:<var>m</var></code></dt>
  2145. <dt><code>-falign-labels=<var>n</var>:<var>m</var>:<var>n2</var></code></dt>
  2146. <dt><code>-falign-labels=<var>n</var>:<var>m</var>:<var>n2</var>:<var>m2</var></code></dt>
  2147. <dd><a name="index-falign_002dlabels"></a>
  2148. <p>Align all branch targets to a power-of-two boundary.
  2149. </p>
  2150. <p>Parameters of this option are analogous to the <samp>-falign-functions</samp> option.
  2151. <samp>-fno-align-labels</samp> and <samp>-falign-labels=1</samp> are
  2152. equivalent and mean that labels are not aligned.
  2153. </p>
  2154. <p>If <samp>-falign-loops</samp> or <samp>-falign-jumps</samp> are applicable and
  2155. are greater than this value, then their values are used instead.
  2156. </p>
  2157. <p>If <var>n</var> is not specified or is zero, use a machine-dependent default
  2158. which is very likely to be &lsquo;<samp>1</samp>&rsquo;, meaning no alignment.
  2159. The maximum allowed <var>n</var> option value is 65536.
  2160. </p>
  2161. <p>Enabled at levels <samp>-O2</samp>, <samp>-O3</samp>.
  2162. </p>
  2163. </dd>
  2164. <dt><code>-falign-loops</code></dt>
  2165. <dt><code>-falign-loops=<var>n</var></code></dt>
  2166. <dt><code>-falign-loops=<var>n</var>:<var>m</var></code></dt>
  2167. <dt><code>-falign-loops=<var>n</var>:<var>m</var>:<var>n2</var></code></dt>
  2168. <dt><code>-falign-loops=<var>n</var>:<var>m</var>:<var>n2</var>:<var>m2</var></code></dt>
  2169. <dd><a name="index-falign_002dloops"></a>
  2170. <p>Align loops to a power-of-two boundary. If the loops are executed
  2171. many times, this makes up for any execution of the dummy padding
  2172. instructions.
  2173. </p>
  2174. <p>If <samp>-falign-labels</samp> is greater than this value, then its value
  2175. is used instead.
  2176. </p>
  2177. <p>Parameters of this option are analogous to the <samp>-falign-functions</samp> option.
  2178. <samp>-fno-align-loops</samp> and <samp>-falign-loops=1</samp> are
  2179. equivalent and mean that loops are not aligned.
  2180. The maximum allowed <var>n</var> option value is 65536.
  2181. </p>
  2182. <p>If <var>n</var> is not specified or is zero, use a machine-dependent default.
  2183. </p>
  2184. <p>Enabled at levels <samp>-O2</samp>, <samp>-O3</samp>.
  2185. </p>
  2186. </dd>
  2187. <dt><code>-falign-jumps</code></dt>
  2188. <dt><code>-falign-jumps=<var>n</var></code></dt>
  2189. <dt><code>-falign-jumps=<var>n</var>:<var>m</var></code></dt>
  2190. <dt><code>-falign-jumps=<var>n</var>:<var>m</var>:<var>n2</var></code></dt>
  2191. <dt><code>-falign-jumps=<var>n</var>:<var>m</var>:<var>n2</var>:<var>m2</var></code></dt>
  2192. <dd><a name="index-falign_002djumps"></a>
  2193. <p>Align branch targets to a power-of-two boundary, for branch targets
  2194. where the targets can only be reached by jumping. In this case,
  2195. no dummy operations need be executed.
  2196. </p>
  2197. <p>If <samp>-falign-labels</samp> is greater than this value, then its value
  2198. is used instead.
  2199. </p>
  2200. <p>Parameters of this option are analogous to the <samp>-falign-functions</samp> option.
  2201. <samp>-fno-align-jumps</samp> and <samp>-falign-jumps=1</samp> are
  2202. equivalent and mean that loops are not aligned.
  2203. </p>
  2204. <p>If <var>n</var> is not specified or is zero, use a machine-dependent default.
  2205. The maximum allowed <var>n</var> option value is 65536.
  2206. </p>
  2207. <p>Enabled at levels <samp>-O2</samp>, <samp>-O3</samp>.
  2208. </p>
  2209. </dd>
  2210. <dt><code>-fno-allocation-dce</code></dt>
  2211. <dd><a name="index-fno_002dallocation_002ddce"></a>
  2212. <p>Do not remove unused C++ allocations in dead code elimination.
  2213. </p>
  2214. </dd>
  2215. <dt><code>-fallow-store-data-races</code></dt>
  2216. <dd><a name="index-fallow_002dstore_002ddata_002draces"></a>
  2217. <p>Allow the compiler to introduce new data races on stores.
  2218. </p>
  2219. <p>Enabled at level <samp>-Ofast</samp>.
  2220. </p>
  2221. </dd>
  2222. <dt><code>-funit-at-a-time</code></dt>
  2223. <dd><a name="index-funit_002dat_002da_002dtime"></a>
  2224. <p>This option is left for compatibility reasons. <samp>-funit-at-a-time</samp>
  2225. has no effect, while <samp>-fno-unit-at-a-time</samp> implies
  2226. <samp>-fno-toplevel-reorder</samp> and <samp>-fno-section-anchors</samp>.
  2227. </p>
  2228. <p>Enabled by default.
  2229. </p>
  2230. </dd>
  2231. <dt><code>-fno-toplevel-reorder</code></dt>
  2232. <dd><a name="index-fno_002dtoplevel_002dreorder"></a>
  2233. <a name="index-ftoplevel_002dreorder"></a>
  2234. <p>Do not reorder top-level functions, variables, and <code>asm</code>
  2235. statements. Output them in the same order that they appear in the
  2236. input file. When this option is used, unreferenced static variables
  2237. are not removed. This option is intended to support existing code
  2238. that relies on a particular ordering. For new code, it is better to
  2239. use attributes when possible.
  2240. </p>
  2241. <p><samp>-ftoplevel-reorder</samp> is the default at <samp>-O1</samp> and higher, and
  2242. also at <samp>-O0</samp> if <samp>-fsection-anchors</samp> is explicitly requested.
  2243. Additionally <samp>-fno-toplevel-reorder</samp> implies
  2244. <samp>-fno-section-anchors</samp>.
  2245. </p>
  2246. </dd>
  2247. <dt><code>-fweb</code></dt>
  2248. <dd><a name="index-fweb"></a>
  2249. <p>Constructs webs as commonly used for register allocation purposes and assign
  2250. each web individual pseudo register. This allows the register allocation pass
  2251. to operate on pseudos directly, but also strengthens several other optimization
  2252. passes, such as CSE, loop optimizer and trivial dead code remover. It can,
  2253. however, make debugging impossible, since variables no longer stay in a
  2254. &ldquo;home register&rdquo;.
  2255. </p>
  2256. <p>Enabled by default with <samp>-funroll-loops</samp>.
  2257. </p>
  2258. </dd>
  2259. <dt><code>-fwhole-program</code></dt>
  2260. <dd><a name="index-fwhole_002dprogram"></a>
  2261. <p>Assume that the current compilation unit represents the whole program being
  2262. compiled. All public functions and variables with the exception of <code>main</code>
  2263. and those merged by attribute <code>externally_visible</code> become static functions
  2264. and in effect are optimized more aggressively by interprocedural optimizers.
  2265. </p>
  2266. <p>This option should not be used in combination with <samp>-flto</samp>.
  2267. Instead relying on a linker plugin should provide safer and more precise
  2268. information.
  2269. </p>
  2270. </dd>
  2271. <dt><code>-flto[=<var>n</var>]</code></dt>
  2272. <dd><a name="index-flto"></a>
  2273. <p>This option runs the standard link-time optimizer. When invoked
  2274. with source code, it generates GIMPLE (one of GCC&rsquo;s internal
  2275. representations) and writes it to special ELF sections in the object
  2276. file. When the object files are linked together, all the function
  2277. bodies are read from these ELF sections and instantiated as if they
  2278. had been part of the same translation unit.
  2279. </p>
  2280. <p>To use the link-time optimizer, <samp>-flto</samp> and optimization
  2281. options should be specified at compile time and during the final link.
  2282. It is recommended that you compile all the files participating in the
  2283. same link with the same options and also specify those options at
  2284. link time.
  2285. For example:
  2286. </p>
  2287. <div class="smallexample">
  2288. <pre class="smallexample">gcc -c -O2 -flto foo.c
  2289. gcc -c -O2 -flto bar.c
  2290. gcc -o myprog -flto -O2 foo.o bar.o
  2291. </pre></div>
  2292. <p>The first two invocations to GCC save a bytecode representation
  2293. of GIMPLE into special ELF sections inside <samp>foo.o</samp> and
  2294. <samp>bar.o</samp>. The final invocation reads the GIMPLE bytecode from
  2295. <samp>foo.o</samp> and <samp>bar.o</samp>, merges the two files into a single
  2296. internal image, and compiles the result as usual. Since both
  2297. <samp>foo.o</samp> and <samp>bar.o</samp> are merged into a single image, this
  2298. causes all the interprocedural analyses and optimizations in GCC to
  2299. work across the two files as if they were a single one. This means,
  2300. for example, that the inliner is able to inline functions in
  2301. <samp>bar.o</samp> into functions in <samp>foo.o</samp> and vice-versa.
  2302. </p>
  2303. <p>Another (simpler) way to enable link-time optimization is:
  2304. </p>
  2305. <div class="smallexample">
  2306. <pre class="smallexample">gcc -o myprog -flto -O2 foo.c bar.c
  2307. </pre></div>
  2308. <p>The above generates bytecode for <samp>foo.c</samp> and <samp>bar.c</samp>,
  2309. merges them together into a single GIMPLE representation and optimizes
  2310. them as usual to produce <samp>myprog</samp>.
  2311. </p>
  2312. <p>The important thing to keep in mind is that to enable link-time
  2313. optimizations you need to use the GCC driver to perform the link step.
  2314. GCC automatically performs link-time optimization if any of the
  2315. objects involved were compiled with the <samp>-flto</samp> command-line option.
  2316. You can always override
  2317. the automatic decision to do link-time optimization
  2318. by passing <samp>-fno-lto</samp> to the link command.
  2319. </p>
  2320. <p>To make whole program optimization effective, it is necessary to make
  2321. certain whole program assumptions. The compiler needs to know
  2322. what functions and variables can be accessed by libraries and runtime
  2323. outside of the link-time optimized unit. When supported by the linker,
  2324. the linker plugin (see <samp>-fuse-linker-plugin</samp>) passes information
  2325. to the compiler about used and externally visible symbols. When
  2326. the linker plugin is not available, <samp>-fwhole-program</samp> should be
  2327. used to allow the compiler to make these assumptions, which leads
  2328. to more aggressive optimization decisions.
  2329. </p>
  2330. <p>When a file is compiled with <samp>-flto</samp> without
  2331. <samp>-fuse-linker-plugin</samp>, the generated object file is larger than
  2332. a regular object file because it contains GIMPLE bytecodes and the usual
  2333. final code (see <samp>-ffat-lto-objects</samp>. This means that
  2334. object files with LTO information can be linked as normal object
  2335. files; if <samp>-fno-lto</samp> is passed to the linker, no
  2336. interprocedural optimizations are applied. Note that when
  2337. <samp>-fno-fat-lto-objects</samp> is enabled the compile stage is faster
  2338. but you cannot perform a regular, non-LTO link on them.
  2339. </p>
  2340. <p>When producing the final binary, GCC only
  2341. applies link-time optimizations to those files that contain bytecode.
  2342. Therefore, you can mix and match object files and libraries with
  2343. GIMPLE bytecodes and final object code. GCC automatically selects
  2344. which files to optimize in LTO mode and which files to link without
  2345. further processing.
  2346. </p>
  2347. <p>Generally, options specified at link time override those
  2348. specified at compile time, although in some cases GCC attempts to infer
  2349. link-time options from the settings used to compile the input files.
  2350. </p>
  2351. <p>If you do not specify an optimization level option <samp>-O</samp> at
  2352. link time, then GCC uses the highest optimization level
  2353. used when compiling the object files. Note that it is generally
  2354. ineffective to specify an optimization level option only at link time and
  2355. not at compile time, for two reasons. First, compiling without
  2356. optimization suppresses compiler passes that gather information
  2357. needed for effective optimization at link time. Second, some early
  2358. optimization passes can be performed only at compile time and
  2359. not at link time.
  2360. </p>
  2361. <p>There are some code generation flags preserved by GCC when
  2362. generating bytecodes, as they need to be used during the final link.
  2363. Currently, the following options and their settings are taken from
  2364. the first object file that explicitly specifies them:
  2365. <samp>-fPIC</samp>, <samp>-fpic</samp>, <samp>-fpie</samp>, <samp>-fcommon</samp>,
  2366. <samp>-fexceptions</samp>, <samp>-fnon-call-exceptions</samp>, <samp>-fgnu-tm</samp>
  2367. and all the <samp>-m</samp> target flags.
  2368. </p>
  2369. <p>Certain ABI-changing flags are required to match in all compilation units,
  2370. and trying to override this at link time with a conflicting value
  2371. is ignored. This includes options such as <samp>-freg-struct-return</samp>
  2372. and <samp>-fpcc-struct-return</samp>.
  2373. </p>
  2374. <p>Other options such as <samp>-ffp-contract</samp>, <samp>-fno-strict-overflow</samp>,
  2375. <samp>-fwrapv</samp>, <samp>-fno-trapv</samp> or <samp>-fno-strict-aliasing</samp>
  2376. are passed through to the link stage and merged conservatively for
  2377. conflicting translation units. Specifically
  2378. <samp>-fno-strict-overflow</samp>, <samp>-fwrapv</samp> and <samp>-fno-trapv</samp> take
  2379. precedence; and for example <samp>-ffp-contract=off</samp> takes precedence
  2380. over <samp>-ffp-contract=fast</samp>. You can override them at link time.
  2381. </p>
  2382. <p>Diagnostic options such as <samp>-Wstringop-overflow</samp> are passed
  2383. through to the link stage and their setting matches that of the
  2384. compile-step at function granularity. Note that this matters only
  2385. for diagnostics emitted during optimization. Note that code
  2386. transforms such as inlining can lead to warnings being enabled
  2387. or disabled for regions if code not consistent with the setting
  2388. at compile time.
  2389. </p>
  2390. <p>When you need to pass options to the assembler via <samp>-Wa</samp> or
  2391. <samp>-Xassembler</samp> make sure to either compile such translation
  2392. units with <samp>-fno-lto</samp> or consistently use the same assembler
  2393. options on all translation units. You can alternatively also
  2394. specify assembler options at LTO link time.
  2395. </p>
  2396. <p>To enable debug info generation you need to supply <samp>-g</samp> at
  2397. compile time. If any of the input files at link time were built
  2398. with debug info generation enabled the link will enable debug info
  2399. generation as well. Any elaborate debug info settings
  2400. like the dwarf level <samp>-gdwarf-5</samp> need to be explicitly repeated
  2401. at the linker command line and mixing different settings in different
  2402. translation units is discouraged.
  2403. </p>
  2404. <p>If LTO encounters objects with C linkage declared with incompatible
  2405. types in separate translation units to be linked together (undefined
  2406. behavior according to ISO C99 6.2.7), a non-fatal diagnostic may be
  2407. issued. The behavior is still undefined at run time. Similar
  2408. diagnostics may be raised for other languages.
  2409. </p>
  2410. <p>Another feature of LTO is that it is possible to apply interprocedural
  2411. optimizations on files written in different languages:
  2412. </p>
  2413. <div class="smallexample">
  2414. <pre class="smallexample">gcc -c -flto foo.c
  2415. g++ -c -flto bar.cc
  2416. gfortran -c -flto baz.f90
  2417. g++ -o myprog -flto -O3 foo.o bar.o baz.o -lgfortran
  2418. </pre></div>
  2419. <p>Notice that the final link is done with <code>g++</code> to get the C++
  2420. runtime libraries and <samp>-lgfortran</samp> is added to get the Fortran
  2421. runtime libraries. In general, when mixing languages in LTO mode, you
  2422. should use the same link command options as when mixing languages in a
  2423. regular (non-LTO) compilation.
  2424. </p>
  2425. <p>If object files containing GIMPLE bytecode are stored in a library archive, say
  2426. <samp>libfoo.a</samp>, it is possible to extract and use them in an LTO link if you
  2427. are using a linker with plugin support. To create static libraries suitable
  2428. for LTO, use <code>gcc-ar</code> and <code>gcc-ranlib</code> instead of <code>ar</code>
  2429. and <code>ranlib</code>;
  2430. to show the symbols of object files with GIMPLE bytecode, use
  2431. <code>gcc-nm</code>. Those commands require that <code>ar</code>, <code>ranlib</code>
  2432. and <code>nm</code> have been compiled with plugin support. At link time, use the
  2433. flag <samp>-fuse-linker-plugin</samp> to ensure that the library participates in
  2434. the LTO optimization process:
  2435. </p>
  2436. <div class="smallexample">
  2437. <pre class="smallexample">gcc -o myprog -O2 -flto -fuse-linker-plugin a.o b.o -lfoo
  2438. </pre></div>
  2439. <p>With the linker plugin enabled, the linker extracts the needed
  2440. GIMPLE files from <samp>libfoo.a</samp> and passes them on to the running GCC
  2441. to make them part of the aggregated GIMPLE image to be optimized.
  2442. </p>
  2443. <p>If you are not using a linker with plugin support and/or do not
  2444. enable the linker plugin, then the objects inside <samp>libfoo.a</samp>
  2445. are extracted and linked as usual, but they do not participate
  2446. in the LTO optimization process. In order to make a static library suitable
  2447. for both LTO optimization and usual linkage, compile its object files with
  2448. <samp>-flto</samp> <samp>-ffat-lto-objects</samp>.
  2449. </p>
  2450. <p>Link-time optimizations do not require the presence of the whole program to
  2451. operate. If the program does not require any symbols to be exported, it is
  2452. possible to combine <samp>-flto</samp> and <samp>-fwhole-program</samp> to allow
  2453. the interprocedural optimizers to use more aggressive assumptions which may
  2454. lead to improved optimization opportunities.
  2455. Use of <samp>-fwhole-program</samp> is not needed when linker plugin is
  2456. active (see <samp>-fuse-linker-plugin</samp>).
  2457. </p>
  2458. <p>The current implementation of LTO makes no
  2459. attempt to generate bytecode that is portable between different
  2460. types of hosts. The bytecode files are versioned and there is a
  2461. strict version check, so bytecode files generated in one version of
  2462. GCC do not work with an older or newer version of GCC.
  2463. </p>
  2464. <p>Link-time optimization does not work well with generation of debugging
  2465. information on systems other than those using a combination of ELF and
  2466. DWARF.
  2467. </p>
  2468. <p>If you specify the optional <var>n</var>, the optimization and code
  2469. generation done at link time is executed in parallel using <var>n</var>
  2470. parallel jobs by utilizing an installed <code>make</code> program. The
  2471. environment variable <code>MAKE</code> may be used to override the program
  2472. used.
  2473. </p>
  2474. <p>You can also specify <samp>-flto=jobserver</samp> to use GNU make&rsquo;s
  2475. job server mode to determine the number of parallel jobs. This
  2476. is useful when the Makefile calling GCC is already executing in parallel.
  2477. You must prepend a &lsquo;<samp>+</samp>&rsquo; to the command recipe in the parent Makefile
  2478. for this to work. This option likely only works if <code>MAKE</code> is
  2479. GNU make. Even without the option value, GCC tries to automatically
  2480. detect a running GNU make&rsquo;s job server.
  2481. </p>
  2482. <p>Use <samp>-flto=auto</samp> to use GNU make&rsquo;s job server, if available,
  2483. or otherwise fall back to autodetection of the number of CPU threads
  2484. present in your system.
  2485. </p>
  2486. </dd>
  2487. <dt><code>-flto-partition=<var>alg</var></code></dt>
  2488. <dd><a name="index-flto_002dpartition"></a>
  2489. <p>Specify the partitioning algorithm used by the link-time optimizer.
  2490. The value is either &lsquo;<samp>1to1</samp>&rsquo; to specify a partitioning mirroring
  2491. the original source files or &lsquo;<samp>balanced</samp>&rsquo; to specify partitioning
  2492. into equally sized chunks (whenever possible) or &lsquo;<samp>max</samp>&rsquo; to create
  2493. new partition for every symbol where possible. Specifying &lsquo;<samp>none</samp>&rsquo;
  2494. as an algorithm disables partitioning and streaming completely.
  2495. The default value is &lsquo;<samp>balanced</samp>&rsquo;. While &lsquo;<samp>1to1</samp>&rsquo; can be used
  2496. as an workaround for various code ordering issues, the &lsquo;<samp>max</samp>&rsquo;
  2497. partitioning is intended for internal testing only.
  2498. The value &lsquo;<samp>one</samp>&rsquo; specifies that exactly one partition should be
  2499. used while the value &lsquo;<samp>none</samp>&rsquo; bypasses partitioning and executes
  2500. the link-time optimization step directly from the WPA phase.
  2501. </p>
  2502. </dd>
  2503. <dt><code>-flto-compression-level=<var>n</var></code></dt>
  2504. <dd><a name="index-flto_002dcompression_002dlevel"></a>
  2505. <p>This option specifies the level of compression used for intermediate
  2506. language written to LTO object files, and is only meaningful in
  2507. conjunction with LTO mode (<samp>-flto</samp>). Valid
  2508. values are 0 (no compression) to 9 (maximum compression). Values
  2509. outside this range are clamped to either 0 or 9. If the option is not
  2510. given, a default balanced compression setting is used.
  2511. </p>
  2512. </dd>
  2513. <dt><code>-fuse-linker-plugin</code></dt>
  2514. <dd><a name="index-fuse_002dlinker_002dplugin"></a>
  2515. <p>Enables the use of a linker plugin during link-time optimization. This
  2516. option relies on plugin support in the linker, which is available in gold
  2517. or in GNU ld 2.21 or newer.
  2518. </p>
  2519. <p>This option enables the extraction of object files with GIMPLE bytecode out
  2520. of library archives. This improves the quality of optimization by exposing
  2521. more code to the link-time optimizer. This information specifies what
  2522. symbols can be accessed externally (by non-LTO object or during dynamic
  2523. linking). Resulting code quality improvements on binaries (and shared
  2524. libraries that use hidden visibility) are similar to <samp>-fwhole-program</samp>.
  2525. See <samp>-flto</samp> for a description of the effect of this flag and how to
  2526. use it.
  2527. </p>
  2528. <p>This option is enabled by default when LTO support in GCC is enabled
  2529. and GCC was configured for use with
  2530. a linker supporting plugins (GNU ld 2.21 or newer or gold).
  2531. </p>
  2532. </dd>
  2533. <dt><code>-ffat-lto-objects</code></dt>
  2534. <dd><a name="index-ffat_002dlto_002dobjects"></a>
  2535. <p>Fat LTO objects are object files that contain both the intermediate language
  2536. and the object code. This makes them usable for both LTO linking and normal
  2537. linking. This option is effective only when compiling with <samp>-flto</samp>
  2538. and is ignored at link time.
  2539. </p>
  2540. <p><samp>-fno-fat-lto-objects</samp> improves compilation time over plain LTO, but
  2541. requires the complete toolchain to be aware of LTO. It requires a linker with
  2542. linker plugin support for basic functionality. Additionally,
  2543. <code>nm</code>, <code>ar</code> and <code>ranlib</code>
  2544. need to support linker plugins to allow a full-featured build environment
  2545. (capable of building static libraries etc). GCC provides the <code>gcc-ar</code>,
  2546. <code>gcc-nm</code>, <code>gcc-ranlib</code> wrappers to pass the right options
  2547. to these tools. With non fat LTO makefiles need to be modified to use them.
  2548. </p>
  2549. <p>Note that modern binutils provide plugin auto-load mechanism.
  2550. Installing the linker plugin into <samp>$libdir/bfd-plugins</samp> has the same
  2551. effect as usage of the command wrappers (<code>gcc-ar</code>, <code>gcc-nm</code> and
  2552. <code>gcc-ranlib</code>).
  2553. </p>
  2554. <p>The default is <samp>-fno-fat-lto-objects</samp> on targets with linker plugin
  2555. support.
  2556. </p>
  2557. </dd>
  2558. <dt><code>-fcompare-elim</code></dt>
  2559. <dd><a name="index-fcompare_002delim"></a>
  2560. <p>After register allocation and post-register allocation instruction splitting,
  2561. identify arithmetic instructions that compute processor flags similar to a
  2562. comparison operation based on that arithmetic. If possible, eliminate the
  2563. explicit comparison operation.
  2564. </p>
  2565. <p>This pass only applies to certain targets that cannot explicitly represent
  2566. the comparison operation before register allocation is complete.
  2567. </p>
  2568. <p>Enabled at levels <samp>-O</samp>, <samp>-O2</samp>, <samp>-O3</samp>, <samp>-Os</samp>.
  2569. </p>
  2570. </dd>
  2571. <dt><code>-fcprop-registers</code></dt>
  2572. <dd><a name="index-fcprop_002dregisters"></a>
  2573. <p>After register allocation and post-register allocation instruction splitting,
  2574. perform a copy-propagation pass to try to reduce scheduling dependencies
  2575. and occasionally eliminate the copy.
  2576. </p>
  2577. <p>Enabled at levels <samp>-O</samp>, <samp>-O2</samp>, <samp>-O3</samp>, <samp>-Os</samp>.
  2578. </p>
  2579. </dd>
  2580. <dt><code>-fprofile-correction</code></dt>
  2581. <dd><a name="index-fprofile_002dcorrection"></a>
  2582. <p>Profiles collected using an instrumented binary for multi-threaded programs may
  2583. be inconsistent due to missed counter updates. When this option is specified,
  2584. GCC uses heuristics to correct or smooth out such inconsistencies. By
  2585. default, GCC emits an error message when an inconsistent profile is detected.
  2586. </p>
  2587. <p>This option is enabled by <samp>-fauto-profile</samp>.
  2588. </p>
  2589. </dd>
  2590. <dt><code>-fprofile-partial-training</code></dt>
  2591. <dd><a name="index-fprofile_002dpartial_002dtraining"></a>
  2592. <p>With <code>-fprofile-use</code> all portions of programs not executed during train
  2593. run are optimized agressively for size rather than speed. In some cases it is
  2594. not practical to train all possible hot paths in the program. (For
  2595. example, program may contain functions specific for a given hardware and
  2596. trianing may not cover all hardware configurations program is run on.) With
  2597. <code>-fprofile-partial-training</code> profile feedback will be ignored for all
  2598. functions not executed during the train run leading them to be optimized as if
  2599. they were compiled without profile feedback. This leads to better performance
  2600. when train run is not representative but also leads to significantly bigger
  2601. code.
  2602. </p>
  2603. </dd>
  2604. <dt><code>-fprofile-use</code></dt>
  2605. <dt><code>-fprofile-use=<var>path</var></code></dt>
  2606. <dd><a name="index-fprofile_002duse"></a>
  2607. <p>Enable profile feedback-directed optimizations,
  2608. and the following optimizations, many of which
  2609. are generally profitable only with profile feedback available:
  2610. </p>
  2611. <div class="smallexample">
  2612. <pre class="smallexample">-fbranch-probabilities -fprofile-values
  2613. -funroll-loops -fpeel-loops -ftracer -fvpt
  2614. -finline-functions -fipa-cp -fipa-cp-clone -fipa-bit-cp
  2615. -fpredictive-commoning -fsplit-loops -funswitch-loops
  2616. -fgcse-after-reload -ftree-loop-vectorize -ftree-slp-vectorize
  2617. -fvect-cost-model=dynamic -ftree-loop-distribute-patterns
  2618. -fprofile-reorder-functions
  2619. </pre></div>
  2620. <p>Before you can use this option, you must first generate profiling information.
  2621. See <a href="Instrumentation-Options.html#Instrumentation-Options">Instrumentation Options</a>, for information about the
  2622. <samp>-fprofile-generate</samp> option.
  2623. </p>
  2624. <p>By default, GCC emits an error message if the feedback profiles do not
  2625. match the source code. This error can be turned into a warning by using
  2626. <samp>-Wno-error=coverage-mismatch</samp>. Note this may result in poorly
  2627. optimized code. Additionally, by default, GCC also emits a warning message if
  2628. the feedback profiles do not exist (see <samp>-Wmissing-profile</samp>).
  2629. </p>
  2630. <p>If <var>path</var> is specified, GCC looks at the <var>path</var> to find
  2631. the profile feedback data files. See <samp>-fprofile-dir</samp>.
  2632. </p>
  2633. </dd>
  2634. <dt><code>-fauto-profile</code></dt>
  2635. <dt><code>-fauto-profile=<var>path</var></code></dt>
  2636. <dd><a name="index-fauto_002dprofile"></a>
  2637. <p>Enable sampling-based feedback-directed optimizations,
  2638. and the following optimizations,
  2639. many of which are generally profitable only with profile feedback available:
  2640. </p>
  2641. <div class="smallexample">
  2642. <pre class="smallexample">-fbranch-probabilities -fprofile-values
  2643. -funroll-loops -fpeel-loops -ftracer -fvpt
  2644. -finline-functions -fipa-cp -fipa-cp-clone -fipa-bit-cp
  2645. -fpredictive-commoning -fsplit-loops -funswitch-loops
  2646. -fgcse-after-reload -ftree-loop-vectorize -ftree-slp-vectorize
  2647. -fvect-cost-model=dynamic -ftree-loop-distribute-patterns
  2648. -fprofile-correction
  2649. </pre></div>
  2650. <p><var>path</var> is the name of a file containing AutoFDO profile information.
  2651. If omitted, it defaults to <samp>fbdata.afdo</samp> in the current directory.
  2652. </p>
  2653. <p>Producing an AutoFDO profile data file requires running your program
  2654. with the <code>perf</code> utility on a supported GNU/Linux target system.
  2655. For more information, see <a href="https://perf.wiki.kernel.org/">https://perf.wiki.kernel.org/</a>.
  2656. </p>
  2657. <p>E.g.
  2658. </p><div class="smallexample">
  2659. <pre class="smallexample">perf record -e br_inst_retired:near_taken -b -o perf.data \
  2660. -- your_program
  2661. </pre></div>
  2662. <p>Then use the <code>create_gcov</code> tool to convert the raw profile data
  2663. to a format that can be used by GCC.&nbsp; You must also supply the
  2664. unstripped binary for your program to this tool.
  2665. See <a href="https://github.com/google/autofdo">https://github.com/google/autofdo</a>.
  2666. </p>
  2667. <p>E.g.
  2668. </p><div class="smallexample">
  2669. <pre class="smallexample">create_gcov --binary=your_program.unstripped --profile=perf.data \
  2670. --gcov=profile.afdo
  2671. </pre></div>
  2672. </dd>
  2673. </dl>
  2674. <p>The following options control compiler behavior regarding floating-point
  2675. arithmetic. These options trade off between speed and
  2676. correctness. All must be specifically enabled.
  2677. </p>
  2678. <dl compact="compact">
  2679. <dt><code>-ffloat-store</code></dt>
  2680. <dd><a name="index-ffloat_002dstore"></a>
  2681. <p>Do not store floating-point variables in registers, and inhibit other
  2682. options that might change whether a floating-point value is taken from a
  2683. register or memory.
  2684. </p>
  2685. <a name="index-floating_002dpoint-precision"></a>
  2686. <p>This option prevents undesirable excess precision on machines such as
  2687. the 68000 where the floating registers (of the 68881) keep more
  2688. precision than a <code>double</code> is supposed to have. Similarly for the
  2689. x86 architecture. For most programs, the excess precision does only
  2690. good, but a few programs rely on the precise definition of IEEE floating
  2691. point. Use <samp>-ffloat-store</samp> for such programs, after modifying
  2692. them to store all pertinent intermediate computations into variables.
  2693. </p>
  2694. </dd>
  2695. <dt><code>-fexcess-precision=<var>style</var></code></dt>
  2696. <dd><a name="index-fexcess_002dprecision"></a>
  2697. <p>This option allows further control over excess precision on machines
  2698. where floating-point operations occur in a format with more precision or
  2699. range than the IEEE standard and interchange floating-point types. By
  2700. default, <samp>-fexcess-precision=fast</samp> is in effect; this means that
  2701. operations may be carried out in a wider precision than the types specified
  2702. in the source if that would result in faster code, and it is unpredictable
  2703. when rounding to the types specified in the source code takes place.
  2704. When compiling C, if <samp>-fexcess-precision=standard</samp> is specified then
  2705. excess precision follows the rules specified in ISO C99; in particular,
  2706. both casts and assignments cause values to be rounded to their
  2707. semantic types (whereas <samp>-ffloat-store</samp> only affects
  2708. assignments). This option is enabled by default for C if a strict
  2709. conformance option such as <samp>-std=c99</samp> is used.
  2710. <samp>-ffast-math</samp> enables <samp>-fexcess-precision=fast</samp> by default
  2711. regardless of whether a strict conformance option is used.
  2712. </p>
  2713. <a name="index-mfpmath"></a>
  2714. <p><samp>-fexcess-precision=standard</samp> is not implemented for languages
  2715. other than C. On the x86, it has no effect if <samp>-mfpmath=sse</samp>
  2716. or <samp>-mfpmath=sse+387</samp> is specified; in the former case, IEEE
  2717. semantics apply without excess precision, and in the latter, rounding
  2718. is unpredictable.
  2719. </p>
  2720. </dd>
  2721. <dt><code>-ffast-math</code></dt>
  2722. <dd><a name="index-ffast_002dmath"></a>
  2723. <p>Sets the options <samp>-fno-math-errno</samp>, <samp>-funsafe-math-optimizations</samp>,
  2724. <samp>-ffinite-math-only</samp>, <samp>-fno-rounding-math</samp>,
  2725. <samp>-fno-signaling-nans</samp>, <samp>-fcx-limited-range</samp> and
  2726. <samp>-fexcess-precision=fast</samp>.
  2727. </p>
  2728. <p>This option causes the preprocessor macro <code>__FAST_MATH__</code> to be defined.
  2729. </p>
  2730. <p>This option is not turned on by any <samp>-O</samp> option besides
  2731. <samp>-Ofast</samp> since it can result in incorrect output for programs
  2732. that depend on an exact implementation of IEEE or ISO rules/specifications
  2733. for math functions. It may, however, yield faster code for programs
  2734. that do not require the guarantees of these specifications.
  2735. </p>
  2736. </dd>
  2737. <dt><code>-fno-math-errno</code></dt>
  2738. <dd><a name="index-fno_002dmath_002derrno"></a>
  2739. <a name="index-fmath_002derrno"></a>
  2740. <p>Do not set <code>errno</code> after calling math functions that are executed
  2741. with a single instruction, e.g., <code>sqrt</code>. A program that relies on
  2742. IEEE exceptions for math error handling may want to use this flag
  2743. for speed while maintaining IEEE arithmetic compatibility.
  2744. </p>
  2745. <p>This option is not turned on by any <samp>-O</samp> option since
  2746. it can result in incorrect output for programs that depend on
  2747. an exact implementation of IEEE or ISO rules/specifications for
  2748. math functions. It may, however, yield faster code for programs
  2749. that do not require the guarantees of these specifications.
  2750. </p>
  2751. <p>The default is <samp>-fmath-errno</samp>.
  2752. </p>
  2753. <p>On Darwin systems, the math library never sets <code>errno</code>. There is
  2754. therefore no reason for the compiler to consider the possibility that
  2755. it might, and <samp>-fno-math-errno</samp> is the default.
  2756. </p>
  2757. </dd>
  2758. <dt><code>-funsafe-math-optimizations</code></dt>
  2759. <dd><a name="index-funsafe_002dmath_002doptimizations"></a>
  2760. <p>Allow optimizations for floating-point arithmetic that (a) assume
  2761. that arguments and results are valid and (b) may violate IEEE or
  2762. ANSI standards. When used at link time, it may include libraries
  2763. or startup files that change the default FPU control word or other
  2764. similar optimizations.
  2765. </p>
  2766. <p>This option is not turned on by any <samp>-O</samp> option since
  2767. it can result in incorrect output for programs that depend on
  2768. an exact implementation of IEEE or ISO rules/specifications for
  2769. math functions. It may, however, yield faster code for programs
  2770. that do not require the guarantees of these specifications.
  2771. Enables <samp>-fno-signed-zeros</samp>, <samp>-fno-trapping-math</samp>,
  2772. <samp>-fassociative-math</samp> and <samp>-freciprocal-math</samp>.
  2773. </p>
  2774. <p>The default is <samp>-fno-unsafe-math-optimizations</samp>.
  2775. </p>
  2776. </dd>
  2777. <dt><code>-fassociative-math</code></dt>
  2778. <dd><a name="index-fassociative_002dmath"></a>
  2779. <p>Allow re-association of operands in series of floating-point operations.
  2780. This violates the ISO C and C++ language standard by possibly changing
  2781. computation result. NOTE: re-ordering may change the sign of zero as
  2782. well as ignore NaNs and inhibit or create underflow or overflow (and
  2783. thus cannot be used on code that relies on rounding behavior like
  2784. <code>(x + 2**52) - 2**52</code>. May also reorder floating-point comparisons
  2785. and thus may not be used when ordered comparisons are required.
  2786. This option requires that both <samp>-fno-signed-zeros</samp> and
  2787. <samp>-fno-trapping-math</samp> be in effect. Moreover, it doesn&rsquo;t make
  2788. much sense with <samp>-frounding-math</samp>. For Fortran the option
  2789. is automatically enabled when both <samp>-fno-signed-zeros</samp> and
  2790. <samp>-fno-trapping-math</samp> are in effect.
  2791. </p>
  2792. <p>The default is <samp>-fno-associative-math</samp>.
  2793. </p>
  2794. </dd>
  2795. <dt><code>-freciprocal-math</code></dt>
  2796. <dd><a name="index-freciprocal_002dmath"></a>
  2797. <p>Allow the reciprocal of a value to be used instead of dividing by
  2798. the value if this enables optimizations. For example <code>x / y</code>
  2799. can be replaced with <code>x * (1/y)</code>, which is useful if <code>(1/y)</code>
  2800. is subject to common subexpression elimination. Note that this loses
  2801. precision and increases the number of flops operating on the value.
  2802. </p>
  2803. <p>The default is <samp>-fno-reciprocal-math</samp>.
  2804. </p>
  2805. </dd>
  2806. <dt><code>-ffinite-math-only</code></dt>
  2807. <dd><a name="index-ffinite_002dmath_002donly"></a>
  2808. <p>Allow optimizations for floating-point arithmetic that assume
  2809. that arguments and results are not NaNs or +-Infs.
  2810. </p>
  2811. <p>This option is not turned on by any <samp>-O</samp> option since
  2812. it can result in incorrect output for programs that depend on
  2813. an exact implementation of IEEE or ISO rules/specifications for
  2814. math functions. It may, however, yield faster code for programs
  2815. that do not require the guarantees of these specifications.
  2816. </p>
  2817. <p>The default is <samp>-fno-finite-math-only</samp>.
  2818. </p>
  2819. </dd>
  2820. <dt><code>-fno-signed-zeros</code></dt>
  2821. <dd><a name="index-fno_002dsigned_002dzeros"></a>
  2822. <a name="index-fsigned_002dzeros"></a>
  2823. <p>Allow optimizations for floating-point arithmetic that ignore the
  2824. signedness of zero. IEEE arithmetic specifies the behavior of
  2825. distinct +0.0 and -0.0 values, which then prohibits simplification
  2826. of expressions such as x+0.0 or 0.0*x (even with <samp>-ffinite-math-only</samp>).
  2827. This option implies that the sign of a zero result isn&rsquo;t significant.
  2828. </p>
  2829. <p>The default is <samp>-fsigned-zeros</samp>.
  2830. </p>
  2831. </dd>
  2832. <dt><code>-fno-trapping-math</code></dt>
  2833. <dd><a name="index-fno_002dtrapping_002dmath"></a>
  2834. <a name="index-ftrapping_002dmath"></a>
  2835. <p>Compile code assuming that floating-point operations cannot generate
  2836. user-visible traps. These traps include division by zero, overflow,
  2837. underflow, inexact result and invalid operation. This option requires
  2838. that <samp>-fno-signaling-nans</samp> be in effect. Setting this option may
  2839. allow faster code if one relies on &ldquo;non-stop&rdquo; IEEE arithmetic, for example.
  2840. </p>
  2841. <p>This option should never be turned on by any <samp>-O</samp> option since
  2842. it can result in incorrect output for programs that depend on
  2843. an exact implementation of IEEE or ISO rules/specifications for
  2844. math functions.
  2845. </p>
  2846. <p>The default is <samp>-ftrapping-math</samp>.
  2847. </p>
  2848. </dd>
  2849. <dt><code>-frounding-math</code></dt>
  2850. <dd><a name="index-frounding_002dmath"></a>
  2851. <p>Disable transformations and optimizations that assume default floating-point
  2852. rounding behavior. This is round-to-zero for all floating point
  2853. to integer conversions, and round-to-nearest for all other arithmetic
  2854. truncations. This option should be specified for programs that change
  2855. the FP rounding mode dynamically, or that may be executed with a
  2856. non-default rounding mode. This option disables constant folding of
  2857. floating-point expressions at compile time (which may be affected by
  2858. rounding mode) and arithmetic transformations that are unsafe in the
  2859. presence of sign-dependent rounding modes.
  2860. </p>
  2861. <p>The default is <samp>-fno-rounding-math</samp>.
  2862. </p>
  2863. <p>This option is experimental and does not currently guarantee to
  2864. disable all GCC optimizations that are affected by rounding mode.
  2865. Future versions of GCC may provide finer control of this setting
  2866. using C99&rsquo;s <code>FENV_ACCESS</code> pragma. This command-line option
  2867. will be used to specify the default state for <code>FENV_ACCESS</code>.
  2868. </p>
  2869. </dd>
  2870. <dt><code>-fsignaling-nans</code></dt>
  2871. <dd><a name="index-fsignaling_002dnans"></a>
  2872. <p>Compile code assuming that IEEE signaling NaNs may generate user-visible
  2873. traps during floating-point operations. Setting this option disables
  2874. optimizations that may change the number of exceptions visible with
  2875. signaling NaNs. This option implies <samp>-ftrapping-math</samp>.
  2876. </p>
  2877. <p>This option causes the preprocessor macro <code>__SUPPORT_SNAN__</code> to
  2878. be defined.
  2879. </p>
  2880. <p>The default is <samp>-fno-signaling-nans</samp>.
  2881. </p>
  2882. <p>This option is experimental and does not currently guarantee to
  2883. disable all GCC optimizations that affect signaling NaN behavior.
  2884. </p>
  2885. </dd>
  2886. <dt><code>-fno-fp-int-builtin-inexact</code></dt>
  2887. <dd><a name="index-fno_002dfp_002dint_002dbuiltin_002dinexact"></a>
  2888. <a name="index-ffp_002dint_002dbuiltin_002dinexact"></a>
  2889. <p>Do not allow the built-in functions <code>ceil</code>, <code>floor</code>,
  2890. <code>round</code> and <code>trunc</code>, and their <code>float</code> and <code>long
  2891. double</code> variants, to generate code that raises the &ldquo;inexact&rdquo;
  2892. floating-point exception for noninteger arguments. ISO C99 and C11
  2893. allow these functions to raise the &ldquo;inexact&rdquo; exception, but ISO/IEC
  2894. TS 18661-1:2014, the C bindings to IEEE 754-2008, as integrated into
  2895. ISO C2X, does not allow these functions to do so.
  2896. </p>
  2897. <p>The default is <samp>-ffp-int-builtin-inexact</samp>, allowing the
  2898. exception to be raised, unless C2X or a later C standard is selected.
  2899. This option does nothing unless <samp>-ftrapping-math</samp> is in effect.
  2900. </p>
  2901. <p>Even if <samp>-fno-fp-int-builtin-inexact</samp> is used, if the functions
  2902. generate a call to a library function then the &ldquo;inexact&rdquo; exception
  2903. may be raised if the library implementation does not follow TS 18661.
  2904. </p>
  2905. </dd>
  2906. <dt><code>-fsingle-precision-constant</code></dt>
  2907. <dd><a name="index-fsingle_002dprecision_002dconstant"></a>
  2908. <p>Treat floating-point constants as single precision instead of
  2909. implicitly converting them to double-precision constants.
  2910. </p>
  2911. </dd>
  2912. <dt><code>-fcx-limited-range</code></dt>
  2913. <dd><a name="index-fcx_002dlimited_002drange"></a>
  2914. <p>When enabled, this option states that a range reduction step is not
  2915. needed when performing complex division. Also, there is no checking
  2916. whether the result of a complex multiplication or division is <code>NaN
  2917. + I*NaN</code>, with an attempt to rescue the situation in that case. The
  2918. default is <samp>-fno-cx-limited-range</samp>, but is enabled by
  2919. <samp>-ffast-math</samp>.
  2920. </p>
  2921. <p>This option controls the default setting of the ISO C99
  2922. <code>CX_LIMITED_RANGE</code> pragma. Nevertheless, the option applies to
  2923. all languages.
  2924. </p>
  2925. </dd>
  2926. <dt><code>-fcx-fortran-rules</code></dt>
  2927. <dd><a name="index-fcx_002dfortran_002drules"></a>
  2928. <p>Complex multiplication and division follow Fortran rules. Range
  2929. reduction is done as part of complex division, but there is no checking
  2930. whether the result of a complex multiplication or division is <code>NaN
  2931. + I*NaN</code>, with an attempt to rescue the situation in that case.
  2932. </p>
  2933. <p>The default is <samp>-fno-cx-fortran-rules</samp>.
  2934. </p>
  2935. </dd>
  2936. </dl>
  2937. <p>The following options control optimizations that may improve
  2938. performance, but are not enabled by any <samp>-O</samp> options. This
  2939. section includes experimental options that may produce broken code.
  2940. </p>
  2941. <dl compact="compact">
  2942. <dt><code>-fbranch-probabilities</code></dt>
  2943. <dd><a name="index-fbranch_002dprobabilities"></a>
  2944. <p>After running a program compiled with <samp>-fprofile-arcs</samp>
  2945. (see <a href="Instrumentation-Options.html#Instrumentation-Options">Instrumentation Options</a>),
  2946. you can compile it a second time using
  2947. <samp>-fbranch-probabilities</samp>, to improve optimizations based on
  2948. the number of times each branch was taken. When a program
  2949. compiled with <samp>-fprofile-arcs</samp> exits, it saves arc execution
  2950. counts to a file called <samp><var>sourcename</var>.gcda</samp> for each source
  2951. file. The information in this data file is very dependent on the
  2952. structure of the generated code, so you must use the same source code
  2953. and the same optimization options for both compilations.
  2954. </p>
  2955. <p>With <samp>-fbranch-probabilities</samp>, GCC puts a
  2956. &lsquo;<samp>REG_BR_PROB</samp>&rsquo; note on each &lsquo;<samp>JUMP_INSN</samp>&rsquo; and &lsquo;<samp>CALL_INSN</samp>&rsquo;.
  2957. These can be used to improve optimization. Currently, they are only
  2958. used in one place: in <samp>reorg.c</samp>, instead of guessing which path a
  2959. branch is most likely to take, the &lsquo;<samp>REG_BR_PROB</samp>&rsquo; values are used to
  2960. exactly determine which path is taken more often.
  2961. </p>
  2962. <p>Enabled by <samp>-fprofile-use</samp> and <samp>-fauto-profile</samp>.
  2963. </p>
  2964. </dd>
  2965. <dt><code>-fprofile-values</code></dt>
  2966. <dd><a name="index-fprofile_002dvalues"></a>
  2967. <p>If combined with <samp>-fprofile-arcs</samp>, it adds code so that some
  2968. data about values of expressions in the program is gathered.
  2969. </p>
  2970. <p>With <samp>-fbranch-probabilities</samp>, it reads back the data gathered
  2971. from profiling values of expressions for usage in optimizations.
  2972. </p>
  2973. <p>Enabled by <samp>-fprofile-generate</samp>, <samp>-fprofile-use</samp>, and
  2974. <samp>-fauto-profile</samp>.
  2975. </p>
  2976. </dd>
  2977. <dt><code>-fprofile-reorder-functions</code></dt>
  2978. <dd><a name="index-fprofile_002dreorder_002dfunctions"></a>
  2979. <p>Function reordering based on profile instrumentation collects
  2980. first time of execution of a function and orders these functions
  2981. in ascending order.
  2982. </p>
  2983. <p>Enabled with <samp>-fprofile-use</samp>.
  2984. </p>
  2985. </dd>
  2986. <dt><code>-fvpt</code></dt>
  2987. <dd><a name="index-fvpt"></a>
  2988. <p>If combined with <samp>-fprofile-arcs</samp>, this option instructs the compiler
  2989. to add code to gather information about values of expressions.
  2990. </p>
  2991. <p>With <samp>-fbranch-probabilities</samp>, it reads back the data gathered
  2992. and actually performs the optimizations based on them.
  2993. Currently the optimizations include specialization of division operations
  2994. using the knowledge about the value of the denominator.
  2995. </p>
  2996. <p>Enabled with <samp>-fprofile-use</samp> and <samp>-fauto-profile</samp>.
  2997. </p>
  2998. </dd>
  2999. <dt><code>-frename-registers</code></dt>
  3000. <dd><a name="index-frename_002dregisters"></a>
  3001. <p>Attempt to avoid false dependencies in scheduled code by making use
  3002. of registers left over after register allocation. This optimization
  3003. most benefits processors with lots of registers. Depending on the
  3004. debug information format adopted by the target, however, it can
  3005. make debugging impossible, since variables no longer stay in
  3006. a &ldquo;home register&rdquo;.
  3007. </p>
  3008. <p>Enabled by default with <samp>-funroll-loops</samp>.
  3009. </p>
  3010. </dd>
  3011. <dt><code>-fschedule-fusion</code></dt>
  3012. <dd><a name="index-fschedule_002dfusion"></a>
  3013. <p>Performs a target dependent pass over the instruction stream to schedule
  3014. instructions of same type together because target machine can execute them
  3015. more efficiently if they are adjacent to each other in the instruction flow.
  3016. </p>
  3017. <p>Enabled at levels <samp>-O2</samp>, <samp>-O3</samp>, <samp>-Os</samp>.
  3018. </p>
  3019. </dd>
  3020. <dt><code>-ftracer</code></dt>
  3021. <dd><a name="index-ftracer"></a>
  3022. <p>Perform tail duplication to enlarge superblock size. This transformation
  3023. simplifies the control flow of the function allowing other optimizations to do
  3024. a better job.
  3025. </p>
  3026. <p>Enabled by <samp>-fprofile-use</samp> and <samp>-fauto-profile</samp>.
  3027. </p>
  3028. </dd>
  3029. <dt><code>-funroll-loops</code></dt>
  3030. <dd><a name="index-funroll_002dloops"></a>
  3031. <p>Unroll loops whose number of iterations can be determined at compile time or
  3032. upon entry to the loop. <samp>-funroll-loops</samp> implies
  3033. <samp>-frerun-cse-after-loop</samp>, <samp>-fweb</samp> and <samp>-frename-registers</samp>.
  3034. It also turns on complete loop peeling (i.e. complete removal of loops with
  3035. a small constant number of iterations). This option makes code larger, and may
  3036. or may not make it run faster.
  3037. </p>
  3038. <p>Enabled by <samp>-fprofile-use</samp> and <samp>-fauto-profile</samp>.
  3039. </p>
  3040. </dd>
  3041. <dt><code>-funroll-all-loops</code></dt>
  3042. <dd><a name="index-funroll_002dall_002dloops"></a>
  3043. <p>Unroll all loops, even if their number of iterations is uncertain when
  3044. the loop is entered. This usually makes programs run more slowly.
  3045. <samp>-funroll-all-loops</samp> implies the same options as
  3046. <samp>-funroll-loops</samp>.
  3047. </p>
  3048. </dd>
  3049. <dt><code>-fpeel-loops</code></dt>
  3050. <dd><a name="index-fpeel_002dloops"></a>
  3051. <p>Peels loops for which there is enough information that they do not
  3052. roll much (from profile feedback or static analysis). It also turns on
  3053. complete loop peeling (i.e. complete removal of loops with small constant
  3054. number of iterations).
  3055. </p>
  3056. <p>Enabled by <samp>-O3</samp>, <samp>-fprofile-use</samp>, and <samp>-fauto-profile</samp>.
  3057. </p>
  3058. </dd>
  3059. <dt><code>-fmove-loop-invariants</code></dt>
  3060. <dd><a name="index-fmove_002dloop_002dinvariants"></a>
  3061. <p>Enables the loop invariant motion pass in the RTL loop optimizer. Enabled
  3062. at level <samp>-O1</samp> and higher, except for <samp>-Og</samp>.
  3063. </p>
  3064. </dd>
  3065. <dt><code>-fsplit-loops</code></dt>
  3066. <dd><a name="index-fsplit_002dloops"></a>
  3067. <p>Split a loop into two if it contains a condition that&rsquo;s always true
  3068. for one side of the iteration space and false for the other.
  3069. </p>
  3070. <p>Enabled by <samp>-fprofile-use</samp> and <samp>-fauto-profile</samp>.
  3071. </p>
  3072. </dd>
  3073. <dt><code>-funswitch-loops</code></dt>
  3074. <dd><a name="index-funswitch_002dloops"></a>
  3075. <p>Move branches with loop invariant conditions out of the loop, with duplicates
  3076. of the loop on both branches (modified according to result of the condition).
  3077. </p>
  3078. <p>Enabled by <samp>-fprofile-use</samp> and <samp>-fauto-profile</samp>.
  3079. </p>
  3080. </dd>
  3081. <dt><code>-fversion-loops-for-strides</code></dt>
  3082. <dd><a name="index-fversion_002dloops_002dfor_002dstrides"></a>
  3083. <p>If a loop iterates over an array with a variable stride, create another
  3084. version of the loop that assumes the stride is always one. For example:
  3085. </p>
  3086. <div class="smallexample">
  3087. <pre class="smallexample">for (int i = 0; i &lt; n; ++i)
  3088. x[i * stride] = &hellip;;
  3089. </pre></div>
  3090. <p>becomes:
  3091. </p>
  3092. <div class="smallexample">
  3093. <pre class="smallexample">if (stride == 1)
  3094. for (int i = 0; i &lt; n; ++i)
  3095. x[i] = &hellip;;
  3096. else
  3097. for (int i = 0; i &lt; n; ++i)
  3098. x[i * stride] = &hellip;;
  3099. </pre></div>
  3100. <p>This is particularly useful for assumed-shape arrays in Fortran where
  3101. (for example) it allows better vectorization assuming contiguous accesses.
  3102. This flag is enabled by default at <samp>-O3</samp>.
  3103. It is also enabled by <samp>-fprofile-use</samp> and <samp>-fauto-profile</samp>.
  3104. </p>
  3105. </dd>
  3106. <dt><code>-ffunction-sections</code></dt>
  3107. <dt><code>-fdata-sections</code></dt>
  3108. <dd><a name="index-ffunction_002dsections"></a>
  3109. <a name="index-fdata_002dsections"></a>
  3110. <p>Place each function or data item into its own section in the output
  3111. file if the target supports arbitrary sections. The name of the
  3112. function or the name of the data item determines the section&rsquo;s name
  3113. in the output file.
  3114. </p>
  3115. <p>Use these options on systems where the linker can perform optimizations to
  3116. improve locality of reference in the instruction space. Most systems using the
  3117. ELF object format have linkers with such optimizations. On AIX, the linker
  3118. rearranges sections (CSECTs) based on the call graph. The performance impact
  3119. varies.
  3120. </p>
  3121. <p>Together with a linker garbage collection (linker <samp>--gc-sections</samp>
  3122. option) these options may lead to smaller statically-linked executables (after
  3123. stripping).
  3124. </p>
  3125. <p>On ELF/DWARF systems these options do not degenerate the quality of the debug
  3126. information. There could be issues with other object files/debug info formats.
  3127. </p>
  3128. <p>Only use these options when there are significant benefits from doing so. When
  3129. you specify these options, the assembler and linker create larger object and
  3130. executable files and are also slower. These options affect code generation.
  3131. They prevent optimizations by the compiler and assembler using relative
  3132. locations inside a translation unit since the locations are unknown until
  3133. link time. An example of such an optimization is relaxing calls to short call
  3134. instructions.
  3135. </p>
  3136. </dd>
  3137. <dt><code>-fstdarg-opt</code></dt>
  3138. <dd><a name="index-fstdarg_002dopt"></a>
  3139. <p>Optimize the prologue of variadic argument functions with respect to usage of
  3140. those arguments.
  3141. </p>
  3142. </dd>
  3143. <dt><code>-fsection-anchors</code></dt>
  3144. <dd><a name="index-fsection_002danchors"></a>
  3145. <p>Try to reduce the number of symbolic address calculations by using
  3146. shared &ldquo;anchor&rdquo; symbols to address nearby objects. This transformation
  3147. can help to reduce the number of GOT entries and GOT accesses on some
  3148. targets.
  3149. </p>
  3150. <p>For example, the implementation of the following function <code>foo</code>:
  3151. </p>
  3152. <div class="smallexample">
  3153. <pre class="smallexample">static int a, b, c;
  3154. int foo (void) { return a + b + c; }
  3155. </pre></div>
  3156. <p>usually calculates the addresses of all three variables, but if you
  3157. compile it with <samp>-fsection-anchors</samp>, it accesses the variables
  3158. from a common anchor point instead. The effect is similar to the
  3159. following pseudocode (which isn&rsquo;t valid C):
  3160. </p>
  3161. <div class="smallexample">
  3162. <pre class="smallexample">int foo (void)
  3163. {
  3164. register int *xr = &amp;x;
  3165. return xr[&amp;a - &amp;x] + xr[&amp;b - &amp;x] + xr[&amp;c - &amp;x];
  3166. }
  3167. </pre></div>
  3168. <p>Not all targets support this option.
  3169. </p>
  3170. </dd>
  3171. <dt><code>--param <var>name</var>=<var>value</var></code></dt>
  3172. <dd><a name="index-param"></a>
  3173. <p>In some places, GCC uses various constants to control the amount of
  3174. optimization that is done. For example, GCC does not inline functions
  3175. that contain more than a certain number of instructions. You can
  3176. control some of these constants on the command line using the
  3177. <samp>--param</samp> option.
  3178. </p>
  3179. <p>The names of specific parameters, and the meaning of the values, are
  3180. tied to the internals of the compiler, and are subject to change
  3181. without notice in future releases.
  3182. </p>
  3183. <p>In order to get minimal, maximal and default value of a parameter,
  3184. one can use <samp>--help=param -Q</samp> options.
  3185. </p>
  3186. <p>In each case, the <var>value</var> is an integer. The following choices
  3187. of <var>name</var> are recognized for all targets:
  3188. </p>
  3189. <dl compact="compact">
  3190. <dt><code>predictable-branch-outcome</code></dt>
  3191. <dd><p>When branch is predicted to be taken with probability lower than this threshold
  3192. (in percent), then it is considered well predictable.
  3193. </p>
  3194. </dd>
  3195. <dt><code>max-rtl-if-conversion-insns</code></dt>
  3196. <dd><p>RTL if-conversion tries to remove conditional branches around a block and
  3197. replace them with conditionally executed instructions. This parameter
  3198. gives the maximum number of instructions in a block which should be
  3199. considered for if-conversion. The compiler will
  3200. also use other heuristics to decide whether if-conversion is likely to be
  3201. profitable.
  3202. </p>
  3203. </dd>
  3204. <dt><code>max-rtl-if-conversion-predictable-cost</code></dt>
  3205. <dt><code>max-rtl-if-conversion-unpredictable-cost</code></dt>
  3206. <dd><p>RTL if-conversion will try to remove conditional branches around a block
  3207. and replace them with conditionally executed instructions. These parameters
  3208. give the maximum permissible cost for the sequence that would be generated
  3209. by if-conversion depending on whether the branch is statically determined
  3210. to be predictable or not. The units for this parameter are the same as
  3211. those for the GCC internal seq_cost metric. The compiler will try to
  3212. provide a reasonable default for this parameter using the BRANCH_COST
  3213. target macro.
  3214. </p>
  3215. </dd>
  3216. <dt><code>max-crossjump-edges</code></dt>
  3217. <dd><p>The maximum number of incoming edges to consider for cross-jumping.
  3218. The algorithm used by <samp>-fcrossjumping</samp> is <em>O(N^2)</em> in
  3219. the number of edges incoming to each block. Increasing values mean
  3220. more aggressive optimization, making the compilation time increase with
  3221. probably small improvement in executable size.
  3222. </p>
  3223. </dd>
  3224. <dt><code>min-crossjump-insns</code></dt>
  3225. <dd><p>The minimum number of instructions that must be matched at the end
  3226. of two blocks before cross-jumping is performed on them. This
  3227. value is ignored in the case where all instructions in the block being
  3228. cross-jumped from are matched.
  3229. </p>
  3230. </dd>
  3231. <dt><code>max-grow-copy-bb-insns</code></dt>
  3232. <dd><p>The maximum code size expansion factor when copying basic blocks
  3233. instead of jumping. The expansion is relative to a jump instruction.
  3234. </p>
  3235. </dd>
  3236. <dt><code>max-goto-duplication-insns</code></dt>
  3237. <dd><p>The maximum number of instructions to duplicate to a block that jumps
  3238. to a computed goto. To avoid <em>O(N^2)</em> behavior in a number of
  3239. passes, GCC factors computed gotos early in the compilation process,
  3240. and unfactors them as late as possible. Only computed jumps at the
  3241. end of a basic blocks with no more than max-goto-duplication-insns are
  3242. unfactored.
  3243. </p>
  3244. </dd>
  3245. <dt><code>max-delay-slot-insn-search</code></dt>
  3246. <dd><p>The maximum number of instructions to consider when looking for an
  3247. instruction to fill a delay slot. If more than this arbitrary number of
  3248. instructions are searched, the time savings from filling the delay slot
  3249. are minimal, so stop searching. Increasing values mean more
  3250. aggressive optimization, making the compilation time increase with probably
  3251. small improvement in execution time.
  3252. </p>
  3253. </dd>
  3254. <dt><code>max-delay-slot-live-search</code></dt>
  3255. <dd><p>When trying to fill delay slots, the maximum number of instructions to
  3256. consider when searching for a block with valid live register
  3257. information. Increasing this arbitrarily chosen value means more
  3258. aggressive optimization, increasing the compilation time. This parameter
  3259. should be removed when the delay slot code is rewritten to maintain the
  3260. control-flow graph.
  3261. </p>
  3262. </dd>
  3263. <dt><code>max-gcse-memory</code></dt>
  3264. <dd><p>The approximate maximum amount of memory that can be allocated in
  3265. order to perform the global common subexpression elimination
  3266. optimization. If more memory than specified is required, the
  3267. optimization is not done.
  3268. </p>
  3269. </dd>
  3270. <dt><code>max-gcse-insertion-ratio</code></dt>
  3271. <dd><p>If the ratio of expression insertions to deletions is larger than this value
  3272. for any expression, then RTL PRE inserts or removes the expression and thus
  3273. leaves partially redundant computations in the instruction stream.
  3274. </p>
  3275. </dd>
  3276. <dt><code>max-pending-list-length</code></dt>
  3277. <dd><p>The maximum number of pending dependencies scheduling allows
  3278. before flushing the current state and starting over. Large functions
  3279. with few branches or calls can create excessively large lists which
  3280. needlessly consume memory and resources.
  3281. </p>
  3282. </dd>
  3283. <dt><code>max-modulo-backtrack-attempts</code></dt>
  3284. <dd><p>The maximum number of backtrack attempts the scheduler should make
  3285. when modulo scheduling a loop. Larger values can exponentially increase
  3286. compilation time.
  3287. </p>
  3288. </dd>
  3289. <dt><code>max-inline-insns-single</code></dt>
  3290. <dd><p>Several parameters control the tree inliner used in GCC. This number sets the
  3291. maximum number of instructions (counted in GCC&rsquo;s internal representation) in a
  3292. single function that the tree inliner considers for inlining. This only
  3293. affects functions declared inline and methods implemented in a class
  3294. declaration (C++).
  3295. </p>
  3296. </dd>
  3297. <dt><code>max-inline-insns-auto</code></dt>
  3298. <dd><p>When you use <samp>-finline-functions</samp> (included in <samp>-O3</samp>),
  3299. a lot of functions that would otherwise not be considered for inlining
  3300. by the compiler are investigated. To those functions, a different
  3301. (more restrictive) limit compared to functions declared inline can
  3302. be applied (<samp>--param max-inline-insns-auto</samp>).
  3303. </p>
  3304. </dd>
  3305. <dt><code>max-inline-insns-small</code></dt>
  3306. <dd><p>This is bound applied to calls which are considered relevant with
  3307. <samp>-finline-small-functions</samp>.
  3308. </p>
  3309. </dd>
  3310. <dt><code>max-inline-insns-size</code></dt>
  3311. <dd><p>This is bound applied to calls which are optimized for size. Small growth
  3312. may be desirable to anticipate optimization oppurtunities exposed by inlining.
  3313. </p>
  3314. </dd>
  3315. <dt><code>uninlined-function-insns</code></dt>
  3316. <dd><p>Number of instructions accounted by inliner for function overhead such as
  3317. function prologue and epilogue.
  3318. </p>
  3319. </dd>
  3320. <dt><code>uninlined-function-time</code></dt>
  3321. <dd><p>Extra time accounted by inliner for function overhead such as time needed to
  3322. execute function prologue and epilogue
  3323. </p>
  3324. </dd>
  3325. <dt><code>inline-heuristics-hint-percent</code></dt>
  3326. <dd><p>The scale (in percents) applied to <samp>inline-insns-single</samp>,
  3327. <samp>inline-insns-single-O2</samp>, <samp>inline-insns-auto</samp>
  3328. when inline heuristics hints that inlining is
  3329. very profitable (will enable later optimizations).
  3330. </p>
  3331. </dd>
  3332. <dt><code>uninlined-thunk-insns</code></dt>
  3333. <dt><code>uninlined-thunk-time</code></dt>
  3334. <dd><p>Same as <samp>--param uninlined-function-insns</samp> and
  3335. <samp>--param uninlined-function-time</samp> but applied to function thunks
  3336. </p>
  3337. </dd>
  3338. <dt><code>inline-min-speedup</code></dt>
  3339. <dd><p>When estimated performance improvement of caller + callee runtime exceeds this
  3340. threshold (in percent), the function can be inlined regardless of the limit on
  3341. <samp>--param max-inline-insns-single</samp> and <samp>--param
  3342. max-inline-insns-auto</samp>.
  3343. </p>
  3344. </dd>
  3345. <dt><code>large-function-insns</code></dt>
  3346. <dd><p>The limit specifying really large functions. For functions larger than this
  3347. limit after inlining, inlining is constrained by
  3348. <samp>--param large-function-growth</samp>. This parameter is useful primarily
  3349. to avoid extreme compilation time caused by non-linear algorithms used by the
  3350. back end.
  3351. </p>
  3352. </dd>
  3353. <dt><code>large-function-growth</code></dt>
  3354. <dd><p>Specifies maximal growth of large function caused by inlining in percents.
  3355. For example, parameter value 100 limits large function growth to 2.0 times
  3356. the original size.
  3357. </p>
  3358. </dd>
  3359. <dt><code>large-unit-insns</code></dt>
  3360. <dd><p>The limit specifying large translation unit. Growth caused by inlining of
  3361. units larger than this limit is limited by <samp>--param inline-unit-growth</samp>.
  3362. For small units this might be too tight.
  3363. For example, consider a unit consisting of function A
  3364. that is inline and B that just calls A three times. If B is small relative to
  3365. A, the growth of unit is 300\% and yet such inlining is very sane. For very
  3366. large units consisting of small inlineable functions, however, the overall unit
  3367. growth limit is needed to avoid exponential explosion of code size. Thus for
  3368. smaller units, the size is increased to <samp>--param large-unit-insns</samp>
  3369. before applying <samp>--param inline-unit-growth</samp>.
  3370. </p>
  3371. </dd>
  3372. <dt><code>inline-unit-growth</code></dt>
  3373. <dd><p>Specifies maximal overall growth of the compilation unit caused by inlining.
  3374. For example, parameter value 20 limits unit growth to 1.2 times the original
  3375. size. Cold functions (either marked cold via an attribute or by profile
  3376. feedback) are not accounted into the unit size.
  3377. </p>
  3378. </dd>
  3379. <dt><code>ipa-cp-unit-growth</code></dt>
  3380. <dd><p>Specifies maximal overall growth of the compilation unit caused by
  3381. interprocedural constant propagation. For example, parameter value 10 limits
  3382. unit growth to 1.1 times the original size.
  3383. </p>
  3384. </dd>
  3385. <dt><code>large-stack-frame</code></dt>
  3386. <dd><p>The limit specifying large stack frames. While inlining the algorithm is trying
  3387. to not grow past this limit too much.
  3388. </p>
  3389. </dd>
  3390. <dt><code>large-stack-frame-growth</code></dt>
  3391. <dd><p>Specifies maximal growth of large stack frames caused by inlining in percents.
  3392. For example, parameter value 1000 limits large stack frame growth to 11 times
  3393. the original size.
  3394. </p>
  3395. </dd>
  3396. <dt><code>max-inline-insns-recursive</code></dt>
  3397. <dt><code>max-inline-insns-recursive-auto</code></dt>
  3398. <dd><p>Specifies the maximum number of instructions an out-of-line copy of a
  3399. self-recursive inline
  3400. function can grow into by performing recursive inlining.
  3401. </p>
  3402. <p><samp>--param max-inline-insns-recursive</samp> applies to functions
  3403. declared inline.
  3404. For functions not declared inline, recursive inlining
  3405. happens only when <samp>-finline-functions</samp> (included in <samp>-O3</samp>) is
  3406. enabled; <samp>--param max-inline-insns-recursive-auto</samp> applies instead.
  3407. </p>
  3408. </dd>
  3409. <dt><code>max-inline-recursive-depth</code></dt>
  3410. <dt><code>max-inline-recursive-depth-auto</code></dt>
  3411. <dd><p>Specifies the maximum recursion depth used for recursive inlining.
  3412. </p>
  3413. <p><samp>--param max-inline-recursive-depth</samp> applies to functions
  3414. declared inline. For functions not declared inline, recursive inlining
  3415. happens only when <samp>-finline-functions</samp> (included in <samp>-O3</samp>) is
  3416. enabled; <samp>--param max-inline-recursive-depth-auto</samp> applies instead.
  3417. </p>
  3418. </dd>
  3419. <dt><code>min-inline-recursive-probability</code></dt>
  3420. <dd><p>Recursive inlining is profitable only for function having deep recursion
  3421. in average and can hurt for function having little recursion depth by
  3422. increasing the prologue size or complexity of function body to other
  3423. optimizers.
  3424. </p>
  3425. <p>When profile feedback is available (see <samp>-fprofile-generate</samp>) the actual
  3426. recursion depth can be guessed from the probability that function recurses
  3427. via a given call expression. This parameter limits inlining only to call
  3428. expressions whose probability exceeds the given threshold (in percents).
  3429. </p>
  3430. </dd>
  3431. <dt><code>early-inlining-insns</code></dt>
  3432. <dd><p>Specify growth that the early inliner can make. In effect it increases
  3433. the amount of inlining for code having a large abstraction penalty.
  3434. </p>
  3435. </dd>
  3436. <dt><code>max-early-inliner-iterations</code></dt>
  3437. <dd><p>Limit of iterations of the early inliner. This basically bounds
  3438. the number of nested indirect calls the early inliner can resolve.
  3439. Deeper chains are still handled by late inlining.
  3440. </p>
  3441. </dd>
  3442. <dt><code>comdat-sharing-probability</code></dt>
  3443. <dd><p>Probability (in percent) that C++ inline function with comdat visibility
  3444. are shared across multiple compilation units.
  3445. </p>
  3446. </dd>
  3447. <dt><code>profile-func-internal-id</code></dt>
  3448. <dd><p>A parameter to control whether to use function internal id in profile
  3449. database lookup. If the value is 0, the compiler uses an id that
  3450. is based on function assembler name and filename, which makes old profile
  3451. data more tolerant to source changes such as function reordering etc.
  3452. </p>
  3453. </dd>
  3454. <dt><code>min-vect-loop-bound</code></dt>
  3455. <dd><p>The minimum number of iterations under which loops are not vectorized
  3456. when <samp>-ftree-vectorize</samp> is used. The number of iterations after
  3457. vectorization needs to be greater than the value specified by this option
  3458. to allow vectorization.
  3459. </p>
  3460. </dd>
  3461. <dt><code>gcse-cost-distance-ratio</code></dt>
  3462. <dd><p>Scaling factor in calculation of maximum distance an expression
  3463. can be moved by GCSE optimizations. This is currently supported only in the
  3464. code hoisting pass. The bigger the ratio, the more aggressive code hoisting
  3465. is with simple expressions, i.e., the expressions that have cost
  3466. less than <samp>gcse-unrestricted-cost</samp>. Specifying 0 disables
  3467. hoisting of simple expressions.
  3468. </p>
  3469. </dd>
  3470. <dt><code>gcse-unrestricted-cost</code></dt>
  3471. <dd><p>Cost, roughly measured as the cost of a single typical machine
  3472. instruction, at which GCSE optimizations do not constrain
  3473. the distance an expression can travel. This is currently
  3474. supported only in the code hoisting pass. The lesser the cost,
  3475. the more aggressive code hoisting is. Specifying 0
  3476. allows all expressions to travel unrestricted distances.
  3477. </p>
  3478. </dd>
  3479. <dt><code>max-hoist-depth</code></dt>
  3480. <dd><p>The depth of search in the dominator tree for expressions to hoist.
  3481. This is used to avoid quadratic behavior in hoisting algorithm.
  3482. The value of 0 does not limit on the search, but may slow down compilation
  3483. of huge functions.
  3484. </p>
  3485. </dd>
  3486. <dt><code>max-tail-merge-comparisons</code></dt>
  3487. <dd><p>The maximum amount of similar bbs to compare a bb with. This is used to
  3488. avoid quadratic behavior in tree tail merging.
  3489. </p>
  3490. </dd>
  3491. <dt><code>max-tail-merge-iterations</code></dt>
  3492. <dd><p>The maximum amount of iterations of the pass over the function. This is used to
  3493. limit compilation time in tree tail merging.
  3494. </p>
  3495. </dd>
  3496. <dt><code>store-merging-allow-unaligned</code></dt>
  3497. <dd><p>Allow the store merging pass to introduce unaligned stores if it is legal to
  3498. do so.
  3499. </p>
  3500. </dd>
  3501. <dt><code>max-stores-to-merge</code></dt>
  3502. <dd><p>The maximum number of stores to attempt to merge into wider stores in the store
  3503. merging pass.
  3504. </p>
  3505. </dd>
  3506. <dt><code>max-unrolled-insns</code></dt>
  3507. <dd><p>The maximum number of instructions that a loop may have to be unrolled.
  3508. If a loop is unrolled, this parameter also determines how many times
  3509. the loop code is unrolled.
  3510. </p>
  3511. </dd>
  3512. <dt><code>max-average-unrolled-insns</code></dt>
  3513. <dd><p>The maximum number of instructions biased by probabilities of their execution
  3514. that a loop may have to be unrolled. If a loop is unrolled,
  3515. this parameter also determines how many times the loop code is unrolled.
  3516. </p>
  3517. </dd>
  3518. <dt><code>max-unroll-times</code></dt>
  3519. <dd><p>The maximum number of unrollings of a single loop.
  3520. </p>
  3521. </dd>
  3522. <dt><code>max-peeled-insns</code></dt>
  3523. <dd><p>The maximum number of instructions that a loop may have to be peeled.
  3524. If a loop is peeled, this parameter also determines how many times
  3525. the loop code is peeled.
  3526. </p>
  3527. </dd>
  3528. <dt><code>max-peel-times</code></dt>
  3529. <dd><p>The maximum number of peelings of a single loop.
  3530. </p>
  3531. </dd>
  3532. <dt><code>max-peel-branches</code></dt>
  3533. <dd><p>The maximum number of branches on the hot path through the peeled sequence.
  3534. </p>
  3535. </dd>
  3536. <dt><code>max-completely-peeled-insns</code></dt>
  3537. <dd><p>The maximum number of insns of a completely peeled loop.
  3538. </p>
  3539. </dd>
  3540. <dt><code>max-completely-peel-times</code></dt>
  3541. <dd><p>The maximum number of iterations of a loop to be suitable for complete peeling.
  3542. </p>
  3543. </dd>
  3544. <dt><code>max-completely-peel-loop-nest-depth</code></dt>
  3545. <dd><p>The maximum depth of a loop nest suitable for complete peeling.
  3546. </p>
  3547. </dd>
  3548. <dt><code>max-unswitch-insns</code></dt>
  3549. <dd><p>The maximum number of insns of an unswitched loop.
  3550. </p>
  3551. </dd>
  3552. <dt><code>max-unswitch-level</code></dt>
  3553. <dd><p>The maximum number of branches unswitched in a single loop.
  3554. </p>
  3555. </dd>
  3556. <dt><code>lim-expensive</code></dt>
  3557. <dd><p>The minimum cost of an expensive expression in the loop invariant motion.
  3558. </p>
  3559. </dd>
  3560. <dt><code>min-loop-cond-split-prob</code></dt>
  3561. <dd><p>When FDO profile information is available, <samp>min-loop-cond-split-prob</samp>
  3562. specifies minimum threshold for probability of semi-invariant condition
  3563. statement to trigger loop split.
  3564. </p>
  3565. </dd>
  3566. <dt><code>iv-consider-all-candidates-bound</code></dt>
  3567. <dd><p>Bound on number of candidates for induction variables, below which
  3568. all candidates are considered for each use in induction variable
  3569. optimizations. If there are more candidates than this,
  3570. only the most relevant ones are considered to avoid quadratic time complexity.
  3571. </p>
  3572. </dd>
  3573. <dt><code>iv-max-considered-uses</code></dt>
  3574. <dd><p>The induction variable optimizations give up on loops that contain more
  3575. induction variable uses.
  3576. </p>
  3577. </dd>
  3578. <dt><code>iv-always-prune-cand-set-bound</code></dt>
  3579. <dd><p>If the number of candidates in the set is smaller than this value,
  3580. always try to remove unnecessary ivs from the set
  3581. when adding a new one.
  3582. </p>
  3583. </dd>
  3584. <dt><code>avg-loop-niter</code></dt>
  3585. <dd><p>Average number of iterations of a loop.
  3586. </p>
  3587. </dd>
  3588. <dt><code>dse-max-object-size</code></dt>
  3589. <dd><p>Maximum size (in bytes) of objects tracked bytewise by dead store elimination.
  3590. Larger values may result in larger compilation times.
  3591. </p>
  3592. </dd>
  3593. <dt><code>dse-max-alias-queries-per-store</code></dt>
  3594. <dd><p>Maximum number of queries into the alias oracle per store.
  3595. Larger values result in larger compilation times and may result in more
  3596. removed dead stores.
  3597. </p>
  3598. </dd>
  3599. <dt><code>scev-max-expr-size</code></dt>
  3600. <dd><p>Bound on size of expressions used in the scalar evolutions analyzer.
  3601. Large expressions slow the analyzer.
  3602. </p>
  3603. </dd>
  3604. <dt><code>scev-max-expr-complexity</code></dt>
  3605. <dd><p>Bound on the complexity of the expressions in the scalar evolutions analyzer.
  3606. Complex expressions slow the analyzer.
  3607. </p>
  3608. </dd>
  3609. <dt><code>max-tree-if-conversion-phi-args</code></dt>
  3610. <dd><p>Maximum number of arguments in a PHI supported by TREE if conversion
  3611. unless the loop is marked with simd pragma.
  3612. </p>
  3613. </dd>
  3614. <dt><code>vect-max-version-for-alignment-checks</code></dt>
  3615. <dd><p>The maximum number of run-time checks that can be performed when
  3616. doing loop versioning for alignment in the vectorizer.
  3617. </p>
  3618. </dd>
  3619. <dt><code>vect-max-version-for-alias-checks</code></dt>
  3620. <dd><p>The maximum number of run-time checks that can be performed when
  3621. doing loop versioning for alias in the vectorizer.
  3622. </p>
  3623. </dd>
  3624. <dt><code>vect-max-peeling-for-alignment</code></dt>
  3625. <dd><p>The maximum number of loop peels to enhance access alignment
  3626. for vectorizer. Value -1 means no limit.
  3627. </p>
  3628. </dd>
  3629. <dt><code>max-iterations-to-track</code></dt>
  3630. <dd><p>The maximum number of iterations of a loop the brute-force algorithm
  3631. for analysis of the number of iterations of the loop tries to evaluate.
  3632. </p>
  3633. </dd>
  3634. <dt><code>hot-bb-count-fraction</code></dt>
  3635. <dd><p>The denominator n of fraction 1/n of the maximal execution count of a
  3636. basic block in the entire program that a basic block needs to at least
  3637. have in order to be considered hot. The default is 10000, which means
  3638. that a basic block is considered hot if its execution count is greater
  3639. than 1/10000 of the maximal execution count. 0 means that it is never
  3640. considered hot. Used in non-LTO mode.
  3641. </p>
  3642. </dd>
  3643. <dt><code>hot-bb-count-ws-permille</code></dt>
  3644. <dd><p>The number of most executed permilles, ranging from 0 to 1000, of the
  3645. profiled execution of the entire program to which the execution count
  3646. of a basic block must be part of in order to be considered hot. The
  3647. default is 990, which means that a basic block is considered hot if
  3648. its execution count contributes to the upper 990 permilles, or 99.0%,
  3649. of the profiled execution of the entire program. 0 means that it is
  3650. never considered hot. Used in LTO mode.
  3651. </p>
  3652. </dd>
  3653. <dt><code>hot-bb-frequency-fraction</code></dt>
  3654. <dd><p>The denominator n of fraction 1/n of the execution frequency of the
  3655. entry block of a function that a basic block of this function needs
  3656. to at least have in order to be considered hot. The default is 1000,
  3657. which means that a basic block is considered hot in a function if it
  3658. is executed more frequently than 1/1000 of the frequency of the entry
  3659. block of the function. 0 means that it is never considered hot.
  3660. </p>
  3661. </dd>
  3662. <dt><code>unlikely-bb-count-fraction</code></dt>
  3663. <dd><p>The denominator n of fraction 1/n of the number of profiled runs of
  3664. the entire program below which the execution count of a basic block
  3665. must be in order for the basic block to be considered unlikely executed.
  3666. The default is 20, which means that a basic block is considered unlikely
  3667. executed if it is executed in fewer than 1/20, or 5%, of the runs of
  3668. the program. 0 means that it is always considered unlikely executed.
  3669. </p>
  3670. </dd>
  3671. <dt><code>max-predicted-iterations</code></dt>
  3672. <dd><p>The maximum number of loop iterations we predict statically. This is useful
  3673. in cases where a function contains a single loop with known bound and
  3674. another loop with unknown bound.
  3675. The known number of iterations is predicted correctly, while
  3676. the unknown number of iterations average to roughly 10. This means that the
  3677. loop without bounds appears artificially cold relative to the other one.
  3678. </p>
  3679. </dd>
  3680. <dt><code>builtin-expect-probability</code></dt>
  3681. <dd><p>Control the probability of the expression having the specified value. This
  3682. parameter takes a percentage (i.e. 0 ... 100) as input.
  3683. </p>
  3684. </dd>
  3685. <dt><code>builtin-string-cmp-inline-length</code></dt>
  3686. <dd><p>The maximum length of a constant string for a builtin string cmp call
  3687. eligible for inlining.
  3688. </p>
  3689. </dd>
  3690. <dt><code>align-threshold</code></dt>
  3691. <dd>
  3692. <p>Select fraction of the maximal frequency of executions of a basic block in
  3693. a function to align the basic block.
  3694. </p>
  3695. </dd>
  3696. <dt><code>align-loop-iterations</code></dt>
  3697. <dd>
  3698. <p>A loop expected to iterate at least the selected number of iterations is
  3699. aligned.
  3700. </p>
  3701. </dd>
  3702. <dt><code>tracer-dynamic-coverage</code></dt>
  3703. <dt><code>tracer-dynamic-coverage-feedback</code></dt>
  3704. <dd>
  3705. <p>This value is used to limit superblock formation once the given percentage of
  3706. executed instructions is covered. This limits unnecessary code size
  3707. expansion.
  3708. </p>
  3709. <p>The <samp>tracer-dynamic-coverage-feedback</samp> parameter
  3710. is used only when profile
  3711. feedback is available. The real profiles (as opposed to statically estimated
  3712. ones) are much less balanced allowing the threshold to be larger value.
  3713. </p>
  3714. </dd>
  3715. <dt><code>tracer-max-code-growth</code></dt>
  3716. <dd><p>Stop tail duplication once code growth has reached given percentage. This is
  3717. a rather artificial limit, as most of the duplicates are eliminated later in
  3718. cross jumping, so it may be set to much higher values than is the desired code
  3719. growth.
  3720. </p>
  3721. </dd>
  3722. <dt><code>tracer-min-branch-ratio</code></dt>
  3723. <dd>
  3724. <p>Stop reverse growth when the reverse probability of best edge is less than this
  3725. threshold (in percent).
  3726. </p>
  3727. </dd>
  3728. <dt><code>tracer-min-branch-probability</code></dt>
  3729. <dt><code>tracer-min-branch-probability-feedback</code></dt>
  3730. <dd>
  3731. <p>Stop forward growth if the best edge has probability lower than this
  3732. threshold.
  3733. </p>
  3734. <p>Similarly to <samp>tracer-dynamic-coverage</samp> two parameters are
  3735. provided. <samp>tracer-min-branch-probability-feedback</samp> is used for
  3736. compilation with profile feedback and <samp>tracer-min-branch-probability</samp>
  3737. compilation without. The value for compilation with profile feedback
  3738. needs to be more conservative (higher) in order to make tracer
  3739. effective.
  3740. </p>
  3741. </dd>
  3742. <dt><code>stack-clash-protection-guard-size</code></dt>
  3743. <dd><p>Specify the size of the operating system provided stack guard as
  3744. 2 raised to <var>num</var> bytes. Higher values may reduce the
  3745. number of explicit probes, but a value larger than the operating system
  3746. provided guard will leave code vulnerable to stack clash style attacks.
  3747. </p>
  3748. </dd>
  3749. <dt><code>stack-clash-protection-probe-interval</code></dt>
  3750. <dd><p>Stack clash protection involves probing stack space as it is allocated. This
  3751. param controls the maximum distance between probes into the stack as 2 raised
  3752. to <var>num</var> bytes. Higher values may reduce the number of explicit probes, but a value
  3753. larger than the operating system provided guard will leave code vulnerable to
  3754. stack clash style attacks.
  3755. </p>
  3756. </dd>
  3757. <dt><code>max-cse-path-length</code></dt>
  3758. <dd>
  3759. <p>The maximum number of basic blocks on path that CSE considers.
  3760. </p>
  3761. </dd>
  3762. <dt><code>max-cse-insns</code></dt>
  3763. <dd><p>The maximum number of instructions CSE processes before flushing.
  3764. </p>
  3765. </dd>
  3766. <dt><code>ggc-min-expand</code></dt>
  3767. <dd>
  3768. <p>GCC uses a garbage collector to manage its own memory allocation. This
  3769. parameter specifies the minimum percentage by which the garbage
  3770. collector&rsquo;s heap should be allowed to expand between collections.
  3771. Tuning this may improve compilation speed; it has no effect on code
  3772. generation.
  3773. </p>
  3774. <p>The default is 30% + 70% * (RAM/1GB) with an upper bound of 100% when
  3775. RAM &gt;= 1GB. If <code>getrlimit</code> is available, the notion of &ldquo;RAM&rdquo; is
  3776. the smallest of actual RAM and <code>RLIMIT_DATA</code> or <code>RLIMIT_AS</code>. If
  3777. GCC is not able to calculate RAM on a particular platform, the lower
  3778. bound of 30% is used. Setting this parameter and
  3779. <samp>ggc-min-heapsize</samp> to zero causes a full collection to occur at
  3780. every opportunity. This is extremely slow, but can be useful for
  3781. debugging.
  3782. </p>
  3783. </dd>
  3784. <dt><code>ggc-min-heapsize</code></dt>
  3785. <dd>
  3786. <p>Minimum size of the garbage collector&rsquo;s heap before it begins bothering
  3787. to collect garbage. The first collection occurs after the heap expands
  3788. by <samp>ggc-min-expand</samp>% beyond <samp>ggc-min-heapsize</samp>. Again,
  3789. tuning this may improve compilation speed, and has no effect on code
  3790. generation.
  3791. </p>
  3792. <p>The default is the smaller of RAM/8, RLIMIT_RSS, or a limit that
  3793. tries to ensure that RLIMIT_DATA or RLIMIT_AS are not exceeded, but
  3794. with a lower bound of 4096 (four megabytes) and an upper bound of
  3795. 131072 (128 megabytes). If GCC is not able to calculate RAM on a
  3796. particular platform, the lower bound is used. Setting this parameter
  3797. very large effectively disables garbage collection. Setting this
  3798. parameter and <samp>ggc-min-expand</samp> to zero causes a full collection
  3799. to occur at every opportunity.
  3800. </p>
  3801. </dd>
  3802. <dt><code>max-reload-search-insns</code></dt>
  3803. <dd><p>The maximum number of instruction reload should look backward for equivalent
  3804. register. Increasing values mean more aggressive optimization, making the
  3805. compilation time increase with probably slightly better performance.
  3806. </p>
  3807. </dd>
  3808. <dt><code>max-cselib-memory-locations</code></dt>
  3809. <dd><p>The maximum number of memory locations cselib should take into account.
  3810. Increasing values mean more aggressive optimization, making the compilation time
  3811. increase with probably slightly better performance.
  3812. </p>
  3813. </dd>
  3814. <dt><code>max-sched-ready-insns</code></dt>
  3815. <dd><p>The maximum number of instructions ready to be issued the scheduler should
  3816. consider at any given time during the first scheduling pass. Increasing
  3817. values mean more thorough searches, making the compilation time increase
  3818. with probably little benefit.
  3819. </p>
  3820. </dd>
  3821. <dt><code>max-sched-region-blocks</code></dt>
  3822. <dd><p>The maximum number of blocks in a region to be considered for
  3823. interblock scheduling.
  3824. </p>
  3825. </dd>
  3826. <dt><code>max-pipeline-region-blocks</code></dt>
  3827. <dd><p>The maximum number of blocks in a region to be considered for
  3828. pipelining in the selective scheduler.
  3829. </p>
  3830. </dd>
  3831. <dt><code>max-sched-region-insns</code></dt>
  3832. <dd><p>The maximum number of insns in a region to be considered for
  3833. interblock scheduling.
  3834. </p>
  3835. </dd>
  3836. <dt><code>max-pipeline-region-insns</code></dt>
  3837. <dd><p>The maximum number of insns in a region to be considered for
  3838. pipelining in the selective scheduler.
  3839. </p>
  3840. </dd>
  3841. <dt><code>min-spec-prob</code></dt>
  3842. <dd><p>The minimum probability (in percents) of reaching a source block
  3843. for interblock speculative scheduling.
  3844. </p>
  3845. </dd>
  3846. <dt><code>max-sched-extend-regions-iters</code></dt>
  3847. <dd><p>The maximum number of iterations through CFG to extend regions.
  3848. A value of 0 disables region extensions.
  3849. </p>
  3850. </dd>
  3851. <dt><code>max-sched-insn-conflict-delay</code></dt>
  3852. <dd><p>The maximum conflict delay for an insn to be considered for speculative motion.
  3853. </p>
  3854. </dd>
  3855. <dt><code>sched-spec-prob-cutoff</code></dt>
  3856. <dd><p>The minimal probability of speculation success (in percents), so that
  3857. speculative insns are scheduled.
  3858. </p>
  3859. </dd>
  3860. <dt><code>sched-state-edge-prob-cutoff</code></dt>
  3861. <dd><p>The minimum probability an edge must have for the scheduler to save its
  3862. state across it.
  3863. </p>
  3864. </dd>
  3865. <dt><code>sched-mem-true-dep-cost</code></dt>
  3866. <dd><p>Minimal distance (in CPU cycles) between store and load targeting same
  3867. memory locations.
  3868. </p>
  3869. </dd>
  3870. <dt><code>selsched-max-lookahead</code></dt>
  3871. <dd><p>The maximum size of the lookahead window of selective scheduling. It is a
  3872. depth of search for available instructions.
  3873. </p>
  3874. </dd>
  3875. <dt><code>selsched-max-sched-times</code></dt>
  3876. <dd><p>The maximum number of times that an instruction is scheduled during
  3877. selective scheduling. This is the limit on the number of iterations
  3878. through which the instruction may be pipelined.
  3879. </p>
  3880. </dd>
  3881. <dt><code>selsched-insns-to-rename</code></dt>
  3882. <dd><p>The maximum number of best instructions in the ready list that are considered
  3883. for renaming in the selective scheduler.
  3884. </p>
  3885. </dd>
  3886. <dt><code>sms-min-sc</code></dt>
  3887. <dd><p>The minimum value of stage count that swing modulo scheduler
  3888. generates.
  3889. </p>
  3890. </dd>
  3891. <dt><code>max-last-value-rtl</code></dt>
  3892. <dd><p>The maximum size measured as number of RTLs that can be recorded in an expression
  3893. in combiner for a pseudo register as last known value of that register.
  3894. </p>
  3895. </dd>
  3896. <dt><code>max-combine-insns</code></dt>
  3897. <dd><p>The maximum number of instructions the RTL combiner tries to combine.
  3898. </p>
  3899. </dd>
  3900. <dt><code>integer-share-limit</code></dt>
  3901. <dd><p>Small integer constants can use a shared data structure, reducing the
  3902. compiler&rsquo;s memory usage and increasing its speed. This sets the maximum
  3903. value of a shared integer constant.
  3904. </p>
  3905. </dd>
  3906. <dt><code>ssp-buffer-size</code></dt>
  3907. <dd><p>The minimum size of buffers (i.e. arrays) that receive stack smashing
  3908. protection when <samp>-fstack-protection</samp> is used.
  3909. </p>
  3910. </dd>
  3911. <dt><code>min-size-for-stack-sharing</code></dt>
  3912. <dd><p>The minimum size of variables taking part in stack slot sharing when not
  3913. optimizing.
  3914. </p>
  3915. </dd>
  3916. <dt><code>max-jump-thread-duplication-stmts</code></dt>
  3917. <dd><p>Maximum number of statements allowed in a block that needs to be
  3918. duplicated when threading jumps.
  3919. </p>
  3920. </dd>
  3921. <dt><code>max-fields-for-field-sensitive</code></dt>
  3922. <dd><p>Maximum number of fields in a structure treated in
  3923. a field sensitive manner during pointer analysis.
  3924. </p>
  3925. </dd>
  3926. <dt><code>prefetch-latency</code></dt>
  3927. <dd><p>Estimate on average number of instructions that are executed before
  3928. prefetch finishes. The distance prefetched ahead is proportional
  3929. to this constant. Increasing this number may also lead to less
  3930. streams being prefetched (see <samp>simultaneous-prefetches</samp>).
  3931. </p>
  3932. </dd>
  3933. <dt><code>simultaneous-prefetches</code></dt>
  3934. <dd><p>Maximum number of prefetches that can run at the same time.
  3935. </p>
  3936. </dd>
  3937. <dt><code>l1-cache-line-size</code></dt>
  3938. <dd><p>The size of cache line in L1 data cache, in bytes.
  3939. </p>
  3940. </dd>
  3941. <dt><code>l1-cache-size</code></dt>
  3942. <dd><p>The size of L1 data cache, in kilobytes.
  3943. </p>
  3944. </dd>
  3945. <dt><code>l2-cache-size</code></dt>
  3946. <dd><p>The size of L2 data cache, in kilobytes.
  3947. </p>
  3948. </dd>
  3949. <dt><code>prefetch-dynamic-strides</code></dt>
  3950. <dd><p>Whether the loop array prefetch pass should issue software prefetch hints
  3951. for strides that are non-constant. In some cases this may be
  3952. beneficial, though the fact the stride is non-constant may make it
  3953. hard to predict when there is clear benefit to issuing these hints.
  3954. </p>
  3955. <p>Set to 1 if the prefetch hints should be issued for non-constant
  3956. strides. Set to 0 if prefetch hints should be issued only for strides that
  3957. are known to be constant and below <samp>prefetch-minimum-stride</samp>.
  3958. </p>
  3959. </dd>
  3960. <dt><code>prefetch-minimum-stride</code></dt>
  3961. <dd><p>Minimum constant stride, in bytes, to start using prefetch hints for. If
  3962. the stride is less than this threshold, prefetch hints will not be issued.
  3963. </p>
  3964. <p>This setting is useful for processors that have hardware prefetchers, in
  3965. which case there may be conflicts between the hardware prefetchers and
  3966. the software prefetchers. If the hardware prefetchers have a maximum
  3967. stride they can handle, it should be used here to improve the use of
  3968. software prefetchers.
  3969. </p>
  3970. <p>A value of -1 means we don&rsquo;t have a threshold and therefore
  3971. prefetch hints can be issued for any constant stride.
  3972. </p>
  3973. <p>This setting is only useful for strides that are known and constant.
  3974. </p>
  3975. </dd>
  3976. <dt><code>loop-interchange-max-num-stmts</code></dt>
  3977. <dd><p>The maximum number of stmts in a loop to be interchanged.
  3978. </p>
  3979. </dd>
  3980. <dt><code>loop-interchange-stride-ratio</code></dt>
  3981. <dd><p>The minimum ratio between stride of two loops for interchange to be profitable.
  3982. </p>
  3983. </dd>
  3984. <dt><code>min-insn-to-prefetch-ratio</code></dt>
  3985. <dd><p>The minimum ratio between the number of instructions and the
  3986. number of prefetches to enable prefetching in a loop.
  3987. </p>
  3988. </dd>
  3989. <dt><code>prefetch-min-insn-to-mem-ratio</code></dt>
  3990. <dd><p>The minimum ratio between the number of instructions and the
  3991. number of memory references to enable prefetching in a loop.
  3992. </p>
  3993. </dd>
  3994. <dt><code>use-canonical-types</code></dt>
  3995. <dd><p>Whether the compiler should use the &ldquo;canonical&rdquo; type system.
  3996. Should always be 1, which uses a more efficient internal
  3997. mechanism for comparing types in C++ and Objective-C++. However, if
  3998. bugs in the canonical type system are causing compilation failures,
  3999. set this value to 0 to disable canonical types.
  4000. </p>
  4001. </dd>
  4002. <dt><code>switch-conversion-max-branch-ratio</code></dt>
  4003. <dd><p>Switch initialization conversion refuses to create arrays that are
  4004. bigger than <samp>switch-conversion-max-branch-ratio</samp> times the number of
  4005. branches in the switch.
  4006. </p>
  4007. </dd>
  4008. <dt><code>max-partial-antic-length</code></dt>
  4009. <dd><p>Maximum length of the partial antic set computed during the tree
  4010. partial redundancy elimination optimization (<samp>-ftree-pre</samp>) when
  4011. optimizing at <samp>-O3</samp> and above. For some sorts of source code
  4012. the enhanced partial redundancy elimination optimization can run away,
  4013. consuming all of the memory available on the host machine. This
  4014. parameter sets a limit on the length of the sets that are computed,
  4015. which prevents the runaway behavior. Setting a value of 0 for
  4016. this parameter allows an unlimited set length.
  4017. </p>
  4018. </dd>
  4019. <dt><code>rpo-vn-max-loop-depth</code></dt>
  4020. <dd><p>Maximum loop depth that is value-numbered optimistically.
  4021. When the limit hits the innermost
  4022. <var>rpo-vn-max-loop-depth</var> loops and the outermost loop in the
  4023. loop nest are value-numbered optimistically and the remaining ones not.
  4024. </p>
  4025. </dd>
  4026. <dt><code>sccvn-max-alias-queries-per-access</code></dt>
  4027. <dd><p>Maximum number of alias-oracle queries we perform when looking for
  4028. redundancies for loads and stores. If this limit is hit the search
  4029. is aborted and the load or store is not considered redundant. The
  4030. number of queries is algorithmically limited to the number of
  4031. stores on all paths from the load to the function entry.
  4032. </p>
  4033. </dd>
  4034. <dt><code>ira-max-loops-num</code></dt>
  4035. <dd><p>IRA uses regional register allocation by default. If a function
  4036. contains more loops than the number given by this parameter, only at most
  4037. the given number of the most frequently-executed loops form regions
  4038. for regional register allocation.
  4039. </p>
  4040. </dd>
  4041. <dt><code>ira-max-conflict-table-size</code></dt>
  4042. <dd><p>Although IRA uses a sophisticated algorithm to compress the conflict
  4043. table, the table can still require excessive amounts of memory for
  4044. huge functions. If the conflict table for a function could be more
  4045. than the size in MB given by this parameter, the register allocator
  4046. instead uses a faster, simpler, and lower-quality
  4047. algorithm that does not require building a pseudo-register conflict table.
  4048. </p>
  4049. </dd>
  4050. <dt><code>ira-loop-reserved-regs</code></dt>
  4051. <dd><p>IRA can be used to evaluate more accurate register pressure in loops
  4052. for decisions to move loop invariants (see <samp>-O3</samp>). The number
  4053. of available registers reserved for some other purposes is given
  4054. by this parameter. Default of the parameter
  4055. is the best found from numerous experiments.
  4056. </p>
  4057. </dd>
  4058. <dt><code>lra-inheritance-ebb-probability-cutoff</code></dt>
  4059. <dd><p>LRA tries to reuse values reloaded in registers in subsequent insns.
  4060. This optimization is called inheritance. EBB is used as a region to
  4061. do this optimization. The parameter defines a minimal fall-through
  4062. edge probability in percentage used to add BB to inheritance EBB in
  4063. LRA. The default value was chosen
  4064. from numerous runs of SPEC2000 on x86-64.
  4065. </p>
  4066. </dd>
  4067. <dt><code>loop-invariant-max-bbs-in-loop</code></dt>
  4068. <dd><p>Loop invariant motion can be very expensive, both in compilation time and
  4069. in amount of needed compile-time memory, with very large loops. Loops
  4070. with more basic blocks than this parameter won&rsquo;t have loop invariant
  4071. motion optimization performed on them.
  4072. </p>
  4073. </dd>
  4074. <dt><code>loop-max-datarefs-for-datadeps</code></dt>
  4075. <dd><p>Building data dependencies is expensive for very large loops. This
  4076. parameter limits the number of data references in loops that are
  4077. considered for data dependence analysis. These large loops are no
  4078. handled by the optimizations using loop data dependencies.
  4079. </p>
  4080. </dd>
  4081. <dt><code>max-vartrack-size</code></dt>
  4082. <dd><p>Sets a maximum number of hash table slots to use during variable
  4083. tracking dataflow analysis of any function. If this limit is exceeded
  4084. with variable tracking at assignments enabled, analysis for that
  4085. function is retried without it, after removing all debug insns from
  4086. the function. If the limit is exceeded even without debug insns, var
  4087. tracking analysis is completely disabled for the function. Setting
  4088. the parameter to zero makes it unlimited.
  4089. </p>
  4090. </dd>
  4091. <dt><code>max-vartrack-expr-depth</code></dt>
  4092. <dd><p>Sets a maximum number of recursion levels when attempting to map
  4093. variable names or debug temporaries to value expressions. This trades
  4094. compilation time for more complete debug information. If this is set too
  4095. low, value expressions that are available and could be represented in
  4096. debug information may end up not being used; setting this higher may
  4097. enable the compiler to find more complex debug expressions, but compile
  4098. time and memory use may grow.
  4099. </p>
  4100. </dd>
  4101. <dt><code>max-debug-marker-count</code></dt>
  4102. <dd><p>Sets a threshold on the number of debug markers (e.g. begin stmt
  4103. markers) to avoid complexity explosion at inlining or expanding to RTL.
  4104. If a function has more such gimple stmts than the set limit, such stmts
  4105. will be dropped from the inlined copy of a function, and from its RTL
  4106. expansion.
  4107. </p>
  4108. </dd>
  4109. <dt><code>min-nondebug-insn-uid</code></dt>
  4110. <dd><p>Use uids starting at this parameter for nondebug insns. The range below
  4111. the parameter is reserved exclusively for debug insns created by
  4112. <samp>-fvar-tracking-assignments</samp>, but debug insns may get
  4113. (non-overlapping) uids above it if the reserved range is exhausted.
  4114. </p>
  4115. </dd>
  4116. <dt><code>ipa-sra-ptr-growth-factor</code></dt>
  4117. <dd><p>IPA-SRA replaces a pointer to an aggregate with one or more new
  4118. parameters only when their cumulative size is less or equal to
  4119. <samp>ipa-sra-ptr-growth-factor</samp> times the size of the original
  4120. pointer parameter.
  4121. </p>
  4122. </dd>
  4123. <dt><code>ipa-sra-max-replacements</code></dt>
  4124. <dd><p>Maximum pieces of an aggregate that IPA-SRA tracks. As a
  4125. consequence, it is also the maximum number of replacements of a formal
  4126. parameter.
  4127. </p>
  4128. </dd>
  4129. <dt><code>sra-max-scalarization-size-Ospeed</code></dt>
  4130. <dt><code>sra-max-scalarization-size-Osize</code></dt>
  4131. <dd><p>The two Scalar Reduction of Aggregates passes (SRA and IPA-SRA) aim to
  4132. replace scalar parts of aggregates with uses of independent scalar
  4133. variables. These parameters control the maximum size, in storage units,
  4134. of aggregate which is considered for replacement when compiling for
  4135. speed
  4136. (<samp>sra-max-scalarization-size-Ospeed</samp>) or size
  4137. (<samp>sra-max-scalarization-size-Osize</samp>) respectively.
  4138. </p>
  4139. </dd>
  4140. <dt><code>sra-max-propagations</code></dt>
  4141. <dd><p>The maximum number of artificial accesses that Scalar Replacement of
  4142. Aggregates (SRA) will track, per one local variable, in order to
  4143. facilitate copy propagation.
  4144. </p>
  4145. </dd>
  4146. <dt><code>tm-max-aggregate-size</code></dt>
  4147. <dd><p>When making copies of thread-local variables in a transaction, this
  4148. parameter specifies the size in bytes after which variables are
  4149. saved with the logging functions as opposed to save/restore code
  4150. sequence pairs. This option only applies when using
  4151. <samp>-fgnu-tm</samp>.
  4152. </p>
  4153. </dd>
  4154. <dt><code>graphite-max-nb-scop-params</code></dt>
  4155. <dd><p>To avoid exponential effects in the Graphite loop transforms, the
  4156. number of parameters in a Static Control Part (SCoP) is bounded.
  4157. A value of zero can be used to lift
  4158. the bound. A variable whose value is unknown at compilation time and
  4159. defined outside a SCoP is a parameter of the SCoP.
  4160. </p>
  4161. </dd>
  4162. <dt><code>loop-block-tile-size</code></dt>
  4163. <dd><p>Loop blocking or strip mining transforms, enabled with
  4164. <samp>-floop-block</samp> or <samp>-floop-strip-mine</samp>, strip mine each
  4165. loop in the loop nest by a given number of iterations. The strip
  4166. length can be changed using the <samp>loop-block-tile-size</samp>
  4167. parameter.
  4168. </p>
  4169. </dd>
  4170. <dt><code>ipa-cp-value-list-size</code></dt>
  4171. <dd><p>IPA-CP attempts to track all possible values and types passed to a function&rsquo;s
  4172. parameter in order to propagate them and perform devirtualization.
  4173. <samp>ipa-cp-value-list-size</samp> is the maximum number of values and types it
  4174. stores per one formal parameter of a function.
  4175. </p>
  4176. </dd>
  4177. <dt><code>ipa-cp-eval-threshold</code></dt>
  4178. <dd><p>IPA-CP calculates its own score of cloning profitability heuristics
  4179. and performs those cloning opportunities with scores that exceed
  4180. <samp>ipa-cp-eval-threshold</samp>.
  4181. </p>
  4182. </dd>
  4183. <dt><code>ipa-cp-max-recursive-depth</code></dt>
  4184. <dd><p>Maximum depth of recursive cloning for self-recursive function.
  4185. </p>
  4186. </dd>
  4187. <dt><code>ipa-cp-min-recursive-probability</code></dt>
  4188. <dd><p>Recursive cloning only when the probability of call being executed exceeds
  4189. the parameter.
  4190. </p>
  4191. </dd>
  4192. <dt><code>ipa-cp-recursion-penalty</code></dt>
  4193. <dd><p>Percentage penalty the recursive functions will receive when they
  4194. are evaluated for cloning.
  4195. </p>
  4196. </dd>
  4197. <dt><code>ipa-cp-single-call-penalty</code></dt>
  4198. <dd><p>Percentage penalty functions containing a single call to another
  4199. function will receive when they are evaluated for cloning.
  4200. </p>
  4201. </dd>
  4202. <dt><code>ipa-max-agg-items</code></dt>
  4203. <dd><p>IPA-CP is also capable to propagate a number of scalar values passed
  4204. in an aggregate. <samp>ipa-max-agg-items</samp> controls the maximum
  4205. number of such values per one parameter.
  4206. </p>
  4207. </dd>
  4208. <dt><code>ipa-cp-loop-hint-bonus</code></dt>
  4209. <dd><p>When IPA-CP determines that a cloning candidate would make the number
  4210. of iterations of a loop known, it adds a bonus of
  4211. <samp>ipa-cp-loop-hint-bonus</samp> to the profitability score of
  4212. the candidate.
  4213. </p>
  4214. </dd>
  4215. <dt><code>ipa-max-aa-steps</code></dt>
  4216. <dd><p>During its analysis of function bodies, IPA-CP employs alias analysis
  4217. in order to track values pointed to by function parameters. In order
  4218. not spend too much time analyzing huge functions, it gives up and
  4219. consider all memory clobbered after examining
  4220. <samp>ipa-max-aa-steps</samp> statements modifying memory.
  4221. </p>
  4222. </dd>
  4223. <dt><code>ipa-max-switch-predicate-bounds</code></dt>
  4224. <dd><p>Maximal number of boundary endpoints of case ranges of switch statement.
  4225. For switch exceeding this limit, IPA-CP will not construct cloning cost
  4226. predicate, which is used to estimate cloning benefit, for default case
  4227. of the switch statement.
  4228. </p>
  4229. </dd>
  4230. <dt><code>ipa-max-param-expr-ops</code></dt>
  4231. <dd><p>IPA-CP will analyze conditional statement that references some function
  4232. parameter to estimate benefit for cloning upon certain constant value.
  4233. But if number of operations in a parameter expression exceeds
  4234. <samp>ipa-max-param-expr-ops</samp>, the expression is treated as complicated
  4235. one, and is not handled by IPA analysis.
  4236. </p>
  4237. </dd>
  4238. <dt><code>lto-partitions</code></dt>
  4239. <dd><p>Specify desired number of partitions produced during WHOPR compilation.
  4240. The number of partitions should exceed the number of CPUs used for compilation.
  4241. </p>
  4242. </dd>
  4243. <dt><code>lto-min-partition</code></dt>
  4244. <dd><p>Size of minimal partition for WHOPR (in estimated instructions).
  4245. This prevents expenses of splitting very small programs into too many
  4246. partitions.
  4247. </p>
  4248. </dd>
  4249. <dt><code>lto-max-partition</code></dt>
  4250. <dd><p>Size of max partition for WHOPR (in estimated instructions).
  4251. to provide an upper bound for individual size of partition.
  4252. Meant to be used only with balanced partitioning.
  4253. </p>
  4254. </dd>
  4255. <dt><code>lto-max-streaming-parallelism</code></dt>
  4256. <dd><p>Maximal number of parallel processes used for LTO streaming.
  4257. </p>
  4258. </dd>
  4259. <dt><code>cxx-max-namespaces-for-diagnostic-help</code></dt>
  4260. <dd><p>The maximum number of namespaces to consult for suggestions when C++
  4261. name lookup fails for an identifier.
  4262. </p>
  4263. </dd>
  4264. <dt><code>sink-frequency-threshold</code></dt>
  4265. <dd><p>The maximum relative execution frequency (in percents) of the target block
  4266. relative to a statement&rsquo;s original block to allow statement sinking of a
  4267. statement. Larger numbers result in more aggressive statement sinking.
  4268. A small positive adjustment is applied for
  4269. statements with memory operands as those are even more profitable so sink.
  4270. </p>
  4271. </dd>
  4272. <dt><code>max-stores-to-sink</code></dt>
  4273. <dd><p>The maximum number of conditional store pairs that can be sunk. Set to 0
  4274. if either vectorization (<samp>-ftree-vectorize</samp>) or if-conversion
  4275. (<samp>-ftree-loop-if-convert</samp>) is disabled.
  4276. </p>
  4277. </dd>
  4278. <dt><code>case-values-threshold</code></dt>
  4279. <dd><p>The smallest number of different values for which it is best to use a
  4280. jump-table instead of a tree of conditional branches. If the value is
  4281. 0, use the default for the machine.
  4282. </p>
  4283. </dd>
  4284. <dt><code>jump-table-max-growth-ratio-for-size</code></dt>
  4285. <dd><p>The maximum code size growth ratio when expanding
  4286. into a jump table (in percent). The parameter is used when
  4287. optimizing for size.
  4288. </p>
  4289. </dd>
  4290. <dt><code>jump-table-max-growth-ratio-for-speed</code></dt>
  4291. <dd><p>The maximum code size growth ratio when expanding
  4292. into a jump table (in percent). The parameter is used when
  4293. optimizing for speed.
  4294. </p>
  4295. </dd>
  4296. <dt><code>tree-reassoc-width</code></dt>
  4297. <dd><p>Set the maximum number of instructions executed in parallel in
  4298. reassociated tree. This parameter overrides target dependent
  4299. heuristics used by default if has non zero value.
  4300. </p>
  4301. </dd>
  4302. <dt><code>sched-pressure-algorithm</code></dt>
  4303. <dd><p>Choose between the two available implementations of
  4304. <samp>-fsched-pressure</samp>. Algorithm 1 is the original implementation
  4305. and is the more likely to prevent instructions from being reordered.
  4306. Algorithm 2 was designed to be a compromise between the relatively
  4307. conservative approach taken by algorithm 1 and the rather aggressive
  4308. approach taken by the default scheduler. It relies more heavily on
  4309. having a regular register file and accurate register pressure classes.
  4310. See <samp>haifa-sched.c</samp> in the GCC sources for more details.
  4311. </p>
  4312. <p>The default choice depends on the target.
  4313. </p>
  4314. </dd>
  4315. <dt><code>max-slsr-cand-scan</code></dt>
  4316. <dd><p>Set the maximum number of existing candidates that are considered when
  4317. seeking a basis for a new straight-line strength reduction candidate.
  4318. </p>
  4319. </dd>
  4320. <dt><code>asan-globals</code></dt>
  4321. <dd><p>Enable buffer overflow detection for global objects. This kind
  4322. of protection is enabled by default if you are using
  4323. <samp>-fsanitize=address</samp> option.
  4324. To disable global objects protection use <samp>--param asan-globals=0</samp>.
  4325. </p>
  4326. </dd>
  4327. <dt><code>asan-stack</code></dt>
  4328. <dd><p>Enable buffer overflow detection for stack objects. This kind of
  4329. protection is enabled by default when using <samp>-fsanitize=address</samp>.
  4330. To disable stack protection use <samp>--param asan-stack=0</samp> option.
  4331. </p>
  4332. </dd>
  4333. <dt><code>asan-instrument-reads</code></dt>
  4334. <dd><p>Enable buffer overflow detection for memory reads. This kind of
  4335. protection is enabled by default when using <samp>-fsanitize=address</samp>.
  4336. To disable memory reads protection use
  4337. <samp>--param asan-instrument-reads=0</samp>.
  4338. </p>
  4339. </dd>
  4340. <dt><code>asan-instrument-writes</code></dt>
  4341. <dd><p>Enable buffer overflow detection for memory writes. This kind of
  4342. protection is enabled by default when using <samp>-fsanitize=address</samp>.
  4343. To disable memory writes protection use
  4344. <samp>--param asan-instrument-writes=0</samp> option.
  4345. </p>
  4346. </dd>
  4347. <dt><code>asan-memintrin</code></dt>
  4348. <dd><p>Enable detection for built-in functions. This kind of protection
  4349. is enabled by default when using <samp>-fsanitize=address</samp>.
  4350. To disable built-in functions protection use
  4351. <samp>--param asan-memintrin=0</samp>.
  4352. </p>
  4353. </dd>
  4354. <dt><code>asan-use-after-return</code></dt>
  4355. <dd><p>Enable detection of use-after-return. This kind of protection
  4356. is enabled by default when using the <samp>-fsanitize=address</samp> option.
  4357. To disable it use <samp>--param asan-use-after-return=0</samp>.
  4358. </p>
  4359. <p>Note: By default the check is disabled at run time. To enable it,
  4360. add <code>detect_stack_use_after_return=1</code> to the environment variable
  4361. <code>ASAN_OPTIONS</code>.
  4362. </p>
  4363. </dd>
  4364. <dt><code>asan-instrumentation-with-call-threshold</code></dt>
  4365. <dd><p>If number of memory accesses in function being instrumented
  4366. is greater or equal to this number, use callbacks instead of inline checks.
  4367. E.g. to disable inline code use
  4368. <samp>--param asan-instrumentation-with-call-threshold=0</samp>.
  4369. </p>
  4370. </dd>
  4371. <dt><code>use-after-scope-direct-emission-threshold</code></dt>
  4372. <dd><p>If the size of a local variable in bytes is smaller or equal to this
  4373. number, directly poison (or unpoison) shadow memory instead of using
  4374. run-time callbacks.
  4375. </p>
  4376. </dd>
  4377. <dt><code>max-fsm-thread-path-insns</code></dt>
  4378. <dd><p>Maximum number of instructions to copy when duplicating blocks on a
  4379. finite state automaton jump thread path.
  4380. </p>
  4381. </dd>
  4382. <dt><code>max-fsm-thread-length</code></dt>
  4383. <dd><p>Maximum number of basic blocks on a finite state automaton jump thread
  4384. path.
  4385. </p>
  4386. </dd>
  4387. <dt><code>max-fsm-thread-paths</code></dt>
  4388. <dd><p>Maximum number of new jump thread paths to create for a finite state
  4389. automaton.
  4390. </p>
  4391. </dd>
  4392. <dt><code>parloops-chunk-size</code></dt>
  4393. <dd><p>Chunk size of omp schedule for loops parallelized by parloops.
  4394. </p>
  4395. </dd>
  4396. <dt><code>parloops-schedule</code></dt>
  4397. <dd><p>Schedule type of omp schedule for loops parallelized by parloops (static,
  4398. dynamic, guided, auto, runtime).
  4399. </p>
  4400. </dd>
  4401. <dt><code>parloops-min-per-thread</code></dt>
  4402. <dd><p>The minimum number of iterations per thread of an innermost parallelized
  4403. loop for which the parallelized variant is preferred over the single threaded
  4404. one. Note that for a parallelized loop nest the
  4405. minimum number of iterations of the outermost loop per thread is two.
  4406. </p>
  4407. </dd>
  4408. <dt><code>max-ssa-name-query-depth</code></dt>
  4409. <dd><p>Maximum depth of recursion when querying properties of SSA names in things
  4410. like fold routines. One level of recursion corresponds to following a
  4411. use-def chain.
  4412. </p>
  4413. </dd>
  4414. <dt><code>hsa-gen-debug-stores</code></dt>
  4415. <dd><p>Enable emission of special debug stores within HSA kernels which are
  4416. then read and reported by libgomp plugin. Generation of these stores
  4417. is disabled by default, use <samp>--param hsa-gen-debug-stores=1</samp> to
  4418. enable it.
  4419. </p>
  4420. </dd>
  4421. <dt><code>max-speculative-devirt-maydefs</code></dt>
  4422. <dd><p>The maximum number of may-defs we analyze when looking for a must-def
  4423. specifying the dynamic type of an object that invokes a virtual call
  4424. we may be able to devirtualize speculatively.
  4425. </p>
  4426. </dd>
  4427. <dt><code>max-vrp-switch-assertions</code></dt>
  4428. <dd><p>The maximum number of assertions to add along the default edge of a switch
  4429. statement during VRP.
  4430. </p>
  4431. </dd>
  4432. <dt><code>unroll-jam-min-percent</code></dt>
  4433. <dd><p>The minimum percentage of memory references that must be optimized
  4434. away for the unroll-and-jam transformation to be considered profitable.
  4435. </p>
  4436. </dd>
  4437. <dt><code>unroll-jam-max-unroll</code></dt>
  4438. <dd><p>The maximum number of times the outer loop should be unrolled by
  4439. the unroll-and-jam transformation.
  4440. </p>
  4441. </dd>
  4442. <dt><code>max-rtl-if-conversion-unpredictable-cost</code></dt>
  4443. <dd><p>Maximum permissible cost for the sequence that would be generated
  4444. by the RTL if-conversion pass for a branch that is considered unpredictable.
  4445. </p>
  4446. </dd>
  4447. <dt><code>max-variable-expansions-in-unroller</code></dt>
  4448. <dd><p>If <samp>-fvariable-expansion-in-unroller</samp> is used, the maximum number
  4449. of times that an individual variable will be expanded during loop unrolling.
  4450. </p>
  4451. </dd>
  4452. <dt><code>tracer-min-branch-probability-feedback</code></dt>
  4453. <dd><p>Stop forward growth if the probability of best edge is less than
  4454. this threshold (in percent). Used when profile feedback is available.
  4455. </p>
  4456. </dd>
  4457. <dt><code>partial-inlining-entry-probability</code></dt>
  4458. <dd><p>Maximum probability of the entry BB of split region
  4459. (in percent relative to entry BB of the function)
  4460. to make partial inlining happen.
  4461. </p>
  4462. </dd>
  4463. <dt><code>max-tracked-strlens</code></dt>
  4464. <dd><p>Maximum number of strings for which strlen optimization pass will
  4465. track string lengths.
  4466. </p>
  4467. </dd>
  4468. <dt><code>gcse-after-reload-partial-fraction</code></dt>
  4469. <dd><p>The threshold ratio for performing partial redundancy
  4470. elimination after reload.
  4471. </p>
  4472. </dd>
  4473. <dt><code>gcse-after-reload-critical-fraction</code></dt>
  4474. <dd><p>The threshold ratio of critical edges execution count that
  4475. permit performing redundancy elimination after reload.
  4476. </p>
  4477. </dd>
  4478. <dt><code>max-loop-header-insns</code></dt>
  4479. <dd><p>The maximum number of insns in loop header duplicated
  4480. by the copy loop headers pass.
  4481. </p>
  4482. </dd>
  4483. <dt><code>vect-epilogues-nomask</code></dt>
  4484. <dd><p>Enable loop epilogue vectorization using smaller vector size.
  4485. </p>
  4486. </dd>
  4487. <dt><code>slp-max-insns-in-bb</code></dt>
  4488. <dd><p>Maximum number of instructions in basic block to be
  4489. considered for SLP vectorization.
  4490. </p>
  4491. </dd>
  4492. <dt><code>avoid-fma-max-bits</code></dt>
  4493. <dd><p>Maximum number of bits for which we avoid creating FMAs.
  4494. </p>
  4495. </dd>
  4496. <dt><code>sms-loop-average-count-threshold</code></dt>
  4497. <dd><p>A threshold on the average loop count considered by the swing modulo scheduler.
  4498. </p>
  4499. </dd>
  4500. <dt><code>sms-dfa-history</code></dt>
  4501. <dd><p>The number of cycles the swing modulo scheduler considers when checking
  4502. conflicts using DFA.
  4503. </p>
  4504. </dd>
  4505. <dt><code>max-inline-insns-recursive-auto</code></dt>
  4506. <dd><p>The maximum number of instructions non-inline function
  4507. can grow to via recursive inlining.
  4508. </p>
  4509. </dd>
  4510. <dt><code>graphite-allow-codegen-errors</code></dt>
  4511. <dd><p>Whether codegen errors should be ICEs when <samp>-fchecking</samp>.
  4512. </p>
  4513. </dd>
  4514. <dt><code>sms-max-ii-factor</code></dt>
  4515. <dd><p>A factor for tuning the upper bound that swing modulo scheduler
  4516. uses for scheduling a loop.
  4517. </p>
  4518. </dd>
  4519. <dt><code>lra-max-considered-reload-pseudos</code></dt>
  4520. <dd><p>The max number of reload pseudos which are considered during
  4521. spilling a non-reload pseudo.
  4522. </p>
  4523. </dd>
  4524. <dt><code>max-pow-sqrt-depth</code></dt>
  4525. <dd><p>Maximum depth of sqrt chains to use when synthesizing exponentiation
  4526. by a real constant.
  4527. </p>
  4528. </dd>
  4529. <dt><code>max-dse-active-local-stores</code></dt>
  4530. <dd><p>Maximum number of active local stores in RTL dead store elimination.
  4531. </p>
  4532. </dd>
  4533. <dt><code>asan-instrument-allocas</code></dt>
  4534. <dd><p>Enable asan allocas/VLAs protection.
  4535. </p>
  4536. </dd>
  4537. <dt><code>max-iterations-computation-cost</code></dt>
  4538. <dd><p>Bound on the cost of an expression to compute the number of iterations.
  4539. </p>
  4540. </dd>
  4541. <dt><code>max-isl-operations</code></dt>
  4542. <dd><p>Maximum number of isl operations, 0 means unlimited.
  4543. </p>
  4544. </dd>
  4545. <dt><code>graphite-max-arrays-per-scop</code></dt>
  4546. <dd><p>Maximum number of arrays per scop.
  4547. </p>
  4548. </dd>
  4549. <dt><code>max-vartrack-reverse-op-size</code></dt>
  4550. <dd><p>Max. size of loc list for which reverse ops should be added.
  4551. </p>
  4552. </dd>
  4553. <dt><code>tracer-dynamic-coverage-feedback</code></dt>
  4554. <dd><p>The percentage of function, weighted by execution frequency,
  4555. that must be covered by trace formation.
  4556. Used when profile feedback is available.
  4557. </p>
  4558. </dd>
  4559. <dt><code>max-inline-recursive-depth-auto</code></dt>
  4560. <dd><p>The maximum depth of recursive inlining for non-inline functions.
  4561. </p>
  4562. </dd>
  4563. <dt><code>fsm-scale-path-stmts</code></dt>
  4564. <dd><p>Scale factor to apply to the number of statements in a threading path
  4565. when comparing to the number of (scaled) blocks.
  4566. </p>
  4567. </dd>
  4568. <dt><code>fsm-maximum-phi-arguments</code></dt>
  4569. <dd><p>Maximum number of arguments a PHI may have before the FSM threader
  4570. will not try to thread through its block.
  4571. </p>
  4572. </dd>
  4573. <dt><code>uninit-control-dep-attempts</code></dt>
  4574. <dd><p>Maximum number of nested calls to search for control dependencies
  4575. during uninitialized variable analysis.
  4576. </p>
  4577. </dd>
  4578. <dt><code>sra-max-scalarization-size-Osize</code></dt>
  4579. <dd><p>Maximum size, in storage units, of an aggregate
  4580. which should be considered for scalarization when compiling for size.
  4581. </p>
  4582. </dd>
  4583. <dt><code>fsm-scale-path-blocks</code></dt>
  4584. <dd><p>Scale factor to apply to the number of blocks in a threading path
  4585. when comparing to the number of (scaled) statements.
  4586. </p>
  4587. </dd>
  4588. <dt><code>sched-autopref-queue-depth</code></dt>
  4589. <dd><p>Hardware autoprefetcher scheduler model control flag.
  4590. Number of lookahead cycles the model looks into; at &rsquo;
  4591. &rsquo; only enable instruction sorting heuristic.
  4592. </p>
  4593. </dd>
  4594. <dt><code>loop-versioning-max-inner-insns</code></dt>
  4595. <dd><p>The maximum number of instructions that an inner loop can have
  4596. before the loop versioning pass considers it too big to copy.
  4597. </p>
  4598. </dd>
  4599. <dt><code>loop-versioning-max-outer-insns</code></dt>
  4600. <dd><p>The maximum number of instructions that an outer loop can have
  4601. before the loop versioning pass considers it too big to copy,
  4602. discounting any instructions in inner loops that directly benefit
  4603. from versioning.
  4604. </p>
  4605. </dd>
  4606. <dt><code>ssa-name-def-chain-limit</code></dt>
  4607. <dd><p>The maximum number of SSA_NAME assignments to follow in determining
  4608. a property of a variable such as its value. This limits the number
  4609. of iterations or recursive calls GCC performs when optimizing certain
  4610. statements or when determining their validity prior to issuing
  4611. diagnostics.
  4612. </p>
  4613. </dd>
  4614. <dt><code>store-merging-max-size</code></dt>
  4615. <dd><p>Maximum size of a single store merging region in bytes.
  4616. </p>
  4617. </dd>
  4618. <dt><code>hash-table-verification-limit</code></dt>
  4619. <dd><p>The number of elements for which hash table verification is done
  4620. for each searched element.
  4621. </p>
  4622. </dd>
  4623. <dt><code>max-find-base-term-values</code></dt>
  4624. <dd><p>Maximum number of VALUEs handled during a single find_base_term call.
  4625. </p>
  4626. </dd>
  4627. <dt><code>analyzer-max-enodes-per-program-point</code></dt>
  4628. <dd><p>The maximum number of exploded nodes per program point within
  4629. the analyzer, before terminating analysis of that point.
  4630. </p>
  4631. </dd>
  4632. <dt><code>analyzer-min-snodes-for-call-summary</code></dt>
  4633. <dd><p>The minimum number of supernodes within a function for the
  4634. analyzer to consider summarizing its effects at call sites.
  4635. </p>
  4636. </dd>
  4637. <dt><code>analyzer-max-recursion-depth</code></dt>
  4638. <dd><p>The maximum number of times a callsite can appear in a call stack
  4639. within the analyzer, before terminating analysis of a call that would
  4640. recurse deeper.
  4641. </p>
  4642. </dd>
  4643. <dt><code>gimple-fe-computed-hot-bb-threshold</code></dt>
  4644. <dd><p>The number of executions of a basic block which is considered hot.
  4645. The parameter is used only in GIMPLE FE.
  4646. </p>
  4647. </dd>
  4648. <dt><code>analyzer-bb-explosion-factor</code></dt>
  4649. <dd><p>The maximum number of &rsquo;after supernode&rsquo; exploded nodes within the analyzer
  4650. per supernode, before terminating analysis.
  4651. </p>
  4652. </dd>
  4653. </dl>
  4654. <p>The following choices of <var>name</var> are available on AArch64 targets:
  4655. </p>
  4656. <dl compact="compact">
  4657. <dt><code>aarch64-sve-compare-costs</code></dt>
  4658. <dd><p>When vectorizing for SVE, consider using &ldquo;unpacked&rdquo; vectors for
  4659. smaller elements and use the cost model to pick the cheapest approach.
  4660. Also use the cost model to choose between SVE and Advanced SIMD vectorization.
  4661. </p>
  4662. <p>Using unpacked vectors includes storing smaller elements in larger
  4663. containers and accessing elements with extending loads and truncating
  4664. stores.
  4665. </p>
  4666. </dd>
  4667. <dt><code>aarch64-float-recp-precision</code></dt>
  4668. <dd><p>The number of Newton iterations for calculating the reciprocal for float type.
  4669. The precision of division is proportional to this param when division
  4670. approximation is enabled. The default value is 1.
  4671. </p>
  4672. </dd>
  4673. <dt><code>aarch64-double-recp-precision</code></dt>
  4674. <dd><p>The number of Newton iterations for calculating the reciprocal for double type.
  4675. The precision of division is propotional to this param when division
  4676. approximation is enabled. The default value is 2.
  4677. </p>
  4678. </dd>
  4679. </dl>
  4680. </dd>
  4681. </dl>
  4682. <hr>
  4683. <div class="header">
  4684. <p>
  4685. Next: <a href="Instrumentation-Options.html#Instrumentation-Options" accesskey="n" rel="next">Instrumentation Options</a>, Previous: <a href="Debugging-Options.html#Debugging-Options" accesskey="p" rel="prev">Debugging Options</a>, Up: <a href="Invoking-GCC.html#Invoking-GCC" accesskey="u" rel="up">Invoking GCC</a> &nbsp; [<a href="index.html#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="Option-Index.html#Option-Index" title="Index" rel="index">Index</a>]</p>
  4686. </div>
  4687. </body>
  4688. </html>