The attached patch fixes a bug in convert_doublest_to_floatformat when converting to a IEEE single float format that has an implied integer bit. The problem is that the code is performing a shift to discard the top bit. It then subtracts one from the number of mantissa bits. Later on, the code does a shift of 32 - mantissa_bits to the right, then puts "mant_bits" into the result. For a single float, we have 23 bits of mantissa. If we shift the value, we still have 23 bits to put into the result. According to the algorithm, we will only put 22 bits and will shift 10 bits to the right, thereby losing the last bit. This in fact, causes the error for Bugzilla bug 85109 whereby p print_two_floats(*f3) in call-rt-st.exp does not print one of the values correctly. It is in fact printing what is given to it which has the last bit zeroed out. The old algorithm is correct for floating values whereby there are 32 or more mantissa bits. In such a case, we only can put 31 bits into the result. A simple test was added. The patch has been tested on the ia64 and x86. Ok to commit? -- Jeff J. 2003-06-10 Jeff Johnston * doublest.c (convert_doublest_to_floatformat): When dealing with the implied integer bit, only alter mant_bits if we are processing a full 32 bits of mantissa.