Path: utzoo!telly!attcan!uunet!tut.cis.ohio-state.edu!GANG-OF-FOUR.STANFORD.EDU!weening From: weening@GANG-OF-FOUR.STANFORD.EDU (Joe Weening) Newsgroups: gnu.gcc.bug Subject: Failure to optimize jumps Message-ID: <8902042238.AA04881@Gang-of-Four.Stanford.EDU> Date: 4 Feb 89 22:38:44 GMT Sender: daemon@tut.cis.ohio-state.edu Distribution: gnu Organization: GNUs Not Usenet Lines: 36 With GCC 1.33 on a Sun-3 using -O, the program foo (i) int i; { if (i > 10) return i; return 10; } compiles into: _foo: link a6,#0 movel a6@(8),d0 moveq #10,d1 cmpl d0,d1 jge L2 jra L1 L2: moveq #10,d0 L1: unlk a6 rts Version 1.31 of GCC was able to optimize the jumps to: _foo: link a6,#0 movel a6@(8),d0 moveq #10,d1 cmpl d0,d1 jlt L1 moveq #10,d0 L1: unlk a6 rts