[gnu.gcc.bug] Unnecessary floating point moves

larus@CS.WISC.EDU (James Larus) (12/14/89)

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

grunwald@foobar.colorado.edu (Dirk Grunwald) (12/14/89)

This happens in 1.37beta as well.