This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [patch] fix PR43602 for emutls targets.
On Wed, May 12, 2010 at 10:45:22AM +0100, IainS wrote:
> Jakub,
>
> Thanks for the review, and sorry about the formating errors.
>
> On 12 May 2010, at 06:47, Jakub Jelinek wrote:
>
>> On Tue, May 11, 2010 at 08:19:51PM -0400, Jack Howarth wrote:
>>> On Tue, May 11, 2010 at 10:13:50AM -0400, Diego Novillo wrote:
>>> It doesn't appear that Jakub's suggested reconfiguration of the
>>> patch is
>>> going to bootstrap.
>
> It does for me, on {i686,powerpc}-apple-darwin9.
>
> With the suggested changes it checks without new errors with the race-
> condition changes applied.
> (I've also checked with my additional tls checks on ObjC/C++)
>
> ===
>
> Jack: could you re-check the attached on x86_64-apple-darwin10?
>
Iain,
Your current patch bootstraps fine on x86_64-apple-darwin10
and shows no regressions...
http://gcc.gnu.org/ml/gcc-testresults/2010-05/msg01166.html
FYI, there are a few new failures introduced with r159311...
FAIL: objc.dg/torture/trivial.m -O2 -flto (test for excess errors)
WARNING: objc.dg/torture/trivial.m -O2 -flto compilation failed to produce executable
FAIL: objc.dg/torture/trivial.m -O2 -fwhopr (test for excess errors)
WARNING: objc.dg/torture/trivial.m -O2 -fwhopr compilation failed to produce executable
FAIL: objc.dg/torture/tls/thr-init-3.m -O2 -flto (test for excess errors)
WARNING: objc.dg/torture/tls/thr-init-3.m -O2 -flto compilation failed to produce executable
FAIL: objc.dg/torture/tls/thr-init-3.m -O2 -fwhopr (test for excess errors)
WARNING: objc.dg/torture/tls/thr-init-3.m -O2 -fwhopr compilation failed to produce executable
FAIL: objc.dg/torture/tls/thr-init-3.m -O2 -flto (test for excess errors)
WARNING: objc.dg/torture/tls/thr-init-3.m -O2 -flto compilation failed to produce executable
FAIL: objc.dg/torture/tls/thr-init-3.m -O2 -fwhopr (test for excess errors)
WARNING: objc.dg/torture/tls/thr-init-3.m -O2 -fwhopr compilation failed to produce executable
that are lto related. We should open a PR for those, which are of the form...
Executing on host: /sw/src/fink.build/gcc46-4.6.0-1000/darwin_objdir/gcc/xgcc -B/sw/src/fink.build/gcc46-4.6.0-1000/darwin_objdir/gcc/ /sw/src/fink.build/gcc46-4.6.0-1000/gcc-4.6-20100512/gcc/testsuite/objc.dg/torture/trivial.m -O2 -flto -fnext-runtime -B/sw/src/fink.build/gcc46-4.6.0-1000/darwin_objdir/x86
_64-apple-darwin10.3.0/./libobjc/.libs -L/sw/src/fink.build/gcc46-4.6.0-1000/darwin_objdir/x86_64-apple-darwin10.3.0/./libobjc/.libs /sw/src/fink.build/
gcc46-4.6.0-1000/gcc-4.6-20100512/gcc/testsuite/objc.dg/torture/../../objc-obj-c++-shared/Object1.m -lobjc -lm -o ./trivial.exe (timeout = 300)
/var/tmp//ccigmvmn.s:unknown:Undefined local symbol L_OBJC_CLASS_Object.2245^M
/var/tmp//ccigmvmn.s:unknown:Undefined local symbol L_OBJC_METACLASS_Object.2244^M
lto-wrapper: /sw/src/fink.build/gcc46-4.6.0-1000/darwin_objdir/gcc/xgcc returned 1 exit status^M
lto-wrapper: deleting LTRANS file /var/tmp//ccz9Or6L.lto.o: No such file or directory^M
collect2: lto-wrapper returned 1 exit status^M
compiler exited with status 1
output is:
/var/tmp//ccigmvmn.s:unknown:Undefined local symbol L_OBJC_CLASS_Object.2245^M
/var/tmp//ccigmvmn.s:unknown:Undefined local symbol L_OBJC_METACLASS_Object.2244^M
lto-wrapper: /sw/src/fink.build/gcc46-4.6.0-1000/darwin_objdir/gcc/xgcc returned 1 exit status^M
lto-wrapper: deleting LTRANS file /var/tmp//ccz9Or6L.lto.o: No such file or directory^M
collect2: lto-wrapper returned 1 exit status^M
FAIL: objc.dg/torture/trivial.m -O2 -flto (test for excess errors)
Jack
> Jakub, would this be OK to apply (assuming that the x86_64 check
> succeeds) ?
>
> Iain
>
>
> gcc/Changelog:
>
> PR 43602
> * varasm.c(get_emutls_init_templ_addr): Copy DECL_VISIBILITY_SPECIFIED
> (emutls_decl): Ditto.
> (emutls_finalize_control_var): New.
> (emutls_finish): Finalize emutls control variables.
> * toplev.c(compile_file): Use emutls_finish () to finalize emutls
> control vars. Move
> its use ahead of varpool_assemble_pending_decls ().
>
>
> Index: gcc/varasm.c
> ===================================================================
> --- gcc/varasm.c (revision 159280)
> +++ gcc/varasm.c (working copy)
> @@ -334,6 +334,7 @@ get_emutls_init_templ_addr (tree decl)
> else
> TREE_STATIC (to) = 1;
>
> + DECL_VISIBILITY_SPECIFIED (to) = DECL_VISIBILITY_SPECIFIED (decl);
> DECL_INITIAL (to) = DECL_INITIAL (decl);
> DECL_INITIAL (decl) = NULL;
>
> @@ -411,6 +412,7 @@ emutls_decl (tree decl)
> DECL_COMMON (to) = DECL_COMMON (decl);
> DECL_WEAK (to) = DECL_WEAK (decl);
> DECL_VISIBILITY (to) = DECL_VISIBILITY (decl);
> + DECL_VISIBILITY_SPECIFIED (to) = DECL_VISIBILITY_SPECIFIED (decl);
>
> return to;
> }
> @@ -449,16 +451,31 @@ emutls_common_1 (void **loc, void *xstmts)
> return 1;
> }
>
> +static int
> +emutls_finalize_control_var (void **loc,
> + void *unused ATTRIBUTE_UNUSED)
> +{
> + struct tree_map *h = *(struct tree_map **) loc;
> + if (h != NULL)
> + varpool_finalize_decl (h->to);
> + return 1;
> +}
> +
> +/* Finalize emutls control vars and add a static constructor if
> + required. */
> +
> void
> emutls_finish (void)
> {
> + if (emutls_htab == NULL)
> + return;
> + htab_traverse_noresize (emutls_htab,
> + emutls_finalize_control_var, NULL);
> +
> if (targetm.emutls.register_common)
> {
> tree body = NULL_TREE;
>
> - if (emutls_htab == NULL)
> - return;
> -
> htab_traverse_noresize (emutls_htab, emutls_common_1, &body);
> if (body == NULL_TREE)
> return;
> Index: gcc/toplev.c
> ===================================================================
> --- gcc/toplev.c (revision 159280)
> +++ gcc/toplev.c (working copy)
> @@ -1067,6 +1067,11 @@ compile_file (void)
> if (errorcount || sorrycount)
> return;
>
> + /* Ensure that control vars are finalized and build a static
> + constructor if it is required. */
> + if (!targetm.have_tls)
> + emutls_finish ();
> +
> varpool_assemble_pending_decls ();
> finish_aliases_2 ();
>
> @@ -1074,10 +1079,6 @@ compile_file (void)
> if (flag_mudflap)
> mudflap_finish_file ();
>
> - /* Likewise for emulated thread-local storage. */
> - if (!targetm.have_tls)
> - emutls_finish ();
> -
> output_shared_constant_pool ();
> output_object_blocks ();
>
>