* [Bug target/39501] -O -ffinite-math-only gets min(x,y) optimization wrong for SF on arm-*-gnueabi
2009-03-19 13:31 [Bug target/39501] New: -O -ffinite-math-only gets min(x,y) optimization wrong for SF on arm-*-gnueabi martinwguy at yahoo dot it
@ 2009-03-19 15:53 ` ramana dot r at gmail dot com
2009-03-19 16:05 ` ramana dot r at gmail dot com
` (13 subsequent siblings)
14 siblings, 0 replies; 19+ messages in thread
From: ramana dot r at gmail dot com @ 2009-03-19 15:53 UTC (permalink / raw)
To: gcc-bugs
------- Comment #1 from ramana dot r at gmail dot com 2009-03-19 15:53 -------
Adding self to CC list -
mainline is also broken. The only difference in mainline is that we generate a
movle instead of movgt.
It should indeed be a moveq instead of a movle.
cheers
Ramana
--
ramana dot r at gmail dot com changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |rearnsha at gcc dot gnu dot
| |org, ramana dot r at gmail
| |dot com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=39501
^ permalink raw reply [flat|nested] 19+ messages in thread
* [Bug target/39501] -O -ffinite-math-only gets min(x,y) optimization wrong for SF on arm-*-gnueabi
2009-03-19 13:31 [Bug target/39501] New: -O -ffinite-math-only gets min(x,y) optimization wrong for SF on arm-*-gnueabi martinwguy at yahoo dot it
2009-03-19 15:53 ` [Bug target/39501] " ramana dot r at gmail dot com
@ 2009-03-19 16:05 ` ramana dot r at gmail dot com
2009-03-19 16:30 ` martinwguy at yahoo dot it
` (12 subsequent siblings)
14 siblings, 0 replies; 19+ messages in thread
From: ramana dot r at gmail dot com @ 2009-03-19 16:05 UTC (permalink / raw)
To: gcc-bugs
------- Comment #2 from ramana dot r at gmail dot com 2009-03-19 16:05 -------
Or get rid of the cmp. The Runtime ABI suggests that the Z,N,C flags are set
for the result of the comparison. If that is true then the second cmp is
unnecessary.
Table 5 section 4.1.2 of the ARM Runtime ABI suggests this.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=39501
^ permalink raw reply [flat|nested] 19+ messages in thread
* [Bug target/39501] -O -ffinite-math-only gets min(x,y) optimization wrong for SF on arm-*-gnueabi
2009-03-19 13:31 [Bug target/39501] New: -O -ffinite-math-only gets min(x,y) optimization wrong for SF on arm-*-gnueabi martinwguy at yahoo dot it
2009-03-19 15:53 ` [Bug target/39501] " ramana dot r at gmail dot com
2009-03-19 16:05 ` ramana dot r at gmail dot com
@ 2009-03-19 16:30 ` martinwguy at yahoo dot it
2009-03-19 16:49 ` ramana dot r at gmail dot com
` (11 subsequent siblings)
14 siblings, 0 replies; 19+ messages in thread
From: martinwguy at yahoo dot it @ 2009-03-19 16:30 UTC (permalink / raw)
To: gcc-bugs
------- Comment #3 from martinwguy at yahoo dot it 2009-03-19 16:29 -------
ramana:
I think you'll find the flags are only set for the 3-way comparisons.
__aeabi_cmple just returns 0 or 1
"Use for C <=" in the table means the C language, not the carry flag.
If you can find where the error is in the GCC source, that'd be great.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=39501
^ permalink raw reply [flat|nested] 19+ messages in thread
* [Bug target/39501] -O -ffinite-math-only gets min(x,y) optimization wrong for SF on arm-*-gnueabi
2009-03-19 13:31 [Bug target/39501] New: -O -ffinite-math-only gets min(x,y) optimization wrong for SF on arm-*-gnueabi martinwguy at yahoo dot it
` (2 preceding siblings ...)
2009-03-19 16:30 ` martinwguy at yahoo dot it
@ 2009-03-19 16:49 ` ramana dot r at gmail dot com
2009-03-19 16:53 ` rearnsha at gcc dot gnu dot org
` (10 subsequent siblings)
14 siblings, 0 replies; 19+ messages in thread
From: ramana dot r at gmail dot com @ 2009-03-19 16:49 UTC (permalink / raw)
To: gcc-bugs
------- Comment #4 from ramana dot r at gmail dot com 2009-03-19 16:49 -------
(In reply to comment #3)
> ramana:
> I think you'll find the flags are only set for the 3-way comparisons.
> __aeabi_cmple just returns 0 or 1
> "Use for C <=" in the table means the C language, not the carry flag.
> If you can find where the error is in the GCC source, that'd be great.
It was pointed out that I was looking at the wrong function in the runtime ABI
- so I take that back. I was referring to the void __aeabi_cfcmple(float,
float) variant rather than the fcmple that's used in this case.
So if you were to use the cfcmple variants (which gcc can't at the moment) the
extra cmp might be removed.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=39501
^ permalink raw reply [flat|nested] 19+ messages in thread
* [Bug target/39501] -O -ffinite-math-only gets min(x,y) optimization wrong for SF on arm-*-gnueabi
2009-03-19 13:31 [Bug target/39501] New: -O -ffinite-math-only gets min(x,y) optimization wrong for SF on arm-*-gnueabi martinwguy at yahoo dot it
` (3 preceding siblings ...)
2009-03-19 16:49 ` ramana dot r at gmail dot com
@ 2009-03-19 16:53 ` rearnsha at gcc dot gnu dot org
2009-03-19 17:02 ` rearnsha at gcc dot gnu dot org
` (9 subsequent siblings)
14 siblings, 0 replies; 19+ messages in thread
From: rearnsha at gcc dot gnu dot org @ 2009-03-19 16:53 UTC (permalink / raw)
To: gcc-bugs
------- Comment #5 from rearnsha at gcc dot gnu dot org 2009-03-19 16:53 -------
Also affects all other EABI target builds.
THe bug is in movsfcc (and movdfcc) which have not been corrected to account
for the libcall comparisons returning a bool value in the EABI.
I'm currently testing a fix
--
rearnsha at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
AssignedTo|unassigned at gcc dot gnu |rearnsha at gcc dot gnu dot
|dot org |org
Status|UNCONFIRMED |ASSIGNED
Ever Confirmed|0 |1
Priority|P3 |P2
Last reconfirmed|0000-00-00 00:00:00 |2009-03-19 16:53:01
date| |
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=39501
^ permalink raw reply [flat|nested] 19+ messages in thread
* [Bug target/39501] -O -ffinite-math-only gets min(x,y) optimization wrong for SF on arm-*-gnueabi
2009-03-19 13:31 [Bug target/39501] New: -O -ffinite-math-only gets min(x,y) optimization wrong for SF on arm-*-gnueabi martinwguy at yahoo dot it
` (4 preceding siblings ...)
2009-03-19 16:53 ` rearnsha at gcc dot gnu dot org
@ 2009-03-19 17:02 ` rearnsha at gcc dot gnu dot org
2009-03-19 18:18 ` pinskia at gcc dot gnu dot org
` (8 subsequent siblings)
14 siblings, 0 replies; 19+ messages in thread
From: rearnsha at gcc dot gnu dot org @ 2009-03-19 17:02 UTC (permalink / raw)
To: gcc-bugs
------- Comment #6 from rearnsha at gcc dot gnu dot org 2009-03-19 17:02 -------
Correction: it doesn't affect movdfcc since that only matches on hard-float
targets.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=39501
^ permalink raw reply [flat|nested] 19+ messages in thread
* [Bug target/39501] -O -ffinite-math-only gets min(x,y) optimization wrong for SF on arm-*-gnueabi
2009-03-19 13:31 [Bug target/39501] New: -O -ffinite-math-only gets min(x,y) optimization wrong for SF on arm-*-gnueabi martinwguy at yahoo dot it
` (5 preceding siblings ...)
2009-03-19 17:02 ` rearnsha at gcc dot gnu dot org
@ 2009-03-19 18:18 ` pinskia at gcc dot gnu dot org
2009-03-29 17:49 ` martinwguy at yahoo dot it
` (7 subsequent siblings)
14 siblings, 0 replies; 19+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2009-03-19 18:18 UTC (permalink / raw)
To: gcc-bugs
------- Comment #7 from pinskia at gcc dot gnu dot org 2009-03-19 18:17 -------
*** Bug 39507 has been marked as a duplicate of this bug. ***
--
pinskia at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |kurt at roeckx dot be
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=39501
^ permalink raw reply [flat|nested] 19+ messages in thread
* [Bug target/39501] -O -ffinite-math-only gets min(x,y) optimization wrong for SF on arm-*-gnueabi
2009-03-19 13:31 [Bug target/39501] New: -O -ffinite-math-only gets min(x,y) optimization wrong for SF on arm-*-gnueabi martinwguy at yahoo dot it
` (6 preceding siblings ...)
2009-03-19 18:18 ` pinskia at gcc dot gnu dot org
@ 2009-03-29 17:49 ` martinwguy at yahoo dot it
2009-04-04 10:37 ` [Bug target/39501] -O -ffinite-math-only gets min(x,y) optimization wrong for soft-float " rearnsha at gcc dot gnu dot org
` (6 subsequent siblings)
14 siblings, 0 replies; 19+ messages in thread
From: martinwguy at yahoo dot it @ 2009-03-29 17:49 UTC (permalink / raw)
To: gcc-bugs
------- Comment #8 from martinwguy at yahoo dot it 2009-03-29 17:49 -------
A bit more info on the real-world cases that this bug bites.
1) libvorbis's testsuite (only in trunk) fails:
svn co http://svn.xiph.org/trunk/vorbis
cd vorbis; ./autogen.sh; ./configure; make
test/test
complains that "max_abs (0.000000) too small."; it should say "ok"
It can be fixed by using "./configure CFLAGS=-fno-finite-math-only"
(Both of these utilities' build scripts append your CFLAGS settings to their
own default ones.)
2) LAME -V0 outputs silence
wget http://downloads.sourceforge.net/lame/lame-398-2.tar.gz
tar xzf lame-398-2.tar.gz
cd lame-398-2
./configure && make
wget http://martinwguy.co.uk/martin/test/Happy.wav
frontend/lame --nohist -V0 Happy.wav Happy.mp3
mpg123 -w Happy2.wav Happy.mp3
# Or frontend/lame --quiet --decode Happy.mp3 Happy2.wav
sox Happy2.wav -e stat | grep 'Maximum amplitude'
should say something like maxamp = 0.574310, not 0.000000
It can be fixed by using
"./configure CFLAGS=-fno-finite-math-only"
and also with
"./configure CFLAGS="-fno-schedule-insns -fno-schedule-insns2"
though this does not fix the libvorbis issue.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=39501
^ permalink raw reply [flat|nested] 19+ messages in thread
* [Bug target/39501] -O -ffinite-math-only gets min(x,y) optimization wrong for soft-float on arm-*-gnueabi
2009-03-19 13:31 [Bug target/39501] New: -O -ffinite-math-only gets min(x,y) optimization wrong for SF on arm-*-gnueabi martinwguy at yahoo dot it
` (7 preceding siblings ...)
2009-03-29 17:49 ` martinwguy at yahoo dot it
@ 2009-04-04 10:37 ` rearnsha at gcc dot gnu dot org
2009-04-04 11:23 ` martinwguy at yahoo dot it
` (5 subsequent siblings)
14 siblings, 0 replies; 19+ messages in thread
From: rearnsha at gcc dot gnu dot org @ 2009-04-04 10:37 UTC (permalink / raw)
To: gcc-bugs
------- Comment #9 from rearnsha at gcc dot gnu dot org 2009-04-04 10:37 -------
Subject: Bug 39501
Author: rearnsha
Date: Sat Apr 4 10:37:10 2009
New Revision: 145534
URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=145534
Log:
PR target/39501
* arm.md (movsfcc): Disable if not TARGET_HARD_FLOAT.
* testsuite/gcc.c-torture/execute/pr39501.c: New file.
* testsuite/gcc.c-torture/execute/pr39501.x: New file.
Added:
trunk/gcc/testsuite/gcc.c-torture/execute/pr39501.c
trunk/gcc/testsuite/gcc.c-torture/execute/pr39501.x
Modified:
trunk/gcc/ChangeLog
trunk/gcc/config/arm/arm.md
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=39501
^ permalink raw reply [flat|nested] 19+ messages in thread
* [Bug target/39501] -O -ffinite-math-only gets min(x,y) optimization wrong for soft-float on arm-*-gnueabi
2009-03-19 13:31 [Bug target/39501] New: -O -ffinite-math-only gets min(x,y) optimization wrong for SF on arm-*-gnueabi martinwguy at yahoo dot it
` (8 preceding siblings ...)
2009-04-04 10:37 ` [Bug target/39501] -O -ffinite-math-only gets min(x,y) optimization wrong for soft-float " rearnsha at gcc dot gnu dot org
@ 2009-04-04 11:23 ` martinwguy at yahoo dot it
2009-04-04 11:50 ` martinwguy at yahoo dot it
` (4 subsequent siblings)
14 siblings, 0 replies; 19+ messages in thread
From: martinwguy at yahoo dot it @ 2009-04-04 11:23 UTC (permalink / raw)
To: gcc-bugs
------- Comment #10 from martinwguy at yahoo dot it 2009-04-04 11:23 -------
Is that *it*? Disable movsfcc completely without finding the cause of the
specific failure?
No wonder the generated ARM code is bigger, slower and buggier with every
release!
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=39501
^ permalink raw reply [flat|nested] 19+ messages in thread
* [Bug target/39501] -O -ffinite-math-only gets min(x,y) optimization wrong for soft-float on arm-*-gnueabi
2009-03-19 13:31 [Bug target/39501] New: -O -ffinite-math-only gets min(x,y) optimization wrong for SF on arm-*-gnueabi martinwguy at yahoo dot it
` (9 preceding siblings ...)
2009-04-04 11:23 ` martinwguy at yahoo dot it
@ 2009-04-04 11:50 ` martinwguy at yahoo dot it
2009-04-04 11:53 ` steven at gcc dot gnu dot org
` (3 subsequent siblings)
14 siblings, 0 replies; 19+ messages in thread
From: martinwguy at yahoo dot it @ 2009-04-04 11:50 UTC (permalink / raw)
To: gcc-bugs
------- Comment #11 from martinwguy at yahoo dot it 2009-04-04 11:50 -------
Sorry about that. I've now seen
http://gcc.gnu.org/ml/gcc-patches/2009-04/msg00300.html
M
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=39501
^ permalink raw reply [flat|nested] 19+ messages in thread
* [Bug target/39501] -O -ffinite-math-only gets min(x,y) optimization wrong for soft-float on arm-*-gnueabi
2009-03-19 13:31 [Bug target/39501] New: -O -ffinite-math-only gets min(x,y) optimization wrong for SF on arm-*-gnueabi martinwguy at yahoo dot it
` (10 preceding siblings ...)
2009-04-04 11:50 ` martinwguy at yahoo dot it
@ 2009-04-04 11:53 ` steven at gcc dot gnu dot org
2009-04-04 12:00 ` steven at gcc dot gnu dot org
` (2 subsequent siblings)
14 siblings, 0 replies; 19+ messages in thread
From: steven at gcc dot gnu dot org @ 2009-04-04 11:53 UTC (permalink / raw)
To: gcc-bugs
------- Comment #12 from steven at gcc dot gnu dot org 2009-04-04 11:53 -------
Re. comment #10: And who are you funding, Martin Guy, to improve GCC for ARM?
Or are you just another user who expects magic for free?
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=39501
^ permalink raw reply [flat|nested] 19+ messages in thread
* [Bug target/39501] -O -ffinite-math-only gets min(x,y) optimization wrong for soft-float on arm-*-gnueabi
2009-03-19 13:31 [Bug target/39501] New: -O -ffinite-math-only gets min(x,y) optimization wrong for SF on arm-*-gnueabi martinwguy at yahoo dot it
` (11 preceding siblings ...)
2009-04-04 11:53 ` steven at gcc dot gnu dot org
@ 2009-04-04 12:00 ` steven at gcc dot gnu dot org
2009-04-04 12:25 ` rearnsha at gcc dot gnu dot org
2009-05-16 22:25 ` rearnsha at gcc dot gnu dot org
14 siblings, 0 replies; 19+ messages in thread
From: steven at gcc dot gnu dot org @ 2009-04-04 12:00 UTC (permalink / raw)
To: gcc-bugs
------- Comment #13 from steven at gcc dot gnu dot org 2009-04-04 12:00 -------
Re. comment #10: I don't know about the "buggier" and "slower" parts.
But for "bigger" I know we have benchmarks that say otherwise. e.g. CSiBE for
arm-elf (http://www.inf.u-szeged.hu/csibe/s-arm.php) and CSiBE for arm-linux
(http://www.inf.u-szeged.hu/csibe/s-arm-linux.php, unfortunately stopped
running in 2006 due to -- you've guessed it -- lack of funding).
Obviously there's no denying that GCC still is too far behind most commercial
compilers for ARM...
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=39501
^ permalink raw reply [flat|nested] 19+ messages in thread
* [Bug target/39501] -O -ffinite-math-only gets min(x,y) optimization wrong for soft-float on arm-*-gnueabi
2009-03-19 13:31 [Bug target/39501] New: -O -ffinite-math-only gets min(x,y) optimization wrong for SF on arm-*-gnueabi martinwguy at yahoo dot it
` (12 preceding siblings ...)
2009-04-04 12:00 ` steven at gcc dot gnu dot org
@ 2009-04-04 12:25 ` rearnsha at gcc dot gnu dot org
2009-05-16 22:25 ` rearnsha at gcc dot gnu dot org
14 siblings, 0 replies; 19+ messages in thread
From: rearnsha at gcc dot gnu dot org @ 2009-04-04 12:25 UTC (permalink / raw)
To: gcc-bugs
------- Comment #14 from rearnsha at gcc dot gnu dot org 2009-04-04 12:25 -------
Subject: Bug 39501
Author: rearnsha
Date: Sat Apr 4 12:25:06 2009
New Revision: 145537
URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=145537
Log:
PR target/39501
* arm.md (movsfcc): Disable if not TARGET_HARD_FLOAT.
* testsuite/gcc.c-torture/execute/pr39501.c: New file.
* testsuite/gcc.c-torture/execute/pr39501.x: New file.
Added:
branches/gcc-4_4-branch/gcc/testsuite/gcc.c-torture/execute/pr39501.c
branches/gcc-4_4-branch/gcc/testsuite/gcc.c-torture/execute/pr39501.x
Modified:
branches/gcc-4_4-branch/gcc/ChangeLog
branches/gcc-4_4-branch/gcc/config/arm/arm.md
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=39501
^ permalink raw reply [flat|nested] 19+ messages in thread
* [Bug target/39501] -O -ffinite-math-only gets min(x,y) optimization wrong for soft-float on arm-*-gnueabi
2009-03-19 13:31 [Bug target/39501] New: -O -ffinite-math-only gets min(x,y) optimization wrong for SF on arm-*-gnueabi martinwguy at yahoo dot it
` (13 preceding siblings ...)
2009-04-04 12:25 ` rearnsha at gcc dot gnu dot org
@ 2009-05-16 22:25 ` rearnsha at gcc dot gnu dot org
14 siblings, 0 replies; 19+ messages in thread
From: rearnsha at gcc dot gnu dot org @ 2009-05-16 22:25 UTC (permalink / raw)
To: gcc-bugs
------- Comment #15 from rearnsha at gcc dot gnu dot org 2009-05-16 22:25 -------
Subject: Bug 39501
Author: rearnsha
Date: Sat May 16 22:24:59 2009
New Revision: 147623
URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=147623
Log:
PR target/39501
* arm.md (movsfcc): Disable if not TARGET_HARD_FLOAT.
* testsuite/gcc.c-torture/execute/pr39501.c: New file.
* testsuite/gcc.c-torture/execute/pr39501.x: New file.
Added:
branches/gcc-4_3-branch/gcc/testsuite/gcc.c-torture/execute/pr39501.c
branches/gcc-4_3-branch/gcc/testsuite/gcc.c-torture/execute/pr39501.x
Modified:
branches/gcc-4_3-branch/gcc/ChangeLog
branches/gcc-4_3-branch/gcc/config/arm/arm.md
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=39501
^ permalink raw reply [flat|nested] 19+ messages in thread