public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [patch] Fix PR41764
@ 2009-10-21 18:09 Rafael Espindola
  2009-10-21 22:46 ` Rafael Espindola
  0 siblings, 1 reply; 9+ messages in thread
From: Rafael Espindola @ 2009-10-21 18:09 UTC (permalink / raw)
  To: GCC Patches; +Cc: Richard Guenther, Diego Novillo, Paul Brook

[-- Attachment #1: Type: text/plain, Size: 491 bytes --]

The attached patch fixes PR 41764. The problem was that the fortran FE
was creating fake variables and marking them public. They were not
written to the final assembly becouse the FE sets TREE_ASM_WRITTEN,
but they were in the IL symbol table.

OK if bootstraps and tests are OK?

2009-10-21  Rafael Avila de Espindola  <espindola@google.com>

	PR 41764
	* trans-common.c (create_common): Set TREE_PUBLIC to false on
	fake variables.

Cheers,
-- 
Rafael Ávila de Espíndola

[-- Attachment #2: fake.patch --]
[-- Type: text/x-diff, Size: 1084 bytes --]

diff --git a/gcc/fortran/trans-common.c b/gcc/fortran/trans-common.c
index 5b1952a..1fb3c40 100644
--- a/gcc/fortran/trans-common.c
+++ b/gcc/fortran/trans-common.c
@@ -680,7 +680,6 @@ create_common (gfc_common_head *com, segment_info *head, bool saw_equiv)
       var_decl = build_decl (s->sym->declared_at.lb->location,
 			     VAR_DECL, DECL_NAME (s->field),
 			     TREE_TYPE (s->field));
-      TREE_PUBLIC (var_decl) = TREE_PUBLIC (decl);
       TREE_STATIC (var_decl) = TREE_STATIC (decl);
       TREE_USED (var_decl) = TREE_USED (decl);
       if (s->sym->attr.use_assoc)
@@ -689,7 +688,9 @@ create_common (gfc_common_head *com, segment_info *head, bool saw_equiv)
 	TREE_ADDRESSABLE (var_decl) = 1;
       /* This is a fake variable just for debugging purposes.  */
       TREE_ASM_WRITTEN (var_decl) = 1;
-      
+      /* Fake variables are not visible from other translation units. */
+      TREE_PUBLIC (var_decl) = 0;
+
       /* To preserve identifier names in COMMON, chain to procedure
          scope unless at top level in a module definition.  */
       if (com

^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2009-10-28 20:03 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-10-21 18:09 [patch] Fix PR41764 Rafael Espindola
2009-10-21 22:46 ` Rafael Espindola
2009-10-26 18:53   ` Rafael Espindola
2009-10-28  4:24     ` Rafael Espindola
2009-10-28 14:27       ` Rafael Espindola
2009-10-28 19:20         ` Toon Moene
2009-10-28 19:37           ` Rafael Espindola
2009-10-28 14:34       ` Ian Lance Taylor
2009-10-28 20:38         ` Tobias Burnus

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).