Re: [Bug target/66015] New: align directives not propagated after __attribute__ ((__optimize__ ("O2")))

2015-05-05 Thread Andreas Schwab
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, sch...@linux-m68k.org
GPG Key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5
"And now for something completely different."


Re: [Bug target/66015] New: align directives not propagated after __attribute__ ((__optimize__ ("O2")))

2015-05-05 Thread Jim Wilson
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




Re: [Bug target/66015] New: align directives not propagated after __attribute__ ((__optimize__ ("O2")))

2015-05-05 Thread Christian Bruel
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





2015-05-05  Christian Bruel  

	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  

	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" } } */
+
+