c-decl.c (pop_scope): Do not set DECL_CONTEXT on file-scope decls when...

* c-decl.c (pop_scope): Do not set DECL_CONTEXT on file-scope
	decls when there is only one input translation unit.
	* langhooks.c (lhd_set_decl_assembler_name): Partially revert
	change of 2004-07-05; do not treat declarations with
	DECL_CONTEXT a TRANSLATION_UNIT_DECL specially.
	* opts.c (cur_in_fname): Delete.
	* opts.h: Likewise.
	* tree.c: Revert changes of 2004-07-05; no special treatment
	for TRANSLATION_UNIT_DECLs.
	* Makefile.in (tree.o): Update dependencies.

From-SVN: r84306
This commit is contained in:
Zack Weinberg 2004-07-08 19:49:08 +00:00
parent 95bcca4705
commit 5b02f0e004
7 changed files with 37 additions and 55 deletions

View File

@ -1,3 +1,16 @@
2004-07-08 Zack Weinberg <zack@codesourcery.com>
* c-decl.c (pop_scope): Do not set DECL_CONTEXT on file-scope
decls when there is only one input translation unit.
* langhooks.c (lhd_set_decl_assembler_name): Partially revert
change of 2004-07-05; do not treat declarations with
DECL_CONTEXT a TRANSLATION_UNIT_DECL specially.
* opts.c (cur_in_fname): Delete.
* opts.h: Likewise.
* tree.c: Revert changes of 2004-07-05; no special treatment
for TRANSLATION_UNIT_DECLs.
* Makefile.in (tree.o): Update dependencies.
2004-07-08 Roger Sayle <roger@eyesopen.com>
* builtins.c (fold_builtin_strcpy): Merge functionality from
@ -69,7 +82,7 @@
* tree-ssa-ccp.c (get_rhs, set_rhs): Reorg to use switch.
2004-07-08 Paolo Bonzini <bonzini@gnu.org>
Jakub Jelinek <jakub@redhat.com>
Jakub Jelinek <jakub@redhat.com>
* config/i386/i386.c (override_options): Enable
SSE prefetches with -mtune, as long as we are
@ -118,7 +131,7 @@
OBJ_TYPE_REF_OBJECT.
2004-07-08 Joseph S. Myers <jsm@polyomino.org.uk>
Neil Booth <neil@daikokuya.co.uk>
Neil Booth <neil@daikokuya.co.uk>
PR c/2511
PR c/3325
@ -148,7 +161,7 @@
2004-07-08 Andrew Pinski <apinski@apple.com>
* Makefile.in (libbackend.o): Add -combine to the gcc
* Makefile.in (libbackend.o): Add -combine to the gcc
command line.
2004-07-08 Nick Clifton <nickc@redhat.com>
@ -158,7 +171,7 @@
2004-07-08 Richard Henderson <rth@redhat.com>
* except.c (expand_eh_region_start, expand_eh_region_end,
* except.c (expand_eh_region_start, expand_eh_region_end,
expand_eh_handler, expand_eh_region_end_cleanup,
expand_start_all_catch, expand_start_catch, expand_end_catch,
expand_end_all_catch, expand_eh_region_end_allowed,
@ -172,7 +185,7 @@
(stack_block_stack, expand_goto_internal, expand_fixup, expand_fixups,
fixup_gotos, save_stack_pointer, expand_decl_cleanup,
expand_decl_cleanup_eh, expand_cleanups, start_cleanup_deferral,
end_cleanup_deferral, last_cleanup_this_contour,
end_cleanup_deferral, last_cleanup_this_contour,
containing_blocks_have_cleanups_or_stack_level,
any_pending_cleanups): Remove.
(expand_null_return_1): Take no arguments.
@ -185,8 +198,8 @@
* function.c (expand_function_end): Likewise.
* expr.c (store_expr, expand_expr_real_1): Likewise.
(safe_from_p): Don't handle WITH_CLEANUP_EXPR, CLEANUP_POINT_EXPR.
(expand_expr_real_1): Don't handle WITH_CLEANUP_EXPR,
CLEANUP_POINT_EXPR, TARGET_EXPR, TRY_CATCH_EXPR, CATCH_EXPR,
(expand_expr_real_1): Don't handle WITH_CLEANUP_EXPR,
CLEANUP_POINT_EXPR, TARGET_EXPR, TRY_CATCH_EXPR, CATCH_EXPR,
EH_FILTER_EXPR, TRY_FINALLY_EXPR, GOTO_SUBROUTINE_EXPR.
* fold-const.c (fold_checksum_tree): Use first_rtl_op.
* gengtype.c (adjust_field_tree_exp): Remove rtl op handling.
@ -714,7 +727,7 @@
2004-07-07 Mike Stump <mrs@apple.com>
* darwin.h (ASM_OUTPUT_LABELREF): Fix -fno-leading-underscore.
* darwin.c (machopic_non_lazy_ptr_name, machopic_stub_name)
* darwin.c (machopic_non_lazy_ptr_name, machopic_stub_name)
(machopic_finish): Likewise.
2004-07-07 Richard Henderson <rth@redhat.com>
@ -906,13 +919,13 @@
PR target/16143
* config/ia64/ia64.c (ia64_dfa_new_cycle): Reset DFA state for asm
insn.
2004-07-06 Kazuhiro Inaoka <inaoka.kazuhiro@renesas.com>
PR target/1679.
* config/m32r/m32r.c (m32r_function_symbol): New function:
Generate a symbol name RTX with the correct m32r specific flags
set.
set.
(block_move_call): Use new function to generate correct symbol.
* config/m32r/m32r-protos.h: Add prototype for new funcion.
* config/m32r/m32r.h (INITIALIZE_TRAMPOLINE): Use the new
@ -942,7 +955,7 @@
2004-07-07 Nick Clifton <nickc@redhat.com>
* config/fr30/fr30.c (fr30_setup_incoming_varargs): Change
arguments to match TARGET_SETUP_INCOMING_VARARGS prototype.
arguments to match TARGET_SETUP_INCOMING_VARARGS prototype.
2004-07-07 Nathan Sidwell <nathan@codesourcery.com>
@ -1119,7 +1132,7 @@
(find_var_from_fn): New function.
(variably_modified_type_p): Add arg and call new function.
* tree.h (variably_modified_type_p): Add extra arg.
2004-07-05 Eric Botcazou <ebotcazou@libertysurf.fr>
* config/sparc/sparc.md (nonlocal_goto): Remove disabled code.

View File

@ -1569,7 +1569,7 @@ langhooks.o : langhooks.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(TREE_H)
$(LANGHOOKS_DEF_H) $(FLAGS_H) $(GGC_H) diagnostic.h
tree.o : tree.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(TREE_H) $(FLAGS_H) function.h \
toplev.h $(GGC_H) $(HASHTAB_H) $(TARGET_H) output.h $(TM_P_H) langhooks.h \
real.h gt-tree.h tree-iterator.h $(BASIC_BLOCK_H) $(TREE_FLOW_H) opts.h
real.h gt-tree.h tree-iterator.h $(BASIC_BLOCK_H) $(TREE_FLOW_H)
tree-dump.o: tree-dump.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(TREE_H) \
$(C_TREE_H) $(FLAGS_H) langhooks.h toplev.h output.h c-pragma.h $(RTL_H) \
$(GGC_H) $(EXPR_H) $(SPLAY_TREE_H) $(TREE_DUMP_H) tree-iterator.h

View File

@ -760,10 +760,12 @@ pop_scope (void)
TREE_CHAIN (p) = BLOCK_VARS (block);
BLOCK_VARS (block) = p;
}
/* If this is the file scope, must set DECL_CONTEXT on
these. Do so even for externals, so that
same_translation_unit_p works. */
if (scope == file_scope)
/* If this is the file scope, and we are processing more
than one translation unit in this compilation, set
DECL_CONTEXT of each decl to the TRANSLATION_UNIT_DECL.
This makes same_translation_unit_p work, and causes
static declarations to be given disambiguating suffixes. */
if (scope == file_scope && num_in_fnames > 1)
DECL_CONTEXT (p) = context;
/* Fall through. */

View File

@ -179,31 +179,15 @@ lhd_set_decl_assembler_name (tree decl)
Can't use just the variable's own name for a variable whose
scope is less than the whole compilation. Concatenate a
distinguishing number. If the decl is at block scope, the
number assigned is the DECL_UID; if the decl is at file
scope, the number is the DECL_UID of the surrounding
TRANSLATION_UNIT_DECL, except for the T_U_D with UID 0.
Those (the file-scope internal-linkage declarations from the
first input file) get no suffix, which is consistent with
what has historically been done for file-scope declarations
with internal linkage. */
if (TREE_PUBLIC (decl)
|| DECL_CONTEXT (decl) == NULL_TREE
|| (TREE_CODE (DECL_CONTEXT (decl)) == TRANSLATION_UNIT_DECL
&& DECL_UID (DECL_CONTEXT (decl)) == 0))
distinguishing number - we use the DECL_UID. */
if (TREE_PUBLIC (decl) || DECL_CONTEXT (decl) == NULL_TREE)
SET_DECL_ASSEMBLER_NAME (decl, DECL_NAME (decl));
else
{
const char *name = IDENTIFIER_POINTER (DECL_NAME (decl));
char *label;
unsigned int uid;
if (TREE_CODE (DECL_CONTEXT (decl)) == TRANSLATION_UNIT_DECL)
uid = DECL_UID (DECL_CONTEXT (decl));
else
uid = DECL_UID (decl);
ASM_FORMAT_PRIVATE_NAME (label, name, uid);
ASM_FORMAT_PRIVATE_NAME (label, name, DECL_UID (decl));
SET_DECL_ASSEMBLER_NAME (decl, get_identifier (label));
}
}

View File

@ -92,7 +92,6 @@ static bool flag_peel_loops_set, flag_branch_probabilities_set;
/* Input file names. */
const char **in_fnames;
unsigned num_in_fnames;
unsigned cur_in_fname;
static size_t find_opt (const char *, int);
static int common_handle_option (size_t scode, const char *arg, int value);

View File

@ -57,8 +57,4 @@ extern const char **in_fnames;
extern unsigned num_in_fnames;
/* Current input filename index. */
extern unsigned cur_in_fname;
#endif

View File

@ -48,7 +48,6 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA
#include "tree-iterator.h"
#include "basic-block.h"
#include "tree-flow.h"
#include "opts.h"
/* obstack.[ch] explicitly declined to prototype this. */
extern int _obstack_allocated_p (struct obstack *h, void *obj);
@ -310,10 +309,7 @@ make_node_stat (enum tree_code code MEM_STAT_DECL)
DECL_USER_ALIGN (t) = 0;
DECL_IN_SYSTEM_HEADER (t) = in_system_header;
DECL_SOURCE_LOCATION (t) = input_location;
if (code == TRANSLATION_UNIT_DECL)
DECL_UID (t) = cur_in_fname;
else
DECL_UID (t) = next_decl_uid++;
DECL_UID (t) = next_decl_uid++;
/* We have not yet computed the alias set for this declaration. */
DECL_POINTER_ALIAS_SET (t) = -1;
@ -386,7 +382,7 @@ copy_node_stat (tree node MEM_STAT_DECL)
TREE_VISITED (t) = 0;
t->common.ann = 0;
if (TREE_CODE_CLASS (code) == 'd' && code != TRANSLATION_UNIT_DECL)
if (TREE_CODE_CLASS (code) == 'd')
DECL_UID (t) = next_decl_uid++;
else if (TREE_CODE_CLASS (code) == 't')
{
@ -5363,14 +5359,6 @@ make_or_reuse_type (unsigned size, int unsignedp)
void
build_common_tree_nodes (int signed_char)
{
/* This function is called after command line parsing is complete,
but before any DECL nodes should have been created. Therefore,
now is the appropriate time to adjust next_decl_uid so that the
range 0 .. num_in_fnames-1 is reserved for TRANSLATION_UNIT_DECLs. */
if (next_decl_uid)
abort ();
next_decl_uid = num_in_fnames;
error_mark_node = make_node (ERROR_MARK);
TREE_TYPE (error_mark_node) = error_mark_node;