diff mbox series

Fix alignment option parser (PR90684)

Message ID VI1PR0801MB21270FA8CC0A8129F306B59183180@VI1PR0801MB2127.eurprd08.prod.outlook.com
State New
Headers show
Series Fix alignment option parser (PR90684) | expand

Commit Message

Wilco Dijkstra May 30, 2019, 4:38 p.m. UTC
Fix the alignment option parser to always allow up to 4 alignments.
Now -falign-functions=16:8:8:8 no longer reports an error.

OK for commit (and backport to GCC9)?

ChangeLog:
2019-05-30  Wilco Dijkstra  <wdijkstr@arm.com>


	PR driver/90684
	* gcc/opts.c (parse_and_check_align_values): Allow 4 alignment values.
--

Comments

Jeff Law May 31, 2019, 10:10 p.m. UTC | #1
On 5/30/19 10:38 AM, Wilco Dijkstra wrote:
> Fix the alignment option parser to always allow up to 4 alignments.
> Now -falign-functions=16:8:8:8 no longer reports an error.
> 
> OK for commit (and backport to GCC9)?
> 
> ChangeLog:
> 2019-05-30  Wilco Dijkstra  <wdijkstr@arm.com>
> 
> 
> 	PR driver/90684
> 	* gcc/opts.c (parse_and_check_align_values): Allow 4 alignment values.
Based on Martin L's comments in the BZ.  OK for the trunk.
jeff
diff mbox series

Patch

diff --git a/gcc/opts.c b/gcc/opts.c
index a1ccd97746890b8259d000cbdeeaddc02df0b74a..d3501421f7879113ab4422063cedfabd23cadce7 100644
--- a/gcc/opts.c
+++ b/gcc/opts.c
@@ -2022,14 +2022,7 @@  parse_and_check_align_values (const char *flag,
   free (str);
 
   /* Check that we have a correct number of values.  */
-#ifdef SUBALIGN_LOG
-  unsigned max_valid_values = 4;
-#else
-  unsigned max_valid_values = 2;
-#endif
-
-  if (result_values.is_empty ()
-      || result_values.length () > max_valid_values)
+  if (result_values.is_empty () || result_values.length () > 4)
     {
       if (report_error)
 	error_at (loc, "invalid number of arguments for %<-falign-%s%> "