c-common.c (shadow_warning): Delete.

* c-common.c (shadow_warning): Delete.
	* c-common.h (free_parser_stacks, shadow_warning, sw_kind): Delete.
	* c-decl.c (warn_if_shadowing): Issue shadow warnings directly.
	* c-opts.c (c_common_parse_file): Don't call free_parser_stacks.
	* c-parse.in (free_parser_stacks): Delete.
cp:
	* name-lookup.c (pushdecl): Issue shadow warnings directly.
	* parser.c (free_parser_stacks): Delete.
testsuite:
	* gcc.c-torture/execute/string-opt-15.c: Define memcmp with void *
	arguments.
	* gcc.dg/fwritable-strings-1.c: Expect the deprecation notice.
------
	Bug 13856
	* c-decl.c (diagnose_mismatched_decls): Only give special
	treatment when olddecl is DECL_BUILT_IN, if C_DECL_INVISIBLE
	is also true.
	(merge_decls): Don't clear DECL_BUILT_IN_CLASS and
	DECL_FUNCTION_CODE when defining a built-in function.
	Don't update DECL_ESTIMATED_INSNS.
	* dwarf2out.c (dwarf2out_decl): Don't ignore built-in
	FUNCTION_DECLs.
	* tree.h: Delete DECL_ESTIMATED_INSNS.
	* tree-inline.c (struct inline_data): Delete inlined_insns field.
	(expand_call_inline, optimize_inline_calls): Don't update
	DECL_ESTIMATED_INSNS nor inlined_insns.
	* cgraphunit.c (cgraph_analyze_function): Don't update
	DECL_ESTIMATED_INSNS.
cp:
	* optimize.c (maybe_clone_body): Don't update DECL_ESTIMATED_INSNS.
	* decl.c (duplicate_decls, start_function): Likewise.
testsuite:
	* gcc.dg/visibility-8.c: New testcase.

From-SVN: r77475
This commit is contained in:
Zack Weinberg 2004-02-08 01:59:11 +00:00
parent 19755f9808
commit a6f78652f3
19 changed files with 157 additions and 167 deletions

View File

@ -1,3 +1,29 @@
2004-02-07 Zack Weinberg <zack@codesourcery.com>
Bug 13856
* c-decl.c (diagnose_mismatched_decls): Only give special
treatment when olddecl is DECL_BUILT_IN, if C_DECL_INVISIBLE
is also true.
(merge_decls): Don't clear DECL_BUILT_IN_CLASS and
DECL_FUNCTION_CODE when defining a built-in function.
Don't update DECL_ESTIMATED_INSNS.
* dwarf2out.c (dwarf2out_decl): Don't ignore built-in
FUNCTION_DECLs.
* tree.h: Delete DECL_ESTIMATED_INSNS.
* tree-inline.c (struct inline_data): Delete inlined_insns field.
(expand_call_inline, optimize_inline_calls): Don't update
DECL_ESTIMATED_INSNS nor inlined_insns.
* cgraphunit.c (cgraph_analyze_function): Don't update
DECL_ESTIMATED_INSNS.
2004-02-07 Zack Weinberg <zack@codesourcery.com>
* c-common.c (shadow_warning): Delete.
* c-common.h (free_parser_stacks, shadow_warning, sw_kind): Delete.
* c-decl.c (warn_if_shadowing): Issue shadow warnings directly.
* c-opts.c (c_common_parse_file): Don't call free_parser_stacks.
* c-parse.in (free_parser_stacks): Delete.
2004-02-07 Nathanael Nerode <neroden@gcc.gnu.org>
* Makefile.in, config/t-slibgcc-darwin, config/t-slibgcc-elf-ver,
@ -114,7 +140,7 @@
2004-02-06 Andrew Pinski <pinskia@physics.uc.edu>
* dwarf2out.c (loclabel_num): Move into #ifdef
* dwarf2out.c (loclabel_num): Move into #ifdef
DWARF2_DEBUGGING_INFO.
2004-02-06 Ziemowit Laski <zlaski@apple.com>
@ -130,7 +156,7 @@
(eliminate_regs_in_insn): Likewise.
2004-02-06 Daniel Berlin <dberlin@dberlin.org>
Josef Zlomek <zlomekj@suse.cz>
Josef Zlomek <zlomekj@suse.cz>
* dwarf2out.c (struct gcc_debug_hooks): Call dwarf2out_begin_function
at the beginning of function, call dwarf2out_var_location for
@ -166,7 +192,7 @@
all insns forces by an insn, not just the first one.
2004-02-06 Josef Zlomek <zlomekj@suse.cz>
Daniel Berlin <dberlin@dberlin.org>
Daniel Berlin <dberlin@dberlin.org>
Josef Zlomek <zlomekj@suse.cz>
* Makefile.in (var-tracking.o): New.
@ -175,31 +201,31 @@
* gengtype.c (adjust_field_rtx_def): NOTE_INSN_VAR_LOCATION was added.
* opts.c (common_handle_option): Add OPT_fvar_tracking.
* print-rtl.c (print_rtx): NOTE_INSN_VAR_LOCATION was added.
* rtl.c (note_insn_name): Likewise.
* rtl.def (VAR_LOCATION): New.
* rtl.h (NOTE_VAR_LOCATION): New.
(NOTE_VAR_LOCATION_DECL): New.
(NOTE_VAR_LOCATION_LOC): New.
(enum insn_note): NOTE_INSN_VAR_LOCATION was added.
(variable_tracking_main): New exported function.
* timevar.def (TV_VAR_TRACKING): New.
* toplev.c (enum dump_file_index): Added DFI_vartrack.
(dump_file): "vartrack" was added (-dV).
(flag_var_tracking): New.
(f_options): "var-tracking" was added.
* rtl.c (note_insn_name): Likewise.
* rtl.def (VAR_LOCATION): New.
* rtl.h (NOTE_VAR_LOCATION): New.
(NOTE_VAR_LOCATION_DECL): New.
(NOTE_VAR_LOCATION_LOC): New.
(enum insn_note): NOTE_INSN_VAR_LOCATION was added.
(variable_tracking_main): New exported function.
* timevar.def (TV_VAR_TRACKING): New.
* toplev.c (enum dump_file_index): Added DFI_vartrack.
(dump_file): "vartrack" was added (-dV).
(flag_var_tracking): New.
(f_options): "var-tracking" was added.
(rest_of_handle_variable_tracking): New function.
(rest_of_compilation): Run variable tracking.
(rest_of_compilation): Run variable tracking.
(process_options): If user has not specified flag_var_tracking set it
according to optimize, debug_info_level and debug_hooks.
* tree.h (frame_base_decl): New.
* var-tracking.c: New file.
* var-tracking.c: New file.
* config/ia64/ia64.c (ia64_flag_var_tracking): New variable.
(ia64_override_options): Set flags to run variable tracking in machine
dependent reorg instead of toplev.c.
(ia64_reorg): Run variable tracking if wanted.
* doc/invoke.texi: Mention variable tracking in -dV,
* doc/invoke.texi: Mention variable tracking in -dV,
add and -fvar-tracking.
* doc/passes.texi: Added variable tracking pass.
* doc/passes.texi: Added variable tracking pass.
Daniel Berlin <dberlin@dberlin.org>
* debug.h (struct gcc_debug_hooks): Added var_location debug hook.
@ -210,8 +236,8 @@
* dwarfout.c (dwarf_debug_hooks): Likewise.
* sdbout.c (sdb_debug_hooks): Likewise.
* vmsdbgout.c (vmsdbg_debug_hooks): Likewise.
* final.c (final_scan_insn): Call var_location debug hook for each
NOTE_INSN_VAR_LOCATION.
* final.c (final_scan_insn): Call var_location debug hook for each
NOTE_INSN_VAR_LOCATION.
2004-02-06 Jan Hubicka <jh@suse.cz>
@ -407,7 +433,7 @@
* dwarf2out.c (force_type_die): Look up input type itself
instead of root_type() of type.
2004-02-05 Andreas Krebbel <krebbel1@de.ibm.com>
* config/s390/s390.md ("*tmqidi_ext"): New insn.
@ -611,8 +637,8 @@
by reference if ARCH32.
2004-02-04 Aldy Hernandez <aldyh@redhat.com>
* cgraphunit.c (cgraph_postorder): Fix typo in comment.
* cgraphunit.c (cgraph_postorder): Fix typo in comment.
2004-02-04 Ulrich Weigand <uweigand@de.ibm.com>
@ -697,7 +723,7 @@
pointer when all VALUE's locations has been invalidated.
(rtx_equal_for_memref_p): Simplify checking of VALUEs.
2004-02-03 Wolfgang Bangerth <bangerth@dealii.org>
2004-02-03 Wolfgang Bangerth <bangerth@dealii.org>
* doc/invoke.texi (x86 options): Fix spelling/wording.
@ -1223,8 +1249,8 @@
2004-02-02 Richard Henderson <rth@redhat.com>
PR target/13789
* expr.c (store_expr): Use force_operand before emit_move_insn.
PR target/13789
* expr.c (store_expr): Use force_operand before emit_move_insn.
2004-02-02 Jeff Law <law@redhat.com>
Roger Sayle <roger@eyesopen.com>
@ -1260,24 +1286,24 @@
gen_rtx.
2004-02-02 Eric Christopher <echristo@redhat.com>
Zack Weinberg <zack@codesourcery.com>
Zack Weinberg <zack@codesourcery.com>
* c-opts.c (c_common_handle_option): Add -finput-charset.
* c.opt: Ditto.
* cppcharset.c (one_iso88591_to_utf8): Remove.
(convert_iso88591_utf8): Ditto.
(conversion_tab): Remove 8859-1 converter.
(_cpp_input_to_utf8): Remove.
(_cpp_init_iconv_buffer): Ditto.
(_cpp_close_iconv_buffer): Ditto.
(_cpp_convert_input): New function.
(_cpp_default_encoding): Ditto.
* cpphash.h: Add/remove prototypes for above.
* cppfiles.c (read_file_guts): Use _cpp_convert_input.
* cppinit.c (cpp_create_reader): Use _cpp_default_encoding
for narrow execution and input character sets.
* cpplib.c (cpp_push_buffer): Delete uses of removed functions.
* doc/cppopts.texi: Document -finput-charset.
* c.opt: Ditto.
* cppcharset.c (one_iso88591_to_utf8): Remove.
(convert_iso88591_utf8): Ditto.
(conversion_tab): Remove 8859-1 converter.
(_cpp_input_to_utf8): Remove.
(_cpp_init_iconv_buffer): Ditto.
(_cpp_close_iconv_buffer): Ditto.
(_cpp_convert_input): New function.
(_cpp_default_encoding): Ditto.
* cpphash.h: Add/remove prototypes for above.
* cppfiles.c (read_file_guts): Use _cpp_convert_input.
* cppinit.c (cpp_create_reader): Use _cpp_default_encoding
for narrow execution and input character sets.
* cpplib.c (cpp_push_buffer): Delete uses of removed functions.
* doc/cppopts.texi: Document -finput-charset.
2004-02-02 David Edelsohn <edelsohn@gnu.org>
@ -1717,7 +1743,7 @@
2004-01-30 Fariborz Jahanian <fjahanian@apple.com>
* config/rs6000/rs6000.c (rs6000_emit_move): Remove #if 0.
* config/rs6000/rs6000.c (rs6000_emit_move): Remove #if 0.
Copy operands[1] to pseudo for simplify_gen_subreg.
2004-01-30 Kazu Hirata <kazu@cs.umass.edu>
@ -1736,7 +1762,7 @@
commuting XOR with ASHIFTRT.
2004-01-30 Kazu Hirata <kazu@cs.umass.edu>
Eric Botcazou <ebotcazou@libertysurf.fr>
Eric Botcazou <ebotcazou@libertysurf.fr>
* config/sparc/sparc-protos.h: Remove the prototype for
sparc_builtin_saveregs.

View File

@ -4266,21 +4266,6 @@ c_init_attributes (void)
#undef DEF_ATTR_TREE_LIST
}
/* Output a -Wshadow warning MSGCODE about NAME, and give the location
of the previous declaration DECL. */
void
shadow_warning (enum sw_kind msgcode, const char *name, tree decl)
{
static const char *const msgs[] = {
/* SW_PARAM */ N_("declaration of \"%s\" shadows a parameter"),
/* SW_LOCAL */ N_("declaration of \"%s\" shadows a previous local"),
/* SW_GLOBAL */ N_("declaration of \"%s\" shadows a global declaration")
};
warning (msgs[msgcode], name);
warning ("%Jshadowed declaration is here", decl);
}
/* Attribute handlers common to C front ends. */
/* Handle a "packed" attribute; arguments as in

View File

@ -330,8 +330,6 @@ extern void (*lang_expand_function_end) (void);
extern int (*lang_missing_noreturn_ok_p) (tree);
extern int yyparse (void);
extern void free_parser_stacks (void);
extern stmt_tree current_stmt_tree (void);
extern tree *current_scope_stmt_stack (void);
extern void begin_stmt_tree (tree *);
@ -347,8 +345,6 @@ extern tree c_begin_if_stmt (void);
extern tree c_begin_while_stmt (void);
extern void c_finish_while_stmt_cond (tree, tree);
enum sw_kind { SW_PARAM = 0, SW_LOCAL, SW_GLOBAL };
extern void shadow_warning (enum sw_kind, const char *, tree);
extern int field_decl_cmp (const void *, const void *);
extern void resort_sorted_fields (void *, void *, gt_pointer_operator,
void *);

View File

@ -939,7 +939,8 @@ diagnose_mismatched_decls (tree newdecl, tree olddecl,
unless OLDDECL is a builtin. OLDDECL will be discarded in any case. */
if (TREE_CODE (olddecl) != TREE_CODE (newdecl))
{
if (TREE_CODE (olddecl) != FUNCTION_DECL || !DECL_BUILT_IN (olddecl))
if (TREE_CODE (olddecl) != FUNCTION_DECL
|| !DECL_BUILT_IN (olddecl) || !C_DECL_INVISIBLE (olddecl))
{
error ("%J'%D' redeclared as different kind of symbol",
newdecl, newdecl);
@ -956,7 +957,8 @@ diagnose_mismatched_decls (tree newdecl, tree olddecl,
if (!comptypes (oldtype, newtype, COMPARE_STRICT))
{
if (TREE_CODE (olddecl) == FUNCTION_DECL && DECL_BUILT_IN (olddecl))
if (TREE_CODE (olddecl) == FUNCTION_DECL
&& DECL_BUILT_IN (olddecl) && C_DECL_INVISIBLE (olddecl))
{
/* Accept harmless mismatch in function types.
This is for the ffs and fprintf builtins. */
@ -1034,6 +1036,7 @@ diagnose_mismatched_decls (tree newdecl, tree olddecl,
can't validate the argument list) the built-in definition is
overridden, but optionally warn this was a bad choice of name. */
if (DECL_BUILT_IN (olddecl)
&& C_DECL_INVISIBLE (olddecl)
&& (!TREE_PUBLIC (newdecl)
|| (DECL_INITIAL (newdecl)
&& !TYPE_ARG_TYPES (TREE_TYPE (newdecl)))))
@ -1428,20 +1431,9 @@ merge_decls (tree newdecl, tree olddecl, tree newtype, tree oldtype)
if (DECL_BUILT_IN (olddecl))
{
/* Get rid of any built-in function if we have a function
definition. */
if (new_is_definition)
{
TREE_TYPE (olddecl) = TREE_TYPE (newdecl);
DECL_BUILT_IN_CLASS (olddecl) = NOT_BUILT_IN;
}
else
{
/* If redeclaring a builtin function, and not a definition,
it stays built in. */
DECL_BUILT_IN_CLASS (newdecl) = DECL_BUILT_IN_CLASS (olddecl);
DECL_FUNCTION_CODE (newdecl) = DECL_FUNCTION_CODE (olddecl);
}
/* If redeclaring a builtin function, it stays built in. */
DECL_BUILT_IN_CLASS (newdecl) = DECL_BUILT_IN_CLASS (olddecl);
DECL_FUNCTION_CODE (newdecl) = DECL_FUNCTION_CODE (olddecl);
}
/* Also preserve various other info from the definition. */
@ -1451,7 +1443,6 @@ merge_decls (tree newdecl, tree olddecl, tree newtype, tree oldtype)
DECL_INITIAL (newdecl) = DECL_INITIAL (olddecl);
DECL_SAVED_INSNS (newdecl) = DECL_SAVED_INSNS (olddecl);
DECL_SAVED_TREE (newdecl) = DECL_SAVED_TREE (olddecl);
DECL_ESTIMATED_INSNS (newdecl) = DECL_ESTIMATED_INSNS (olddecl);
DECL_ARGUMENTS (newdecl) = DECL_ARGUMENTS (olddecl);
/* Set DECL_INLINE on the declaration if we've got a body
@ -1553,8 +1544,6 @@ record_external_decl (tree decl)
static void
warn_if_shadowing (tree x, tree old)
{
const char *name;
/* Nothing to shadow? */
if (old == 0
/* Shadow warnings not wanted? */
@ -1571,13 +1560,14 @@ warn_if_shadowing (tree x, tree old)
|| (TREE_CODE (x) == PARM_DECL && current_scope->outer->parm_flag))
return;
name = IDENTIFIER_POINTER (DECL_NAME (x));
if (TREE_CODE (old) == PARM_DECL)
shadow_warning (SW_PARAM, name, old);
warning ("%Jdeclaration of '%D' shadows a parameter", x, x);
else if (DECL_FILE_SCOPE_P (old))
shadow_warning (SW_GLOBAL, name, old);
warning ("%Jdeclaration of '%D' shadows a global declaration", x, x);
else
shadow_warning (SW_LOCAL, name, old);
warning ("%Jdeclaration of '%D' shadows a previous local", x, x);
warning ("%Jshadowed declaration is here", old);
}

View File

@ -1237,7 +1237,6 @@ c_common_parse_file (int set_yydebug ATTRIBUTE_UNUSED)
file_index++;
} while (file_index < num_in_fnames);
free_parser_stacks ();
finish_file ();
}

View File

@ -3763,13 +3763,6 @@ yyprint (FILE *file, int yychar, YYSTYPE yyl)
/* This is not the ideal place to put these, but we have to get them out
of c-lex.c because cp/lex.c has its own versions. */
/* Free malloced parser stacks if necessary. */
void
free_parser_stacks (void)
{
}
/* Parse the file. */
void
c_parse_file (void)

View File

@ -327,10 +327,9 @@ cgraph_analyze_function (struct cgraph_node *node)
cgraph_create_edges (decl, DECL_SAVED_TREE (decl));
node->local.inlinable = tree_inlinable_function_p (decl);
if (!DECL_ESTIMATED_INSNS (decl))
DECL_ESTIMATED_INSNS (decl)
if (!node->local.self_insns)
node->local.self_insns
= (*lang_hooks.tree_inlining.estimate_num_insns) (decl);
node->local.self_insns = DECL_ESTIMATED_INSNS (decl);
if (node->local.inlinable)
node->local.disregard_inline_limits
= (*lang_hooks.tree_inlining.disregard_inline_limits) (decl);

View File

@ -1,3 +1,14 @@
2004-02-07 Zack Weinberg <zack@codesourcery.com>
Bug 13856
* optimize.c (maybe_clone_body): Don't update DECL_ESTIMATED_INSNS.
* decl.c (duplicate_decls, start_function): Likewise.
2004-02-07 Zack Weinberg <zack@codesourcery.com>
* name-lookup.c (pushdecl): Issue shadow warnings directly.
* parser.c (free_parser_stacks): Delete.
2004-02-07 Kazu Hirata <kazu@cs.umass.edu>
* rtti.c: Update copyright.
@ -45,7 +56,7 @@
2003-02-05 Giovanni Bajo <giovannibajo@gcc.gnu.org>
PR c++/14008
* parser.c (cp_parser_diagnose_invalid_typename): Removed parsing
* parser.c (cp_parser_diagnose_invalid_typename): Removed parsing
code, only emits the diagnostic now. Added lookup of the identifier
and support for qualified ids.
(cp_parser_parse_and_diagnose_invalid_type_name): New function.
@ -177,10 +188,10 @@
2004-01-30 Richard Henderson <rth@redhat.com>
PR c++/13693
* method.c (use_thunk): Don't force_target_expr for void thunks.
* tree.c (build_target_expr_with_type): Assert non-void type.
(force_target_expr): Likewise.
PR c++/13693
* method.c (use_thunk): Don't force_target_expr for void thunks.
* tree.c (build_target_expr_with_type): Assert non-void type.
(force_target_expr): Likewise.
2004-01-30 Michael Matz <matz@suse.de>
@ -207,7 +218,7 @@
2004-01-28 Giovanni Bajo <giovannibajo@gcc.gnu.org>
* parser.c (cp_parser_template_id): Parse tentatively `[:' after a
* parser.c (cp_parser_template_id): Parse tentatively `[:' after a
template name as it was `<::' (digraph typo).
(cp_parser_nth_token_starts_template_argument_list_p): New function.
(cp_parser_id_expression): Use it.
@ -237,7 +248,7 @@
* name-lookup.c: Include "debug.h"
(do_namespace_alias): Invoke debug_hooks to emit debug info
for namespace alias.
(do_local_using_decl): Invoke debug_hooks to emit debug info
(do_local_using_decl): Invoke debug_hooks to emit debug info
for using decl.
(do_class_using_decl): Same.
(do_toplevel_using_decl): Same.
@ -295,7 +306,7 @@
2004-01-25 Giovanni Bajo <giovannibajo@gcc.gnu.org>
PR c++/13810
* parser.c (cp_parser_type_parameter): When cp_parser_id_expression
* parser.c (cp_parser_type_parameter): When cp_parser_id_expression
returns a TYPE_DECL. no further lookup is required.
* semantics.c (check_template_template_default_arg): A TYPE_DECL
is invalid. Rework to give better diagnostics.
@ -336,7 +347,7 @@
2004-01-20 Kelley Cook <kcook@gcc.gnu.org>
* Make-lang.in (CXX_INSTALL_NAME, GXX_INSTALL_NAME,
* Make-lang.in (CXX_INSTALL_NAME, GXX_INSTALL_NAME,
CXX_TARGET_INSTALL_NAME, GXX_TARGET_INSTALL_NAME): Define via a
immediate $(shell) instead of deferred backquote.
@ -444,7 +455,7 @@
2004-01-15 Giovanni Bajo <giovannibajo@gcc.gnu.org>
PR c++/8856
* parser.c (cp_parser_template_name): Don't try to parse a
* parser.c (cp_parser_template_name): Don't try to parse a
conversion-function-id, as it cannot be a template-name.
(cp_parser_simple_type_specifier): Check for invalid template-ids
even after a built-in type.
@ -555,7 +566,7 @@
DR 337
PR c++/9256
* pt.c (tsubst): Substitution must fail if we are attempting to
* pt.c (tsubst): Substitution must fail if we are attempting to
create an array with element type that is an abstract class type.
* decl.c (cp_finish_decl): Strip pointers and array types recursively
before calling abstract_virtuals_error.

View File

@ -1853,8 +1853,6 @@ duplicate_decls (tree newdecl, tree olddecl)
regardless of declaration matches. */
SET_DECL_RTL (newdecl, DECL_RTL (olddecl));
}
else
DECL_ESTIMATED_INSNS (newdecl) = DECL_ESTIMATED_INSNS (olddecl);
DECL_RESULT (newdecl) = DECL_RESULT (olddecl);
/* Don't clear out the arguments if we're redefining a function. */
@ -10258,9 +10256,6 @@ start_function (tree declspecs, tree declarator, tree attrs, int flags)
/* Start the statement-tree, start the tree now. */
begin_stmt_tree (&DECL_SAVED_TREE (decl1));
/* Don't double-count statements in templates. */
DECL_ESTIMATED_INSNS (decl1) = 0;
/* Let the user know we're compiling this function. */
announce_function (decl1);

View File

@ -937,15 +937,16 @@ pushdecl (tree x)
/* ARM $8.3 */
if (b->kind == sk_function_parms)
{
error ("declaration of `%#D' shadows a parameter",
name);
error ("declaration of '%#D' shadows a parameter", x);
err = true;
}
}
if (warn_shadow && !err)
shadow_warning (SW_PARAM,
IDENTIFIER_POINTER (name), oldlocal);
{
warning ("declaration of '%#D' shadows a parameter", x);
warning ("%Jshadowed declaration is here", oldlocal);
}
}
/* Maybe warn if shadowing something else. */
@ -958,17 +959,25 @@ pushdecl (tree x)
if (IDENTIFIER_CLASS_VALUE (name) != NULL_TREE
&& current_class_ptr
&& !TREE_STATIC (name))
warning ("declaration of `%s' shadows a member of `this'",
IDENTIFIER_POINTER (name));
{
/* Location of previous decl is not useful in this case. */
warning ("declaration of '%D' shadows a member of 'this'",
x);
}
else if (oldlocal != NULL_TREE
&& TREE_CODE (oldlocal) == VAR_DECL)
shadow_warning (SW_LOCAL,
IDENTIFIER_POINTER (name), oldlocal);
{
warning ("declaration of '%D' shadows a previous local", x);
warning ("%Jshadowed declaration is here", oldlocal);
}
else if (oldglobal != NULL_TREE
&& TREE_CODE (oldglobal) == VAR_DECL)
/* XXX shadow warnings in outer-more namespaces */
shadow_warning (SW_GLOBAL,
IDENTIFIER_POINTER (name), oldglobal);
{
warning ("declaration of '%D' shadows a global declaration",
x);
warning ("%Jshadowed declaration is here", oldglobal);
}
}
}

View File

@ -232,10 +232,6 @@ maybe_clone_body (tree fn)
/* Clone the body. */
clone_body (clone, fn, decl_map);
/* There are as many statements in the clone as in the
original. */
DECL_ESTIMATED_INSNS (clone) = DECL_ESTIMATED_INSNS (fn);
/* Clean up. */
splay_tree_delete (decl_map);

View File

@ -15274,14 +15274,6 @@ c_parse_file (void)
the_parser = NULL;
}
/* Clean up after parsing the entire translation unit. */
void
free_parser_stacks (void)
{
/* Nothing to do. */
}
/* This variable must be provided by every front end. */
int yydebug;

View File

@ -12565,12 +12565,6 @@ dwarf2out_decl (tree decl)
return;
case FUNCTION_DECL:
/* Ignore this FUNCTION_DECL if it refers to a builtin declaration of a
builtin function. Explicit programmer-supplied declarations of
these same functions should NOT be ignored however. */
if (DECL_EXTERNAL (decl) && DECL_BUILT_IN (decl))
return;
/* What we would really like to do here is to filter out all mere
file-scope declarations of file-scope functions which are never
referenced later within this translation unit (and keep all of ones

View File

@ -1,3 +1,14 @@
2004-02-07 Zack Weinberg <zack@codesourcery.com>
Bug 13856
* gcc.dg/visibility-8.c: New testcase.
2004-02-07 Zack Weinberg <zack@codesourcery.com>
* gcc.c-torture/execute/string-opt-15.c: Define memcmp with void *
arguments.
* gcc.dg/fwritable-strings-1.c: Expect the deprecation notice.
2004-02-07 Roger Sayle <roger@eyesopen.com>
PR middle-end/13696
@ -130,7 +141,7 @@
* g++.dg/template/sizeof7.C: New test.
2004-02-02 Eric Christopher <echristo@redhat.com>
Zack Weinberg <zack@codesourcery.com>
Zack Weinberg <zack@codesourcery.com>
* gcc.c-torture/execute/wchar_t-1.c: Add -finput-charset.

View File

@ -39,7 +39,7 @@ main ()
should abort. */
__attribute__ ((noinline))
static int
memcmp (const char *p1, const char *p2, size_t len)
memcmp (const void *p1, const void *p2, size_t len)
{
abort ();
}

View File

@ -3,6 +3,7 @@
/* { dg-do run } */
/* { dg-options "-fwritable-strings" } */
/* { dg-error "-fwritable-strings is deprecated" "" { target *-*-* } 0 } */
extern void abort(void);

View File

@ -0,0 +1,16 @@
/* Test hidden visibility on built-in functions (for libc). PR 13856. */
/* { dg-do compile } */
/* { dg-options "-std=gnu99" } */
/* { dg-require-visibility "" } */
/* { dg-final { scan-assembler "\\.hidden.*__GI_fputs_unlocked" } } */
int fputs_unlocked (const char *restrict, int *restrict)
__asm__ ("__GI_fputs_unlocked")
__attribute__ ((visibility ("hidden")));
int
fputs_unlocked (str, fp)
const char *str;
int *fp;
{
}

View File

@ -95,9 +95,6 @@ typedef struct inline_data
int in_target_cleanup_p;
/* A list of the functions current function has inlined. */
varray_type inlined_fns;
/* The approximate number of instructions we have inlined in the
current call stack. */
int inlined_insns;
/* We use the same mechanism to build clones that we do to perform
inlining. However, there are a few places where we need to
distinguish between those two situations. This flag is true if
@ -1569,11 +1566,6 @@ expand_call_inline (tree *tp, int *walk_subtrees, void *data)
the equivalent inlined version either. */
TREE_USED (*tp) = 1;
/* Our function now has more statements than it did before. */
DECL_ESTIMATED_INSNS (VARRAY_TREE (id->fns, 0)) += DECL_ESTIMATED_INSNS (fn);
/* For accounting, subtract one for the saved call/ret. */
id->inlined_insns += DECL_ESTIMATED_INSNS (fn) - 1;
/* Update callgraph if needed. */
if (id->decl)
{
@ -1590,11 +1582,6 @@ expand_call_inline (tree *tp, int *walk_subtrees, void *data)
}
VARRAY_POP (id->fns);
/* If we've returned to the top level, clear out the record of how
much inlining has been done. */
if (VARRAY_ACTIVE_SIZE (id->fns) == id->first_inlined_fn)
id->inlined_insns = 0;
/* Don't walk into subtrees. We've already handled them above. */
*walk_subtrees = 0;
@ -1634,9 +1621,6 @@ optimize_inline_calls (tree fn)
/* Don't allow recursion into FN. */
VARRAY_TREE_INIT (id.fns, 32, "fns");
VARRAY_PUSH_TREE (id.fns, fn);
if (!DECL_ESTIMATED_INSNS (fn))
DECL_ESTIMATED_INSNS (fn)
= (*lang_hooks.tree_inlining.estimate_num_insns) (fn);
/* Or any functions that aren't finished yet. */
prev_fn = NULL_TREE;
if (current_function_decl)

View File

@ -1627,13 +1627,6 @@ struct tree_type GTY(())
#define DECL_POINTER_ALIAS_SET_KNOWN_P(NODE) \
(DECL_POINTER_ALIAS_SET (NODE) != - 1)
/* In a FUNCTION_DECL for which DECL_BUILT_IN does not hold, this is
the approximate number of statements in this function. There is
no need for this number to be exact; it is only used in various
heuristics regarding optimization. */
#define DECL_ESTIMATED_INSNS(NODE) \
(FUNCTION_DECL_CHECK (NODE)->decl.u1.i)
/* Nonzero for a decl which is at file scope. */
#define DECL_FILE_SCOPE_P(EXP) \
(! DECL_CONTEXT (EXP) \