This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[PATCH][testsuite] Cache return value of check_effective_target_tiny


Hi all,

The check for the tiny memory model is something that is called frequently on aarch64 testing
since we use it to prune relocation truncation errors in the testsuite.
Therefore it makes sense to cached the result.
I've done this in a similar way to how check_effective_target_vect_shift does it.

Testsuite runs fine with this patch.

Ok for trunk?

Thanks,
Kyrill

2014-12-03  Kyrylo Tkachov  <kyrylo.tkachov@arm.com>

    * lib/target-supports.exp (check_effective_target_tiny): Cache
    predicate value.
commit 607dd84000612dc6845070ecb211bc8ceb2cb6ba
Author: Kyrylo Tkachov <kyrylo.tkachov@arm.com>
Date:   Mon Dec 1 14:00:40 2014 +0000

    [testsuite] Cached check for tiny memory model

diff --git a/gcc/testsuite/lib/target-supports.exp b/gcc/testsuite/lib/target-supports.exp
index ac04d95..19f512d 100644
--- a/gcc/testsuite/lib/target-supports.exp
+++ b/gcc/testsuite/lib/target-supports.exp
@@ -6053,11 +6053,20 @@ proc check_effective_target_fenv_exceptions {} {
 }
 
 proc check_effective_target_tiny {} {
-    if { [istarget aarch64*-*-*]
-         && [check_effective_target_aarch64_tiny] } {
-        return 1
+    global et_target_tiny_saved
+
+    if [info exists et_target_tine_saved] {
+      verbose "check_effective_target_tiny: using cached result" 2
+    } else {
+       set et_target_tiny_saved 0
+       if { [istarget aarch64*-*-*]
+             && [check_effective_target_aarch64_tiny] } {
+         set et_target_tiny_saved 1
+       }
     }
-    return 0
+
+    verbose "check_effective_target_tiny: returning $et_target_tiny_saved" 2
+    return $et_target_tiny_saved
 }
 
 # Return 1 if LOGICAL_OP_NON_SHORT_CIRCUIT is set to 0 for the current target.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]