This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH 1/3] improve detection of attribute conflicts (PR 81544)
- From: Joseph Myers <joseph at codesourcery dot com>
- To: Martin Sebor <msebor at gmail dot com>
- Cc: Jeff Law <law at redhat dot com>, Marek Polacek <polacek at redhat dot com>, Gcc Patch List <gcc-patches at gcc dot gnu dot org>, Jason Merrill <jason at redhat dot com>
- Date: Tue, 19 Sep 2017 21:00:30 +0000
- Subject: Re: [PATCH 1/3] improve detection of attribute conflicts (PR 81544)
- Authentication-results: sourceware.org; auth=none
- References: <f48353a5-a1b9-6a2d-98c9-831c5d9d44a0@gmail.com> <20170809115341.GM17069@redhat.com> <52dbf0e4-09b3-f313-d6b1-92f0e5ac6c16@gmail.com> <alpine.DEB.2.20.1708091711010.18502@digraph.polyomino.org.uk> <c6150c61-3774-bfc7-b909-05efda68cfc4@gmail.com> <alpine.DEB.2.20.1708091949180.9262@digraph.polyomino.org.uk> <0fc9f24b-f474-3ab5-e660-b206486cc644@gmail.com> <alpine.DEB.2.20.1708102145580.8101@digraph.polyomino.org.uk> <61464927-ba0d-860d-d08f-5d36d473e3c2@gmail.com> <c6c50436-d6f8-69ee-3550-432cd3e32bc7@gmail.com> <alpine.DEB.2.20.1709062317320.29155@digraph.polyomino.org.uk> <cb5c4c9f-a4ee-6488-4a15-8bbd2be46da6@gmail.com>
On Tue, 19 Sep 2017, Martin Sebor wrote:
> > In general, the data structures where you need to ensure manually that if
> > attribute A is listed in EXCL for B, then attribute B is also listed in
> > EXCL for A, seem concerning. I'd expect either data structures that make
> > such asymmetry impossible, or a self-test that verifies that the tables in
> > use are in fact symmetric (unless there is some reason the symmetry is not
> > in fact required and symmetric diagnostics still result from asymmetric
> > tables - in which case the various combinations and orderings of
> > gnu_inline and noinline definitely need tests to show that the diagnostics
> > work).
>
> If I understand correctly what you're concerned about then I don't
> think there are any such cases in the updated version of the patch.
I don't see how you ensure that it's not possible to have such asymmetry.
My point wasn't so much "there was a bug in the previous patch version" as
"the choice of data structures for defining such exclusions is prone to
such bugs". Which can be addressed either by using different data
structures (e.g. listing incompatible pairs in a single array) or by a
self-test to verify symmetry so a compiler with asymmetry doesn't build.
--
Joseph S. Myers
joseph@codesourcery.com