Bug 48845 - [4.7 regression] All g++.dg/tree-prof and gcc.dg/{matrix, tree-prof} executions tests fail on Solaris 8/9
Summary: [4.7 regression] All g++.dg/tree-prof and gcc.dg/{matrix, tree-prof} executio...
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: gcov-profile (show other bugs)
Version: 4.7.0
: P3 normal
Target Milestone: 4.7.0
Assignee: Rainer Orth
URL: http://gcc.gnu.org/ml/gcc-patches/201...
Keywords:
Depends on:
Blocks:
 
Reported: 2011-05-02 17:26 UTC by Rainer Orth
Modified: 2011-05-26 11:17 UTC (History)
2 users (show)

See Also:
Host: *-*-solaris2.[89]
Target: *-*-solaris2.[89]
Build: *-*-solaris2.[89]
Known to work:
Known to fail:
Last reconfirmed: 2011-05-24 21:25:43


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Rainer Orth 2011-05-02 17:26:33 UTC
Between 20110421 and 20110429, all g++.dg/tree-prof and gcc.dg/{matrix, tree-prof}
execution tests started to fail on Solaris 8 and 9, both x86 and SPARC:

+FAIL: g++.dg/tree-prof/indir-call-prof-2.C execution,    -g  -fprofile-generate

spawn [open ...]
ld.so.1: indir-call-prof-2.x01: fatal: /var/gcc/regression/trunk/9-gcc-gas/build
/gcc/testsuite/g++/indir-call-prof-2.x01: object requires TLS, but TLS failed to
 initialize

This obviously happens since profiling now uses TLS under the hood:

[5]     |         4|       4|TLS  |LOCL |0    |9      |__gcov_indirect_call_callee
[6]     |         0|       4|TLS  |LOCL |0    |9      |__gcov_indirect_call_counters

So it is caused by this patch:

2011-04-27  Xinliang David Li  <davidxl@google.com>

        * tree-profile.c (init_ic_make_global_vars): Set
        tls attribute on ic vars.
        * coverage.c (coverage_end_function): Initialize
        function_list with zero.

Some platforms require special options for TLS, which is handled by
dg-add-options tls.  It seems that all tests in those directories should be
marked

  dg-require-effective-target tls_runtime
  dg-add-options tls

or rather this should be handled in the .exp files instead.

  Rainer
Comment 1 Rainer Orth 2011-05-24 14:53:42 UTC
Author: ro
Date: Tue May 24 14:53:39 2011
New Revision: 174119

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=174119
Log:
	PR gcov-profile/48845
	* config/sol2.h (LIB_SPEC): Link TLS support for tree profiling.

Modified:
    trunk/gcc/ChangeLog
    trunk/gcc/config/sol2.h
Comment 2 Eric Botcazou 2011-05-24 21:25:43 UTC
Yep.
Comment 3 Rainer Orth 2011-05-26 11:17:35 UTC
Fixed both for Solaris and in testsuite.