--- Comment #6 from hjl at lucon dot org 2007-08-07 14:56 ---
Here is a testcase in C:
bash-3.2$ cat x.c
extern void bar (int *);
void
foo (int *i)
{
float x;
int y;
x = *i;
y = (int) __builtin_lroundf (x);
bar (&y);
}
bash-3.2$ /export/build/gnu/gcc/build-x86_64-linux/gcc/x
--- Comment #5 from hjl at lucon dot org 2007-08-07 14:40 ---
There is a disconnect between middle-end and back-end. There are many
places in builtins.c with
/* If argument is already integer valued, and we don't need to worry
about setting errno, there's no need to perform round
--- Comment #4 from fxcoudert at gcc dot gnu dot org 2007-08-07 08:54
---
Testcase reduced to:
subroutine foo(x)
integer :: x
real :: t
t = x
call bar(nint(t))
end subroutine foo
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=33007
--- Comment #3 from pinskia at gcc dot gnu dot org 2007-08-07 03:23 ---
This is a bug in the middle-end:
/* If we were unable to expand via the builtin, stop the sequence
(without outputting the insns) and call to the library function
with the stabilized argument list. */