summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorzack <zack@138bc75d-0d04-0410-961f-82ee72b054a4>2004-02-08 01:59:11 +0000
committerzack <zack@138bc75d-0d04-0410-961f-82ee72b054a4>2004-02-08 01:59:11 +0000
commita3ad3e27edff7998572d4bb4c4f4e8ce6466d4e2 (patch)
treed4cd835e75cfa41869573447cf76d5e4dc2453ad
parentb1c4a3aac918c702dfb6a235d517117bda3db1df (diff)
downloadppe42-gcc-a3ad3e27edff7998572d4bb4c4f4e8ce6466d4e2.tar.gz
ppe42-gcc-a3ad3e27edff7998572d4bb4c4f4e8ce6466d4e2.zip
* 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. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@77475 138bc75d-0d04-0410-961f-82ee72b054a4
-rw-r--r--gcc/ChangeLog116
-rw-r--r--gcc/c-common.c15
-rw-r--r--gcc/c-common.h4
-rw-r--r--gcc/c-decl.c36
-rw-r--r--gcc/c-opts.c1
-rw-r--r--gcc/c-parse.in7
-rw-r--r--gcc/cgraphunit.c5
-rw-r--r--gcc/cp/ChangeLog33
-rw-r--r--gcc/cp/decl.c5
-rw-r--r--gcc/cp/name-lookup.c29
-rw-r--r--gcc/cp/optimize.c4
-rw-r--r--gcc/cp/parser.c8
-rw-r--r--gcc/dwarf2out.c6
-rw-r--r--gcc/testsuite/ChangeLog13
-rw-r--r--gcc/testsuite/gcc.c-torture/execute/string-opt-15.c2
-rw-r--r--gcc/testsuite/gcc.dg/fwritable-strings-1.c1
-rw-r--r--gcc/testsuite/gcc.dg/visibility-8.c16
-rw-r--r--gcc/tree-inline.c16
-rw-r--r--gcc/tree.h7
19 files changed, 157 insertions, 167 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index ef2a3f5e200..a0bab4f2ade 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -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.
diff --git a/gcc/c-common.c b/gcc/c-common.c
index b628ac49e5b..c31c671e9a2 100644
--- a/gcc/c-common.c
+++ b/gcc/c-common.c
@@ -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
diff --git a/gcc/c-common.h b/gcc/c-common.h
index f948e44c694..5529252f6c6 100644
--- a/gcc/c-common.h
+++ b/gcc/c-common.h
@@ -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 *);
diff --git a/gcc/c-decl.c b/gcc/c-decl.c
index c0cd2193386..87d24a9ead4 100644
--- a/gcc/c-decl.c
+++ b/gcc/c-decl.c
@@ -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);
}
diff --git a/gcc/c-opts.c b/gcc/c-opts.c
index 6fbfd1cee6c..3f773be18d9 100644
--- a/gcc/c-opts.c
+++ b/gcc/c-opts.c
@@ -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 ();
}
diff --git a/gcc/c-parse.in b/gcc/c-parse.in
index 23e2898aed1..d177250e125 100644
--- a/gcc/c-parse.in
+++ b/gcc/c-parse.in
@@ -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)
diff --git a/gcc/cgraphunit.c b/gcc/cgraphunit.c
index ea9cae664b2..78b566f5c68 100644
--- a/gcc/cgraphunit.c
+++ b/gcc/cgraphunit.c
@@ -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);
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog
index 9e6633d790b..661d9e7630a 100644
--- a/gcc/cp/ChangeLog
+++ b/gcc/cp/ChangeLog
@@ -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.
diff --git a/gcc/cp/decl.c b/gcc/cp/decl.c
index 86cee367a07..3f9feac4737 100644
--- a/gcc/cp/decl.c
+++ b/gcc/cp/decl.c
@@ -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);
diff --git a/gcc/cp/name-lookup.c b/gcc/cp/name-lookup.c
index 30ff8e50822..1d03dc261d3 100644
--- a/gcc/cp/name-lookup.c
+++ b/gcc/cp/name-lookup.c
@@ -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);
+ }
}
}
diff --git a/gcc/cp/optimize.c b/gcc/cp/optimize.c
index da17d316bb1..5ada1312e59 100644
--- a/gcc/cp/optimize.c
+++ b/gcc/cp/optimize.c
@@ -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);
diff --git a/gcc/cp/parser.c b/gcc/cp/parser.c
index 7e259f6bffb..684de506686 100644
--- a/gcc/cp/parser.c
+++ b/gcc/cp/parser.c
@@ -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;
diff --git a/gcc/dwarf2out.c b/gcc/dwarf2out.c
index 4e310b2a28a..a2848a443d1 100644
--- a/gcc/dwarf2out.c
+++ b/gcc/dwarf2out.c
@@ -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
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index 20a9683a0f3..ffa9d6b1d69 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -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.
diff --git a/gcc/testsuite/gcc.c-torture/execute/string-opt-15.c b/gcc/testsuite/gcc.c-torture/execute/string-opt-15.c
index 2cf73da151c..e2395d4dfeb 100644
--- a/gcc/testsuite/gcc.c-torture/execute/string-opt-15.c
+++ b/gcc/testsuite/gcc.c-torture/execute/string-opt-15.c
@@ -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 ();
}
diff --git a/gcc/testsuite/gcc.dg/fwritable-strings-1.c b/gcc/testsuite/gcc.dg/fwritable-strings-1.c
index e519231c368..652a0845fd0 100644
--- a/gcc/testsuite/gcc.dg/fwritable-strings-1.c
+++ b/gcc/testsuite/gcc.dg/fwritable-strings-1.c
@@ -3,6 +3,7 @@
/* { dg-do run } */
/* { dg-options "-fwritable-strings" } */
+/* { dg-error "-fwritable-strings is deprecated" "" { target *-*-* } 0 } */
extern void abort(void);
diff --git a/gcc/testsuite/gcc.dg/visibility-8.c b/gcc/testsuite/gcc.dg/visibility-8.c
new file mode 100644
index 00000000000..fc3a1055757
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/visibility-8.c
@@ -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;
+{
+}
diff --git a/gcc/tree-inline.c b/gcc/tree-inline.c
index 013723059ab..6d3fcf87f20 100644
--- a/gcc/tree-inline.c
+++ b/gcc/tree-inline.c
@@ -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)
diff --git a/gcc/tree.h b/gcc/tree.h
index f6d3baf5c81..5b075d9ad4c 100644
--- a/gcc/tree.h
+++ b/gcc/tree.h
@@ -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) \
OpenPOWER on IntegriCloud