Bug 37578 - Testsuite cannot tell systems with REAL(10) and REAL(16) apart
Summary: Testsuite cannot tell systems with REAL(10) and REAL(16) apart
Status: UNCONFIRMED
Alias: None
Product: gcc
Classification: Unclassified
Component: testsuite (show other bugs)
Version: 4.4.0
: P3 normal
Target Milestone: ---
Assignee: Not yet assigned to anyone
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-09-18 20:50 UTC by Dennis Wassel
Modified: 2009-02-28 11:38 UTC (History)
1 user (show)

See Also:
Host: any
Target:
Build:
Known to work:
Known to fail:
Last reconfirmed:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Dennis Wassel 2008-09-18 20:50:04 UTC
The testsuite defines "fortran_large_real" for all systems that have a REAL kind > 8. However, there are cases where different things should really be tested for REAL(10) vs REAL(16) [my upcoming patch to fortran/PR37159 being one of them].

To not break existing testcases, how about defining two additional conditionals, say "fortran_has_real_10" and "fortan_has_real_16"?

One (seemingly) simple way of figuring those guys out could be to compile the two canonical code snippets, dg-test for success and then run the actual Fortran tests.
Without a clue of the testsuite-internals, unfortunately I have no idea if this is feasible.
Comment 1 Dominique d'Humieres 2008-09-18 21:10:31 UTC
If I am right real(10) is a leftover of the "coprocessor" era and is a peculiarity of the x86 processors (may be also 68k, I cannot remember). I think for all the other platforms with "fortran_large_real" use real(16).

If this is correct a short term solution is to have two programs, one for "fortran_large_real" and *86* (and may be || *68k*) and one for "fortran_large_real" and !*86* (using the right syntax for the platform selection).

Comment 2 Janis Johnson 2009-02-28 00:25:42 UTC
The GCC testsuite supports effective-target keywords which can be used anywhere that target lists are used; see the internals manual about Test Directives.

Define an effective-target keyword xxx via check_effective_target_xxx in gcc/testsuite/lib/target-supports.exp.
Comment 3 Dominique d'Humieres 2009-02-28 11:38:41 UTC
> Define an effective-target keyword xxx via check_effective_target_xxx in
> gcc/testsuite/lib/target-supports.exp.

The only test I see is check_effective_target_fortran_large_real and it does not distinguishes between real(10) and real(16):

# Return 1 if the target supports Fortran real kinds larger than real(8),
# 0 otherwise.
#
# When the target name changes, replace the cached result.

proc check_effective_target_fortran_large_real { } {
    return [check_no_compiler_messages fortran_large_real executable {
	! Fortran
	integer,parameter :: k = selected_real_kind (precision (0.0_8) + 1)
	real(kind=k) :: x
	x = cos (x)
	end
    }]
}

Using precision(x) in similar tests could be used for check_effective_target_fortran_real_10 and check_effective_target_fortran_real_16: precision(x)==18 for real(10) and is larger than 30 for real(16) (31 on powerpc-apple-darwin9, 33 with ifort).