This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: dg-add-options ieee ?
- From: Segher Boessenkool <segher at kernel dot crashing dot org>
- To: Paul Koning <paulkoning at comcast dot net>
- Cc: GCC Development <gcc at gcc dot gnu dot org>
- Date: Wed, 31 Oct 2018 14:55:51 -0500
- Subject: Re: dg-add-options ieee ?
- References: <ECFA11AD-AF3F-4B2F-842F-050E00FB3B3B@comcast.net>
On Wed, Oct 31, 2018 at 02:20:38PM -0400, Paul Koning wrote:
> I see some test cases that say dg-add-options ieee. That apparently means: pretend we have IEEE float even when the target does not.
It means:
(from testsuite/lib/target-supports.exp)
===
# Add to FLAGS all the target-specific flags needed to enable
# full IEEE compliance mode.
proc add_options_for_ieee { flags } {
if { [istarget alpha*-*-*]
|| [istarget sh*-*-*] } {
return "$flags -mieee"
}
if { [istarget rx-*-*] } {
return "$flags -mnofpu"
}
return $flags
}
===
i.e. add those options that make the floating point IEEE compliant.
If your target cannot do that, it should skip the tests that need IEEE float
(and if it can do it, but it is (possibly) not the default, code needs to
be added here for your target).
> What is the point of doing that? On non-IEEE targets such test cases fail -- at least they do on pdp11. Instead I'd expect a check that skips these tests if not IEEE. There is a subdirectory for IEEE tests under gcc.c-torture, though not under gcc.dg.
>
> I can just put a target specific dg-skip-if in these files, but I'm curious why dg-add-options was used.
On some targets IEEE float is not the default, but those targets can still
do it if you pass certain options.
Segher