+2008-07-19 Jan Hubicka <jh@suse.cz>
+
+ * doc/extend.texi (flatten attribute): Remove note about unit-at-a-time
+ * doc/invoke.texi (--combine): Likewise.
+ (-finline-functions-called-once): Update levels when enabled.
+ (-funit-at-a-time): Document new behaviour.
+ (-ftoplevel-reorder): Document that it is enabled -O0 and imply
+ -fno-section-anchors when disabled explicitly.
+ (inline params): They are not ignored now.
+ (precompiled headers): Remove unit-at-a-time as being incompatible.
+ * opts.c (decode_options): Handle unit-at-a-time as alias;
+ imply -fno-section-anchors when toplevel reorder is disabled
+ explicitly.
+ * common.opt (ftoplevel-reorder): Set default value to 2.
+ (funit-at-a-time): Set default value to 1.
+ * config/rs6000/rs6000.c (optimization_options): Set section anchors
+ to 2.
+
2008-07-19 Jan Hubicka <jh@suse.cz>
* builtins.c (expand_builtin_int_roundingfn,
the performance and/or code size at the expense of compilation time
and possibly the ability to debug the program.
-The compiler performs optimization based on the knowledge it has of
-the program. Optimization levels @option{-O} and above, in
-particular, enable @emph{unit-at-a-time} mode, which allows the
-compiler to consider information gained from later functions in
-the file when compiling a function. Compiling multiple files at
-once to a single output file in @emph{unit-at-a-time} mode allows
-the compiler to use information gained from all of the files when
-compiling each of them.
+The compiler performs optimization based on the knowledge it has of the
+program. Compiling multiple files at once to a single output file mode allows
+the compiler to use information gained from all of the files when compiling
+each of them.
Not all optimizations are controlled directly by a flag. Only
optimizations that have a flag are listed.
function is integrated, then the function is not output as assembler code
in its own right.
-Enabled if @option{-funit-at-a-time} is enabled.
+Enabled at levels @option{-O1}, @option{-O2}, @option{-O3} and @option{-Os}.
@item -fearly-inlining
@opindex fearly-inlining
@item -funit-at-a-time
@opindex funit-at-a-time
-Parse the whole compilation unit before starting to produce code.
-This allows some extra optimizations to take place but consumes
-more memory (in general). There are some compatibility issues
-with @emph{unit-at-a-time} mode:
-@itemize @bullet
-@item
-enabling @emph{unit-at-a-time} mode may change the order
-in which functions, variables, and top-level @code{asm} statements
-are emitted, and will likely break code relying on some particular
-ordering. The majority of such top-level @code{asm} statements,
-though, can be replaced by @code{section} attributes. The
-@option{fno-toplevel-reorder} option may be used to keep the ordering
-used in the input file, at the cost of some optimizations.
-
-@item
-@emph{unit-at-a-time} mode removes unreferenced static variables
-and functions. This may result in undefined references
-when an @code{asm} statement refers directly to variables or functions
-that are otherwise unused. In that case either the variable/function
-shall be listed as an operand of the @code{asm} statement operand or,
-in the case of top-level @code{asm} statements the attribute @code{used}
-shall be used on the declaration.
-
-@item
-Static functions now can use non-standard passing conventions that
-may break @code{asm} statements calling functions directly. Again,
-attribute @code{used} will prevent this behavior.
-@end itemize
-
-As a temporary workaround, @option{-fno-unit-at-a-time} can be used,
-but this scheme may not be supported by future releases of GCC@.
+This option is left for compatibility reasons. @option{-funit-at-a-time}
+has no effect, while @option{-fno-unit-at-a-time} implies
+@option{-fno-toplevel-reorder} and @option{-fno-section-anchors}.
-Enabled at levels @option{-O}, @option{-O2}, @option{-O3}, @option{-Os}.
+Enabled by default.
@item -fno-toplevel-reorder
@opindex fno-toplevel-reorder
which relies on a particular ordering. For new code, it is better to
use attributes.
+Enabled at level @option{-O0}. When disabled explicitly, it also imply
+@option{-fno-section-anchors} that is otherwise enabled at @option{-O0} on some
+targets.
+
@item -fweb
@opindex fweb
Constructs webs as commonly used for register allocation purposes and assign
@option{--param large-function-growth}. This parameter is useful primarily
to avoid extreme compilation time caused by non-linear algorithms used by the
backend.
-This parameter is ignored when @option{-funit-at-a-time} is not used.
The default value is 2700.
@item large-function-growth
Specifies maximal growth of large function caused by inlining in percents.
-This parameter is ignored when @option{-funit-at-a-time} is not used.
The default value is 100 which limits large function growth to 2.0 times
the original size.
@item inline-unit-growth
Specifies maximal overall growth of the compilation unit caused by inlining.
-This parameter is ignored when @option{-funit-at-a-time} is not used.
The default value is 30 which limits unit growth to 1.3 times the original
size.
@item Each of the following options must be the same when building and using
the precompiled header:
-@gccoptlist{-fexceptions -funit-at-a-time}
+@gccoptlist{-fexceptions}
@item
Some other command-line options starting with @option{-f},
}
}
- if (!optimize)
+
+ if (!flag_unit_at_a_time)
{
- flag_merge_constants = 0;
+ flag_section_anchors = 0;
+ flag_toplevel_reorder = 0;
+ flag_unit_at_a_time = 1;
+ }
+ if (!flag_toplevel_reorder)
+ {
+ if (flag_section_anchors == 1)
+ error ("Section anchors must be disabled when toplevel reorder is disabled.");
+ flag_section_anchors = 0;
}
- if (!no_unit_at_a_time_default)
+ if (!optimize)
{
- flag_unit_at_a_time = 1;
- if (!optimize)
+ flag_merge_constants = 0;
+
+ /* We disable toplevel reordering at -O0 to disable transformations that
+ might be surprising to end users and to get -fno-toplevel-reorder
+ tested, but we keep section anchors. */
+ if (flag_toplevel_reorder == 2)
flag_toplevel_reorder = 0;
}