This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug target/19116] -fno-finite-math-only does not override -ffast-math
- From: "Thomas dot Koenig at online dot de" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 27 Dec 2004 10:26:47 -0000
- Subject: [Bug target/19116] -fno-finite-math-only does not override -ffast-math
- References: <20041221203640.19116.Thomas.Koenig@online.de>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Additional Comments From Thomas dot Koenig at online dot de 2004-12-27 10:26 -------
(In reply to comment #6)
> Can you try just -funsafe-math-optimizations and see what happens I think you
will get the same
> results as "-ffast-math -fno-finite-math-only" as I think an instruction in
the .md file checks the wrong
> flag.
$ gcc -funsafe-math-optimizations nan-check2.c
$ ./a.out
nan compares equal to itself
$ gcc -S -funsafe-math-optimizations nan-check2.c
$ cat nan-check2.s
.file "nan-check2.c"
.section .rodata
.LC1:
.string "%f compares equal to itself\n"
.align 4
.LC2:
.string "%f compares unequal to itself\n"
.text
.globl main
.type main, @function
main:
pushl %ebp
movl %esp, %ebp
subl $56, %esp
andl $-16, %esp
movl $0, %eax
addl $15, %eax
addl $15, %eax
shrl $4, %eax
sall $4, %eax
subl %eax, %esp
fldz
fstpl -16(%ebp)
fldz
fstpl -8(%ebp)
fldl -16(%ebp)
fdivl -8(%ebp)
fstpl -24(%ebp)
leal -24(%ebp), %eax
movl %eax, 4(%esp)
leal -24(%ebp), %eax
movl %eax, (%esp)
call equality
testl %eax, %eax
je .L2
fldl -24(%ebp)
fstpl 4(%esp)
movl $.LC1, (%esp)
call printf
jmp .L4
.L2:
fldl -24(%ebp)
fstpl 4(%esp)
movl $.LC2, (%esp)
call printf
.L4:
movl $0, %eax
leave
ret
.size main, .-main
.globl equality
.type equality, @function
equality:
pushl %ebp
movl %esp, %ebp
movl 8(%ebp), %eax
fldl (%eax)
movl 12(%ebp), %eax
fldl (%eax)
fcompp
fnstsw %ax
sahf
sete %al
movzbl %al, %eax
popl %ebp
ret
.size equality, .-equality
.ident "GCC: (GNU) 4.0.0 20041224 (experimental)"
.section .note.GNU-stack,"",@progbits
$
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=19116