This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[PATCH] Fix alignment option parser (PR90684)


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.
--

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%> "


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]