This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug rtl-optimization/37262] Two branches of the same condition being emitted
- From: "msebor at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Sat, 30 Jan 2016 15:45:52 +0000
- Subject: [Bug rtl-optimization/37262] Two branches of the same condition being emitted
- Auto-submitted: auto-generated
- References: <bug-37262-4 at http dot gcc dot gnu dot org/bugzilla/>
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=37262
--- Comment #7 from Martin Sebor <msebor at gcc dot gnu.org> ---
Yes, sorry, I meant to say "still there at -O1" because that's the optimization
level mentioned in comment #1. (I had to guess at the level based on that. I
also accidentally used -m32 when the target is powerpc64, probably because of
all the other old 32-bit powerpc bugs I've been looking at.)
The -O2 code for -m32 doesn't have the duplicate branch, though it does nicely
show the other unnecessary branches:
$ /build/gcc-5.x/gcc/xgcc -B /build/gcc-5.x/gcc -O2 -S -Wall -Wextra -Wpedantic
-m32 -o/dev/stdout t.c
...
_bfd_xcoff_canonicalize_dynamic_reloc:
cmpwi 7,3,0
bnelr 7
cmplwi 7,4,2
bgtlr 7
bnelr 7
b _bfd_abort
...and for -m64:
.L._bfd_xcoff_canonicalize_dynamic_reloc:
cmpldi 7,3,2
bgt 7,.L2
beq 7,.L7
.L2:
blr
.p2align 4,,15
.L7:
mflr 0
std 0,16(1)
stdu 1,-112(1)
bl _bfd_abort
nop
addi 1,1,112
ld 0,16(1)
mtlr 0
blr