diff mbox series

Mark falign-*= as Optimization (PR c/84100)

Message ID 20180130224651.GH2063@tucnak
State New
Headers show
Series Mark falign-*= as Optimization (PR c/84100) | expand

Commit Message

Jakub Jelinek Jan. 30, 2018, 10:46 p.m. UTC
Hi!

While -falign-{functions,jumps,labels,loops} are marked Optimization,
-falign-{functions,jumps,labels,loops}= are not.  They use the same Var(),
for that it makes no difference, but it means we reject them in optimize
attribute starting with r237174.

Fixed thusly, bootstrapped/regtested on x86_64-linux and i686-linux, ok for
trunk?

2018-01-30  Jakub Jelinek  <jakub@redhat.com>

	PR c/84100
	* common.opt (falign-functions=, falign-jumps=, falign-labels=,
	falign-loops=): Add Optimization flag.

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


	Jakub

Comments

Joseph Myers Jan. 31, 2018, 12:14 a.m. UTC | #1
On Tue, 30 Jan 2018, Jakub Jelinek wrote:

> Hi!
> 
> While -falign-{functions,jumps,labels,loops} are marked Optimization,
> -falign-{functions,jumps,labels,loops}= are not.  They use the same Var(),
> for that it makes no difference, but it means we reject them in optimize
> attribute starting with r237174.
> 
> Fixed thusly, bootstrapped/regtested on x86_64-linux and i686-linux, ok for
> trunk?

OK.
diff mbox series

Patch

--- gcc/common.opt.jj	2018-01-18 21:11:58.664207128 +0100
+++ gcc/common.opt	2018-01-30 14:53:25.091842202 +0100
@@ -954,7 +954,7 @@  Common Report Var(align_functions,0) Opt
 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) Optimiz
 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
--- gcc/testsuite/gcc.dg/pr84100.c.jj	2018-01-30 15:01:59.243703278 +0100
+++ gcc/testsuite/gcc.dg/pr84100.c	2018-01-30 15:00:30.569726685 +0100
@@ -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 ();
+}