* [Bug ada/46490] For four major i386 BSDs, GNAT fails FP to static integer conversion with -O2,-O3 optimization
2010-11-15 19:54 [Bug ada/46490] New: For four major i386 BSDs, GNAT fails FP to static integer conversion with -O2,-O3 optimization gnugcc at marino dot st
@ 2010-11-15 19:58 ` gnugcc at marino dot st
2010-11-15 19:58 ` gnugcc at marino dot st
` (10 subsequent siblings)
11 siblings, 0 replies; 13+ messages in thread
From: gnugcc at marino dot st @ 2010-11-15 19:58 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=46490
--- Comment #2 from John Marino <gnugcc at marino dot st> 2010-11-15 19:55:34 UTC ---
Created attachment 22406
--> http://gcc.gnu.org/bugzilla/attachment.cgi?id=22406
SlimC46007 program (2 of 3)
^ permalink raw reply [flat|nested] 13+ messages in thread
* [Bug ada/46490] For four major i386 BSDs, GNAT fails FP to static integer conversion with -O2,-O3 optimization
2010-11-15 19:54 [Bug ada/46490] New: For four major i386 BSDs, GNAT fails FP to static integer conversion with -O2,-O3 optimization gnugcc at marino dot st
2010-11-15 19:58 ` [Bug ada/46490] " gnugcc at marino dot st
@ 2010-11-15 19:58 ` gnugcc at marino dot st
2010-11-15 20:10 ` gnugcc at marino dot st
` (9 subsequent siblings)
11 siblings, 0 replies; 13+ messages in thread
From: gnugcc at marino dot st @ 2010-11-15 19:58 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=46490
--- Comment #1 from John Marino <gnugcc at marino dot st> 2010-11-15 19:53:38 UTC ---
Created attachment 22405
--> http://gcc.gnu.org/bugzilla/attachment.cgi?id=22405
SlimC46007 program (1 of 3)
^ permalink raw reply [flat|nested] 13+ messages in thread
* [Bug ada/46490] For four major i386 BSDs, GNAT fails FP to static integer conversion with -O2,-O3 optimization
2010-11-15 19:54 [Bug ada/46490] New: For four major i386 BSDs, GNAT fails FP to static integer conversion with -O2,-O3 optimization gnugcc at marino dot st
2010-11-15 19:58 ` [Bug ada/46490] " gnugcc at marino dot st
2010-11-15 19:58 ` gnugcc at marino dot st
@ 2010-11-15 20:10 ` gnugcc at marino dot st
2010-11-16 8:28 ` ebotcazou at gcc dot gnu.org
` (8 subsequent siblings)
11 siblings, 0 replies; 13+ messages in thread
From: gnugcc at marino dot st @ 2010-11-15 20:10 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=46490
--- Comment #3 from John Marino <gnugcc at marino dot st> 2010-11-15 19:56:33 UTC ---
Created attachment 22407
--> http://gcc.gnu.org/bugzilla/attachment.cgi?id=22407
SlimC46007 program (3 of 3)
^ permalink raw reply [flat|nested] 13+ messages in thread
* [Bug ada/46490] For four major i386 BSDs, GNAT fails FP to static integer conversion with -O2,-O3 optimization
2010-11-15 19:54 [Bug ada/46490] New: For four major i386 BSDs, GNAT fails FP to static integer conversion with -O2,-O3 optimization gnugcc at marino dot st
` (2 preceding siblings ...)
2010-11-15 20:10 ` gnugcc at marino dot st
@ 2010-11-16 8:28 ` ebotcazou at gcc dot gnu.org
2010-11-16 10:49 ` gnugcc at marino dot st
` (7 subsequent siblings)
11 siblings, 0 replies; 13+ messages in thread
From: ebotcazou at gcc dot gnu.org @ 2010-11-16 8:28 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=46490
Eric Botcazou <ebotcazou at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |NEW
Last reconfirmed| |2010.11.16 08:22:33
CC| |ebotcazou at gcc dot
| |gnu.org
Ever Confirmed|0 |1
--- Comment #4 from Eric Botcazou <ebotcazou at gcc dot gnu.org> 2010-11-16 08:22:33 UTC ---
There is a known issue for FreeBSD. GNAT requires 64-bit precision on the x87
so it resets it in ada/init.c:__gnat_init_float. This runs afoul of:
/* FreeBSD sets the rounding precision of the FPU to 53 bits. Let the
compiler get the contents of <float.h> and std::numeric_limits correct. */
#undef TARGET_96_ROUND_53_LONG_DOUBLE
#define TARGET_96_ROUND_53_LONG_DOUBLE (!TARGET_64BIT)
in config/i386/freebsd.h so you'd need to force it to 0 unconditionally for
GNAT.
For the stack checking, you should try to define:
/* Static stack checking is supported by means of probes. */
#define STACK_CHECK_STATIC_BUILTIN 1
like in config/i386/freebsd.h.
^ permalink raw reply [flat|nested] 13+ messages in thread
* [Bug ada/46490] For four major i386 BSDs, GNAT fails FP to static integer conversion with -O2,-O3 optimization
2010-11-15 19:54 [Bug ada/46490] New: For four major i386 BSDs, GNAT fails FP to static integer conversion with -O2,-O3 optimization gnugcc at marino dot st
` (3 preceding siblings ...)
2010-11-16 8:28 ` ebotcazou at gcc dot gnu.org
@ 2010-11-16 10:49 ` gnugcc at marino dot st
2010-11-16 11:25 ` [Bug ada/46490] ACATS cb460007 fails at -O2 or above ebotcazou at gcc dot gnu.org
` (6 subsequent siblings)
11 siblings, 0 replies; 13+ messages in thread
From: gnugcc at marino dot st @ 2010-11-16 10:49 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=46490
--- Comment #5 from John Marino <gnugcc at marino dot st> 2010-11-16 10:35:54 UTC ---
Hi Eric,
Thanks for you comment, but I don't think that is it for several reasons:
1) I am aware of both those quirks, and my codebase is patched with both of
those suggestions.
2) There's no problem with stack checking on FreeBSD i386. There are no
failures whatsoever on either ACATS or gnat.dejagnu except for this particular
case of c460007. NetBSD stack-checking doesn't work, but that's outside this
bug report.
3) The test passes with optimization level 0 or 1. It fails with O2 and O3
settings.
4) There are no other rounding issues. If TARGET_96_ROUND_53_LONG_DOUBLE is
not set correctly, multiple tests fail.
5) It's occurring identically on all four i386 platforms which are pretty
divergent.
This looks like a problem in the optimization stage.
The two test cases I provided are interesting as you can see the test will pass
if the EQUAL function is nested inside the main procedure rather than being
called as a separate package (also pointing to a problem in optimization I
would think.)
This warrants a closer look, it's not a configuration thing.
Thanks,
John
^ permalink raw reply [flat|nested] 13+ messages in thread
* [Bug ada/46490] ACATS cb460007 fails at -O2 or above
2010-11-15 19:54 [Bug ada/46490] New: For four major i386 BSDs, GNAT fails FP to static integer conversion with -O2,-O3 optimization gnugcc at marino dot st
` (4 preceding siblings ...)
2010-11-16 10:49 ` gnugcc at marino dot st
@ 2010-11-16 11:25 ` ebotcazou at gcc dot gnu.org
2010-11-16 11:43 ` gnugcc at marino dot st
` (5 subsequent siblings)
11 siblings, 0 replies; 13+ messages in thread
From: ebotcazou at gcc dot gnu.org @ 2010-11-16 11:25 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=46490
Eric Botcazou <ebotcazou at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Keywords| |wrong-code
Target|FreeBSD, OpenBSD, NetBSD, |i386-*-*
|DragonFlyBSD: i386 |
Host|Same as Target |
Summary|For four major i386 BSDs, |ACATS cb460007 fails at -O2
|GNAT fails FP to static |or above
|integer conversion with |
|-O2,-O3 optimization |
Build|Same as Target |
--- Comment #6 from Eric Botcazou <ebotcazou at gcc dot gnu.org> 2010-11-16 11:16:40 UTC ---
> 5) It's occurring identically on all four i386 platforms which are pretty
> divergent.
>
> This looks like a problem in the optimization stage.
OK, the summary is slightly misleading then, if this has nothing to do with
BSD.
Do you know if this fails with earlier versions? Let me try on Linux.
^ permalink raw reply [flat|nested] 13+ messages in thread
* [Bug ada/46490] ACATS cb460007 fails at -O2 or above
2010-11-15 19:54 [Bug ada/46490] New: For four major i386 BSDs, GNAT fails FP to static integer conversion with -O2,-O3 optimization gnugcc at marino dot st
` (5 preceding siblings ...)
2010-11-16 11:25 ` [Bug ada/46490] ACATS cb460007 fails at -O2 or above ebotcazou at gcc dot gnu.org
@ 2010-11-16 11:43 ` gnugcc at marino dot st
2010-11-16 11:48 ` [Bug ada/46490] ACATS c460007 " ebotcazou at gcc dot gnu.org
` (4 subsequent siblings)
11 siblings, 0 replies; 13+ messages in thread
From: gnugcc at marino dot st @ 2010-11-16 11:43 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=46490
--- Comment #7 from John Marino <gnugcc at marino dot st> 2010-11-16 11:25:31 UTC ---
Eric,
Actually I believe it is limited to the BSDs, although I can't explain why. I
also ported GNAT to x86 OpenSolaris (SXCE 130) and that one passed all ACATS.
I also have not seen this failure on any of the Linux testsuite reports for
4.6.0.
This error may have also been present in the 4.5.0 branch, but there were
several other failures back then so I wasn't paying particular attention to it
at the time.
FYI, here are recent test reports if you find this helpful:
DragonFly32 : http://www.dragonlace.net/gnataux/dragonfly32/
FreeBSD32 : http://www.dragonlace.net/gnataux/freebsd32/
OpenBSD32 : http://www.dragonlace.net/gnataux/openbsd32/
NetBSD32 : http://www.dragonlace.net/gnataux/netbsd32/
Also, remember x86_64 works fine, there is no issue with -O2,-O3 with this test
on that architecture.
^ permalink raw reply [flat|nested] 13+ messages in thread
* [Bug ada/46490] ACATS c460007 fails at -O2 or above
2010-11-15 19:54 [Bug ada/46490] New: For four major i386 BSDs, GNAT fails FP to static integer conversion with -O2,-O3 optimization gnugcc at marino dot st
` (6 preceding siblings ...)
2010-11-16 11:43 ` gnugcc at marino dot st
@ 2010-11-16 11:48 ` ebotcazou at gcc dot gnu.org
2010-11-16 17:11 ` [Bug rtl-optimization/46490] [4.6 regression] " ebotcazou at gcc dot gnu.org
` (3 subsequent siblings)
11 siblings, 0 replies; 13+ messages in thread
From: ebotcazou at gcc dot gnu.org @ 2010-11-16 11:48 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=46490
Eric Botcazou <ebotcazou at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|NEW |ASSIGNED
AssignedTo|unassigned at gcc dot |ebotcazou at gcc dot
|gnu.org |gnu.org
--- Comment #8 from Eric Botcazou <ebotcazou at gcc dot gnu.org> 2010-11-16 11:46:51 UTC ---
> Actually I believe it is limited to the BSDs, although I can't explain why.
You need -mtune=i386 to reproduce on Linux for example.
> FYI, here are recent test reports if you find this helpful:
>
> DragonFly32 : http://www.dragonlace.net/gnataux/dragonfly32/
> FreeBSD32 : http://www.dragonlace.net/gnataux/freebsd32/
> OpenBSD32 : http://www.dragonlace.net/gnataux/openbsd32/
> NetBSD32 : http://www.dragonlace.net/gnataux/netbsd32/
Thanks. If the OpenBSD port is SJLJ, you can add an XFAIL for *-*-openbsd* to
gnat.dg/test_raise_from_pure.adb.
^ permalink raw reply [flat|nested] 13+ messages in thread
* [Bug rtl-optimization/46490] [4.6 regression] ACATS c460007 fails at -O2 or above
2010-11-15 19:54 [Bug ada/46490] New: For four major i386 BSDs, GNAT fails FP to static integer conversion with -O2,-O3 optimization gnugcc at marino dot st
` (7 preceding siblings ...)
2010-11-16 11:48 ` [Bug ada/46490] ACATS c460007 " ebotcazou at gcc dot gnu.org
@ 2010-11-16 17:11 ` ebotcazou at gcc dot gnu.org
2010-11-16 22:32 ` ebotcazou at gcc dot gnu.org
` (2 subsequent siblings)
11 siblings, 0 replies; 13+ messages in thread
From: ebotcazou at gcc dot gnu.org @ 2010-11-16 17:11 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=46490
Eric Botcazou <ebotcazou at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Component|ada |rtl-optimization
Known to work| |4.5.1
Target Milestone|--- |4.6.0
Summary|ACATS c460007 fails at -O2 |[4.6 regression] ACATS
|or above |c460007 fails at -O2 or
| |above
--- Comment #9 from Eric Botcazou <ebotcazou at gcc dot gnu.org> 2010-11-16 17:07:00 UTC ---
Recategorizing.
^ permalink raw reply [flat|nested] 13+ messages in thread
* [Bug rtl-optimization/46490] [4.6 regression] ACATS c460007 fails at -O2 or above
2010-11-15 19:54 [Bug ada/46490] New: For four major i386 BSDs, GNAT fails FP to static integer conversion with -O2,-O3 optimization gnugcc at marino dot st
` (8 preceding siblings ...)
2010-11-16 17:11 ` [Bug rtl-optimization/46490] [4.6 regression] " ebotcazou at gcc dot gnu.org
@ 2010-11-16 22:32 ` ebotcazou at gcc dot gnu.org
2010-11-16 22:35 ` ebotcazou at gcc dot gnu.org
2010-11-16 23:08 ` gnugcc at marino dot st
11 siblings, 0 replies; 13+ messages in thread
From: ebotcazou at gcc dot gnu.org @ 2010-11-16 22:32 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=46490
--- Comment #10 from Eric Botcazou <ebotcazou at gcc dot gnu.org> 2010-11-16 22:30:25 UTC ---
Author: ebotcazou
Date: Tue Nov 16 22:30:19 2010
New Revision: 166830
URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=166830
Log:
PR rtl-optimization/46490
* combine.c (expand_compound_operation): Fix thinko.
Added:
trunk/gcc/testsuite/gnat.dg/opt12.adb
trunk/gcc/testsuite/gnat.dg/opt12_pkg.adb
trunk/gcc/testsuite/gnat.dg/opt12_pkg.ads
Modified:
trunk/gcc/ChangeLog
trunk/gcc/combine.c
trunk/gcc/testsuite/ChangeLog
^ permalink raw reply [flat|nested] 13+ messages in thread
* [Bug rtl-optimization/46490] [4.6 regression] ACATS c460007 fails at -O2 or above
2010-11-15 19:54 [Bug ada/46490] New: For four major i386 BSDs, GNAT fails FP to static integer conversion with -O2,-O3 optimization gnugcc at marino dot st
` (9 preceding siblings ...)
2010-11-16 22:32 ` ebotcazou at gcc dot gnu.org
@ 2010-11-16 22:35 ` ebotcazou at gcc dot gnu.org
2010-11-16 23:08 ` gnugcc at marino dot st
11 siblings, 0 replies; 13+ messages in thread
From: ebotcazou at gcc dot gnu.org @ 2010-11-16 22:35 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=46490
Eric Botcazou <ebotcazou at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|ASSIGNED |RESOLVED
URL|http://www.dragonlace.net |http://gcc.gnu.org/ml/gcc-p
| |atches/2010-11/msg01736.htm
| |l
Resolution| |FIXED
--- Comment #11 from Eric Botcazou <ebotcazou at gcc dot gnu.org> 2010-11-16 22:32:39 UTC ---
This should work again.
^ permalink raw reply [flat|nested] 13+ messages in thread
* [Bug rtl-optimization/46490] [4.6 regression] ACATS c460007 fails at -O2 or above
2010-11-15 19:54 [Bug ada/46490] New: For four major i386 BSDs, GNAT fails FP to static integer conversion with -O2,-O3 optimization gnugcc at marino dot st
` (10 preceding siblings ...)
2010-11-16 22:35 ` ebotcazou at gcc dot gnu.org
@ 2010-11-16 23:08 ` gnugcc at marino dot st
11 siblings, 0 replies; 13+ messages in thread
From: gnugcc at marino dot st @ 2010-11-16 23:08 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=46490
--- Comment #12 from John Marino <gnugcc at marino dot st> 2010-11-16 23:07:46 UTC ---
That's great news, Eric!
Many thanks, both for spending some long hours resolving this the same day it
was reported, and for the tip on the raise_from_pure test. This results in two
GNAT ports have zero ACATS errors.
John
^ permalink raw reply [flat|nested] 13+ messages in thread