[Bug target/67745] [ARM] wrong alignments when __attribute__ ((optimize,target,align) is used
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67745 --- Comment #6 from chrbr at gcc dot gnu.org --- Author: chrbr Date: Fri Oct 16 13:37:14 2015 New Revision: 228904 URL: https://gcc.gnu.org/viewcvs?rev=228904=gcc=rev Log: 2015-10-16 Christian BruelPR target/67745 * config/arm/arm.h (FUNCTION_BOUNDARY): Move optimize_size condition to: * config/arm/arm.c (arm_option_override_internal): Call arm_override_options_after_change_1. (arm_override_options_after_change): New function. (arm_override_options_after_change_1): Likewise. (TARGET_OVERRIDE_OPTIONS_AFTER_CHANGE): Define hook. Added: trunk/gcc/testsuite/gcc.target/arm/attr-align1.c trunk/gcc/testsuite/gcc.target/arm/attr-align2.c trunk/gcc/testsuite/gcc.target/arm/attr-align3.c trunk/gcc/testsuite/gcc.target/arm/no-align.c Modified: trunk/gcc/ChangeLog trunk/gcc/config/arm/arm.c trunk/gcc/config/arm/arm.h trunk/gcc/testsuite/ChangeLog
[Bug target/67745] [ARM] wrong alignments when __attribute__ ((optimize,target,align) is used
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67745 --- Comment #7 from chrbr at gcc dot gnu.org --- Author: chrbr Date: Fri Oct 16 13:52:51 2015 New Revision: 228912 URL: https://gcc.gnu.org/viewcvs?rev=228912=gcc=rev Log: 2015-10-16 Christian BruelPR target/67745 * config/arm/arm.h (FUNCTION_BOUNDARY): Use FUNCTION_BOUNDARY_P. (FUNCTION_BOUNDARY_P): New macro: * config/arm/arm.c (TARGET_RELAYOUT_FUNCTION, arm_relayout_function): New hook. * doc/tm.texi.in (TARGET_RELAYOUT_FUNCTION): Document. * doc/tm.texi (TARGET_RELAYOUT_FUNCTION): New hook. * gcc/target.def (TARGET_RELAYOUT_FUNCTION): Likewise. * gcc/function.c (allocate_struct_function): Call relayout_function hook. * gcc/passes.c (rest_of_decl_compilation): Likewise. Modified: trunk/gcc/ChangeLog trunk/gcc/config/arm/arm.c trunk/gcc/config/arm/arm.h trunk/gcc/doc/tm.texi trunk/gcc/doc/tm.texi.in trunk/gcc/function.c trunk/gcc/passes.c trunk/gcc/target.def
[Bug target/67745] [ARM] wrong alignments when __attribute__ ((optimize,target,align) is used
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67745 chrbr at gcc dot gnu.org changed: What|Removed |Added Status|ASSIGNED|RESOLVED Resolution|--- |FIXED --- Comment #8 from chrbr at gcc dot gnu.org --- fixed at rev 228912
[Bug target/67745] [ARM] wrong alignments when __attribute__ ((optimize,target,align) is used
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67745 --- Comment #5 from Ramana Radhakrishnan --- *** Bug 67880 has been marked as a duplicate of this bug. ***
[Bug target/67745] [ARM] wrong alignments when __attribute__ ((optimize,target,align) is used
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67745 Ramana Radhakrishnan changed: What|Removed |Added Status|UNCONFIRMED |ASSIGNED Last reconfirmed||2015-10-10 CC||ramana at gcc dot gnu.org Assignee|unassigned at gcc dot gnu.org |chrbr at gcc dot gnu.org Ever confirmed|0 |1 --- Comment #4 from Ramana Radhakrishnan --- Confirmed.
[Bug target/67745] [ARM] wrong alignments when __attribute__ ((optimize,target,align) is used
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67745 chrbr at gcc dot gnu.org changed: What|Removed |Added Target||arm Target Milestone|--- |6.0
[Bug target/67745] [ARM] wrong alignments when __attribute__ ((optimize,target,align) is used
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67745 --- Comment #1 from chrbr at gcc dot gnu.org --- the problems are three folds: - FUNCTION_BOUNDARY should not test optimize_size, that should be tested in override_options_internal instead to be carried by invoke_set_current_function_hook - FUNCTION_BOUNDARY depends on TARGET_THUMB that depends on the attribute target. So it should be reevaluated at each function change, thus TARGET_OVERRIDE_OPTIONS_AFTER_CHANGE
[Bug target/67745] [ARM] wrong alignments when __attribute__ ((optimize,target,align) is used
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67745 --- Comment #2 from chrbr at gcc dot gnu.org --- and test check optimize_function_for_speed_p (cfun)) in assemble_start_function put an unnecessary constraint on align_functions (either from -falign-functions or __attribute__). We should be able to decrease alignment between functions for a target switch in -Os, for example.
[Bug target/67745] [ARM] wrong alignments when __attribute__ ((optimize,target,align) is used
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67745 --- Comment #3 from chrbr at gcc dot gnu.org --- another example that gives suboptimal alignment: void __attribute__ ((optimize("Os"))) foo() { } compiled with -O2 -mthumb is aligned on 2^2 instead of 2^1. -Os should remove padding here.