This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[PATCH] Fix alignment option parser (PR90684)
- From: Wilco Dijkstra <Wilco dot Dijkstra at arm dot com>
- To: GCC Patches <gcc-patches at gcc dot gnu dot org>
- Cc: nd <nd at arm dot com>
- Date: Thu, 30 May 2019 16:38:21 +0000
- Subject: [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%> "