https://gcc.gnu.org/bugzilla/show_bug.cgi?id=96285
Bug ID: 96285 Summary: The documentation of -fprofile-exclude-files is unclear Product: gcc Version: 10.1.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c Assignee: unassigned at gcc dot gnu.org Reporter: goeran at uddeborg dot se Target Milestone: --- During the translation of the help text for -fprofile-exclude-files a discussion started what it actually meant. Does the name has to match ALL the regular expressions given, or just ANY of them, for the file to be excluded? The texinfo documentation didn't help, since it just had an example with a single expression. Checking the code I figured out it is excluded if it matches any of them. Even if the current documentation actually say this, it is easy to misunderstand. May I suggest the documentation is clarified on this point? Perhaps simply Instrument only functions from files whose name does not match any of the regular expressions (separated by semi-colons). In addition, the texinfo documentation is probably slightly wrong. It gives as the example "/usr/*". Treated as a regular expression, which indeed seems to be what the code implements, that means "/usr" followed by an arbitrary number of "/". Not what was intended, I believe. Maybe it might still work; from what I can tell the search string isn't anchored so it is ok for it to match only the beginning of the name. But if so the "/*" at the end is pointless, and the example could lead the reader to assume it is a glob expression rather than a regular expression.