]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
c-common.c (shadow_warning): Delete.
authorZack Weinberg <zack@gcc.gnu.org>
Sun, 8 Feb 2004 01:59:11 +0000 (01:59 +0000)
committerZack Weinberg <zack@gcc.gnu.org>
Sun, 8 Feb 2004 01:59:11 +0000 (01:59 +0000)
* 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

19 files changed:
gcc/ChangeLog
gcc/c-common.c
gcc/c-common.h
gcc/c-decl.c
gcc/c-opts.c
gcc/c-parse.in
gcc/cgraphunit.c
gcc/cp/ChangeLog
gcc/cp/decl.c
gcc/cp/name-lookup.c
gcc/cp/optimize.c
gcc/cp/parser.c
gcc/dwarf2out.c
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.c-torture/execute/string-opt-15.c
gcc/testsuite/gcc.dg/fwritable-strings-1.c
gcc/testsuite/gcc.dg/visibility-8.c [new file with mode: 0644]
gcc/tree-inline.c
gcc/tree.h

index ef2a3f5e200a4ed6ff40b8fc6b569e6f07398b8b..a0bab4f2adee37923d6ca4dc6108a66b4c82a88c 100644 (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,
 
 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>
        (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
        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.
        * 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.
        * 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>
 
 
        * 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.
        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>
 
        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.
 
 
 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>
        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>
 
 
 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>
        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.
index b628ac49e5bed455716088d2b34a8c55b7bffcac..c31c671e9a26543eeb8fba85c6d3807c9b17ec6a 100644 (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
index f948e44c6949d14079d6e4ff878538156fe2afd0..5529252f6c6ed6f51a77318a5425a1ade0dde9f6 100644 (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 *);
index c0cd2193386e19fe2094c3d74331fa79323bfedc..87d24a9ead495f57ee8f2b28f8dec0cc6fa128e1 100644 (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);
 }
 
 
index 6fbfd1cee6c3c0970b2f0090d9f215da5462d96f..3f773be18d99eb558462328e2c58b3061f834512 100644 (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 ();
 }
 
index 23e2898aed1612188c56124672bbc2e502b3a836..d177250e125c460b6b6478f02aa965f67f627f28 100644 (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)
index ea9cae664b2e694332ea20475976e29ee7a2ffb1..78b566f5c68c85cac1eae1750d76af3ec453265e 100644 (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);
index 9e6633d790b7d53fdfb019458a5ab06d424d63ae..661d9e7630acd5df33c38cd7f34639540083f129 100644 (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.
 
 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>
 
 
 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.
        * 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.
 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.
 
 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.
 
 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.
 
        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.
index 86cee367a0726e9d4d5b023ea3a282168342ae29..3f9feac4737835cb2ee3a3be592d8eef36ace48d 100644 (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);
 
index 30ff8e50822532707e95777a7d0db2570acca13f..1d03dc261d3779ab6485bd7053d245f23a19a5d5 100644 (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);
+               }
            }
        }
 
index da17d316bb13addb038d61d679fbd876aefadc8d..5ada1312e59d1a55e0952b9cfdf60ae13ac40b77 100644 (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);
 
index 7e259f6bffbc0eae1ac4b9673f9875399293683a..684de5066861d9672728673a07b3193ad15a7736 100644 (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;
index 4e310b2a28a5571bb29ab16e76f898cb8c4460f0..a2848a443d14a76f2cd093f5a99a59883046bc7f 100644 (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
index 20a9683a0f398e33f058d0bdd7bfeeeb1d92aa02..ffa9d6b1d69d2753feb5d21f746fe36fecbbb49c 100644 (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
        * 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.
 
index 2cf73da151c5f015d1bcca3bcf38001e72d1a1c5..e2395d4dfeb20c2fa01b618f855b9ea04afade9b 100644 (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 ();
 }
index e519231c36874745ed114f2091eb99f510a658b6..652a0845fd058403161456728aa7d7e4dd5566bf 100644 (file)
@@ -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 (file)
index 0000000..fc3a105
--- /dev/null
@@ -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;
+{
+}
index 013723059ab4ebc7c0ce70a2174d123f62f6ab97..6d3fcf87f203357c18e21faf25d85fd0fa1674d3 100644 (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)
index f6d3baf5c81a08a525a280757ecbb886ae3935b0..5b075d9ad4c91259d6e85ee5798ffcb8c1aa453a 100644 (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)                                                \