This is the mail archive of the libstdc++@gcc.gnu.org mailing list for the libstdc++ 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]

Re: PATCH: Install four PCH files instead of one


>> I think the fallout will be pretty minimal, but I'd like to get a round
>> of testing in before Friday and the weekend sets in.
>
>Agreed.

OK. It's in.

>To ensure that flags are properly overrode in all cases, I changed the
>list to: "-O0 -g0", "-O2 -g0", "-O0 -g", "-O2 -g".

Sounds good.

>How about this (perhaps better than adding -Winvalid-pch when you have
>multiple PCH options to reduce the noise; and documented as a valid
>technique):
>
>	echo '#error Failure to use PCH file as requested.' > ${pch_input}; \
>
>A #warning might be better still.  Perhaps, when multiple PCH files
>are consider, no reason should be presented why 3/4 don't work.  If
>4/4 don't work then dump all reasons.

I guess my use of pch_input is unclear.

pch_input == stdc++.h
pch_output == stdc++.h.gch

That part is ok. However, $(src)/*/$(pch_input) is an include file that
includes all the C++ includes. And $(bld)/*/$(pch_input) is an empty file.

Note that ${pch_input} isn't installed, and on purpose. I'd toyed with
not even having it, but then for 26_numerics/complex_value (and the
thread tests, which pass -pthread), which is compiled with -O0, the one
generated pch file can't be used. Since "-include $bld/$(pch_output)" is
passed to all testsuite files, if $(pch_output) cannot be used, and
there isn't some $(pch_input) to use instead, compilation fails. This
just adds extra fails, when in reality nothing is really wrong, just
that the generated PCH file cannot be used.

Thus, the dummy file. Your solution is to instead make a bunch of PCH
files, each with different compilation options.

I'm not quite sure what to do. Part of me feels that PCH is an
optimization (and a useful one), and that if it doesn't work 100% of the
time, and that a silent failure when attempting to use it still results
in correct behavior, well then.... not something to get crazy about. 

I'm not quite sure what people expect with PCH, or what other's
experiences are. I am unaware of EDG based compilers shipping with a PCH
at all, assuming that the end users will do what is best for them, and I
think that Metrowerks just ships one (but that it works for all
optimization levels?) What does Apple do?

I do wish that -H showed what was going on though, so that figuring out
when a given PCH file is being used (in the current scenario) or which
PCH is being used (in the scenario you suggest) would be a
straightforward proposition. Patches accepted, I'm sure...

>I have a patch from Geoff
>(only required for dwarf2 machines) to fix some but not all remaining
>current PCH issues visible on this port.

Any chance these could go in as you find them?

best,
benjamin


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