This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c/61271] 3 * possible coding error with logical not (!)
- From: "dcb314 at hotmail dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Wed, 21 May 2014 14:20:17 +0000
- Subject: [Bug c/61271] 3 * possible coding error with logical not (!)
- Auto-submitted: auto-generated
- References: <bug-61271-4 at http dot gcc dot gnu dot org/bugzilla/>
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61271
--- Comment #1 from David Binderman <dcb314 at hotmail dot com> ---
Some more:
4.
trunk/gcc/expr.c:10660:10: warning: logical not is only applied to the left
hand side of this comparison [-Wlogical-not-parentheses]
Source code
|| !exact_log2 (tree_to_uhwi (TREE_OPERAND (offset, 1)) + 1) < 0)
Maybe
|| exact_log2 (tree_to_uhwi (TREE_OPERAND (offset, 1)) + 1) >= 0)
5.
trunk/gcc/ipa-devirt.c:1122:11: warning: logical not is only applied to the
left hand side of this comparison [-Wlogical-not-parentheses]
Source code is
|| !tree_to_shwi (TYPE_SIZE (subtype)) <= 0)
Maybe
|| tree_to_shwi (TYPE_SIZE (subtype)) > 0)
6.
trunk/gcc/ira-color.c:3851:9: warning: logical not is only applied to the left
hand side of this comparison [-Wlogical-not-parentheses]
Source code is
|| !FRAME_GROWS_DOWNWARD == STACK_GROWS_DOWNWARD ? diff : -diff);
Maybe
|| ((FRAME_GROWS_DOWNWARD != STACK_GROWS_DOWNWARD) ? diff : -diff));