public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* Re: [Bug target/66015] New: align directives not propagated after __attribute__ ((__optimize__ ("O2")))
       [not found] <bug-66015-4@http.gcc.gnu.org/bugzilla/>
@ 2015-05-05 12:19 ` Christian Bruel
  2015-05-05 15:46   ` Jim Wilson
  2015-05-05 17:32   ` Andreas Schwab
  0 siblings, 2 replies; 3+ messages in thread
From: Christian Bruel @ 2015-05-05 12:19 UTC (permalink / raw)
  To: wilson, Steve Ellcey, gcc-patches, schwab

[-- Attachment #1: Type: text/plain, Size: 323 bytes --]

Hi Jim, Steve, Andreas

Please find here a fix for the issue reported by Andreas
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64835 for ia64.

same than x86 and aarch64.

I don't the environment to run the testsuite for ia64. would you mind
giving it a try and verify that it fixes the issue ?

many thanks

Christian






[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: ia64.patch --]
[-- Type: text/x-patch; name="ia64.patch", Size: 1903 bytes --]

2015-05-05  Christian Bruel  <christian.bruel@st.com>

	PR target/66015
	* config/ia64/ia64.c (ia64_option_override): Move align_loops,
	and align_functions into ia64_override_options_after_change.

2015-05-05  Christian Bruel  <christian.bruel@st.com>

	PR target/66015
	* gcc.target/ia64/iinline-attr-1.c: New test.

Index: gcc/config/ia64/ia64.c
===================================================================
--- gcc/config/ia64/ia64.c	(revision 222803)
+++ gcc/config/ia64/ia64.c	(working copy)
@@ -6051,10 +6051,6 @@
 
   init_machine_status = ia64_init_machine_status;
 
-  if (align_functions <= 0)
-    align_functions = 64;
-  if (align_loops <= 0)
-    align_loops = 32;
   if (TARGET_ABI_OPEN_VMS)
     flag_no_common = 1;
 
@@ -6066,6 +6062,11 @@
 static void
 ia64_override_options_after_change (void)
 {
+  if (align_functions <= 0)
+    align_functions = 64;
+  if (align_loops <= 0)
+    align_loops = 32;
+
   if (optimize >= 3
       && !global_options_set.x_flag_selective_scheduling
       && !global_options_set.x_flag_selective_scheduling2)
Index: gcc/testsuite/gcc.target/ia64/iinline-attr-1.c
===================================================================
--- gcc/testsuite/gcc.target/ia64/iinline-attr-1.c	(revision 0)
+++ gcc/testsuite/gcc.target/ia64/iinline-attr-1.c	(working copy)
@@ -0,0 +1,28 @@
+/* Verify that alignment flags are set when  attribute __optimize is used.  */
+/* { dg-do compile } */
+
+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 ".align 64" } } */
+
+

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [Bug target/66015] New: align directives not propagated after __attribute__ ((__optimize__ ("O2")))
  2015-05-05 12:19 ` [Bug target/66015] New: align directives not propagated after __attribute__ ((__optimize__ ("O2"))) Christian Bruel
@ 2015-05-05 15:46   ` Jim Wilson
  2015-05-05 17:32   ` Andreas Schwab
  1 sibling, 0 replies; 3+ messages in thread
From: Jim Wilson @ 2015-05-05 15:46 UTC (permalink / raw)
  To: Christian Bruel; +Cc: Steve Ellcey, gcc-patches, schwab

On Tue, 2015-05-05 at 14:19 +0200, Christian Bruel wrote:
> I don't the environment to run the testsuite for ia64. would you mind
> giving it a try and verify that it fixes the issue ?

I don't have ia64 hardware anymore.

The GCC compile farm advertises ia64 hardware
    https://gcc.gnu.org/wiki/CompileFarm
though the web site suggests that all ia64 machines are offline, so I
don't know if that is going to help.

Jim


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [Bug target/66015] New: align directives not propagated after __attribute__ ((__optimize__ ("O2")))
  2015-05-05 12:19 ` [Bug target/66015] New: align directives not propagated after __attribute__ ((__optimize__ ("O2"))) Christian Bruel
  2015-05-05 15:46   ` Jim Wilson
@ 2015-05-05 17:32   ` Andreas Schwab
  1 sibling, 0 replies; 3+ messages in thread
From: Andreas Schwab @ 2015-05-05 17:32 UTC (permalink / raw)
  To: Christian Bruel; +Cc: wilson, Steve Ellcey, gcc-patches

Running /usr/local/gcc/gcc-20150505/gcc/testsuite/gcc.dg/ipa/ipa.exp ...
PASS: gcc.dg/ipa/iinline-attr.c (test for excess errors)
PASS: gcc.dg/ipa/iinline-attr.c scan-ipa-dump inline "hooray[^\\n]*inline copy \
in test"
Running /usr/local/gcc/gcc-20150505/gcc/testsuite/gcc.target/ia64/ia64.exp ...
PASS: gcc.target/ia64/iinline-attr-1.c (test for excess errors)
PASS: gcc.target/ia64/iinline-attr-1.c scan-assembler .align 64

Andreas.

-- 
Andreas Schwab, schwab@linux-m68k.org
GPG Key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5
"And now for something completely different."

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2015-05-05 17:32 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <bug-66015-4@http.gcc.gnu.org/bugzilla/>
2015-05-05 12:19 ` [Bug target/66015] New: align directives not propagated after __attribute__ ((__optimize__ ("O2"))) Christian Bruel
2015-05-05 15:46   ` Jim Wilson
2015-05-05 17:32   ` Andreas Schwab

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).