This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[PATCH] Support -fno-builtin-foo options in C++ (take 2)


This is just a reminder that the following patch hasn't yet been
reviewed:  http://gcc.gnu.org/ml/gcc-patches/2002-07/msg00635.html

I'd normally wait until the end of the month before posting a
reminder, but this small patch should also simplify Neil Booth's
task of integrating C/C++ switch handling.  I'm resending the
patch updated to apply cleanly against current mainline.  Tested
as before.

Ok for mainline?


2002-07-27  Roger Sayle  <roger@eyesopen.com>

	* cp/decl2.c (cxx_decode_option): Support -fno-builtin-foo.

	* doc/invoke.texi: Document that both -fno-builtin-foo and
	-fno-builtin are supported by the g++ front-end.


Index: cp/decl2.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/cp/decl2.c,v
retrieving revision 1.551
diff -c -3 -p -r1.551 decl2.c
*** cp/decl2.c	26 Jul 2002 20:10:42 -0000	1.551
--- cp/decl2.c	27 Jul 2002 14:24:50 -0000
*************** cxx_decode_option (argc, argv)
*** 534,539 ****
--- 534,541 ----
  	  warning ("-fname-mangling-version is no longer supported");
  	  return 1;
  	}
+       else if ((option_value = skip_leading_substring (p, "no-builtin-")))
+ 	disable_builtin_function (option_value);
        else if (dump_switch_p (p))
  	;
        else
Index: doc/invoke.texi
===================================================================
RCS file: /cvs/gcc/gcc/gcc/doc/invoke.texi,v
retrieving revision 1.161
diff -c -3 -p -r1.161 invoke.texi
*** doc/invoke.texi	25 Jul 2002 10:15:58 -0000	1.161
--- doc/invoke.texi	27 Jul 2002 14:24:52 -0000
*************** switch only affects the @code{asm} and @
*** 1081,1087 ****
  @code{inline} is a standard keyword in ISO C99.

  @item -fno-builtin
! @itemx -fno-builtin-@var{function} @r{(C and Objective-C only)}
  @opindex fno-builtin
  @cindex built-in functions
  Don't recognize built-in functions that do not begin with
--- 1081,1087 ----
  @code{inline} is a standard keyword in ISO C99.

  @item -fno-builtin
! @itemx -fno-builtin-@var{function}
  @opindex fno-builtin
  @cindex built-in functions
  Don't recognize built-in functions that do not begin with
*************** and faster, but since the function calls
*** 1099,1113 ****
  cannot set a breakpoint on those calls, nor can you change the behavior
  of the functions by linking with a different library.

! In C++, @option{-fno-builtin} is always in effect.  The @option{-fbuiltin}
! option has no effect.  Therefore, in C++, the only way to get the
! optimization benefits of built-in functions is to call the function
! using the @samp{__builtin_} prefix.  The GNU C++ Standard Library uses
! built-in functions to implement many functions (like
! @code{std::strchr}), so that you automatically get efficient code.
!
! With the @option{-fno-builtin-@var{function}} option, not available
! when compiling C++, only the built-in function @var{function} is
  disabled.  @var{function} must not begin with @samp{__builtin_}.  If a
  function is named this is not built-in in this version of GCC, this
  option is ignored.  There is no corresponding
--- 1099,1106 ----
  cannot set a breakpoint on those calls, nor can you change the behavior
  of the functions by linking with a different library.

! With the @option{-fno-builtin-@var{function}} option
! only the built-in function @var{function} is
  disabled.  @var{function} must not begin with @samp{__builtin_}.  If a
  function is named this is not built-in in this version of GCC, this
  option is ignored.  There is no corresponding

Roger
--
Roger Sayle,                         E-mail: roger@eyesopen.com
OpenEye Scientific Software,         WWW: http://www.eyesopen.com/
Suite 1107, 3600 Cerrillos Road,     Tel: (+1) 505-473-7385
Santa Fe, New Mexico, 87507.         Fax: (+1) 505-473-0833


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]