This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: PR c/7543 no warning for always-false "if (!a & 0x4)" bitwise and no boolean value
- From: Ian Lance Taylor <iant at google dot com>
- To: "Joseph S. Myers" <joseph at codesourcery dot com>
- Cc: Manuel LÃpez-IbÃÃez <lopezibanez at gmail dot com>, Gcc Patch List <gcc-patches at gcc dot gnu dot org>, Tom Truscott <Tom dot Truscott at sas dot com>
- Date: Tue, 02 Sep 2008 07:26:46 -0700
- Subject: Re: PR c/7543 no warning for always-false "if (!a & 0x4)" bitwise and no boolean value
- References: <6c33472e0808280959n3525c1camda64fb6ee109054a@mail.gmail.com> <Pine.LNX.4.64.0808282326360.4350@digraph.polyomino.org.uk>
"Joseph S. Myers" <joseph@codesourcery.com> writes:
> On Thu, 28 Aug 2008, Manuel LÃpez-IbÃÃez wrote:
>
>> This is a warning suggested by Tom Truscott who has tested it on real
>> code for a long time with a very low false positive rate. It seems it
>> catches a real bug in GCC in value-prof.c. It doesn't work in C++
>> because of the way C++ parses binary operators. I added a note about
>> it and a XFAILED testcase. Any suggestions on how to make it work in
>> C++ are welcome.
>>
>> Bootstrapped and regression tested on x86_64-unknown-linux-gnu with
>> --enable-languages=all,ada
>>
>> OK for trunk?
>
> The C front-end changes and testcase are OK if you also update the comment
> on the original_code element of the definition of struct c_expr in
> c-tree.h to reflect the new cases in which it is no longer ERROR_MARK.
The rest of the patch is OK.
Thanks.
Ian