public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Kyrill Tkachov <kyrylo.tkachov@arm.com>
To: Mike Stump <mikestump@comcast.net>,
	 Richard Earnshaw <Richard.Earnshaw@arm.com>
Cc: Ramana Radhakrishnan <Ramana.Radhakrishnan@arm.com>,
	 GCC Patches <gcc-patches@gcc.gnu.org>,
	Marcus Shawcroft <Marcus.Shawcroft@arm.com>
Subject: Re: [PATCH][AArch64][tests]Skip graphite tests that don't fit -mcmodel=tiny
Date: Tue, 19 Aug 2014 13:12:00 -0000	[thread overview]
Message-ID: <53F34D3D.4070104@arm.com> (raw)
In-Reply-To: <8E1B2289-3353-4A30-882A-2A1FC024F8E3@comcast.net>

[-- Attachment #1: Type: text/plain, Size: 3103 bytes --]


On 11/08/14 18:34, Mike Stump wrote:
> 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.  :-)
>

So how about this?

We add a check_effective_target_tiny (and define it for aarch64) and 
when find a "relocation truncated" message we say it's unsupported only 
when check_effective_target_tiny holds.

Kyrill


2014-08-19  Kyrylo Tkachov  <kyrylo.tkachov@arm.com>

     * lib/gcc-defs.exp (${tool}_check_unsupported_p):
     Return memory full when we have a tiny target and relocation
     truncation occurs.
     * lib/gcc-dg.exp (gcc-dg-prune): Likewise.
     * lib/objc.exp (${tool}_check_unsupported_p): Likewise.
     * lib/target-supports.exp (check_effective_target_tiny): New function.


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: testsuite-mem-full.patch --]
[-- Type: text/x-patch; name=testsuite-mem-full.patch, Size: 2414 bytes --]

diff --git a/gcc/testsuite/lib/gcc-defs.exp b/gcc/testsuite/lib/gcc-defs.exp
index 69a5971..1ea7028 100644
--- a/gcc/testsuite/lib/gcc-defs.exp
+++ b/gcc/testsuite/lib/gcc-defs.exp
@@ -157,6 +157,11 @@ 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"
+     }
+
     if { [istarget spu-*-*] && \
 	     [string match "*exceeds local store*" $output] } {
 	return "memory full"
diff --git a/gcc/testsuite/lib/gcc-dg.exp b/gcc/testsuite/lib/gcc-dg.exp
index 3390caa..dfdb257 100644
--- a/gcc/testsuite/lib/gcc-dg.exp
+++ b/gcc/testsuite/lib/gcc-dg.exp
@@ -233,6 +233,11 @@ proc gcc-dg-prune { system text } {
 	return "::unsupported::memory full"
     }
 
+    if { [regexp "(^|\n)\[^\n\]*: relocation truncated to fit" $text]
+          && [check_effective_target_tiny] } {
+        return "::unsupported::memory full"
+    }
+
     # Likewise, if we see ".text exceeds local store range" or
     # similar.
     if {[string match "spu-*" $system] && \
diff --git a/gcc/testsuite/lib/objc.exp b/gcc/testsuite/lib/objc.exp
index 5ecefa9..e19b264 100644
--- a/gcc/testsuite/lib/objc.exp
+++ b/gcc/testsuite/lib/objc.exp
@@ -357,6 +357,10 @@ 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"
+    }
     return ""
 }
 
diff --git a/gcc/testsuite/lib/target-supports.exp b/gcc/testsuite/lib/target-supports.exp
index c03370d..9eed181 100644
--- a/gcc/testsuite/lib/target-supports.exp
+++ b/gcc/testsuite/lib/target-supports.exp
@@ -5950,6 +5950,14 @@ proc check_effective_target_fenv_exceptions {} {
     } [add_options_for_ieee "-std=gnu99"]]
 }
 
+proc check_effective_target_tiny {} {
+    if { [istarget aarch64*-*-*]
+         && [check_effective_target_aarch64_tiny] } {
+        return 1
+    }
+    return 0
+}
+
 # Return 1 if LOGICAL_OP_NON_SHORT_CIRCUIT is set to 0 for the current target.
 
 proc check_effective_target_logical_op_short_circuit {} {

  reply	other threads:[~2014-08-19 13:12 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-07-22 11:23 Kyrill Tkachov
2014-07-22 15:04 ` Sebastian Pop
2014-07-22 15:17   ` Kyrill Tkachov
2014-07-22 20:40 ` Mike Stump
2014-07-30 21:40   ` Mike Stump
     [not found]     ` <CAJA7tRYxZbYVzrYNzj2mQNoyx2oXOmNParie4vtuXgDrTN-wUQ@mail.gmail.com>
2014-08-01  0:00       ` Mike Stump
2014-08-07  8:38         ` Kyrill Tkachov
2014-08-08 17:54           ` Mike Stump
2014-08-11  9:06             ` Richard Earnshaw
2014-08-11 17:35               ` Mike Stump
2014-08-19 13:12                 ` Kyrill Tkachov [this message]
2014-08-19 16:30                   ` Mike Stump
2014-10-21 14:08                     ` [PATCH][dejagnu] gcc-dg-prune glitch when filtering "relocation truncation" error Jiong Wang
2014-10-21 18:14                       ` Jeff Law

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=53F34D3D.4070104@arm.com \
    --to=kyrylo.tkachov@arm.com \
    --cc=Marcus.Shawcroft@arm.com \
    --cc=Ramana.Radhakrishnan@arm.com \
    --cc=Richard.Earnshaw@arm.com \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=mikestump@comcast.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).