Re: [PATCH RFA] driver: fix validate_switches logic

2022-12-01 Thread Richard Biener via Gcc-patches
On Fri, Dec 2, 2022 at 7:37 AM Alexandre Oliva via Gcc-patches wrote: > > On Dec 1, 2022, Jason Merrill wrote: > > > Once we see g*, starred is set. Then we see %:, and it sees that as a > > zero-length switch, which because starred is still set, matches any and all > > command-line options. S

Re: [PATCH RFA] driver: fix validate_switches logic

2022-12-01 Thread Alexandre Oliva via Gcc-patches
On Dec 1, 2022, Jason Merrill wrote: > Once we see g*, starred is set. Then we see %:, and it sees that as a > zero-length switch, which because starred is still set, matches any and all > command-line options. So targets that use such a spec accept all options in > the driver, while ones that

[PATCH RFA] driver: fix validate_switches logic

2022-12-01 Thread Jason Merrill via Gcc-patches
Tested x86_64-pc-linux-gnu, OK for trunk? -- 8< -- Under the old logic for validate_switches, once suffix or starred got set, they stayed set for all later switches found in the spec. So for e.g. %{g*:%{%:debug-level-gt(0): Once we see g*, starred is set. Then we see %:, and it sees that as a