re PR c/84100 (Function __attribute__((optimize(align-loops=32))) gives spurious...
authorJakub Jelinek <jakub@redhat.com>
Wed, 31 Jan 2018 08:26:52 +0000 (09:26 +0100)
committerJakub Jelinek <jakub@gcc.gnu.org>
Wed, 31 Jan 2018 08:26:52 +0000 (09:26 +0100)
PR c/84100
* common.opt (falign-functions=, falign-jumps=, falign-labels=,
falign-loops=): Add Optimization flag.

* gcc.dg/pr84100.c: New test.

From-SVN: r257219

gcc/ChangeLog
gcc/common.opt
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.dg/pr84100.c [new file with mode: 0644]

index 4b18ca160db2f623a620519973b41f2520220ffc..8787d37c6b737880cb4e71990ed1abb91200e915 100644 (file)
@@ -1,3 +1,9 @@
+2018-01-31  Jakub Jelinek  <jakub@redhat.com>
+
+       PR c/84100
+       * common.opt (falign-functions=, falign-jumps=, falign-labels=,
+       falign-loops=): Add Optimization flag.
+
 2017-01-30  Jeff Law  <law@redhat.com>
 
        PR target/84064
index 874d0c2e72b53672066d7d61b76ef6c4753b9c53..3e9e3101c8f2e43b1292361a6716d7ef584fe729 100644 (file)
@@ -954,7 +954,7 @@ Common Report Var(align_functions,0) Optimization UInteger
 Align the start of functions.
 
 falign-functions=
-Common RejectNegative Joined UInteger Var(align_functions)
+Common RejectNegative Joined UInteger Var(align_functions) Optimization
 
 flimit-function-alignment
 Common Report Var(flag_limit_function_alignment) Optimization Init(0)
@@ -964,21 +964,21 @@ Common Report Var(align_jumps,0) Optimization UInteger
 Align labels which are only reached by jumping.
 
 falign-jumps=
-Common RejectNegative Joined UInteger Var(align_jumps)
+Common RejectNegative Joined UInteger Var(align_jumps) Optimization
 
 falign-labels
 Common Report Var(align_labels,0) Optimization UInteger
 Align all labels.
 
 falign-labels=
-Common RejectNegative Joined UInteger Var(align_labels)
+Common RejectNegative Joined UInteger Var(align_labels) Optimization
 
 falign-loops
 Common Report Var(align_loops,0) Optimization UInteger
 Align the start of loops.
 
 falign-loops=
-Common RejectNegative Joined UInteger Var(align_loops)
+Common RejectNegative Joined UInteger Var(align_loops) Optimization
 
 fargument-alias
 Common Ignore
index a83ec029f63522dfe75143f31ffa6f38ba79efa2..80cb48876e3870b2d4b733c5699965e463291ec3 100644 (file)
@@ -1,3 +1,8 @@
+2018-01-31  Jakub Jelinek  <jakub@redhat.com>
+
+       PR c/84100
+       * gcc.dg/pr84100.c: New test.
+
 2018-01-30  Jeff Law  <law@redhat.com>
 
        PR target/84064
diff --git a/gcc/testsuite/gcc.dg/pr84100.c b/gcc/testsuite/gcc.dg/pr84100.c
new file mode 100644 (file)
index 0000000..86fbc4f
--- /dev/null
@@ -0,0 +1,14 @@
+/* PR c/84100 */
+/* { dg-do compile } */
+/* { dg-options "-O2" } */
+
+void bar (void);
+
+__attribute__((optimize ("align-loops=16", "align-jumps=16",
+                        "align-labels=16", "align-functions=16")))
+void
+foo (void)
+{                      /* { dg-bogus "bad option" } */
+  for (int i = 0; i < 1024; ++i)
+    bar ();
+}