__builtin_stdarg_start
has been completely
removed from GCC. Support for <varargs.h>
had
been deprecated since GCC 4.0. Use
__builtin_va_start
as a replacement. -fpermissive
are now warnings by default. They can be
converted into errors by using -pedantic-errors
.-Wdeprecated
or -pedantic
is used.
This extension has been deprecated for many years, but never
warned about.char
were not properly
bit-packed on many targets prior to GCC 4.4. On these targets, the fix in
GCC 4.4 causes an ABI change. For example there is no longer a 4-bit
padding between field a
and b
in this structure:
struct foo { char a:4; char b:8; } __attribute__ ((packed));
There is a new warning to help identify fields that are affected:
foo.c:5: note: Offset of packed bit-field 'b' has changed in GCC 4.4
The warning can be disabled with
-Wno-packed-bitfield-compat
.
va_list
type has been changed to conform to the
current revision of the EABI. This does not affect the libstdc++
library included with GCC.h
asm
constraint. It was necessary to remove
this constraint in order to avoid generating unpredictable
code sequences.
One of the main uses of the h
constraint
was to extract the high part of a multiplication on
64-bit targets. For example:
asm ("dmultu\t%1,%2" : "=h" (result) : "r" (x), "r" (y));
You can now achieve the same effect using 128-bit types:
typedef unsigned int uint128_t __attribute__((mode(TI))); result = ((uint128_t) x * y) >> 64;
The second sequence is better in many ways. For example,
if x
and y
are constants, the
compiler can perform the multiplication at compile time.
If x
and y
are not constants,
the compiler can schedule the runtime multiplication
better than it can schedule an asm
statement.
Support for a number of older systems and recently unmaintained or untested target ports of GCC has been declared obsolete in GCC 4.4. Unless there is activity to revive them, the next release of GCC will have their sources permanently removed.
The following ports for individual systems on particular architectures have been obsoleted:
protoize
and unprotoize
utilities have been obsoleted and will be removed in GCC 4.5.
These utilities have not been installed by default since GCC
3.0.-Wno-*
options are now silently ignored
by GCC if no other diagnostics are issued. If other diagnostics
are issued, then GCC warns about the unknown options.-findirect-inlining
has been
added. When turned on it allows the inliner to also inline indirect
calls that are discovered to have known targets at compile time
thanks to previous inlining. -ftree-switch-conversion
has
been added. This new pass turns simple initializations of scalar
variables in switch statements into initializations from a static array,
given that all the values are known at compile time and the ratio between
the new array size and the original switch branches does not exceed
the parameter --param switch-conversion-max-branch-ratio
(default is eight). -ftree-builtin-call-dce
has been added. This optimization eliminates unnecessary calls
to certain builtin functions when the return value is not used,
in cases where the calls can not be eliminated entirely because
the function may set errno
. This optimization is
on by default at -O2
and above.-fconserve-stack
directs the compiler to minimize stack usage even if it makes
the generated code slower. This affects inlining
decisions..cfi
directives.
This makes it possible to use such directives in inline
assembler code. The new option -fno-dwarf2-cfi-asm
directs the compiler to not use .cfi
directives.The Graphite branch has been merged. This merge has brought in a new framework for loop optimizations based on a polyhedral intermediate representation. These optimizations apply to all the languages supported by GCC. The following new code transformations are available in GCC 4.4:
-floop-interchange
performs loop interchange transformations on loops. Interchanging two
nested loops switches the inner and outer loops. For example, given a
loop like:
DO J = 1, M DO I = 1, N A(J, I) = A(J, I) * C ENDDO ENDDO
loop interchange will transform the loop as if the user had written:
DO I = 1, N DO J = 1, M A(J, I) = A(J, I) * C ENDDO ENDDO
which can be beneficial when N
is larger than the caches,
because in Fortran, the elements of an array are stored in memory
contiguously by column, and the original loop iterates over rows,
potentially creating at each access a cache miss.
-floop-strip-mine
performs loop strip mining transformations on loops. Strip mining
splits a loop into two nested loops. The outer loop has strides
equal to the strip size and the inner loop has strides of the
original loop within a strip. For example, given a loop like:
DO I = 1, N A(I) = A(I) + C ENDDO
loop strip mining will transform the loop as if the user had written:
DO II = 1, N, 4 DO I = II, min (II + 3, N) A(I) = A(I) + C ENDDO ENDDO
-floop-block
performs loop blocking transformations on loops. Blocking strip mines
each loop in the loop nest such that the memory accesses of the
element loops fit inside caches. For example, given a loop like:
DO I = 1, N DO J = 1, M A(J, I) = B(I) + C(J) ENDDO ENDDO
loop blocking will transform the loop as if the user had written:
DO II = 1, N, 64 DO JJ = 1, M, 64 DO I = II, min (II + 63, N) DO J = JJ, min (JJ + 63, M) A(J, I) = B(I) + C(J) ENDDO ENDDO ENDDO ENDDO
which can be beneficial when M
is larger than the caches,
because the innermost loop will iterate over a smaller amount of data
that can be kept in the caches.
-O3
optimization level.
-fprofile-generate
with a
multi-threaded program, the profile counts may be slightly wrong
due to race conditions. The
new -fprofile-correction
option directs the
compiler to apply heuristics to smooth out the inconsistencies.
By default the compiler will give an error message when it finds
an inconsistent profile.-fprofile-dir=PATH
option permits setting
the directory where profile data files are stored when
using -fprofile-generate
and friends, and the
directory used when reading profile data files
using -fprofile-use
and friends.-Wframe-larger-than=NUMBER
option directs
GCC to emit a warning if any stack frame is larger
than NUMBER
bytes. This may be used to help ensure that
code fits within a limited amount of stack space.-Wno-mudflap
option disables warnings
about constructs which can not be instrumented when
using -fmudflap
.optimize
attribute was added to allow programmers to
change the optimization level and particular optimization options for an
individual function. You can also change the optimization options via the
GCC optimize
pragma for functions defined after the pragma.
The GCC push_options
pragma and the
GCC pop_options
pragma allow you temporarily save and restore
the options used. The GCC reset_options
pragma restores the
options to what was specified on the command line.
-Wuninitialized
can be used
together with -O0
. Nonetheless, the warnings given
by -Wuninitialized
will probably be more accurate if
optimization is enabled.
-Wparentheses
now warns about expressions such as
(!x | y)
and (!x & y)
. Using explicit
parentheses, such as in ((!x) | y)
, silences this
warning.-Wsequence-points
now warns within
if
, while
,do while
and for
conditions, and within for
begin/end expressions.
-dU
is available to dump definitions
of preprocessor macros that are tested or expanded.auto
, inline namespaces, generalized initializer
lists, defaulted and deleted functions, new character types, and
scoped enums.-fpermissive
when
-fdiagnostics-show-option
is enabled.-Wconversion
now warns if the result of a
static_cast
to enumeral type is unspecified because
the value is outside the range of the enumeral type.
-Wuninitialized
now warns if a non-static
reference or non-static const
member appears in a
class without constructors.
()
and an implicitly defined default
constructor will be zero-initialized before the default constructor is
called.unique_ptr
, <algorithm>
additions, exception propagation, and support for the new
character types in <string> and <limits>.-cpp
option was added to allow manual invocation of the
preprocessor without relying on filename extensions.-Warray-temporaries
option warns about array temporaries
generated by the compiler, as an aid to optimization.-fcheck-array-temporaries
option has been added, printing
a notification at run time, when an array temporary had to be created for
an function argument. Contrary to -Warray-temporaries
the
warning is only printed if the array is noncontiguous.-std=
and -fall-intrinsics
) gfortran will now
treat it as if this procedure were declared EXTERNAL
and
try to link to a user-supplied procedure. -Wintrinsics-std
will warn whenever this happens. The now-useless option
-Wnonstd-intrinsic
was removed.-falign-commons
has been added to control the
alignment of variables in COMMON blocks, which is enabled by default in
line with previous GCC version. Using -fno-align-commons
one
can force commons to be contiguous in memory as required by the Fortran
standard, however, this slows down the memory access. The option
-Walign-commons
, which is enabled by default, warns when
padding bytes were added for alignment. The proper solution is to sort
the common objects by decreasing storage size, which avoids the alignment
problems.kind=4
) and UTF-8
I/O is now supported (except internal reads from/writes to wide
strings).
-fbackslash
now supports also
\unnnn
and \Unnnnnnnn
to enter Unicode characters.decimal=
, size=
, sign=
,
pad=
, blank=
, and delim=
specifiers are now supported in I/O statements.PROCEDURE
and GENERIC
but not as
operators). Note: As CLASS
/polymorphyic types are
not implemented, type-bound procedures with PASS
accept as non-standard extension TYPE
arguments.-std=f2008
option and support for the file
extensions .f2008
and .F2008
has been
added.ASINH
,
ACOSH
, ATANH
, ERF
,
ERFC
, GAMMA
, LOG_GAMMA
,
BESSEL_*
, HYPOT
,
and ERFC_SCALED
are now available
(some of them existed as GNU extension before). Note: The hyperbolic
functions are not yet supporting complex arguments and the three-
argument version of BESSEL_*N
is not available.LEADZ
and TRAILZ
have been added.-mfpu=vfpv3-d16
. The
option -mfpu=vfp3
has been renamed
to -mfpu=vfpv3
.-mfix-cortex-m3-ldrd
option
to work around an erratum on Cortex-M3 processors.__sync_*
atomic operations
for ARM EABI GNU/Linux.__gnu_mcount_nc
, which is provided by GNU
libc versions 2.8 and later.-mno-tablejump
option has been deprecated because
it has the same effect as the -fno-jump-tables
option.-maes
.-mpclmul
.-mavx
.-mveclibabi=svml
is specified
and you link to an SVML ABI compatible library.target
attribute was added to allow programmers to change the target options like -msse2
or -march=k8
for an individual function. You can also change the target options via the GCC target
pragma for functions defined after the pragma.--with-arch-32
, --with-arch-64
,
--with-cpu-32
, --with-cpu-64
,
--with-tune-32
and --with-tune-64
to
control the default optimization separately for 32-bit and 64-bit
modes.__float128
(TFmode) IEEE quad type and
corresponding TCmode IEEE complex quad type is available
via the soft-fp library on IA-32/IA64
targets.
This includes basic arithmetic operations (addition, subtraction,
negation, multiplication and division) on __float128
real and TCmode complex values, the full set of IEEE comparisons
between __float128
values, conversions to and from
float
, double
and long double
floating point types, as well as conversions to and from
signed
or unsigned
integer,
signed
or unsigned long
integer and
signed
or unsigned
quad
(TImode, IA64
only) integer types. Additionally,
all operations generate the full set of IEEE exceptions and support
the full set of IEEE rounding modes.-mxgot
option to support
programs requiring many GOT entries on ColdFire.MIPS Technologies have extended the original MIPS SVR4 ABI to include support for procedure linkage tables (PLTs) and copy relocations. These extensions allow GNU/Linux executables to use a significantly more efficient code model than the one defined by the original ABI.
GCC support for this code model is available via a
new command-line option, -mplt
. There is also
a new configure-time option, --with-mips-plt
,
to make -mplt
the default.
The new code model requires support from the assembler, the linker, and the runtime C library. This support is available in binutils 2.19 and GLIBC 2.9.
-march=xlr
and -mtune=xlr
options.libgcc
function.-march=native
and -mtune=native
, which select the host processor.-march=
and -mtune=
names for
these processors are r10000
, r12000
,
r14000
and r16000
respectively.-mr10k-cache-barrier
option for details.-march=mips64r2
enables generation of these
instructions.-march=octeon
and
-mtune=octeon
options.-march=
and -mtune=
names for
these processors are loongson2e
and
loongson2f
.Picochip is a 16-bit processor. A typical picoChip contains over 250
small cores, each with small amounts of memory. There are three processor
variants (STAN, MEM and CTRL) with different instruction sets and memory
configurations and they can be chosen using the -mae
option.
This port is intended to be a "C" only port.
-march=z10
option,
the compiler will generate code making use of instructions
provided by the General-Instruction-Extension Facility and the
Execute-Extension Facility.Please send FSF & GNU inquiries & questions to gnu@gnu.org. There are also other ways to contact the FSF.
These pages are maintained by the GCC team.
For questions related to the use of GCC, please consult these web pages and the GCC manuals. If that fails, the gcc-help@gcc.gnu.org mailing list might help.Copyright (C) Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110, USA.
Verbatim copying and distribution of this entire article is permitted in any medium, provided this notice is preserved.
Last modified 2009-04-21 |