Commit 116f30c3 by Richard Guenther Committed by Richard Biener

c-decl.c (pop_scope): Always set file-scope DECL_CONTEXT.

2010-09-24  Richard Guenther  <rguenther@suse.de>

	* c-decl.c (pop_scope): Always set file-scope DECL_CONTEXT.
	Make sure to not call set_type_context with error_mark_node.
	* langhooks.c (lhd_set_decl_assembler_name): Use DECL_FILE_SCOPE_P.

	* gcc.dg/lto/20091006-2_0.c: Prune warnings.

From-SVN: r164591
parent de6ba7ae
2010-09-24 Richard Guenther <rguenther@suse.de> 2010-09-24 Richard Guenther <rguenther@suse.de>
* c-decl.c (pop_scope): Always set file-scope DECL_CONTEXT.
Make sure to not call set_type_context with error_mark_node.
* langhooks.c (lhd_set_decl_assembler_name): Use DECL_FILE_SCOPE_P.
2010-09-24 Richard Guenther <rguenther@suse.de>
* Makefile.in (OBJS-onestep): Remove. * Makefile.in (OBJS-onestep): Remove.
(ALL_HOST_BACKEND_OBJS): Remove libbackend.o. (ALL_HOST_BACKEND_OBJS): Remove libbackend.o.
(libbackend.a): Remove onestep support. (libbackend.a): Remove onestep support.
...@@ -1203,15 +1203,14 @@ pop_scope (void) ...@@ -1203,15 +1203,14 @@ pop_scope (void)
DECL_CHAIN (extp) = BLOCK_VARS (block); DECL_CHAIN (extp) = BLOCK_VARS (block);
BLOCK_VARS (block) = extp; BLOCK_VARS (block) = extp;
} }
/* If this is the file scope, and we are processing more /* If this is the file scope set DECL_CONTEXT of each decl to
than one translation unit in this compilation, set the TRANSLATION_UNIT_DECL. This makes same_translation_unit_p
DECL_CONTEXT of each decl to the TRANSLATION_UNIT_DECL. work. */
This makes same_translation_unit_p work, and causes if (scope == file_scope)
static declarations to be given disambiguating suffixes. */
if (scope == file_scope && num_in_fnames > 1)
{ {
DECL_CONTEXT (p) = context; DECL_CONTEXT (p) = context;
if (TREE_CODE (p) == TYPE_DECL) if (TREE_CODE (p) == TYPE_DECL
&& TREE_TYPE (p) != error_mark_node)
set_type_context (TREE_TYPE (p), context); set_type_context (TREE_TYPE (p), context);
} }
......
...@@ -176,7 +176,7 @@ lhd_set_decl_assembler_name (tree decl) ...@@ -176,7 +176,7 @@ lhd_set_decl_assembler_name (tree decl)
is less than the whole compilation. Concatenate a distinguishing is less than the whole compilation. Concatenate a distinguishing
number - we use the DECL_UID. */ number - we use the DECL_UID. */
if (TREE_PUBLIC (decl) || DECL_CONTEXT (decl) == NULL_TREE) if (TREE_PUBLIC (decl) || DECL_FILE_SCOPE_P (decl))
id = targetm.mangle_decl_assembler_name (decl, DECL_NAME (decl)); id = targetm.mangle_decl_assembler_name (decl, DECL_NAME (decl));
else else
{ {
......
2010-09-24 Richard Guenther <rguenther@suse.de>
* gcc.dg/lto/20091006-2_0.c: Prune warnings.
2010-09-24 Marcus Shawcroft <marcus.shawcroft@arm.com> 2010-09-24 Marcus Shawcroft <marcus.shawcroft@arm.com>
* g++.dg/debug/dwarf2/nested-2.C: Permit the ARM @ character * g++.dg/debug/dwarf2/nested-2.C: Permit the ARM @ character
......
/* { dg-lto-do link } */ /* { dg-lto-do link } */
/* { dg-extra-ld-options "-w" } */
extern int a[10]; extern int a[10];
int main() { return 0; } int main() { return 0; }
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