This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH v5, middle end]: Committed: Fix PR 37908, thinko with atomic NAND operation
- From: "H.J. Lu" <hjl dot tools at gmail dot com>
- To: "Uros Bizjak" <ubizjak at gmail dot com>
- Cc: "Mark Mitchell" <mark at codesourcery dot com>, "GCC Patches" <gcc-patches at gcc dot gnu dot org>, "Richard Guenther" <richard dot guenther at gmail dot com>, "Jakub Jelinek" <jakub at redhat dot com>
- Date: Mon, 17 Nov 2008 13:53:16 -0800
- Subject: Re: [PATCH v5, middle end]: Committed: Fix PR 37908, thinko with atomic NAND operation
- References: <5787cf470811170324o207e7fe3j44c95ae40401fdfd@mail.gmail.com>
On Mon, Nov 17, 2008 at 3:24 AM, Uros Bizjak <ubizjak@gmail.com> wrote:
> On Sun, Nov 16, 2008 at 8:18 PM, Mark Mitchell <mark@codesourcery.com> wrote:
>
>>> However, I'm not sure I understood the reason to disable the note. The
>>> note can be IMO considered as "less than a warning", just a heads-up
>>> that something has been changed that requires a bit of attention.
>>
>> See all the various threads on "fine-grained warning control" over the
>> years.
>>
>> Once you go through and audit your code to make sure that you're using
>> the builtin in the way that it now behaves, the warning is just noise.
>> You want the signal-to-noise ratio to be high. So, you want a way to
>> turn it off. Otherwise, every compilation of your project results in
>> the same pointless note.
>>
>> In general, it should be possible to disable all non-errors. That's "in
>> general"; there are exceptions.
>
> Attached is the patch that was commited to SVN. I didn't want to add a
> message to the note itself, since the way to disable this note was
> added to the documentation.
>
> 2008-11-17 Uros Bizjak <ubizjak@gmail.com>
>
> PR middle-end/37908
> * optabs.c (expand_sync_operation): Properly handle NAND case
> by calculating ~(t1 & val) instead of (~t1 & val).
> * builtins.c (expand_builtin_sync_operation): Warn for changed
> semantics in NAND builtins.
> * c.opt (Wsync-nand): New warning option. Describe -Wsync-nand.
>
> * doc/invoke.texi (Warning options): Add Wsync-nand.
> * doc/extend.texi (Atomic Builtins) [__sync_fetch_and_nand]: Correct
> __sync_fetch_and_nand builtin operation in the example. Add a note
> about changed semantics in GCC 4.4.
> [__sync_nand_and_fetch]: Correct __sync_nand_and_fetch builtin
> operation in the example. Add a note about changed semantics in
> GCC 4.4.
>
> testsuite/ChangeLog:
>
> 2008-11-17 Uros Bizjak <ubizjak@gmail.com>
>
> PR middle-end/37908
> * gcc.dg/pr37908.c: New test.
> * gcc.dg/ia64-sync-1.c: Correct __sync_fetch_and_nand and
> __sync_nand_and_fetch results. Add dg-message to look for the warning
> about changed semantics of NAND builtin.
> (init_si, init_di): Change init value for __sync_fetch_and_nand to -1.
> (test_si, test_di): Change expected result of
> __sync_nand_and_fetch to ~7.
> * gcc.dg/ia64-sync-2.c: Correct __sync_fetch_and_nand and
> __sync_nand_and_fetch results. Add dg-message to look for the warning
> about changed semantics of NAND builtin.
> (init_noret_si, init_noret_di): Change init value for
> __sync_fetch_and_nand to -1.
> (init_noret_si, init_noret_di): Change expected result of
> __sync_nand_and_fetch to ~7.
> * gcc.dg/sync-2.c: Correct __sync_fetch_and_nand and
> __sync_nand_and_fetch results. Add dg-message to look for the warning
> about changed semantics of NAND builtin.
> (init_qi, init_qi): Change init value for __sync_fetch_and_nand to -1.
> (init_hi, init_hi): Change expected result of
> __sync_nand_and_fetch to ~7.
> * gcc.dg/sync-3.c: Copy from sync-2.c instead of including
> the c source file.
> * gcc.c-torture/compile/sync-1.c: Add dg-message to look for the
> warning about changed semantics of NAND builtin.
> * gcc.c-torture/compile/sync-2.c: Ditto.
> * gcc.c-torture/compile/sync-3.c: Ditto.
>
> Patch was regression tested and bootstrapped on i686-pc-linux-gnu and
> x86_64-pc-linux-gnu {,-m32}.
>
> Uros.
>
Those are failed on Linux/ia64:
+FAIL: gcc.dg/ia64-sync-1.c execution test
+FAIL: gcc.dg/ia64-sync-2.c execution test
+FAIL: gcc.dg/pr37908.c execution test
+FAIL: gcc.dg/sync-2.c execution test
+FAIL: gcc.dg/sync-3.c execution test
--
H.J.