This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c/81568] attribute always_inline honored even after attribute noinline
- From: "msebor at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Wed, 26 Jul 2017 20:46:21 +0000
- Subject: [Bug c/81568] attribute always_inline honored even after attribute noinline
- Auto-submitted: auto-generated
- References: <bug-81568-4@http.gcc.gnu.org/bugzilla/>
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81568
Martin Sebor <msebor at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Keywords| |diagnostic, wrong-code
Severity|normal |minor
--- Comment #1 from Martin Sebor <msebor at gcc dot gnu.org> ---
The cause of the problem is in the validation for these two attributes being
done in two places: one in handle_always_inline_attribute and
handle_noinline_attribute in c-attribs.c, and another in
diagnose_mismatched_attributes. The former rejects the attribute if it's found
to conflict with the other on the same declaration, but it doesn't detect
conflicts across declarations. The latter does detect those conflicts but it
doesn't reject them. As a result, the same problem gets handled differently in
the two situations.