This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] Fix sporadic failure in g++.dg/tsan/aligned_vs_unaligned_race.C
- From: Mike Stump <mikestump at comcast dot net>
- To: Bernd Edlinger <bernd dot edlinger at hotmail dot de>
- Cc: Jakub Jelinek <jakub at redhat dot com>, "H.J. Lu" <hjl dot tools at gmail dot com>, "gcc-patches at gcc dot gnu dot org" <gcc-patches at gcc dot gnu dot org>, Dmitry Vyukov <dvyukov at google dot com>
- Date: Tue, 6 Jan 2015 11:47:30 -0800
- Subject: Re: [PATCH] Fix sporadic failure in g++.dg/tsan/aligned_vs_unaligned_race.C
- Authentication-results: sourceware.org; auth=none
- References: <DUB118-W8F5E63DE36A8DB2DA1DF6E45B0 at phx dot gbl>,<623A5348-6FC9-4F7B-A9BC-B2B098AF7D37 at comcast dot net>,<20150104191658 dot GK1667 at tucnak dot redhat dot com>,<DUB118-W450ACE7162969EFB27F817E45B0 at phx dot gbl>,<8E43F8AA-96BA-47A3-A886-C058459B4108 at comcast dot net>,<DUB118-W286F157F7B8B1EE05ED51FE4580 at phx dot gbl>,<E67B07D7-6ABA-48C1-B58B-B804144D91C2 at comcast dot net>,<D86529BC-DB94-481A-AE60-913D7E2B8D7F at comcast dot net>,<DUB118-W1E901D082BACEDE02A5E8E4590 at phx dot gbl>,<DUB118-W468072AA78C7E7CD1DCF6BE4590 at phx dot gbl>,<20150106091633 dot GF1667 at tucnak dot redhat dot com> <DUB118-W15350AC346C8CE664A5ECDE4590 at phx dot gbl>
On Jan 6, 2015, at 9:45 AM, Bernd Edlinger <bernd.edlinger@hotmail.de> wrote:
> I tried your suggestion now, and it seems to work. (on a 4-way core AMD64 laptop)
>
> Would you prefer this over adding a sleep in Thread1, which I posted previously?
The problem with the patch is there is nothing in the patch that makes it work. You merely lower the odds of it failing. The point of addressing the problem, and the problem is, this test case randomly fails, is to change the test case, so that it is impossible by design for the test case to ever fail. In my version of the fix, I think it can't fail.