GCC Bugzilla – Bug 29864
Folding conversion unsigned long long to float
Last modified: 2008-02-04 15:52:59 UTC
In Funktion expand_float the libcall generated for a conversion from unsigned long long to float gets a wrong EQUIV note. See line optabs.c:4712 in the 4.3-20061111 snapshot. The equiv note is set to gen_rtx_FLOAT regardless of the unsignedp flag. When that flag is set, it should be a gen_rtx_UNSIGNED_FLOAT note.
The error is also present in 4.2. In 4.1 it was hidden because the code was only executed with unsignedp being false.
I found the problem while working on a private port. I do not have a confirmed testcase for a public port. The problem surfaced when GCSE eliminated the libcall using the note for the conversion.
A testcase would probably be sth along the lines of
extern void abort (void);
void __attribute__((noinline)) foo (unsigned long long x)
float uf = x;
float sf = (signed long long)x;
if (uf == sf)
with the right target and soft-float (any suggestion?).