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 tree-optimization/16220] New: Jump pessimization


long ticks(long val, long high, long prev) {
    return high + ((long) (val < prev) << 32);
}

gcc 3.3 produces this nice branch-free code:

cmplt   a0,a2,v0
sll     v0,0x20,t1
addq    a1,t1,v0

whereas mainline introduces a branch and pointless constants:

	cmplt   a0,a2,a2
	clr     v0
	beq     a2,L14
	lda     t0,1
	sll     t0,0x20,v0
L14:	addq    v0,a1,v0
	ret

-- 
           Summary: Jump pessimization
           Product: gcc
           Version: 3.5.0
            Status: UNCONFIRMED
          Keywords: missed-optimization
          Severity: normal
          Priority: P2
         Component: tree-optimization
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: falk at debian dot org
                CC: gcc-bugs at gcc dot gnu dot org
 GCC build triplet: alphaev68-unknown-linux-gnu
  GCC host triplet: alphaev68-unknown-linux-gnu
GCC target triplet: alphaev68-unknown-linux-gnu


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=16220


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