minus-d-inlining.patch

Doug Evans dje@transmeta.com
Fri Nov 19 08:35:00 GMT 1999


configuration: i686-pc-linux-gnu

The current "proper" way of compiling a file on gcc+glibc systems
with -fno-inline -O is to also pass -D__NO_STRING_INLINES.
-fno-inline should DTRT and -D__NO_STRING_INLINES shouldn't be
required (and you agree, right Ulrich?).
One way to do this is to define a macro that system libraries can then
key off of.  [One can of course turn it around and define the macro
when not inlining.]

I haven't got a disclaimer from my employer sent in yet.
That is in the works.  If this patch is sufficiently large
to require it then it can wait to be installed.
In the meantime, we can discuss whether to do things this way or
another.

The timing of applying this patch should coincide with a gcc version
number change (gcc3?) so that glibc can DTRT with newer and older
versions of gcc.

1999-11-19  Doug Evans  <dje@casey.transmeta.com>

	* gcc.c (default_compilers): Pass -D__INLINING__ to cpp if
	optimizing and not -fno-inline.

Index: gcc.c
===================================================================
RCS file: /cvs/gcc/egcs/gcc/gcc.c,v
retrieving revision 1.120
diff -c -p -r1.120 gcc.c
*** gcc.c	1999/11/10 19:59:20	1.120
--- gcc.c	1999/11/19 16:01:07
*************** static struct compiler default_compilers
*** 631,636 ****
--- 631,637 ----
  	%{ansi|std=*:%{!std=gnu*:-trigraphs -D__STRICT_ANSI__}}\
  	%{!undef:%{!ansi:%{!std=*:%p}%{std=gnu*:%p}} %P} %{trigraphs}\
          %c %{Os:-D__OPTIMIZE_SIZE__} %{O*:%{!O0:-D__OPTIMIZE__}}\
+ 	%{!fno-inline:%{O*:%{!O0:-D__INLINING__}}}\
  	%{ffast-math:-D__FAST_MATH__}\
  	%{fshort-wchar:-D__WCHAR_TYPE__=short\\ unsigned\\ int}\
          %{traditional} %{ftraditional:-traditional}\
*************** static struct compiler default_compilers
*** 646,651 ****
--- 647,653 ----
  		  %{ansi|std=*:%{!std=gnu*:-trigraphs -D__STRICT_ANSI__}}\
  		  %{!undef:%{!ansi:%{!std=*:%p}%{std=gnu*:%p}} %P} %{trigraphs}\
                    %c %{Os:-D__OPTIMIZE_SIZE__} %{O*:%{!O0:-D__OPTIMIZE__}}\
+ 		  %{!fno-inline:%{O*:%{!O0:-D__INLINING__}}}\
  		  %{ffast-math:-D__FAST_MATH__}\
  		  %{fshort-wchar:-D__WCHAR_TYPE__=short\\ unsigned\\ int}\
  		  %{fshort-wchar:-D__WCHAR_TYPE__=short\\ unsigned\\ int}\
*************** static struct compiler default_compilers
*** 670,675 ****
--- 672,678 ----
  	%{ansi|std=*:%{!std=gnu*:-trigraphs -D__STRICT_ANSI__}}\
  	%{!undef:%{!ansi:%{!std=*:%p}%{std=gnu*:%p}} %P} %{trigraphs}\
          %c %{Os:-D__OPTIMIZE_SIZE__} %{O*:%{!O0:-D__OPTIMIZE__}}\
+ 	%{!fno-inline:%{O*:%{!O0:-D__INLINING__}}}\
  	%{ffast-math:-D__FAST_MATH__}\
  	%{fshort-wchar:-D__WCHAR_TYPE__=short\\ unsigned\\ int}\
          %{traditional} %{ftraditional:-traditional}\
*************** static struct compiler default_compilers
*** 699,704 ****
--- 702,708 ----
  	%{ansi|std=*:%{!std=gnu*:-trigraphs -D__STRICT_ANSI__}}\
  	%{!undef:%{!ansi:%{!std=*:%p}%{std=gnu*:%p}} %P} %{trigraphs}\
          %c %{Os:-D__OPTIMIZE_SIZE__} %{O*:%{!O0:-D__OPTIMIZE__}}\
+ 	%{!fno-inline:%{O*:%{!O0:-D__INLINING__}}}\
  	%{ffast-math:-D__FAST_MATH__}\
  	%{fshort-wchar:-D__WCHAR_TYPE__=short\\ unsigned\\ int}\
          %{traditional} %{ftraditional:-traditional}\
*************** static struct compiler default_compilers
*** 717,722 ****
--- 721,727 ----
  	%{std=*:%{!std=gnu*:-trigraphs -D__STRICT_ANSI__}}\
  	%{!undef:%{!std=*:%p}%{std=gnu*:%p} %P} %{trigraphs}\
          %c %{Os:-D__OPTIMIZE_SIZE__} %{O*:%{!O0:-D__OPTIMIZE__}}\
+ 	%{!fno-inline:%{O*:%{!O0:-D__INLINING__}}}\
  	%{ffast-math:-D__FAST_MATH__}\
  	%{fshort-wchar:-D__WCHAR_TYPE__=short\\ unsigned\\ int}\
  	%{fshort-wchar:-D__WCHAR_TYPE__=short\\ unsigned\\ int}\
*************** static struct compiler default_compilers
*** 748,753 ****
--- 753,759 ----
  	%{M} %{MM} %{MD:-MD %b.d} %{MMD:-MMD %b.d} %{MG} %{trigraphs}\
          -$ %{!undef:%p %P} -D__ASSEMBLER__ \
          %c %{Os:-D__OPTIMIZE_SIZE__} %{O*:%{!O0:-D__OPTIMIZE__}}\
+ 	%{!fno-inline:%{O*:%{!O0:-D__INLINING__}}}\
  	%{ffast-math:-D__FAST_MATH__}\
  	%{fshort-wchar:-D__WCHAR_TYPE__=short\\ unsigned\\ int}\
          %{traditional} %{ftraditional:-traditional}\


More information about the Gcc-patches mailing list