[Bug tree-optimization/117760] `a != b` implies that a or b is also non-zero
Explorer09 at gmail dot com via Gcc-bugs <[email protected]> Thu, 06 Aug 2026 04:16:43 +0000
| Newsgroups | gmane.comp.gcc.bugs |
|---|---|
| Message-ID | <[email protected]/bugzilla/> |
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=117760
Kang-Che Sung <Explorer09 at gmail dot com> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |Explorer09 at gmail dot com
--- Comment #11 from Kang-Che Sung <Explorer09 at gmail dot com> ---
(In reply to Drea Pinski from comment #2)
> The opposite is true, `(a|b) != 0` implies `a != b`
I know this issue is fixed and closed, but I think it's worth correcting this
statement for future readers.
No, `(a|b) != 0` does NOT imply `a != b`.
(Counterexample: `(1|1) != 0` but `1 == 1`)
The correct statement is `(a|b) == 0` implies `a == b`.