Commit 4d62b56a by Rafael Avila de Espindola Committed by Rafael Espindola

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

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

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

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

	* dbxout.c (dbxout_common_check): Accept non public trees.
	* dwarf2out.c (fortran_common): Accept non public trees.

From-SVN: r153685
parent da18ea94
2009-10-28 Rafael Avila de Espindola <espindola@google.com> 2009-10-28 Rafael Avila de Espindola <espindola@google.com>
* dbxout.c (dbxout_common_check): Accept non public trees.
* dwarf2out.c (fortran_common): Accept non public trees.
2009-10-28 Rafael Avila de Espindola <espindola@google.com>
* common.opt (fuse-linker-plugin): New option. * common.opt (fuse-linker-plugin): New option.
* gcc.c (LINK_COMMAND_SPEC, main): Rename use-linker-plugin to * gcc.c (LINK_COMMAND_SPEC, main): Rename use-linker-plugin to
fuse-linker-plugin. fuse-linker-plugin.
...@@ -3189,7 +3189,7 @@ dbxout_common_check (tree decl, int *value) ...@@ -3189,7 +3189,7 @@ dbxout_common_check (tree decl, int *value)
rtx sym_addr; rtx sym_addr;
const char *name = NULL; const char *name = NULL;
/* If the decl isn't a VAR_DECL, or if it isn't public or static, or if /* If the decl isn't a VAR_DECL, or if it isn't static, or if
it does not have a value (the offset into the common area), or if it it does not have a value (the offset into the common area), or if it
is thread local (as opposed to global) then it isn't common, and shouldn't is thread local (as opposed to global) then it isn't common, and shouldn't
be handled as such. be handled as such.
...@@ -3198,7 +3198,6 @@ dbxout_common_check (tree decl, int *value) ...@@ -3198,7 +3198,6 @@ dbxout_common_check (tree decl, int *value)
for thread-local symbols. Can be handled via same mechanism as used for thread-local symbols. Can be handled via same mechanism as used
in dwarf2out.c. */ in dwarf2out.c. */
if (TREE_CODE (decl) != VAR_DECL if (TREE_CODE (decl) != VAR_DECL
|| !TREE_PUBLIC(decl)
|| !TREE_STATIC(decl) || !TREE_STATIC(decl)
|| !DECL_HAS_VALUE_EXPR_P(decl) || !DECL_HAS_VALUE_EXPR_P(decl)
|| DECL_THREAD_LOCAL_P (decl) || DECL_THREAD_LOCAL_P (decl)
......
...@@ -15621,12 +15621,11 @@ fortran_common (tree decl, HOST_WIDE_INT *value) ...@@ -15621,12 +15621,11 @@ fortran_common (tree decl, HOST_WIDE_INT *value)
tree offset; tree offset;
int volatilep = 0, unsignedp = 0; int volatilep = 0, unsignedp = 0;
/* If the decl isn't a VAR_DECL, or if it isn't public or static, or if /* If the decl isn't a VAR_DECL, or if it isn't static, or if
it does not have a value (the offset into the common area), or if it it does not have a value (the offset into the common area), or if it
is thread local (as opposed to global) then it isn't common, and shouldn't is thread local (as opposed to global) then it isn't common, and shouldn't
be handled as such. */ be handled as such. */
if (TREE_CODE (decl) != VAR_DECL if (TREE_CODE (decl) != VAR_DECL
|| !TREE_PUBLIC (decl)
|| !TREE_STATIC (decl) || !TREE_STATIC (decl)
|| !DECL_HAS_VALUE_EXPR_P (decl) || !DECL_HAS_VALUE_EXPR_P (decl)
|| !is_fortran ()) || !is_fortran ())
......
2009-10-28 Rafael Avila de Espindola <espindola@google.com>
* trans-common.c (create_common): Set TREE_PUBLIC to false on
fake variables.
2009-10-26 Janus Weil <janus@gcc.gnu.org> 2009-10-26 Janus Weil <janus@gcc.gnu.org>
PR fortran/41714 PR fortran/41714
......
...@@ -680,7 +680,6 @@ create_common (gfc_common_head *com, segment_info *head, bool saw_equiv) ...@@ -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 = build_decl (s->sym->declared_at.lb->location,
VAR_DECL, DECL_NAME (s->field), VAR_DECL, DECL_NAME (s->field),
TREE_TYPE (s->field)); TREE_TYPE (s->field));
TREE_PUBLIC (var_decl) = TREE_PUBLIC (decl);
TREE_STATIC (var_decl) = TREE_STATIC (decl); TREE_STATIC (var_decl) = TREE_STATIC (decl);
TREE_USED (var_decl) = TREE_USED (decl); TREE_USED (var_decl) = TREE_USED (decl);
if (s->sym->attr.use_assoc) if (s->sym->attr.use_assoc)
...@@ -689,7 +688,9 @@ create_common (gfc_common_head *com, segment_info *head, bool saw_equiv) ...@@ -689,7 +688,9 @@ create_common (gfc_common_head *com, segment_info *head, bool saw_equiv)
TREE_ADDRESSABLE (var_decl) = 1; TREE_ADDRESSABLE (var_decl) = 1;
/* This is a fake variable just for debugging purposes. */ /* This is a fake variable just for debugging purposes. */
TREE_ASM_WRITTEN (var_decl) = 1; 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 /* To preserve identifier names in COMMON, chain to procedure
scope unless at top level in a module definition. */ scope unless at top level in a module definition. */
if (com if (com
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment