diff mbox

Fix testsuite profiling support checks

Message ID 4E5F86A1.7080208@codesourcery.com
State New
Headers show

Commit Message

Bernd Schmidt Sept. 1, 2011, 1:20 p.m. UTC
The following change

	2011-05-26  Rainer Orth  <ro@CeBiTec.Uni-Bielefeld.DE>
	PR gcov-profile/48845

causes testsuite failures on C6X. Specifically,

@@ -495,11 +495,16 @@ proc check_profiling_available { test_wh
     # These conditions depend on the argument so examine them before
     # looking at the cache variable.

+    # Tree profiling requires TLS runtime support.
+    if { $test_what == "-fprofile-generate" } {
+       return [check_effective_target_tls_runtime]
+    }
+

skips all the further tests in that function if
check_effective_target_tls_runtime returns true. (I'm not sure why it
does that on C6X - it seems to link in emutls stuff?) We then fail with
unresolved __gcov symbols.

Fixed with the following patch. I've removed the new avr special case,
assuming it was intended to fix the same issue. Ok?


Bernd
* testsuite/lib/target-supports.exp (check_profiling_available):
	Don't rely solely on TLS tests for -fprofile-generate, fall
	through to the other code.

Comments

Bernd Schmidt Sept. 22, 2011, 6:35 p.m. UTC | #1
On 09/01/11 15:20, Bernd Schmidt wrote:
> The following change
> 
> 	2011-05-26  Rainer Orth  <ro@CeBiTec.Uni-Bielefeld.DE>
> 	PR gcov-profile/48845
> 
> causes testsuite failures on C6X. Specifically,
> 
> @@ -495,11 +495,16 @@ proc check_profiling_available { test_wh
>      # These conditions depend on the argument so examine them before
>      # looking at the cache variable.
> 
> +    # Tree profiling requires TLS runtime support.
> +    if { $test_what == "-fprofile-generate" } {
> +       return [check_effective_target_tls_runtime]
> +    }
> +
> 
> skips all the further tests in that function if
> check_effective_target_tls_runtime returns true. (I'm not sure why it
> does that on C6X - it seems to link in emutls stuff?) We then fail with
> unresolved __gcov symbols.
> 
> Fixed with the following patch. I've removed the new avr special case,
> assuming it was intended to fix the same issue. Ok?

Ping?


Bernd
Mike Stump Sept. 23, 2011, 12:37 a.m. UTC | #2
On Sep 1, 2011, at 6:20 AM, Bernd Schmidt wrote:
> The following change
> 
> 	2011-05-26  Rainer Orth  <ro@CeBiTec.Uni-Bielefeld.DE>
> 	PR gcov-profile/48845
> 
> causes testsuite failures on C6X.

I was hoping that Rainer would comment...  or a profiling person, or an avr person....

> Ok?

Ok.  Watch for any hate mail from the avr folks.  :-)
Rainer Orth Sept. 23, 2011, 12:51 p.m. UTC | #3
Bernd Schmidt <bernds@codesourcery.com> writes:

> The following change
>
> 	2011-05-26  Rainer Orth  <ro@CeBiTec.Uni-Bielefeld.DE>
> 	PR gcov-profile/48845
>
> causes testsuite failures on C6X. Specifically,
>
> @@ -495,11 +495,16 @@ proc check_profiling_available { test_wh
>      # These conditions depend on the argument so examine them before
>      # looking at the cache variable.
>
> +    # Tree profiling requires TLS runtime support.
> +    if { $test_what == "-fprofile-generate" } {
> +       return [check_effective_target_tls_runtime]
> +    }
> +
>
> skips all the further tests in that function if
> check_effective_target_tls_runtime returns true. (I'm not sure why it
> does that on C6X - it seems to link in emutls stuff?) We then fail with

Right, this is always present and satisfies the tls_runtime test.  The
check was primarily meant for targets that have native TLS, but need
special switches to enable it.

	Rainer
Rainer Orth Sept. 23, 2011, 12:53 p.m. UTC | #4
Mike Stump <mikestump@comcast.net> writes:

> On Sep 1, 2011, at 6:20 AM, Bernd Schmidt wrote:
>> The following change
>> 
>> 	2011-05-26  Rainer Orth  <ro@CeBiTec.Uni-Bielefeld.DE>
>> 	PR gcov-profile/48845
>> 
>> causes testsuite failures on C6X.
>
> I was hoping that Rainer would comment...  or a profiling person, or an avr person....

I've just returned from a 3-week vacation and am slowly working through
my mail.

>> Ok?
>
> Ok.  Watch for any hate mail from the avr folks.  :-)

Looks good.  I'm just running a Solaris 8/x86 bootstrap, which will
notice if something's amiss for that target.

Thanks.
	Rainer
diff mbox

Patch

Index: gcc/testsuite/lib/target-supports.exp
===================================================================
--- gcc/testsuite/lib/target-supports.exp	(revision 178293)
+++ gcc/testsuite/lib/target-supports.exp	(working copy)
@@ -459,12 +459,9 @@  proc check_profiling_available { test_wh
 
     # Tree profiling requires TLS runtime support.
     if { $test_what == "-fprofile-generate" } {
-	# AVR does not support profile generation because
-	# it does not implement needed support functions.
-	if { [istarget avr-*-*] } {
+	if { ![check_effective_target_tls_runtime] } {
 	    return 0
 	}
-	return [check_effective_target_tls_runtime]
     }
 
     # Support for -p on solaris2 relies on mcrt1.o which comes with the