diff options
author | Martin Liska <marxin@gcc.gnu.org> | 2018-07-04 07:51:08 +0000 |
---|---|---|
committer | Martin Liska <marxin@gcc.gnu.org> | 2018-07-04 07:51:08 +0000 |
commit | c518c1025b435e1c593a745036fc9b8ed04c5819 (patch) | |
tree | 75ee9f7156d26af39f332f3fab50c5012d340427 /gcc/doc | |
parent | dd047c67e45c244c147a8244671154c77a9bda47 (diff) | |
download | gcc-c518c1025b435e1c593a745036fc9b8ed04c5819.zip gcc-c518c1025b435e1c593a745036fc9b8ed04c5819.tar.gz gcc-c518c1025b435e1c593a745036fc9b8ed04c5819.tar.bz2 |
[multiple changes]
2018-07-04 Denys Vlasenko <dvlasenk@redhat.com>
Martin Liska <mliska@suse.cz>
PR middle-end/66240
PR target/45996
PR c/84100
* common.opt: Rename align options with 'str_' prefix.
* common/config/i386/i386-common.c (set_malign_value): New
function.
(ix86_handle_option): Use it to set -falign-* options/
* config/aarch64/aarch64-protos.h (struct tune_params): Change
type from int to string.
* config/aarch64/aarch64.c: Update default values from int
to string.
* config/alpha/alpha.c (alpha_override_options_after_change):
Likewise.
* config/arm/arm.c (arm_override_options_after_change_1): Likewise.
* config/i386/dragonfly.h (ASM_OUTPUT_MAX_SKIP_ALIGN): Print
max skip conditionally.
* config/i386/freebsd.h (SUBALIGN_LOG): New.
(ASM_OUTPUT_MAX_SKIP_ALIGN): Print
max skip conditionally.
* config/i386/gas.h (ASM_OUTPUT_MAX_SKIP_ALIGN): Print
max skip conditionally.
* config/i386/gnu-user.h (SUBALIGN_LOG): New.
(ASM_OUTPUT_MAX_SKIP_ALIGN): Print
max skip conditionally.
* config/i386/i386.c (struct ptt): Change type from int to
string.
(ix86_default_align): Set default values.
* config/i386/i386.h (ASM_OUTPUT_MAX_SKIP_PAD): Print
max skip conditionally.
* config/i386/iamcu.h (SUBALIGN_LOG): New.
(ASM_OUTPUT_MAX_SKIP_ALIGN):
* config/i386/lynx.h (ASM_OUTPUT_MAX_SKIP_ALIGN):
* config/i386/netbsd-elf.h (ASM_OUTPUT_MAX_SKIP_ALIGN): Print
max skip conditionally.
* config/i386/openbsdelf.h (SUBALIGN_LOG): New.
(ASM_OUTPUT_MAX_SKIP_ALIGN) Print max skip conditionally.:
* config/i386/x86-64.h (SUBALIGN_LOG): New.
(ASM_OUTPUT_MAX_SKIP_ALIGN): Print
max skip conditionally.
(ASM_OUTPUT_MAX_SKIP_PAD): Likewise.
* config/ia64/ia64.c (ia64_option_override): Set default values
for alignment options.
* config/m68k/m68k.c: Handle new str_align_* options.
* config/mips/mips.c (mips_set_compression_mode): Change
type of constants.
(mips_option_override): Set default values for options.
* config/powerpcspe/powerpcspe.c (rs6000_option_override_internal):
Likewise.
* config/rs6000/rs6000.c (rs6000_option_override_internal):
Likewise.
* config/rx/rx.c (rx_option_override): Likewise.
* config/rx/rx.h (JUMP_ALIGN): Use align_jumps_log.
(LABEL_ALIGN): Use align_labels_log.
(LOOP_ALIGN): Use align_loops_align.
* config/s390/s390.c (s390_asm_output_function_label): Use new
macros.
* config/sh/sh.c (sh_override_options_after_change):
Change type of constants.
* config/spu/spu.c (spu_sched_init): Likewise.
* config/sparc/sparc.c (sparc_option_override): Set default
values for options.
* config/visium/visium.c (visium_option_override): Likewise.
* config/visium/visium.h (ASM_OUTPUT_MAX_SKIP_ALIGN): Do not
emit p2align format with last argument if it's not needed.
* doc/invoke.texi: Document extended format of -falign-*.
* final.c: Use align_labels alignment.
* flags.h (struct target_flag_state): Change type to use
align_flags.
(struct align_flags_tuple): New.
(struct align_flags): Likewise.
(align_loops_log): Redefine macro to use new types.
(align_loops_max_skip): Redefine macro to use new types.
(align_jumps_log): Redefine macro to use new types.
(align_jumps_max_skip): Redefine macro to use new types.
(align_labels_log): Redefine macro to use new types.
(align_labels_max_skip): Redefine macro to use new types.
(align_functions_log): Redefine macro to use new types.
(align_loops): Redefine macro to use new types.
(align_jumps): Redefine macro to use new types.
(align_labels): Redefine macro to use new types.
(align_functions): Redefine macro to use new types.
(align_functions_max_skip): Redefine macro to use new types.
(align_loops_value): New macro.
(align_jumps_value): New macro.
(align_labels_value): New macro.
(align_functions_value): New macro.
* function.c (invoke_set_current_function_hook): Propagate
alignment values from flags to global variables default in
topleev.h.
* ipa-icf.c (sem_function::equals_wpa): Use
cl_optimization_option_eq instead of memcmp.
* lto-streamer.h (cl_optimization_stream_out): Support streaming
of string types.
(cl_optimization_stream_in): Likewise.
* optc-save-gen.awk: Support strings in cl_optimization.
* opth-gen.awk: Likewise.
* opts.c (finish_options): Remove error checking of invalid
value ranges.
(MAX_CODE_ALIGN): Remove.
(MAX_CODE_ALIGN_VALUE): Likewise.
(parse_and_check_align_values): New function.
(check_alignment_argument): Likewise.
(common_handle_option): Use check_alignment_argument.
* opts.h (parse_and_check_align_values): Declare.
* toplev.c (init_alignments): Remove.
(read_log_maxskip): New.
(parse_N_M): Likewise.
(parse_alignment_opts): Likewise.
(backend_init_target): Remove usage of init_alignments.
* toplev.h (parse_alignment_opts): Declare.
* tree-streamer-in.c (streamer_read_tree_bitfields): Add new
argument.
* tree-streamer-out.c (streamer_write_tree_bitfields): Likewise.
* tree.c (cl_option_hasher::equal): New.
* varasm.c: Use new global macros.
2018-07-04 Martin Liska <mliska@suse.cz>
PR middle-end/66240
PR target/45996
PR c/84100
* lto.c (compare_tree_sccs_1): Use cl_optimization_option_eq
instead of memcmp.
2018-07-04 Martin Liska <mliska@suse.cz>
PR middle-end/66240
PR target/45996
PR c/84100
* gcc.dg/pr84100.c (foo):
* gcc.target/i386/falign-functions-2.c: New test.
* gcc.target/i386/falign-functions.c: New test.
From-SVN: r262375
Diffstat (limited to 'gcc/doc')
-rw-r--r-- | gcc/doc/invoke.texi | 66 |
1 files changed, 46 insertions, 20 deletions
diff --git a/gcc/doc/invoke.texi b/gcc/doc/invoke.texi index 31d4f10..e0e59f6 100644 --- a/gcc/doc/invoke.texi +++ b/gcc/doc/invoke.texi @@ -365,9 +365,11 @@ Objective-C and Objective-C++ Dialects}. @item Optimization Options @xref{Optimize Options,,Options that Control Optimization}. -@gccoptlist{-faggressive-loop-optimizations -falign-functions[=@var{n}] @gol --falign-jumps[=@var{n}] @gol --falign-labels[=@var{n}] -falign-loops[=@var{n}] @gol +@gccoptlist{-faggressive-loop-optimizations @gol +-falign-functions[=@var{n}[:@var{m}:[@var{n2}[:@var{m2}]]]] @gol +-falign-jumps[=@var{n}[:@var{m}:[@var{n2}[:@var{m2}]]]] @gol +-falign-labels[=@var{n}[:@var{m}:[@var{n2}[:@var{m2}]]]] @gol +-falign-loops[=@var{n}[:@var{m}:[@var{n2}[:@var{m2}]]]] @gol -fassociative-math -fauto-profile -fauto-profile[=@var{path}] @gol -fauto-inc-dec -fbranch-probabilities @gol -fbranch-target-load-optimize -fbranch-target-load-optimize2 @gol @@ -9240,19 +9242,36 @@ The @option{-fstrict-aliasing} option is enabled at levels @item -falign-functions @itemx -falign-functions=@var{n} +@itemx -falign-functions=@var{n}:@var{m} +@itemx -falign-functions=@var{n}:@var{m}:@var{n2} +@itemx -falign-functions=@var{n}:@var{m}:@var{n2}:@var{m2} @opindex falign-functions Align the start of functions to the next power-of-two greater than -@var{n}, skipping up to @var{n} bytes. For instance, -@option{-falign-functions=32} aligns functions to the next 32-byte -boundary, but @option{-falign-functions=24} aligns to the next -32-byte boundary only if this can be done by skipping 23 bytes or less. +@var{n}, skipping up to @var{m}-1 bytes. This ensures that at least +the first @var{m} bytes of the function can be fetched by the CPU +without crossing an @var{n}-byte alignment boundary. -@option{-fno-align-functions} and @option{-falign-functions=1} are -equivalent and mean that functions are not aligned. +If @var{m} is not specified, it defaults to @var{n}. + +Examples: @option{-falign-functions=32} aligns functions to the next +32-byte boundary, @option{-falign-functions=24} aligns to the next +32-byte boundary only if this can be done by skipping 23 bytes or less, +@option{-falign-functions=32:7} aligns to the next +32-byte boundary only if this can be done by skipping 6 bytes or less. + +The second pair of @var{n2}:@var{m2} values allows you to specify +a secondary alignment: @option{-falign-functions=64:7:32:3} aligns to +the next 64-byte boundary if this can be done by skipping 6 bytes or less, +otherwise aligns to the next 32-byte boundary if this can be done +by skipping 2 bytes or less. +If @var{m2} is not specified, it defaults to @var{n2}. Some assemblers only support this flag when @var{n} is a power of two; in that case, it is rounded up. +@option{-fno-align-functions} and @option{-falign-functions=1} are +equivalent and mean that functions are not aligned. + If @var{n} is not specified or is zero, use a machine-dependent default. The maximum allowed @var{n} option value is 65536. @@ -9266,12 +9285,13 @@ skip more bytes than the size of the function. @item -falign-labels @itemx -falign-labels=@var{n} +@itemx -falign-labels=@var{n}:@var{m} +@itemx -falign-labels=@var{n}:@var{m}:@var{n2} +@itemx -falign-labels=@var{n}:@var{m}:@var{n2}:@var{m2} @opindex falign-labels -Align all branch targets to a power-of-two boundary, skipping up to -@var{n} bytes like @option{-falign-functions}. This option can easily -make code slower, because it must insert dummy operations for when the -branch target is reached in the usual flow of the code. +Align all branch targets to a power-of-two boundary. +Parameters of this option are analogous to the @option{-falign-functions} option. @option{-fno-align-labels} and @option{-falign-labels=1} are equivalent and mean that labels are not aligned. @@ -9286,12 +9306,15 @@ Enabled at levels @option{-O2}, @option{-O3}. @item -falign-loops @itemx -falign-loops=@var{n} +@itemx -falign-loops=@var{n}:@var{m} +@itemx -falign-loops=@var{n}:@var{m}:@var{n2} +@itemx -falign-loops=@var{n}:@var{m}:@var{n2}:@var{m2} @opindex falign-loops -Align loops to a power-of-two boundary, skipping up to @var{n} bytes -like @option{-falign-functions}. If the loops are -executed many times, this makes up for any execution of the dummy -operations. +Align loops to a power-of-two boundary. If the loops are executed +many times, this makes up for any execution of the dummy padding +instructions. +Parameters of this option are analogous to the @option{-falign-functions} option. @option{-fno-align-loops} and @option{-falign-loops=1} are equivalent and mean that loops are not aligned. The maximum allowed @var{n} option value is 65536. @@ -9302,12 +9325,15 @@ Enabled at levels @option{-O2}, @option{-O3}. @item -falign-jumps @itemx -falign-jumps=@var{n} +@itemx -falign-jumps=@var{n}:@var{m} +@itemx -falign-jumps=@var{n}:@var{m}:@var{n2} +@itemx -falign-jumps=@var{n}:@var{m}:@var{n2}:@var{m2} @opindex falign-jumps Align branch targets to a power-of-two boundary, for branch targets -where the targets can only be reached by jumping, skipping up to @var{n} -bytes like @option{-falign-functions}. In this case, no dummy operations -need be executed. +where the targets can only be reached by jumping. In this case, +no dummy operations need be executed. +Parameters of this option are analogous to the @option{-falign-functions} option. @option{-fno-align-jumps} and @option{-falign-jumps=1} are equivalent and mean that loops are not aligned. |