<?xml version="1.0"?>
<!DOCTYPE flagsdescription
    SYSTEM "http://www.spec.org/dtd/cpuflags2.dtd"
>

<!-- $Id: flags-advanced.xml 971 2014-01-08 18:18:48Z BrianWhitney $ -->

<!-- ... You'll want a nice wide window when reading or editing this .................................................... -->


<flagsdescription>

<filename>flags-advanced</filename>

<title>Example GCC flags</title>

<!-- 
  *********************************************************************************************************************
  Explanations of software environment, such as boot time settings
  ********************************************************************************************************************* 
-->

<sw_environment>
<![CDATA[

<p><b>Platform settings</b></p>

<p>One or more of the following settings may have been applied to the testbed.  If so, the "Platform Notes" section of the
report will say so; and you can read below to find out more about what these settings mean.</p>

<p><b><kbd>LD_LIBRARY_PATH=&lt;directories&gt;</kbd></b> (linker)
<br />LD_LIBRARY_PATH controls the search order for both the compile-time and run-time linkers.  Usually, it can be
defaulted; but testers may sometimes choose to explicitly set it (as documented in the notes in the submission), in order to
ensure that the correct versions of libraries are picked up.  </p>

<p><b><kbd>STACKSIZE=&lt;n&gt;</kbd></b> (Unix)
<br /> Set the size of the stack (temporary storage area) for each slave thread of a multithreaded program.  </p>

<p><b><kbd>ulimit -s &lt;n&gt;</kbd></b> (Unix)
<br /> Sets the stack size to <kbd>n</kbd> kbytes, or "<kbd>unlimited</kbd>" to allow the stack size to grow without limit.
</p>
]]>
</sw_environment>

<!-- 
  *********************************************************************************************************************
  Preface for flags dump and per-result flag report
  ********************************************************************************************************************* 
-->
<header>
<![CDATA[
<p>Compilers: GCC </p>
<p>Operating systems: Linux</p>
<p>Last updated: 21-Jan-2014 blw </p>

<p>The text for many of the descriptions below was taken from 
the online help for gcc.</p>
]]>
</header>

<!-- 
  ********************************************************************************************************************
  Compilers
  ********************************************************************************************************************* 
-->

<!-- If there is any chance that your compiler will be used by any third party in conjunction with another compiler, it is
   _strongly_ recommended that the flag names be chosen in such a way as to facilitate flag file merging.

  Sure, the C compiler name below could be "cc", but "sun_cc" is so much less ambiguous.

  The regexp below allows a path, as in /usr/opt/SUNwspro/.  The "(?:pattern)" notation groups the pattern inside the
  parentheses so that the "?" operator that immediately follows the closing parentheses applies to the pattern, thus allowing
  0 or 1 instances of the whole thing.  
-->

<!-- The regexp is a little different; '+' is a "magic" character for
     regular expressions, so it must be escaped with a backslash.
     Also, '+' is not a word character, so '\b' is useless.  See section
     3.3.4 for an explanation of the thing at the end. -->
<!-- Hey!  After all these times where we've been saying "use CDATA",
     why isn't there any this time?  Well, actually, the rule is that
     you have to use CDATA if you're using any HTML.  But all we want
     to say today is a simple sentence, with no emphasis, no HTML, no
     italics, no flashing, just a simple plain declarative uncurliqued
     straightforward unembelished sentence.  Fine.  We can skip the
     CDATA stuff.  See the bottom part of section 2.3.1 -->

<flag name="gnu_CC"
      class="compiler"
      regexp="(?:/\S+/)?g\+\+(?=\s|$)">
<example>CC</example>
Invoke the GNU C++ Compiler
</flag>

<flag name="gnu_cc"
      class="compiler"
      regexp="(?:/\S+/)?gcc\b">
<example>cc</example>
Invoke the GNU C Compiler
</flag>

<flag name="gnu_f90"
      class="compiler"
      regexp="(?:/\S+/)?gf90\b">
<example>f90</example>
Invoke the GNU Fortran 90 Compiler
</flag>

<!--
  *************************************************************************************************************************
  Flags

  Actual flag descriptions at last begin here.  The order is alphabetical by how the human reads it (so you might have to
  peek at that regexp to understand what it would look like to the human).  The alphabetizing is without regard to
  upper/lower case, without regard to the presence of leading punctuation, and without regard to the presence of a leading
  -Wx, or -qoption x

  Exception: The flag "-#" is alphabetized next to "-v".
  *************************************************************************************************************************
-->

<flag name="F-lOpenCL"
      class="optimization">
Links in the OpenCL library.
</flag>

<flag name="F-lcuda"
      class="optimization">
Links in the OpenCL library.
</flag>

<flag name="f-m32"
      class="optimization">
Specifies the memory model for the compiled binary object as 32-bit.'
</flag>

<flag name="f-m64"
      class="optimization">
Specifies the memory model for the compiled binary object as 64-bit.'
</flag>


<flag name="Istd"
      class="optimization"
      regexp="-I\s*[^ ]*include[^ ]*">
Adds the directory for include files to the search path at compile time.
</flag>

<flag name="Lstd"
      class="optimization"
      regexp="-L\s*[^ ]*[^ ]*">
Adds the library directory search path at link time
</flag>


<flag name="O" 
      class="optimization" 
      regexp="-O\d+\b">
<example>-O&lt;n&gt;</example>
<![CDATA[
<p> Specify optimization level <kbd>n</kbd>: </p>
<ul>
  <li><kbd>-O1</kbd> does only basic optimizations to reduce code size and execution time</li>
  <li><kbd>-O2</kbd> does additional options which do not involve space-speed trade-off
</li>
  <li><kbd>-O3</kbd> does more optimization, adding function inlining, other interprocedural analysis, and others.</li>
</ul>
]]>
</flag>


</flagsdescription>
