Path: utzoo!telly!philmtl!uunet!tut.cis.ohio-state.edu!CS.WISC.EDU!larus From: larus@CS.WISC.EDU (James Larus) Newsgroups: gnu.gcc.bug Subject: Unnecessary floating point moves Message-ID: <8912131621.AA19808@primost.cs.wisc.edu> Date: 13 Dec 89 16:21:16 GMT Sender: daemon@tut.cis.ohio-state.edu Reply-To: larus@cs.wisc.edu Distribution: gnu Organization: GNUs Not Usenet Lines: 25 gcc version 1.36 on DECstation 3100 (MIPS R2000) compiles the following function: float foo (s) char *s; { double atof(); return atof(s); } into the following code: addiu $29,$29,0xfff0 #subsi3 $29,16 -> $29 jal atof # call atof regle 2-call (VOIDmode) mov.d $f4,$f0 #movdf $f0 -> $f4 cvt.s.d $f4,$f4 #truncdfsf2 $f4 -> $f4 mov.s $f0,$f4 #movsf $f4 -> $f0 addiu $29,$29,0x10 #addsi3 $29,16 -> $29 The move to $f4 to truncate and then back to $f0 is unncessary. /Jim