<html lang="en">
<head>
<title>i386 and x86-64 Options - Using the GNU Compiler Collection (GCC)</title>
<meta http-equiv="Content-Type" content="text/html">
<meta name="description" content="Using the GNU Compiler Collection (GCC)">
<meta name="generator" content="makeinfo 4.8">
<link title="Top" rel="start" href="index.html#Top">
<link rel="up" href="Submodel-Options.html#Submodel-Options" title="Submodel Options">
<link rel="prev" href="HPPA-Options.html#HPPA-Options" title="HPPA Options">
<link rel="next" href="IA_002d64-Options.html#IA_002d64-Options" title="IA-64 Options">
<link href="http://www.gnu.org/software/texinfo/" rel="generator-home" title="Texinfo Homepage">
<!--
Copyright (C) 1988, 1989, 1992, 1993, 1994, 1995, 1996, 1997, 1998,
1999, 2000, 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc.

Permission is granted to copy, distribute and/or modify this document
under the terms of the GNU Free Documentation License, Version 1.2 or
any later version published by the Free Software Foundation; with the
Invariant Sections being ``GNU General Public License'' and ``Funding
Free Software'', the Front-Cover texts being (a) (see below), and with
the Back-Cover Texts being (b) (see below).  A copy of the license is
included in the section entitled ``GNU Free Documentation License''.

(a) The FSF's Front-Cover Text is:

     A GNU Manual

(b) The FSF's Back-Cover Text is:

     You have freedom to copy and modify this GNU Manual, like GNU
     software.  Copies published by the Free Software Foundation raise
     funds for GNU development.-->
<meta http-equiv="Content-Style-Type" content="text/css">
<style type="text/css"><!--
@import url("../raisonance.css");
  pre.display { font-family:inherit }
  pre.format  { font-family:inherit }
  pre.smalldisplay { font-family:inherit; font-size:smaller }
  pre.smallformat  { font-family:inherit; font-size:smaller }
  pre.smallexample { font-size:smaller }
  pre.smalllisp    { font-size:smaller }
  span.sc    { font-variant:small-caps }
  span.roman { font-family:serif; font-weight:normal; } 
  span.sansserif { font-family:sans-serif; font-weight:normal; } 
--></style>
</head>
<body>
<div class="node">
<p>
<a name="i386-and-x86-64-Options"></a>
<a name="i386-and-x86_002d64-Options"></a>
Next:&nbsp;<a rel="next" accesskey="n" href="IA_002d64-Options.html#IA_002d64-Options">IA-64 Options</a>,
Previous:&nbsp;<a rel="previous" accesskey="p" href="HPPA-Options.html#HPPA-Options">HPPA Options</a>,
Up:&nbsp;<a rel="up" accesskey="u" href="Submodel-Options.html#Submodel-Options">Submodel Options</a>
<hr>
</div>

<h4 class="subsection">3.17.14 Intel 386 and AMD x86-64 Options</h4>

<p><a name="index-i386-Options-1023"></a><a name="index-x86_002d64-Options-1024"></a><a name="index-Intel-386-Options-1025"></a><a name="index-AMD-x86_002d64-Options-1026"></a>
These `<samp><span class="samp">-m</span></samp>' options are defined for the i386 and x86-64 family of
computers:

     <dl>
<dt><code>-mtune=</code><var>cpu-type</var><dd><a name="index-mtune-1027"></a>Tune to <var>cpu-type</var> everything applicable about the generated code, except
for the ABI and the set of available instructions.  The choices for
<var>cpu-type</var> are:
          <dl>
<dt><em>generic</em><dd>Produce code optimized for the most common IA32/AMD64/EM64T processors. 
If you know the CPU on which your code will run, then you should use
the corresponding <samp><span class="option">-mtune</span></samp> option instead of
<samp><span class="option">-mtune=generic</span></samp>.  But, if you do not know exactly what CPU users
of your application will have, then you should use this option.

          <p>As new processors are deployed in the marketplace, the behavior of this
option will change.  Therefore, if you upgrade to a newer version of
GCC, the code generated option will change to reflect the processors
that were most common when that version of GCC was released.

          <p>There is no <samp><span class="option">-march=generic</span></samp> option because <samp><span class="option">-march</span></samp>
indicates the instruction set the compiler can use, and there is no
generic instruction set applicable to all processors.  In contrast,
<samp><span class="option">-mtune</span></samp> indicates the processor (or, in this case, collection of
processors) for which the code is optimized. 
<br><dt><em>native</em><dd>This selects the CPU to tune for at compilation time by determining
the processor type of the compiling machine.  Using <samp><span class="option">-mtune=native</span></samp>
will produce code optimized for the local machine under the constraints
of the selected instruction set.  Using <samp><span class="option">-march=native</span></samp> will
enable all instruction subsets supported by the local machine (hence
the result might not run on different machines). 
<br><dt><em>i386</em><dd>Original Intel's i386 CPU. 
<br><dt><em>i486</em><dd>Intel's i486 CPU.  (No scheduling is implemented for this chip.) 
<br><dt><em>i586, pentium</em><dd>Intel Pentium CPU with no MMX support. 
<br><dt><em>pentium-mmx</em><dd>Intel PentiumMMX CPU based on Pentium core with MMX instruction set support. 
<br><dt><em>pentiumpro</em><dd>Intel PentiumPro CPU. 
<br><dt><em>i686</em><dd>Same as <code>generic</code>, but when used as <code>march</code> option, PentiumPro
instruction set will be used, so the code will run on all i686 family chips. 
<br><dt><em>pentium2</em><dd>Intel Pentium2 CPU based on PentiumPro core with MMX instruction set support. 
<br><dt><em>pentium3, pentium3m</em><dd>Intel Pentium3 CPU based on PentiumPro core with MMX and SSE instruction set
support. 
<br><dt><em>pentium-m</em><dd>Low power version of Intel Pentium3 CPU with MMX, SSE and SSE2 instruction set
support.  Used by Centrino notebooks. 
<br><dt><em>pentium4, pentium4m</em><dd>Intel Pentium4 CPU with MMX, SSE and SSE2 instruction set support. 
<br><dt><em>prescott</em><dd>Improved version of Intel Pentium4 CPU with MMX, SSE, SSE2 and SSE3 instruction
set support. 
<br><dt><em>nocona</em><dd>Improved version of Intel Pentium4 CPU with 64-bit extensions, MMX, SSE,
SSE2 and SSE3 instruction set support. 
<br><dt><em>k6</em><dd>AMD K6 CPU with MMX instruction set support. 
<br><dt><em>k6-2, k6-3</em><dd>Improved versions of AMD K6 CPU with MMX and 3dNOW! instruction set support. 
<br><dt><em>athlon, athlon-tbird</em><dd>AMD Athlon CPU with MMX, 3dNOW!, enhanced 3dNOW! and SSE prefetch instructions
support. 
<br><dt><em>athlon-4, athlon-xp, athlon-mp</em><dd>Improved AMD Athlon CPU with MMX, 3dNOW!, enhanced 3dNOW! and full SSE
instruction set support. 
<br><dt><em>k8, opteron, athlon64, athlon-fx</em><dd>AMD K8 core based CPUs with x86-64 instruction set support.  (This supersets
MMX, SSE, SSE2, 3dNOW!, enhanced 3dNOW! and 64-bit instruction set extensions.) 
<br><dt><em>winchip-c6</em><dd>IDT Winchip C6 CPU, dealt in same way as i486 with additional MMX instruction
set support. 
<br><dt><em>winchip2</em><dd>IDT Winchip2 CPU, dealt in same way as i486 with additional MMX and 3dNOW! 
instruction set support. 
<br><dt><em>c3</em><dd>Via C3 CPU with MMX and 3dNOW! instruction set support.  (No scheduling is
implemented for this chip.) 
<br><dt><em>c3-2</em><dd>Via C3-2 CPU with MMX and SSE instruction set support.  (No scheduling is
implemented for this chip.) 
</dl>

     <p>While picking a specific <var>cpu-type</var> will schedule things appropriately
for that particular chip, the compiler will not generate any code that
does not run on the i386 without the <samp><span class="option">-march=</span><var>cpu-type</var></samp> option
being used.

     <br><dt><code>-march=</code><var>cpu-type</var><dd><a name="index-march-1028"></a>Generate instructions for the machine type <var>cpu-type</var>.  The choices
for <var>cpu-type</var> are the same as for <samp><span class="option">-mtune</span></samp>.  Moreover,
specifying <samp><span class="option">-march=</span><var>cpu-type</var></samp> implies <samp><span class="option">-mtune=</span><var>cpu-type</var></samp>.

     <br><dt><code>-mcpu=</code><var>cpu-type</var><dd><a name="index-mcpu-1029"></a>A deprecated synonym for <samp><span class="option">-mtune</span></samp>.

     <br><dt><code>-m386</code><dt><code>-m486</code><dt><code>-mpentium</code><dt><code>-mpentiumpro</code><dd><a name="index-m386-1030"></a><a name="index-m486-1031"></a><a name="index-mpentium-1032"></a><a name="index-mpentiumpro-1033"></a>These options are synonyms for <samp><span class="option">-mtune=i386</span></samp>, <samp><span class="option">-mtune=i486</span></samp>,
<samp><span class="option">-mtune=pentium</span></samp>, and <samp><span class="option">-mtune=pentiumpro</span></samp> respectively. 
These synonyms are deprecated.

     <br><dt><code>-mfpmath=</code><var>unit</var><dd><a name="index-march-1034"></a>Generate floating point arithmetics for selected unit <var>unit</var>.  The choices
for <var>unit</var> are:

          <dl>
<dt>`<samp><span class="samp">387</span></samp>'<dd>Use the standard 387 floating point coprocessor present majority of chips and
emulated otherwise.  Code compiled with this option will run almost everywhere. 
The temporary results are computed in 80bit precision instead of precision
specified by the type resulting in slightly different results compared to most
of other chips.  See <samp><span class="option">-ffloat-store</span></samp> for more detailed description.

          <p>This is the default choice for i386 compiler.

          <br><dt>`<samp><span class="samp">sse</span></samp>'<dd>Use scalar floating point instructions present in the SSE instruction set. 
This instruction set is supported by Pentium3 and newer chips, in the AMD line
by Athlon-4, Athlon-xp and Athlon-mp chips.  The earlier version of SSE
instruction set supports only single precision arithmetics, thus the double and
extended precision arithmetics is still done using 387.  Later version, present
only in Pentium4 and the future AMD x86-64 chips supports double precision
arithmetics too.

          <p>For the i386 compiler, you need to use <samp><span class="option">-march=</span><var>cpu-type</var></samp>, <samp><span class="option">-msse</span></samp>
or <samp><span class="option">-msse2</span></samp> switches to enable SSE extensions and make this option
effective.  For the x86-64 compiler, these extensions are enabled by default.

          <p>The resulting code should be considerably faster in the majority of cases and avoid
the numerical instability problems of 387 code, but may break some existing
code that expects temporaries to be 80bit.

          <p>This is the default choice for the x86-64 compiler.

          <br><dt>`<samp><span class="samp">sse,387</span></samp>'<dd>Attempt to utilize both instruction sets at once.  This effectively double the
amount of available registers and on chips with separate execution units for
387 and SSE the execution resources too.  Use this option with care, as it is
still experimental, because the GCC register allocator does not model separate
functional units well resulting in instable performance. 
</dl>

     <br><dt><code>-masm=</code><var>dialect</var><dd><a name="index-masm_003d_0040var_007bdialect_007d-1035"></a>Output asm instructions using selected <var>dialect</var>.  Supported
choices are `<samp><span class="samp">intel</span></samp>' or `<samp><span class="samp">att</span></samp>' (the default one).  Darwin does
not support `<samp><span class="samp">intel</span></samp>'.

     <br><dt><code>-mieee-fp</code><dt><code>-mno-ieee-fp</code><dd><a name="index-mieee_002dfp-1036"></a><a name="index-mno_002dieee_002dfp-1037"></a>Control whether or not the compiler uses IEEE floating point
comparisons.  These handle correctly the case where the result of a
comparison is unordered.

     <br><dt><code>-msoft-float</code><dd><a name="index-msoft_002dfloat-1038"></a>Generate output containing library calls for floating point. 
<strong>Warning:</strong> the requisite libraries are not part of GCC. 
Normally the facilities of the machine's usual C compiler are used, but
this can't be done directly in cross-compilation.  You must make your
own arrangements to provide suitable library functions for
cross-compilation.

     <p>On machines where a function returns floating point results in the 80387
register stack, some floating point opcodes may be emitted even if
<samp><span class="option">-msoft-float</span></samp> is used.

     <br><dt><code>-mno-fp-ret-in-387</code><dd><a name="index-mno_002dfp_002dret_002din_002d387-1039"></a>Do not use the FPU registers for return values of functions.

     <p>The usual calling convention has functions return values of types
<code>float</code> and <code>double</code> in an FPU register, even if there
is no FPU.  The idea is that the operating system should emulate
an FPU.

     <p>The option <samp><span class="option">-mno-fp-ret-in-387</span></samp> causes such values to be returned
in ordinary CPU registers instead.

     <br><dt><code>-mno-fancy-math-387</code><dd><a name="index-mno_002dfancy_002dmath_002d387-1040"></a>Some 387 emulators do not support the <code>sin</code>, <code>cos</code> and
<code>sqrt</code> instructions for the 387.  Specify this option to avoid
generating those instructions.  This option is the default on FreeBSD,
OpenBSD and NetBSD.  This option is overridden when <samp><span class="option">-march</span></samp>
indicates that the target cpu will always have an FPU and so the
instruction will not need emulation.  As of revision 2.6.1, these
instructions are not generated unless you also use the
<samp><span class="option">-funsafe-math-optimizations</span></samp> switch.

     <br><dt><code>-malign-double</code><dt><code>-mno-align-double</code><dd><a name="index-malign_002ddouble-1041"></a><a name="index-mno_002dalign_002ddouble-1042"></a>Control whether GCC aligns <code>double</code>, <code>long double</code>, and
<code>long long</code> variables on a two word boundary or a one word
boundary.  Aligning <code>double</code> variables on a two word boundary will
produce code that runs somewhat faster on a `<samp><span class="samp">Pentium</span></samp>' at the
expense of more memory.

     <p>On x86-64, <samp><span class="option">-malign-double</span></samp> is enabled by default.

     <p><strong>Warning:</strong> if you use the <samp><span class="option">-malign-double</span></samp> switch,
structures containing the above types will be aligned differently than
the published application binary interface specifications for the 386
and will not be binary compatible with structures in code compiled
without that switch.

     <br><dt><code>-m96bit-long-double</code><dt><code>-m128bit-long-double</code><dd><a name="index-m96bit_002dlong_002ddouble-1043"></a><a name="index-m128bit_002dlong_002ddouble-1044"></a>These switches control the size of <code>long double</code> type.  The i386
application binary interface specifies the size to be 96 bits,
so <samp><span class="option">-m96bit-long-double</span></samp> is the default in 32 bit mode.

     <p>Modern architectures (Pentium and newer) would prefer <code>long double</code>
to be aligned to an 8 or 16 byte boundary.  In arrays or structures
conforming to the ABI, this would not be possible.  So specifying a
<samp><span class="option">-m128bit-long-double</span></samp> will align <code>long double</code>
to a 16 byte boundary by padding the <code>long double</code> with an additional
32 bit zero.

     <p>In the x86-64 compiler, <samp><span class="option">-m128bit-long-double</span></samp> is the default choice as
its ABI specifies that <code>long double</code> is to be aligned on 16 byte boundary.

     <p>Notice that neither of these options enable any extra precision over the x87
standard of 80 bits for a <code>long double</code>.

     <p><strong>Warning:</strong> if you override the default value for your target ABI, the
structures and arrays containing <code>long double</code> variables will change
their size as well as function calling convention for function taking
<code>long double</code> will be modified.  Hence they will not be binary
compatible with arrays or structures in code compiled without that switch.

     <br><dt><code>-mmlarge-data-threshold=</code><var>number</var><dd><a name="index-mlarge_002ddata_002dthreshold_003d_0040var_007bnumber_007d-1045"></a>When <samp><span class="option">-mcmodel=medium</span></samp> is specified, the data greater than
<var>threshold</var> are placed in large data section.  This value must be the
same across all object linked into the binary and defaults to 65535.

     <br><dt><code>-msvr3-shlib</code><dt><code>-mno-svr3-shlib</code><dd><a name="index-msvr3_002dshlib-1046"></a><a name="index-mno_002dsvr3_002dshlib-1047"></a>Control whether GCC places uninitialized local variables into the
<code>bss</code> or <code>data</code> segments.  <samp><span class="option">-msvr3-shlib</span></samp> places them
into <code>bss</code>.  These options are meaningful only on System V Release 3.

     <br><dt><code>-mrtd</code><dd><a name="index-mrtd-1048"></a>Use a different function-calling convention, in which functions that
take a fixed number of arguments return with the <code>ret</code> <var>num</var>
instruction, which pops their arguments while returning.  This saves one
instruction in the caller since there is no need to pop the arguments
there.

     <p>You can specify that an individual function is called with this calling
sequence with the function attribute `<samp><span class="samp">stdcall</span></samp>'.  You can also
override the <samp><span class="option">-mrtd</span></samp> option by using the function attribute
`<samp><span class="samp">cdecl</span></samp>'.  See <a href="Function-Attributes.html#Function-Attributes">Function Attributes</a>.

     <p><strong>Warning:</strong> this calling convention is incompatible with the one
normally used on Unix, so you cannot use it if you need to call
libraries compiled with the Unix compiler.

     <p>Also, you must provide function prototypes for all functions that
take variable numbers of arguments (including <code>printf</code>);
otherwise incorrect code will be generated for calls to those
functions.

     <p>In addition, seriously incorrect code will result if you call a
function with too many arguments.  (Normally, extra arguments are
harmlessly ignored.)

     <br><dt><code>-mregparm=</code><var>num</var><dd><a name="index-mregparm-1049"></a>Control how many registers are used to pass integer arguments.  By
default, no registers are used to pass arguments, and at most 3
registers can be used.  You can control this behavior for a specific
function by using the function attribute `<samp><span class="samp">regparm</span></samp>'. 
See <a href="Function-Attributes.html#Function-Attributes">Function Attributes</a>.

     <p><strong>Warning:</strong> if you use this switch, and
<var>num</var> is nonzero, then you must build all modules with the same
value, including any libraries.  This includes the system libraries and
startup modules.

     <br><dt><code>-msseregparm</code><dd><a name="index-msseregparm-1050"></a>Use SSE register passing conventions for float and double arguments
and return values.  You can control this behavior for a specific
function by using the function attribute `<samp><span class="samp">sseregparm</span></samp>'. 
See <a href="Function-Attributes.html#Function-Attributes">Function Attributes</a>.

     <p><strong>Warning:</strong> if you use this switch then you must build all
modules with the same value, including any libraries.  This includes
the system libraries and startup modules.

     <br><dt><code>-mstackrealign</code><dd><a name="index-mstackrealign-1051"></a>Realign the stack at entry.  On the Intel x86, the
<samp><span class="option">-mstackrealign</span></samp> option will generate an alternate prologue and
epilogue that realigns the runtime stack.  This supports mixing legacy
codes that keep a 4-byte aligned stack with modern codes that keep a
16-byte stack for SSE compatibility.  The alternate prologue and
epilogue are slower and bigger than the regular ones, and the
alternate prologue requires an extra scratch register; this lowers the
number of registers available if used in conjunction with the
<code>regparm</code> attribute.  The <samp><span class="option">-mstackrealign</span></samp> option is
incompatible with the nested function prologue; this is considered a
hard error.  See also the attribute <code>force_align_arg_pointer</code>,
applicable to individual functions.

     <br><dt><code>-mpreferred-stack-boundary=</code><var>num</var><dd><a name="index-mpreferred_002dstack_002dboundary-1052"></a>Attempt to keep the stack boundary aligned to a 2 raised to <var>num</var>
byte boundary.  If <samp><span class="option">-mpreferred-stack-boundary</span></samp> is not specified,
the default is 4 (16 bytes or 128 bits).

     <p>On Pentium and PentiumPro, <code>double</code> and <code>long double</code> values
should be aligned to an 8 byte boundary (see <samp><span class="option">-malign-double</span></samp>) or
suffer significant run time performance penalties.  On Pentium III, the
Streaming SIMD Extension (SSE) data type <code>__m128</code> may not work
properly if it is not 16 byte aligned.

     <p>To ensure proper alignment of this values on the stack, the stack boundary
must be as aligned as that required by any value stored on the stack. 
Further, every function must be generated such that it keeps the stack
aligned.  Thus calling a function compiled with a higher preferred
stack boundary from a function compiled with a lower preferred stack
boundary will most likely misalign the stack.  It is recommended that
libraries that use callbacks always use the default setting.

     <p>This extra alignment does consume extra stack space, and generally
increases code size.  Code that is sensitive to stack space usage, such
as embedded systems and operating system kernels, may want to reduce the
preferred alignment to <samp><span class="option">-mpreferred-stack-boundary=2</span></samp>.

     <br><dt><code>-mmmx</code><dt><code>-mno-mmx</code><br><dt><code>-msse</code><dt><code>-mno-sse</code><br><dt><code>-msse2</code><dt><code>-mno-sse2</code><br><dt><code>-msse3</code><dt><code>-mno-sse3</code><br><dt><code>-m3dnow</code><dt><code>-mno-3dnow</code><dd><a name="index-mmmx-1053"></a><a name="index-mno_002dmmx-1054"></a><a name="index-msse-1055"></a><a name="index-mno_002dsse-1056"></a><a name="index-m3dnow-1057"></a><a name="index-mno_002d3dnow-1058"></a>These switches enable or disable the use of instructions in the MMX,
SSE, SSE2 or 3DNow! extended instruction sets.  These extensions are
also available as built-in functions: see <a href="X86-Built_002din-Functions.html#X86-Built_002din-Functions">X86 Built-in Functions</a>,
for details of the functions enabled and disabled by these switches.

     <p>To have SSE/SSE2 instructions generated automatically from floating-point
code (as opposed to 387 instructions), see <samp><span class="option">-mfpmath=sse</span></samp>.

     <p>These options will enable GCC to use these extended instructions in
generated code, even without <samp><span class="option">-mfpmath=sse</span></samp>.  Applications which
perform runtime CPU detection must compile separate files for each
supported architecture, using the appropriate flags.  In particular,
the file containing the CPU detection code should be compiled without
these options.

     <br><dt><code>-mpush-args</code><dt><code>-mno-push-args</code><dd><a name="index-mpush_002dargs-1059"></a><a name="index-mno_002dpush_002dargs-1060"></a>Use PUSH operations to store outgoing parameters.  This method is shorter
and usually equally fast as method using SUB/MOV operations and is enabled
by default.  In some cases disabling it may improve performance because of
improved scheduling and reduced dependencies.

     <br><dt><code>-maccumulate-outgoing-args</code><dd><a name="index-maccumulate_002doutgoing_002dargs-1061"></a>If enabled, the maximum amount of space required for outgoing arguments will be
computed in the function prologue.  This is faster on most modern CPUs
because of reduced dependencies, improved scheduling and reduced stack usage
when preferred stack boundary is not equal to 2.  The drawback is a notable
increase in code size.  This switch implies <samp><span class="option">-mno-push-args</span></samp>.

     <br><dt><code>-mthreads</code><dd><a name="index-mthreads-1062"></a>Support thread-safe exception handling on `<samp><span class="samp">Mingw32</span></samp>'.  Code that relies
on thread-safe exception handling must compile and link all code with the
<samp><span class="option">-mthreads</span></samp> option.  When compiling, <samp><span class="option">-mthreads</span></samp> defines
<samp><span class="option">-D_MT</span></samp>; when linking, it links in a special thread helper library
<samp><span class="option">-lmingwthrd</span></samp> which cleans up per thread exception handling data.

     <br><dt><code>-mno-align-stringops</code><dd><a name="index-mno_002dalign_002dstringops-1063"></a>Do not align destination of inlined string operations.  This switch reduces
code size and improves performance in case the destination is already aligned,
but GCC doesn't know about it.

     <br><dt><code>-minline-all-stringops</code><dd><a name="index-minline_002dall_002dstringops-1064"></a>By default GCC inlines string operations only when destination is known to be
aligned at least to 4 byte boundary.  This enables more inlining, increase code
size, but may improve performance of code that depends on fast memcpy, strlen
and memset for short lengths.

     <br><dt><code>-momit-leaf-frame-pointer</code><dd><a name="index-momit_002dleaf_002dframe_002dpointer-1065"></a>Don't keep the frame pointer in a register for leaf functions.  This
avoids the instructions to save, set up and restore frame pointers and
makes an extra register available in leaf functions.  The option
<samp><span class="option">-fomit-frame-pointer</span></samp> removes the frame pointer for all functions
which might make debugging harder.

     <br><dt><code>-mtls-direct-seg-refs</code><dt><code>-mno-tls-direct-seg-refs</code><dd><a name="index-mtls_002ddirect_002dseg_002drefs-1066"></a>Controls whether TLS variables may be accessed with offsets from the
TLS segment register (<code>%gs</code> for 32-bit, <code>%fs</code> for 64-bit),
or whether the thread base pointer must be added.  Whether or not this
is legal depends on the operating system, and whether it maps the
segment to cover the entire TLS area.

     <p>For systems that use GNU libc, the default is on. 
</dl>

 <p>These `<samp><span class="samp">-m</span></samp>' switches are supported in addition to the above
on AMD x86-64 processors in 64-bit environments.

     <dl>
<dt><code>-m32</code><dt><code>-m64</code><dd><a name="index-m32-1067"></a><a name="index-m64-1068"></a>Generate code for a 32-bit or 64-bit environment. 
The 32-bit environment sets int, long and pointer to 32 bits and
generates code that runs on any i386 system. 
The 64-bit environment sets int to 32 bits and long and pointer
to 64 bits and generates code for AMD's x86-64 architecture. For
darwin only the -m64 option turns off the <samp><span class="option">-fno-pic</span></samp> and
<samp><span class="option">-mdynamic-no-pic</span></samp> options.

     <br><dt><code>-mno-red-zone</code><dd><a name="index-no_002dred_002dzone-1069"></a>Do not use a so called red zone for x86-64 code.  The red zone is mandated
by the x86-64 ABI, it is a 128-byte area beyond the location of the
stack pointer that will not be modified by signal or interrupt handlers
and therefore can be used for temporary data without adjusting the stack
pointer.  The flag <samp><span class="option">-mno-red-zone</span></samp> disables this red zone.

     <br><dt><code>-mcmodel=small</code><dd><a name="index-mcmodel_003dsmall-1070"></a>Generate code for the small code model: the program and its symbols must
be linked in the lower 2 GB of the address space.  Pointers are 64 bits. 
Programs can be statically or dynamically linked.  This is the default
code model.

     <br><dt><code>-mcmodel=kernel</code><dd><a name="index-mcmodel_003dkernel-1071"></a>Generate code for the kernel code model.  The kernel runs in the
negative 2 GB of the address space. 
This model has to be used for Linux kernel code.

     <br><dt><code>-mcmodel=medium</code><dd><a name="index-mcmodel_003dmedium-1072"></a>Generate code for the medium model: The program is linked in the lower 2
GB of the address space but symbols can be located anywhere in the
address space.  Programs can be statically or dynamically linked, but
building of shared libraries are not supported with the medium model.

     <br><dt><code>-mcmodel=large</code><dd><a name="index-mcmodel_003dlarge-1073"></a>Generate code for the large model: This model makes no assumptions
about addresses and sizes of sections.  Currently GCC does not implement
this model. 
</dl>

 </body></html>

