Fix an obvious issue when processing save_decoded_options.
Patch can bootstrap on x86_64-linux-gnu and survives regression tests.
Thanks,
Martin
gcc/ChangeLog:
* toplev.c (toplev::main): save_decoded_options[0] is program
name and so it should be skipped.
---
gcc/toplev.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/gcc/toplev.c b/gcc/toplev.c
index 78bb7e9749b..d952319ad95 100644
--- a/gcc/toplev.c
+++ b/gcc/toplev.c
@@ -2338,7 +2338,7 @@ toplev::main (int argc, char **argv)
&save_decoded_options_count);
/* Save Optimization decoded options. */
- for (unsigned i = 0; i < save_decoded_options_count; ++i)
+ for (unsigned i = 1; i < save_decoded_options_count; ++i)
if (cl_options[save_decoded_options[i].opt_index].flags & CL_OPTIMIZATION)
save_opt_decoded_options.safe_push (save_decoded_options[i]);
--
2.33.0