invoke.texi (-fno-builtin): Document that this is always on in C++.
authorMark Mitchell <mark@codesourcery.com>
Fri, 25 May 2001 01:27:08 +0000 (01:27 +0000)
committerMark Mitchell <mmitchel@gcc.gnu.org>
Fri, 25 May 2001 01:27:08 +0000 (01:27 +0000)
* invoke.texi (-fno-builtin): Document that this is always on
in C++.

* decl.c (duplicate_decls): Tidy.
(init_decl_processing): Always set flag_no_builtin.

From-SVN: r42553

gcc/ChangeLog
gcc/cp/ChangeLog
gcc/cp/decl.c
gcc/invoke.texi

index 450007aa9981b29ccc50a95b2112c1fe689628c8..f464a4a05f439710c56153c844045469e2839128 100644 (file)
@@ -1,3 +1,8 @@
+2001-05-24  Mark Mitchell  <mark@codesourcery.com>
+
+       * invoke.texi (-fno-builtin): Document that this is always on
+       in C++.
+
 2001-05-24  Philip Blundell  <philb@gnu.org>
 
        * doc/install.texi (arm*-*-linux-gnu): Say that binutils 2.10 is
index 577cf532fa9031b3a108d0dafd8e50572f5d643f..df72dfe3d0ab5e90a58e7eb2b6795a267649b31e 100644 (file)
@@ -1,3 +1,8 @@
+2001-05-24  Mark Mitchell  <mark@codesourcery.com>
+
+       * decl.c (duplicate_decls): Tidy.
+       (init_decl_processing): Always set flag_no_builtin.
+
 2001-05-24  Nathan Sidwell  <nathan@codesourcery.com>
 
        PR c++/2184
index 8376282bcfcfb51164b8f0faf04aa4e79db830ed..c91ba6082ee7d108cfecabcb80130dd8b87cb303 100644 (file)
@@ -3717,11 +3717,8 @@ duplicate_decls (newdecl, olddecl)
            DECL_ARGUMENTS (newdecl) = DECL_ARGUMENTS (olddecl);
        }
     }
-
-  if (TREE_CODE (newdecl) == NAMESPACE_DECL)
-    {
-      NAMESPACE_LEVEL (newdecl) = NAMESPACE_LEVEL (olddecl);
-    }
+  else if (TREE_CODE (newdecl) == NAMESPACE_DECL)
+    NAMESPACE_LEVEL (newdecl) = NAMESPACE_LEVEL (olddecl);
 
   /* Now preserve various other info from the definition.  */
   TREE_ADDRESSABLE (newdecl) = TREE_ADDRESSABLE (olddecl);
@@ -6372,6 +6369,12 @@ init_decl_processing ()
       flag_inline_functions = 0;
     }
 
+  /* In C++, we never create builtin functions whose name does not
+     begin with `__'.  Users should be using headers to get prototypes
+     in C++.  It would be nice if we could warn when `-fbuiltin' is
+     used explicitly, but we do not have that information.  */
+  flag_no_builtin = 1;
+
   /* Initially, C.  */
   current_lang_name = lang_name_c;
 
index 537060eb55bacd39ba71d13e361bebe296f4d678..80cd33e31ee46b9de9f77cf6a0f075e667e77d03 100644 (file)
@@ -972,6 +972,13 @@ and faster, but since the function calls no longer appear as such, you
 cannot set a breakpoint on those calls, nor can you change the behavior
 of the functions by linking with a different library.
 
+In C++, @samp{-fno-builtin} is always in effect.  The @samp{-fbuiltin}
+option has no effect.  Therefore, in C++, the only way to get the
+optimization benefits of builtin functions is to call the function
+using the @samp{__builtin_} prefix.  The GNU C++ Standard Library uses
+builtin functions to implement many functions (like
+@code{std::strchr}), so that you automatically get efficient code.
+
 @item -fhosted
 @cindex hosted environment