diff options
author | Ben Gamari <bgamari.foss@gmail.com> | 2015-07-03 19:36:12 +0200 |
---|---|---|
committer | Ben Gamari <ben@smart-cactus.org> | 2015-07-03 22:44:49 +0200 |
commit | 6400c7687223c5b2141176aa92f7ff987f61aba6 (patch) | |
tree | 1f4df8a45438f63fd9bdf4ac5ed6cd3afd0eb789 /docs/users_guide/using.xml | |
parent | f07b7a876cb3b9d38bb7ed301503f5b84104fc90 (diff) | |
download | haskell-6400c7687223c5b2141176aa92f7ff987f61aba6.tar.gz |
users_guide: Describe order-dependence of -f and -O flags
The behavior of the -f and -O options can be quite surprising.
Document this fact. At some point this behavior should likely be changed.
Test Plan: documentation only
Reviewers: austin, trofi
Reviewed By: austin, trofi
Subscribers: thomie, bgamari
Differential Revision: https://phabricator.haskell.org/D1008
GHC Trac Issues: #10560
Diffstat (limited to 'docs/users_guide/using.xml')
-rw-r--r-- | docs/users_guide/using.xml | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/docs/users_guide/using.xml b/docs/users_guide/using.xml index 4d4b01f243..5642ea52c9 100644 --- a/docs/users_guide/using.xml +++ b/docs/users_guide/using.xml @@ -2105,6 +2105,29 @@ _ = rhs3 -- No warning: lone wild-card pattern <emphasis>machine-specific</emphasis> optimisations to be turned on/off.</para> + <para>Most of these options are boolean and have options to turn them both + “on” and “off” (beginning with the prefix + <option>no-</option>). For instance, while <option>-fspecialise</option> + enables specialisation, <option>-fno-specialise</option> disables it. When + multiple flags for the same option appear in the command-line they are + evaluated from left to right. For instance <option>-fno-specialise + -fspecialise</option> will enable specialisation. + </para> + + <para>It is important to note that the <option>-O*</option> flags are roughly + equivalent to combinations of <option>-f*</option> flags. For this reason, + the effect of the <option>-O*</option> and <option>-f*</option> flags is + dependent upon the order in which they occur on the command line. + </para> + + <para>For instance, take the example of <option>-fno-specialise + -O1</option>. Despite the <option>-fno-specialise</option> appearing in the + command line, specialisation will still be enabled. This is the case + as <option>-O1</option> implies <option>-fspecialise</option>, overriding + the previous flag. By contrast, <option>-O1 -fno-specialise</option> will + compile without specialisation, as one would expect. + </para> + <sect2 id="optimise-pkgs"> <title><option>-O*</option>: convenient “packages” of optimisation flags.</title> |