Restore alignment in rs6000 target.
authorMartin Liska <mliska@suse.cz>
Mon, 9 Mar 2020 13:13:04 +0000 (14:13 +0100)
committerMartin Liska <mliska@suse.cz>
Mon, 9 Mar 2020 13:13:04 +0000 (14:13 +0100)
PR target/93800
* config/rs6000/rs6000.c (rs6000_option_override_internal):
Remove set of str_align_loops and str_align_jumps as these
should be set in previous 2 conditions in the function.
PR target/93800
* gcc.target/powerpc/pr93800.c: New test.

gcc/ChangeLog
gcc/config/rs6000/rs6000.c
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.target/powerpc/pr93800.c [new file with mode: 0644]

index c9c4e75..6c4a505 100644 (file)
@@ -1,3 +1,10 @@
+2020-03-09  Martin Liska  <mliska@suse.cz>
+
+       PR target/93800
+       * config/rs6000/rs6000.c (rs6000_option_override_internal):
+       Remove set of str_align_loops and str_align_jumps as these
+       should be set in previous 2 conditions in the function.
+
 2020-03-09  Jakub Jelinek  <jakub@redhat.com>
 
        PR rtl-optimization/94045
index ecbf7ae..848a4ef 100644 (file)
@@ -4363,11 +4363,6 @@ rs6000_option_override_internal (bool global_init_p)
                  str_align_loops = "16";
                }
            }
-
-         if (flag_align_jumps && !str_align_jumps)
-           str_align_jumps = "16";
-         if (flag_align_loops && !str_align_loops)
-           str_align_loops = "16";
        }
 
       /* Arrange to save and restore machine status around nested functions.  */
index cf7243d..e4885b2 100644 (file)
@@ -1,3 +1,8 @@
+2020-03-09  Martin Liska  <mliska@suse.cz>
+
+       PR target/93800
+       * gcc.target/powerpc/pr93800.c: New test.
+
 2020-03-09  Bin Cheng  <bin.cheng@linux.alibaba.com>
 
        * g++.dg/coroutines/torture/co-ret-15-default-return_void.C: New.
diff --git a/gcc/testsuite/gcc.target/powerpc/pr93800.c b/gcc/testsuite/gcc.target/powerpc/pr93800.c
new file mode 100644 (file)
index 0000000..f8dfbe7
--- /dev/null
@@ -0,0 +1,14 @@
+/* { dg-do compile } */
+/* { dg-options "-mcpu=860 -O2" } */
+/* { dg-require-effective-target ilp32 } */
+/* { dg-final { scan-assembler-not "\\.p2align 4" } } */
+
+volatile int g;
+int f(int a, int b)
+{
+       int i;
+
+       for (i = 0; i < b; i++)
+               a += g;
+       return a;
+}