Ada requires conversion of floating-point to integer to round, with halfway cases rounded away from zero. This is implemented by adding 0.5 to the floating-point value and then truncating, as in regular C float to int conversion. However, this gives wrong semantics for the predecessor of 0.5, and odd floating-point integers in the range 2.0**(mantissa - 1)+1.0 .. 2.0**(mantissa)-1.0 and the negative versions of these. The reason is that adding 0.5 in the above cases, yields a value exactly between two representable floating-point numbers. So the predecessor of 0.5 is then rounded to one, and the floating-point integers mentioned before get rounded to the next higher integer. I'll file a self-contained test case testing these cases.
Created attachment 7396 [details] Test case showing failure
The fix for this is now in GCC 4.0.0.