This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug rtl-optimization/70467] Useless "and [esp],-1" emitted on AND with uint64_t variable


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`.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]