optimization/1532: -O3 generates (obviously) redundant tests and jumps

bangerth@dealii.org bangerth@dealii.org
Thu Dec 5 12:07:00 GMT 2002


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



More information about the Gcc-prs mailing list