mp (02/22/83)
The following bug in the 4.1bsd pcc compiler was passed on to me by
Jeff Mogul of Stanford. The compiler seems to forget that a cvtfd
instruction clobbers 2 registers, rather than 1. Several of us here
with a less-than-complete understanding of pcc fooled with the
templates in table.c, but didn't get anywhere.
#include <stdio.h>
double dd[] = { 0.0, 2.0 };
float ff[] = { 0.0, 1.0 };
int i = 1;
main(){
if( ff[i] >= dd[i] ) printf( "ff >= dd\n" );
}
Here is the buggy Vax machine code (cc -S, no optimizer):
movl _i,r0
movl _i,r1
cvtfd _ff[r0],r0
cmpd r0,_dd[r1]
jlss L25