------- Comment #2 from zsojka at seznam dot cz  2010-03-09 15:19 -------
I don't have 4.3 (or older) builds with enabled checking available. But without
checking, the code below prints "0.000000" for 4.4/4.5 and "6.000000" for 4.3
and older (4.2.4, 4.1.2, 3.3.6, 3.4.6).

Command line:
gcc -Os -ffast-math main.c -lm && ./a.out
------- main.c ------
extern int ilogbl(long double);
extern int printf(const char *format, ...);

__attribute__((noinline, noclone))
int foo(long double x) { return ilogbl(x); }
int main() { printf("%f\n", (float)foo(100)); }
---------------------

In 4.4/4.5 without checking, foo() is reduced to:
        xorl    %eax, %eax
        ret
while in 4.3/4.2/4.1, it is:
        jmp     ilogbl


-- 

zsojka at seznam dot cz changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |ice-checking, ice-on-valid-
                   |                            |code, wrong-code
            Summary|ICE: in emit_unop_insn, at  |[4.4/4.5 Regression] ICE: in
                   |optabs.c:3838 with -Os -    |emit_unop_insn, at
                   |ffast-math and ilogbl()     |optabs.c:3838 with -Os -
                   |                            |ffast-math and ilogbl()


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=43305

Reply via email to