int printf(const char *, ...); typedef int TItype __attribute__((mode(TI))); TItype x = -1; int main(void) { printf("%f %f\n", (float)x, (double)x); return 0; }
displays 0.000000 0.000000 on x86_64-unknown-linux-gnu. The conversion functions in libgcc2.c work for converting DImode values on the presumption that SImode values can be converted exactly to DFmode and wider. They don't work for converting TImode values to types which can't exactly represent all DImode values. (I'd say these functions should have #if conditionals embodying their prerequisites about type precisions, to make build fail for unsupported combinations, but existing targets need fixing first.) -- Summary: TImode-to-floating conversions broken Product: gcc Version: 4.2.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: other AssignedTo: unassigned at gcc dot gnu dot org ReportedBy: jsm28 at gcc dot gnu dot org http://gcc.gnu.org/bugzilla/show_bug.cgi?id=25028