public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
* using stdc++.h.gch
@ 2003-04-15 18:00 Benjamin Kosnik
  2003-04-15 20:39 ` Geoff Keating
  2003-04-23 13:16 ` [PCH bug] anonymous variadic macros were introduced in C99 warning at pch using Vladimir Merzliakov
  0 siblings, 2 replies; 10+ messages in thread
From: Benjamin Kosnik @ 2003-04-15 18:00 UTC (permalink / raw)
  To: libstdc++, gcc; +Cc: law, geoffk


Geoff recently fixed the last issue with PCH support on linux. It is now
possible to use pre compiled headers on linux. Doing so is a win, by
quite a large margin.

for 'time make check-target-libstdc++-v3'

20030415 pch
722.110u 89.320s 19:26.08 69.5% 0+0k 0+0io 5429730pf+0w

20030415 no pch
1514.670u 108.510s 34:27.58 78.5%       0+0k 0+0io 2496245pf+0w

I expect similar results for the g++ testsuite.

I'm all about reclaiming 15 more minutes in my day (times x times I do
make check) by using the precompiled header support. Also, if this is
flipped on, more people will use PCH and thus it will get wider testing.

Attached is a patch that enables PCH by default, for all targets. I'd
appreciate it if people could start testing with this patch and let me
know the results. In particular, I'm curious about 64 bit linux systems,
BSD, and Solaris.

Also, I have some questions and issues.

1) What targets support PCH, and how can I identify this in autoconf?
I'm assuming that PCH should not be flipped on for everybody, and that
maybe an --enable flag will be needed, with hosts that support it
getting it automagically fipped on?

2) At some point, -H needs to show that the .gch files is being used.
What this means is still a bit up in the air.

3) Installing a zero-size stdc++.h file so that I can use stdc++.h.gch
seems weird. Is it possible to just do some kind of -include
/foo/stdc++.gch?

-benjamin


2003-04-15  Benjamin Kosnik  <bkoz@redhat.com>

	* include/Makefile.am (allstamps): Add stamp-stdc++-precompile.
        (stamp-std-precompile): Generate stdc++.h.gch
	(install-data-local): Install generated file.
        * include/Makefile.in: Regenerate.
        * testsuite_flags.in (--build-cxx): Use pch file.

Index: testsuite_flags.in
===================================================================
RCS file: /cvs/gcc/gcc/libstdc++-v3/testsuite_flags.in,v
retrieving revision 1.14
diff -c -p -r1.14 testsuite_flags.in
*** testsuite_flags.in	14 Mar 2003 22:17:26 -0000	1.14
--- testsuite_flags.in	15 Apr 2003 16:26:04 -0000
*************** case ${query} in
*** 43,50 ****
        echo ${CXX}
        ;;
      --build-cxx)
!       PCHFLAGS="-Winvalid-pch -include ${BUILD_DIR}/include/stdc++.h"
!       CC_build="@glibcpp_CXX@"
        CXX=`echo $CC_build | sed 's/xgcc/g++/g'`
        echo ${CXX}
        ;;
--- 43,50 ----
        echo ${CXX}
        ;;
      --build-cxx)
!       PCHFLAGS="-include ${BUILD_DIR}/include/stdc++.h"
!       CC_build="@glibcpp_CXX@ ${PCHFLAGS}"
        CXX=`echo $CC_build | sed 's/xgcc/g++/g'`
        echo ${CXX}
        ;;
Index: include/Makefile.am
===================================================================
RCS file: /cvs/gcc/gcc/libstdc++-v3/include/Makefile.am,v
retrieving revision 1.54
diff -c -p -r1.54 Makefile.am
*** include/Makefile.am	14 Mar 2003 22:16:05 -0000	1.54
--- include/Makefile.am	15 Apr 2003 16:26:04 -0000
*************** pch_source = ${glibcpp_srcdir}/include/$
*** 348,354 ****
  # CLEANFILES and all-local are kept up-to-date.
  allstamps = \
  	stamp-std stamp-bits stamp-c_base stamp-c_compatibility \
! 	stamp-backward stamp-ext stamp-target
  
  # Here are the rules for building the headers
  all-local: ${target_builddir}/c++config.h ${thread_target_headers} ${allstamps}
--- 348,354 ----
  # CLEANFILES and all-local are kept up-to-date.
  allstamps = \
  	stamp-std stamp-bits stamp-c_base stamp-c_compatibility \
! 	stamp-backward stamp-ext stamp-target stamp-stdc++-precompile
  
  # Here are the rules for building the headers
  all-local: ${target_builddir}/c++config.h ${thread_target_headers} ${allstamps}
*************** stamp-std: ${std_headers}
*** 367,373 ****
  	  echo `date` > stamp-std ;\
  	fi
  
! PCHFLAGS=-Winvalid-pch -x c++-header $(CXXFLAGS)
  stamp-stdc++-precompile: stamp-std ${target_builddir}/c++config.h ${pch_source}
  	if [ ! -f "${pch_output}" ]; then \
  	  $(CXX) $(PCHFLAGS) $(INCLUDES) ${pch_source} -o ${pch_output}; \
--- 367,373 ----
  	  echo `date` > stamp-std ;\
  	fi
  
! PCHFLAGS=-Winvalid-pch -Wno-deprecated -x c++-header $(CXXFLAGS)
  stamp-stdc++-precompile: stamp-std ${target_builddir}/c++config.h ${pch_source}
  	if [ ! -f "${pch_output}" ]; then \
  	  $(CXX) $(PCHFLAGS) $(INCLUDES) ${pch_source} -o ${pch_output}; \
*************** stamp-c_base: ${c_base_headers} ${c_base
*** 388,398 ****
  	@if [ ! -d "${c_base_builddir}" ]; then \
  	  mkdir -p ${c_base_builddir} ;\
  	fi ;\
- 	(cd ${c_base_builddir} && for h in ${c_base_headers}; do \
- 	  official_name=`echo $$h | sed -e 's,.*/std_,,' -e 's,\.h$$,,'` ;\
- 	  @LN_S@ $$h ./$${official_name} || true ;\
- 	done) ;\
  	if [ ! -f stamp-c_base ]; then \
  	  if [ ! -z "${c_base_headers_extra}" ]; then \
  	  (cd ${bits_builddir} && @LN_S@ ${c_base_headers_extra}  . || true) ;\
  	  fi ;\
--- 388,398 ----
  	@if [ ! -d "${c_base_builddir}" ]; then \
  	  mkdir -p ${c_base_builddir} ;\
  	fi ;\
  	if [ ! -f stamp-c_base ]; then \
+ 	  (cd ${c_base_builddir} && for h in ${c_base_headers}; do \
+ 	    official_name=`echo $$h | sed -e 's,.*/std_,,' -e 's,\.h$$,,'` ;\
+ 	    @LN_S@ $$h ./$${official_name} || true ;\
+ 	  done) ;\
  	  if [ ! -z "${c_base_headers_extra}" ]; then \
  	  (cd ${bits_builddir} && @LN_S@ ${c_base_headers_extra}  . || true) ;\
  	  fi ;\
*************** install-data-local:
*** 524,529 ****
--- 524,531 ----
  	$(mkinstalldirs) $(DESTDIR)${gxx_include_dir}/${std_builddir}
  	for file in ${std_headers_rename}; do \
  	  $(INSTALL_DATA) ${std_builddir}/$${file} $(DESTDIR)${gxx_include_dir}/${std_builddir}; done
+ 	$(INSTALL_DATA) ${std_builddir}/${pch_input} $(DESTDIR)${gxx_include_dir}/${std_builddir}
+ 	$(INSTALL_DATA) ${std_builddir}/${pch_output} $(DESTDIR)${gxx_include_dir}/${std_builddir}
  	$(mkinstalldirs) $(DESTDIR)${gxx_include_dir}/${target_builddir}
  	for file in ${target_headers} ${target_headers_extra} \
  	 ${thread_target_headers}; do \

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: using stdc++.h.gch
  2003-04-15 18:00 using stdc++.h.gch Benjamin Kosnik
@ 2003-04-15 20:39 ` Geoff Keating
  2003-04-15 20:50   ` Benjamin Kosnik
  2003-04-23 13:16 ` [PCH bug] anonymous variadic macros were introduced in C99 warning at pch using Vladimir Merzliakov
  1 sibling, 1 reply; 10+ messages in thread
From: Geoff Keating @ 2003-04-15 20:39 UTC (permalink / raw)
  To: bkoz; +Cc: libstdc++, gcc, law

> Date: Tue, 15 Apr 2003 12:23:53 -0500
> From: Benjamin Kosnik <bkoz@redhat.com>
> Cc: law@redhat.com, geoffk@geoffk.org
> X-OriginalArrivalTime: 15 Apr 2003 17:25:23.0129 (UTC) FILETIME=[FF073290:01C30373]
> 
> 
> Geoff recently fixed the last issue with PCH support on linux. It is now
> possible to use pre compiled headers on linux. Doing so is a win, by
> quite a large margin.
> 
> for 'time make check-target-libstdc++-v3'
> 
> 20030415 pch
> 722.110u 89.320s 19:26.08 69.5% 0+0k 0+0io 5429730pf+0w
> 
> 20030415 no pch
> 1514.670u 108.510s 34:27.58 78.5%       0+0k 0+0io 2496245pf+0w
> 
> I expect similar results for the g++ testsuite.
> 
> I'm all about reclaiming 15 more minutes in my day (times x times I do
> make check) by using the precompiled header support. Also, if this is
> flipped on, more people will use PCH and thus it will get wider testing.
> 
> Attached is a patch that enables PCH by default, for all targets. I'd
> appreciate it if people could start testing with this patch and let me
> know the results. In particular, I'm curious about 64 bit linux systems,
> BSD, and Solaris.

Solaris is known to not-work, due to some weirdness in their mmap()
implementation.  I think the current situation is that there are two
possible design choices, one that is more portable but maybe slower,
and another that relies on fragile OS behaviour but would be fast when
it worked.

BSD is known to work (well, Darwin at least).

> Also, I have some questions and issues.
> 
> 1) What targets support PCH, and how can I identify this in autoconf?
> I'm assuming that PCH should not be flipped on for everybody, and that
> maybe an --enable flag will be needed, with hosts that support it
> getting it automagically fipped on?

If you did want to check PCH support with autoconf, I'd suggest trying
to build a PCH file and trying to use it.

> 2) At some point, -H needs to show that the .gch files is being used.
> What this means is still a bit up in the air.
> 
> 3) Installing a zero-size stdc++.h file so that I can use stdc++.h.gch
> seems weird. Is it possible to just do some kind of -include
> /foo/stdc++.gch?

You don't need to have a stdc++.h file to use stdc++.h.gch; and
-include does work, although remember that you have to leave the .gch off.

-- 
- Geoffrey Keating <geoffk@geoffk.org>

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: using stdc++.h.gch
  2003-04-15 20:39 ` Geoff Keating
@ 2003-04-15 20:50   ` Benjamin Kosnik
  0 siblings, 0 replies; 10+ messages in thread
From: Benjamin Kosnik @ 2003-04-15 20:50 UTC (permalink / raw)
  To: Geoff Keating; +Cc: libstdc++, gcc, law


>Solaris is known to not-work, due to some weirdness in their mmap()
>implementation.  I think the current situation is that there are two
>possible design choices, one that is more portable but maybe slower,
>and another that relies on fragile OS behaviour but would be fast when
>it worked.
>
>BSD is known to work (well, Darwin at least).

Hmmm. I'm hoping Loren can do some testing on FreeBSD. I'm expecting
FreeBSD to work, since it's Darwin + DWARF2 + ELF. Loren, any chance you
can double check this?

>> 1) What targets support PCH, and how can I identify this in autoconf?
>> I'm assuming that PCH should not be flipped on for everybody, and that
>> maybe an --enable flag will be needed, with hosts that support it
>> getting it automagically fipped on?
>
>If you did want to check PCH support with autoconf, I'd suggest trying
>to build a PCH file and trying to use it.

Yep. I suppose this is what needs to happen. So either the generation
fails with -Winvalid-pch, or -Winvalid-pch and usage of the file will
fail? Hmmm. I guess there is no need for an --enable flag for this.

>> 3) Installing a zero-size stdc++.h file so that I can use stdc++.h.gch
>> seems weird. Is it possible to just do some kind of -include
>> /foo/stdc++.gch?
>
>You don't need to have a stdc++.h file to use stdc++.h.gch; and
>-include does work, although remember that you have to leave the .gch off.

Indeed it does. I thought it wasn't, but it seems you are correct.
Thanks!

-benjamin

^ permalink raw reply	[flat|nested] 10+ messages in thread

* [PCH bug] anonymous variadic macros were introduced in C99 warning at pch using
  2003-04-15 18:00 using stdc++.h.gch Benjamin Kosnik
  2003-04-15 20:39 ` Geoff Keating
@ 2003-04-23 13:16 ` Vladimir Merzliakov
  2003-04-23 18:52   ` Geoff Keating
  2003-04-23 21:03   ` Benjamin Kosnik
  1 sibling, 2 replies; 10+ messages in thread
From: Vladimir Merzliakov @ 2003-04-23 13:16 UTC (permalink / raw)
  To: libstdc++, gcc; +Cc: law, geoffk

simple test.c test.h files compile without using pch
and generate strange warning if use test.h.gch

All case with options: g++ -ansi -pedantic -Werror -Winvalid-pch

-test.h----8<-----------
#include<string>
-test.h---->8-----------

-test.cc---8<-----------
#include"test.h"

int main() {
  return 0;
}
-test.cc--->8-----------

Warning generated at line in concept_check.h:52 :

#define __glibcpp_function_requires(...)

Vladimir


^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PCH bug] anonymous variadic macros were introduced in C99 warning at pch using
  2003-04-23 13:16 ` [PCH bug] anonymous variadic macros were introduced in C99 warning at pch using Vladimir Merzliakov
@ 2003-04-23 18:52   ` Geoff Keating
  2003-04-23 19:13     ` Vladimir Merzliakov
  2003-04-23 21:03   ` Benjamin Kosnik
  1 sibling, 1 reply; 10+ messages in thread
From: Geoff Keating @ 2003-04-23 18:52 UTC (permalink / raw)
  To: Vladimir Merzliakov; +Cc: law, gcc


"Vladimir Merzliakov" <wanderer@rsu.ru> writes:

> simple test.c test.h files compile without using pch
> and generate strange warning if use test.h.gch
> 
> All case with options: g++ -ansi -pedantic -Werror -Winvalid-pch

> Warning generated at line in concept_check.h:52 :
> 
> #define __glibcpp_function_requires(...)

I get:

t.c:1:37: warning: anonymous variadic macros were introduced in C99

which is not exactly clear, but it is true; and I get it whether or
not I use PCH.

-- 
- Geoffrey Keating <geoffk@geoffk.org>

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PCH bug] anonymous variadic macros were introduced in C99 warning at pch using
  2003-04-23 18:52   ` Geoff Keating
@ 2003-04-23 19:13     ` Vladimir Merzliakov
  2003-04-23 22:20       ` Geoff Keating
  0 siblings, 1 reply; 10+ messages in thread
From: Vladimir Merzliakov @ 2003-04-23 19:13 UTC (permalink / raw)
  To: Geoff Keating; +Cc: law, gcc

>
> "Vladimir Merzliakov" <wanderer@rsu.ru> writes:
>
> > simple test.c test.h files compile without using pch
> > and generate strange warning if use test.h.gch
> >
> > All case with options: g++ -ansi -pedantic -Werror -Winvalid-pch
>
> > Warning generated at line in concept_check.h:52 :
> >
> > #define __glibcpp_function_requires(...)
>
> I get:
>
> t.c:1:37: warning: anonymous variadic macros were introduced in C99
>
> which is not exactly clear, but it is true; and I get it whether or
> not I use PCH.
>
Hmm...
script
----8X----------------------------------
#!/bin/sh -
#
rm *.gch
echo !!! Compile without gch
g++ -ansi -Werror -pedantic -Winvalid-pch -o test.o -c test.cc
echo !!! GCH generation
g++ -ansi -Werror -pedantic -Winvalid-pch -o test.h.gch -c test.h
echo !!! Compile with gch
g++ -ansi -Werror -pedantic -Winvalid-pch -o test.o -c test.cc

----X8----------------------------------
generate for me output:

rm: *.gch: No such file or directory
!!! Compile without gch
!!! GCH generation
!!! Compile with gch
test.cc:432:2: anonymous variadic macros were introduced in C99

May be this is platform specific case (FreeBSD 4.7)
I also don't link file position in my case.
I compile many my programs with same options and first recive this warning
only with PCH.

Vladimir


^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PCH bug] anonymous variadic macros were introduced in C99 warning at pch using
  2003-04-23 13:16 ` [PCH bug] anonymous variadic macros were introduced in C99 warning at pch using Vladimir Merzliakov
  2003-04-23 18:52   ` Geoff Keating
@ 2003-04-23 21:03   ` Benjamin Kosnik
  1 sibling, 0 replies; 10+ messages in thread
From: Benjamin Kosnik @ 2003-04-23 21:03 UTC (permalink / raw)
  To: Vladimir Merzliakov; +Cc: libstdc++, gcc

I get 

%COMP.sh "-ansi -pedantic" test.cc
test.cc:720:2: warning: anonymous variadic macros were introduced in C99

with/without the PCH. I don't think the PCH has anything to do with this.

-benjamin

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PCH bug] anonymous variadic macros were introduced in C99 warning at pch using
  2003-04-23 19:13     ` Vladimir Merzliakov
@ 2003-04-23 22:20       ` Geoff Keating
  2003-04-23 22:35         ` Vladimir Merzliakov
  0 siblings, 1 reply; 10+ messages in thread
From: Geoff Keating @ 2003-04-23 22:20 UTC (permalink / raw)
  To: Vladimir Merzliakov; +Cc: gcc


Please see <http://gcc.gnu.org/bugs.html> for how to report a bug.

-- 
- Geoffrey Keating <geoffk@geoffk.org>

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PCH bug] anonymous variadic macros were introduced in C99 warning at pch using
  2003-04-23 22:20       ` Geoff Keating
@ 2003-04-23 22:35         ` Vladimir Merzliakov
  2003-04-24  3:20           ` Geoff Keating
  0 siblings, 1 reply; 10+ messages in thread
From: Vladimir Merzliakov @ 2003-04-23 22:35 UTC (permalink / raw)
  To: Geoff Keating; +Cc: gcc

> 
> Please see <http://gcc.gnu.org/bugs.html> for how to report a bug.
> 
PR10470



^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PCH bug] anonymous variadic macros were introduced in C99 warning at pch using
  2003-04-23 22:35         ` Vladimir Merzliakov
@ 2003-04-24  3:20           ` Geoff Keating
  0 siblings, 0 replies; 10+ messages in thread
From: Geoff Keating @ 2003-04-24  3:20 UTC (permalink / raw)
  To: wanderer; +Cc: gcc

> From: "Vladimir Merzliakov" <wanderer@rsu.ru>
> Cc: <gcc@gcc.gnu.org>
> Date: Thu, 24 Apr 2003 01:50:01 +0400
> X-Priority: 3
> X-MSMail-Priority: Normal
> X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165
> X-OriginalArrivalTime: 23 Apr 2003 21:50:43.0718 (UTC) FILETIME=[63BE4A60:01C309E2]
> 
> > 
> > Please see <http://gcc.gnu.org/bugs.html> for how to report a bug.
> > 
> PR10470

Could you please read *all* the page?  In particular, the part about
'Summarized bug reporting instructions', and 'what we do not want'.

-- 
- Geoffrey Keating <geoffk@geoffk.org>

^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2003-04-24  1:09 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-04-15 18:00 using stdc++.h.gch Benjamin Kosnik
2003-04-15 20:39 ` Geoff Keating
2003-04-15 20:50   ` Benjamin Kosnik
2003-04-23 13:16 ` [PCH bug] anonymous variadic macros were introduced in C99 warning at pch using Vladimir Merzliakov
2003-04-23 18:52   ` Geoff Keating
2003-04-23 19:13     ` Vladimir Merzliakov
2003-04-23 22:20       ` Geoff Keating
2003-04-23 22:35         ` Vladimir Merzliakov
2003-04-24  3:20           ` Geoff Keating
2003-04-23 21:03   ` Benjamin Kosnik

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).