Patchwork [RFA,Fortran,try,11] Emulated tls rewrite

login
register
mail settings
Submitter Richard Guenther
Date July 24, 2010, 1:52 p.m.
Message ID <AANLkTinv86JQg=_Dk=skpubRDbFC8=PPN=FtqWfRa=B9@mail.gmail.com>
Download mbox | patch
Permalink /patch/59855/
State New
Headers show

Comments

Richard Guenther - July 24, 2010, 1:52 p.m.
On Sat, Jul 24, 2010 at 11:54 AM, Jan Hubicka <jh@suse.de> wrote:
> Am Sat 24 Jul 2010 01:11:31 AM CEST schrieb Richard Henderson
> <rth@redhat.com>:
>
>> On 07/21/2010 07:32 PM, Jack Howarth wrote:
>>>
>>> FAIL: gfortran.dg/gomp/appendix-a/a.22.6.f90  -O  (test for excess
>>> errors)
>>> Excess errors:
>>> .../testsuite/gfortran.dg/gomp/appendix-a/a.22.6.f90:4:0: sorry,
>>>  unimplemented: thread-local COMMON data not implemented
>>
>> I managed to reproduce this problem reliably.  It has to do with the
>> Fortran
>> front end (indirectly) invoking varpool_finalize_decl much later than the
>> C
>> front ends do.  Without the decls being finalized, the IPA pass doesn't
>> get
>> to see them and they don't get lowered.
>>
>> I talked to Richi about this ordering problem on IRC, and changing the
>> generic ordering of decls vs compilation unit finalization appears to run
>> into problems with C++ and Java and their aliases.  An acceptable solution
>> appears to be to hack the Fortran front end to do it by hand.
>
> Hmm, I wanted to get decl finalization out of wrapup_global_decls for a
> while but never got around it.  What are those problems with aliases?

Apply


(basically move it after /* Generate hidden aliases for Java.  */) and enjoy
libjava exploding.

Richard.

> Honza
>
>

Patch

Index: decl2.c
===================================================================
--- decl2.c	(revision 162499)
+++ decl2.c	(working copy)
@@ -3921,8 +3921,6 @@  cp_write_global_declarations (void)
   /* Collect candidates for Java hidden aliases.  */
   candidates = collect_candidates_for_java_method_aliases ();

-  cgraph_finalize_compilation_unit ();
-
   /* Now, issue warnings about static, but not defined, functions,
      etc., and emit debugging information.  */
   walk_namespaces (wrapup_globals_for_namespace, /*data=*/&reconsider);
@@ -3968,6 +3966,8 @@  cp_write_global_declarations (void)
 #ifdef ENABLE_CHECKING
   validate_conversion_obstack ();
 #endif /* ENABLE_CHECKING */
+
+  cgraph_finalize_compilation_unit ();
 }

 /* FN is an OFFSET_REF, DOTSTAR_EXPR or MEMBER_REF indicating the