This is the mail archive of the
gcc-prs@gcc.gnu.org
mailing list for the GCC project.
Re: optimization/1532: -O3 generates (obviously) redundant tests and jumps
- From: bangerth at dealii dot org
- To: duchier at ps dot uni-sb dot de, gcc-bugs at gcc dot gnu dot org, gcc-prs at gcc dot gnu dot org, nobody at gcc dot gnu dot org
- Date: 5 Dec 2002 20:07:13 -0000
- Subject: Re: optimization/1532: -O3 generates (obviously) redundant tests and jumps
- Reply-to: bangerth at dealii dot org, duchier at ps dot uni-sb dot de, gcc-bugs at gcc dot gnu dot org, gcc-prs at gcc dot gnu dot org, nobody at gcc dot gnu dot org, gcc-gnats at gcc dot gnu dot org
Synopsis: -O3 generates (obviously) redundant tests and jumps
State-Changed-From-To: open->analyzed
State-Changed-By: bangerth
State-Changed-When: Thu Dec 5 12:07:13 2002
State-Changed-Why:
Confirmed. This is the relevant part of the assembler code:
cmpl %eax, %edx
je .L16
cmpl %eax, %edx
jg .L1
movl %eax, %edx
.L1:
popl %ebp
movl %edx, %eax
ret
.p2align 4,,7
.L16:
leal (%eax,%eax), %edx
jmp .L1
The two cmp operations are wasteful, and the one mov
operation before .L1 could be merged with the one
after in a better control flow.
http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view%20audit-trail&database=gcc&pr=1532