This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug tree-optimization/52345] Missed optimization dealing with bools
- From: "pinskia at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Mon, 29 Aug 2016 07:35:30 +0000
- Subject: [Bug tree-optimization/52345] Missed optimization dealing with bools
- Auto-submitted: auto-generated
- References: <bug-52345-4@http.gcc.gnu.org/bugzilla/>
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=52345
--- Comment #2 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
For the trunk, they all come close (at least for aarch64):
f:
cmp w0, 0
cset w0, ne
orr w1, w0, w1
cmp w1, 0
cset w0, ne
ret
.size f, .-f
.align 2
.p2align 3,,7
.global f1
.type f1, %function
f1:
cmp w0, 0
ccmp w1, 0, 0, eq
cset w0, ne
ret
.size f1, .-f1
.align 2
.p2align 3,,7
.global f2
.type f2, %function
f2:
orr w0, w0, w1
cmp w0, 0
cset w0, ne
ret
f1 and f2 are similar enough for aarch64 (at least for ThunderX).