This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug rtl-optimization/70467] Useless "and [esp],-1" emitted on AND with uint64_t variable
- From: "b7.10110111 at gmail dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Thu, 31 Mar 2016 10:38:09 +0000
- Subject: [Bug rtl-optimization/70467] Useless "and [esp],-1" emitted on AND with uint64_t variable
- Auto-submitted: auto-generated
- References: <bug-70467-4 at http dot gcc dot gnu dot org/bugzilla/>
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70467
--- Comment #4 from Ruslan <b7.10110111 at gmail dot com> ---
(In reply to Jakub Jelinek from comment #3)
> ...
> nothing there is able to optimize & -1 (and similarly | or ^ 0, or & 0, or |
> -1).
Just a note: the same happens for arithmetic operations, not just bitwise. E.g.
if you change `v&=~(1ull<<63)` in the OP to `v+=1ull<<32`, GCC generates `add
dword [esp],0` followed by `adc dword [esp+4],1`.