This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH][AArch64][tests]Skip graphite tests that don't fit -mcmodel=tiny
- From: Mike Stump <mikestump at comcast dot net>
- To: Richard Earnshaw <rearnsha at arm dot com>
- Cc: Kyrylo Tkachov <Kyrylo dot Tkachov at arm dot com>, Ramana Radhakrishnan <Ramana dot Radhakrishnan at arm dot com>, GCC Patches <gcc-patches at gcc dot gnu dot org>, Marcus Shawcroft <Marcus dot Shawcroft at arm dot com>
- Date: Mon, 11 Aug 2014 10:34:42 -0700
- Subject: Re: [PATCH][AArch64][tests]Skip graphite tests that don't fit -mcmodel=tiny
- Authentication-results: sourceware.org; auth=none
- References: <53CE448E dot 4060109 at arm dot com> <558B280E-4993-4FC6-9A57-A12ECB4A9B10 at comcast dot net> <77E8A918-CCEF-4F2F-9E17-8866991575BE at comcast dot net> <CAJA7tRYxZbYVzrYNzj2mQNoyx2oXOmNParie4vtuXgDrTN-wUQ at mail dot gmail dot com> <C3D47CDB-126C-4B9D-BB1D-516B246BF1EE at comcast dot net> <53E33AE9 dot 4050902 at arm dot com> <975E949D-CAEF-48E8-9BCF-F95188EA7A12 at comcast dot net> <53E88797 dot 2050304 at arm dot com>
On Aug 11, 2014, at 2:06 AM, Richard Earnshaw <rearnsha@arm.com> wrote:
> Not quite, read the subject line again.
Doh. I did miss that entirely. The solutions I gave were for other cases than the case at hand.
> I'm not sure what the correct change to the testsuite is here.
The below is close, let me refine it a little.
> Perhaps the best solution would be something like marking the test as
> "large" in some way and for "large" tests the linker would handle
> "relocation truncated to fit" errors from the linker through some target
> hook that had a better understanding of whether size related options
> were being used and could decide between error and unsupported.
How about a target tiny in supports.exp and any target that is tiny, we handle overflows in relocs as always unsupported. Works for all tiny targets, and uniformly works for all languages and all test cases of all time. Doesn’t depend upon guessing a size (how many bytes is tiny, is it code or data, and exactly how many bytes were generated on the target for the test case) nor guessing which test case are large. If you test the entire test suite with the tiny flag or if that flag is the default, then supports will say that the target is tiny. If you don’t give that flag and it isn’t the default, that same target is large. A person that only has tiny, can just say I’m tiny, and be forever done with it. An advanced ports with relaxation can then remove the I’m tiny, and then test relaxation.
I think that offers little code to do this (5-10 lines), handles most situations nicely, retains as much testing as possible generally speaking.
If one wants to handle mcmodel options on test cases seamlessly, one can use check-flags I think as well, see check_effective_target_arm_fp16_ok_nocache for example.
Something like:
proc ${tool}_check_unsupported_p { output } {
if [regexp "(^|\n)\[^\n\]*: region \[^\n\]* is full" $output] {
return "memory full”
+ if { [regexp "(^|\n)\[^\n\]*: relocation truncated to fit" $output] && [check_effective_target_tiny] } {
return "memory full”
}
proc check_effective_target_tiny { } {
if { [istarget blabla-*-*]
return 1
}
return 0
}
if the choice is static for the target. Slightly more complex is check-flags is used. I’ll leave that as an exercise for the reader. :-)