arm/gcc: Tighten checks in check_effective_target_freorder
authorAndrew Burgess <andrew.burgess@embecosm.com>
Wed, 30 Nov 2016 11:38:46 +0000 (11:38 +0000)
committerAndrew Burgess <aburgess@gcc.gnu.org>
Wed, 30 Nov 2016 11:38:46 +0000 (11:38 +0000)
In check_effective_target_freorder we check to see if the target
supports -freorder-blocks-and-partition.  However we disable
-freorder-blocks-and-partition when -fprofile-use is not supplied so for
some targets we'll not see any message about lack of support for
-freorder-blocks-and-partition unless -fprofile-use is also passed.

This commit extends check_effective_target_freorder to first try
-freorder-blocks-and-partition on its own, then try -fprofile-use and
-freorder-blocks-and-partition.

gcc/testsuite/ChangeLog:

* lib/target-supports.exp (check_effective_target_freorder): Check
additional case.

From-SVN: r243009

gcc/testsuite/ChangeLog
gcc/testsuite/lib/target-supports.exp

index 5532ed1..e89bca5 100644 (file)
@@ -1,5 +1,10 @@
 2016-11-30  Andrew Burgess  <andrew.burgess@embecosm.com>
 
+       * lib/target-supports.exp (check_effective_target_freorder): Check
+       additional case.
+
+2016-11-30  Andrew Burgess  <andrew.burgess@embecosm.com>
+
        * gcc.target/arc/arc700-stld-hazard.c: New file.
 
 2016-11-30  Janus Weil  <janus@gcc.gnu.org>
index 2192eb6..ace080e 100644 (file)
@@ -1011,12 +1011,19 @@ proc check_effective_target_fstack_protector {} {
 }
 
 # Return 1 if compilation with -freorder-blocks-and-partition is error-free
-# for trivial code, 0 otherwise.
+# for trivial code, 0 otherwise.  As some targets (ARM for example) only
+# warn when -fprofile-use is also supplied we test that combination too.
 
 proc check_effective_target_freorder {} {
-    return [check_no_compiler_messages freorder object {
+    if { [check_no_compiler_messages freorder object {
        void foo (void) { }
     } "-freorder-blocks-and-partition"]
+    && [check_no_compiler_messages fprofile_use_freorder object {
+       void foo (void) { }
+    } "-fprofile-use -freorder-blocks-and-partition"] } {
+       return 1
+    }
+    return 0
 }
 
 # Return 1 if -fpic and -fPIC are supported, as in no warnings or errors