Message ID | 20201126090420.100928-1-kito.cheng@sifive.com |
---|---|
State | New |
Headers | show |
Series | Fix print_multilib_info when default arguments appear in the option list with '!' | expand |
On Thu, Nov 26, 2020 at 1:04 AM Kito Cheng <kito.cheng@sifive.com> wrote: > * gcc.c (print_multilib_info): Check default arguments not > appeared in multi-lib option list with '!' > OK. Jim
Committed :) On Sat, Nov 28, 2020 at 7:45 AM Jim Wilson <jimw@sifive.com> wrote: > > On Thu, Nov 26, 2020 at 1:04 AM Kito Cheng <kito.cheng@sifive.com> wrote: > > > * gcc.c (print_multilib_info): Check default arguments not > > appeared in multi-lib option list with '!' > > > > OK. > > Jim
diff --git a/gcc/gcc.c b/gcc/gcc.c index 26bc5065eeb..b2a26b5af81 100644 --- a/gcc/gcc.c +++ b/gcc/gcc.c @@ -9730,6 +9730,7 @@ print_multilib_info (void) const char *p = multilib_select; const char *last_path = 0, *this_path; int skip; + int not_arg; unsigned int last_path_len = 0; while (*p != '\0') @@ -9884,9 +9885,13 @@ print_multilib_info (void) goto invalid_select; if (*q == '!') - arg = NULL; + { + not_arg = 1; + q++; + } else - arg = q; + not_arg = 0; + arg = q; while (*q != ' ' && *q != ';') { @@ -9895,11 +9900,17 @@ print_multilib_info (void) ++q; } - if (arg != NULL - && default_arg (arg, q - arg)) + if (default_arg (arg, q - arg)) { - skip = 1; - break; + /* Stop checking if any default arguments appeared in not + list. */ + if (not_arg) + { + skip = 0; + break; + } + else + skip = 1; } if (*q == ' ')