* [PATCH, PR target/66015]: Fix alignments with attribute_optimize for aarch64
@ 2015-05-05 11:07 Christian Bruel
2015-05-05 12:42 ` Marcus Shawcroft
0 siblings, 1 reply; 3+ messages in thread
From: Christian Bruel @ 2015-05-05 11:07 UTC (permalink / raw)
To: marcus.shawcroft, Richard Earnshaw; +Cc: gcc-patches, Yvan Roux, Bin.Cheng
[-- Attachment #1: Type: text/plain, Size: 230 bytes --]
This fixes PR target/66015 and a latent issue revealed by
gcc.dg/ipa/iinline-attr.c since
https://gcc.gnu.org/ml/gcc-patches/2015-04/msg01609.html
Regtested on aarch64-linux-gnu by Linaro.
OK for trunk ?
Many thanks
Christian
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: aarch64.patch --]
[-- Type: text/x-patch; name="aarch64.patch", Size: 2491 bytes --]
2015-05-05 Christian Bruel <christian.bruel@st.com>
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-05 Christian Bruel <christian.bruel@st.com>
PR target/66015
* gcc.target/aarch64/iinline-attr-1.c: New test.
Index: gcc/config/aarch64/aarch64.c
===================================================================
--- gcc/config/aarch64/aarch64.c (revision 222803)
+++ gcc/config/aarch64/aarch64.c (working copy)
@@ -7024,18 +7024,6 @@
#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 ();
@@ -7051,6 +7039,18 @@
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 *
Index: gcc/testsuite/gcc.target/aarch64/iinline-attr-1.c
===================================================================
--- gcc/testsuite/gcc.target/aarch64/iinline-attr-1.c (revision 0)
+++ gcc/testsuite/gcc.target/aarch64/iinline-attr-1.c (working copy)
@@ -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" } } */
+
+
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH, PR target/66015]: Fix alignments with attribute_optimize for aarch64
2015-05-05 11:07 [PATCH, PR target/66015]: Fix alignments with attribute_optimize for aarch64 Christian Bruel
@ 2015-05-05 12:42 ` Marcus Shawcroft
2015-05-06 11:22 ` Christian Bruel
0 siblings, 1 reply; 3+ messages in thread
From: Marcus Shawcroft @ 2015-05-05 12:42 UTC (permalink / raw)
To: Christian Bruel
Cc: Marcus Shawcroft, Richard Earnshaw, gcc-patches, Yvan Roux, Bin.Cheng
On 5 May 2015 at 12:07, Christian Bruel <christian.bruel@st.com> wrote:
> This fixes PR target/66015 and a latent issue revealed by
> gcc.dg/ipa/iinline-attr.c since
> https://gcc.gnu.org/ml/gcc-patches/2015-04/msg01609.html
>
> Regtested on aarch64-linux-gnu by Linaro.
>
> OK for trunk ?
OK. Is this issue present in gcc-5? If so can you backport?
Thanks
/Marcus
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH, PR target/66015]: Fix alignments with attribute_optimize for aarch64
2015-05-05 12:42 ` Marcus Shawcroft
@ 2015-05-06 11:22 ` Christian Bruel
0 siblings, 0 replies; 3+ messages in thread
From: Christian Bruel @ 2015-05-06 11:22 UTC (permalink / raw)
To: Marcus Shawcroft
Cc: Marcus Shawcroft, Richard Earnshaw, gcc-patches, Yvan Roux, Bin.Cheng
On 05/05/2015 02:42 PM, Marcus Shawcroft wrote:
> On 5 May 2015 at 12:07, Christian Bruel <christian.bruel@st.com> wrote:
>> This fixes PR target/66015 and a latent issue revealed by
>> gcc.dg/ipa/iinline-attr.c since
>> https://gcc.gnu.org/ml/gcc-patches/2015-04/msg01609.html
>>
>> Regtested on aarch64-linux-gnu by Linaro.
>>
>> OK for trunk ?
>
> OK. Is this issue present in gcc-5? If so can you backport?
yes, eventhough there is no gcc.dg/ipa/iinline-attr.c to expose it
done. thanks
Christian
>
> Thanks
> /Marcus
>
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2015-05-06 11:22 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-05-05 11:07 [PATCH, PR target/66015]: Fix alignments with attribute_optimize for aarch64 Christian Bruel
2015-05-05 12:42 ` Marcus Shawcroft
2015-05-06 11:22 ` Christian Bruel
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).