From: Christian Bruel Date: Wed, 6 May 2015 10:54:40 +0000 (+0200) Subject: re PR target/66015 (align directives not propagated after __attribute__ ((__optimize_... X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=487edc878fe4c984c2b16fa6dd28e2715977dd24;p=gcc.git re PR target/66015 (align directives not propagated after __attribute__ ((__optimize__ ("O2")))) 2015-05-06 Christian Bruel PR target/66015 * config/aarch64/aarch64.c (aarch64_override_options): Move align_loops, align_jumps, align_functions into aarch64_override_options_after_change. From-SVN: r222847 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index f201ab905cb..07ea864db7b 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2015-05-06 Christian Bruel + + PR target/66015 + * config/aarch64/aarch64.c (aarch64_override_options): Move align_loops, + align_jumps, align_functions into aarch64_override_options_after_change. + 2015-05-06 Richard Biener * tree-vect-slp.c (vect_supported_load_permutation_p): Use diff --git a/gcc/config/aarch64/aarch64.c b/gcc/config/aarch64/aarch64.c index 7bc28ae7cf2..7a34e4905f7 100644 --- a/gcc/config/aarch64/aarch64.c +++ b/gcc/config/aarch64/aarch64.c @@ -7053,18 +7053,6 @@ aarch64_override_options (void) #endif } - /* If not opzimizing for size, set the default - alignment to what the target wants */ - if (!optimize_size) - { - if (align_loops <= 0) - align_loops = aarch64_tune_params->loop_align; - if (align_jumps <= 0) - align_jumps = aarch64_tune_params->jump_align; - if (align_functions <= 0) - align_functions = aarch64_tune_params->function_align; - } - if (AARCH64_TUNE_FMA_STEERING) aarch64_register_fma_steering (); @@ -7080,6 +7068,18 @@ aarch64_override_options_after_change (void) flag_omit_leaf_frame_pointer = false; else if (flag_omit_leaf_frame_pointer) flag_omit_frame_pointer = true; + + /* If not optimizing for size, set the default + alignment to what the target wants */ + if (!optimize_size) + { + if (align_loops <= 0) + align_loops = aarch64_tune_params->loop_align; + if (align_jumps <= 0) + align_jumps = aarch64_tune_params->jump_align; + if (align_functions <= 0) + align_functions = aarch64_tune_params->function_align; + } } static struct machine_function * diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index c42a9d4a862..2bea3f8c368 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2015-05-06 Christian Bruel + + PR target/66015 + * gcc.target/aarch64/iinline-attr-1.c: New test. + 2015-05-06 Richard Biener * gcc.dg/vect/bb-slp-34.c: New testcase. diff --git a/gcc/testsuite/gcc.target/aarch64/iinline-attr-1.c b/gcc/testsuite/gcc.target/aarch64/iinline-attr-1.c new file mode 100644 index 00000000000..4b390cae0ef --- /dev/null +++ b/gcc/testsuite/gcc.target/aarch64/iinline-attr-1.c @@ -0,0 +1,29 @@ +/* Verify that alignment flags are set when attribute __optimize is used. */ +/* { dg-do compile } */ +/* { dg-options "-O2" } */ + +extern void non_existent(int); + +__attribute__ ((__optimize__ ("O2"))) +static void hooray () +{ + non_existent (1); +} + +__attribute__ ((__optimize__ ("O2"))) +static void hiphip (void (*f)()) +{ + non_existent (2); + f (); +} + +__attribute__ ((__optimize__ ("O2"))) +int test (void) +{ + hiphip (hooray); + return 0; +} + +/* { dg-final { scan-assembler "p2align" } } */ + +