This is the mail archive of the
gcc-prs@gcc.gnu.org
mailing list for the GCC project.
Re: preprocessor/2948
- To: nobody at gcc dot gnu dot org
- Subject: Re: preprocessor/2948
- From: Sean McNeil <sean at mcneil dot com>
- Date: 29 May 2001 01:56:01 -0000
- Cc: gcc-prs at gcc dot gnu dot org,
- Reply-To: Sean McNeil <sean at mcneil dot com>
The following reply was made to PR preprocessor/2948; it has been noted by GNATS.
From: Sean McNeil <sean@mcneil.com>
To: Neil Booth <neil@daikokuya.demon.co.uk>
Cc: nobody@gcc.gnu.org, gcc-gnats@gcc.gnu.org
Subject: Re: preprocessor/2948
Date: Mon, 28 May 2001 18:54:22 -0700
Neil,
This has puzzled me for a while and I've tried several additional things as we've been
discussing this. I noticed that the cc1plus program installs handlers for various
pragmas and discovered a #pragma implementation in PlotFile.cpp. When I remove this
pragma, compilation is as I expected.
HOWEVER.... there is no template code that exists within the ttt.ii file (after
preprocessor) and adding a #pragma implementation to ttt.cc (copy of ttt.ii) doesn't
reproduce the problem either. So I am still at a loss as to why
1) there is a #pragma implementation in this file (Something I do not expect anyone on
the gcc team to answer :).
2) why code is generated for the pragma even though -fexternal-templates was not
defined.
I suppose what it boils down to is it's not a cpp problem, but a cc1plus problem.
Should this be reassigned?
Sean
Neil Booth wrote:
> Hi Sean,
>
> The command lines look identical in their effects to me. I honestly
> have no idea what is going wrong. I'll leave your bug report open, of
> course.
>
> If you could narrow it down by removing code and / or command line
> options until the difference in behaviour vanishes, it would help a
> lot. Otherwise this kind of thing, by its very nature, is hard to
> get a grip on.
>
> Neil.
>
> Sean McNeil wrote:-
>
> > Here is the information you requested.
>
> > I've also tried running the code through with the -E option twice
> > to see if the cpp is changing the code in any way in the second
> > pass-through. The only difference was in some white space and diff
> > -cb shows no differences. I was under the impression that the cpp
> > is now a library invoked directly from the different modules
> > (C,C++,etc.). Could it be that the format/switches used between how
> > the cpp is invoked with the -E option and without it are different?
> > The -v option indicates that cpp0 is not called so it must now get
> > used by cc1plus directly.
> >
> > [root@blue libstdcxx]# arm-wrs-vxworks-g++ -S -v -mcpu=arm8 -mapcs-32
> > -mlittle-endian -ansi -nostdinc -fno-implicit-templates -DVXW_EXPLICIT_TEMPLATES
> > -O2 -mno-sched-prolog -I/usr/wind/target/h -DCPU=ARMARCH4 -DARMEL -fno-exceptions
> > -o /tmp/ttt-bad.s PlotFile.cpp
> > Reading specs from
> > /usr/wind/host/x86-freebsd/lib/gcc-lib/arm-wrs-vxworks/3.1/specs
> > Configured with: ../configure --prefix=/usr/wind/host/x86-freebsd
> > --target=arm-wrs-vxworks
> > Thread model: vxworks
> > gcc version 3.1 20010525 (experimental)
> > /usr/wind/host/x86-freebsd/lib/gcc-lib/arm-wrs-vxworks/3.1/cc1plus -nostdinc -v
> > -I/usr/wind/target/h -D__GNUC__=3 -D__GNUC_MINOR__=1 -D__GNUC_PATCHLEVEL__=0
> > -D__vxworks -D__arm__ -D__svr4__ -Acpu=arm -Amachine=arm -D__CHAR_UNSIGNED__
> > -D__OPTIMIZE__ -D__STDC_HOSTED__=1 -D__ARM_ARCH_4__ -D__APCS_32__ -D__ARMEL__
> > -D__CPU__=ARMARCH4 -D__arm__ -DVXW_EXPLICIT_TEMPLATES -DCPU=ARMARCH4 -DARMEL
> > PlotFile.cpp -D__GNUG__=3 -D_GNU_SOURCE -D__DEPRECATED -D__GXX_ABI_VERSION=100
> > -D__STRICT_ANSI__ -trigraphs -$ -quiet -dumpbase PlotFile.cpp -mcpu=arm8 -mapcs-32
> > -mlittle-endian -mno-sched-prolog -ansi -O2 -ansi -version -fno-implicit-templates
> > -fno-exceptions -o /tmp/ttt-bad.s
> > GNU CPP version 3.1 20010525 (experimental) (cpplib) (ARM/COFF)
> > GNU C++ version 3.1 20010525 (experimental) (arm-wrs-vxworks)
> > compiled by GNU C version 2.95.3 [FreeBSD] 20010315 (release).
> > #include "..." search starts here:
> > #include <...> search starts here:
> > /usr/wind/target/h
> > End of search list.
> >
> >
> > [root@blue libstdcxx]# arm-wrs-vxworks-g++ -E -v -mcpu=arm8 -mapcs-32
> > -mlittle-endian -ansi -nostdinc -fno-implicit-templates -DVXW_EXPLICIT_TEMPLATES
> > -O2 -mno-sched-prolog -I/usr/wind/target/h -DCPU=ARMARCH4 -DARMEL -fno-exceptions
> > -o /tmp/ttt.ii PlotFile.cpp
> > Reading specs from
> > /usr/wind/host/x86-freebsd/lib/gcc-lib/arm-wrs-vxworks/3.1/specs
> > Configured with: ../configure --prefix=/usr/wind/host/x86-freebsd
> > --target=arm-wrs-vxworks
> > Thread model: vxworks
> > gcc version 3.1 20010525 (experimental)
> > /usr/wind/host/x86-freebsd/lib/gcc-lib/arm-wrs-vxworks/3.1/cpp0 -lang-c++
> > -D_GNU_SOURCE -D__GNUG__=3 -D__DEPRECATED -D__GXX_ABI_VERSION=100
> > -D__STRICT_ANSI__ -trigraphs -$ -nostdinc -v -I/usr/wind/target/h -D__GNUC__=3
> > -D__GNUC_MINOR__=1 -D__GNUC_PATCHLEVEL__=0 -D__vxworks -D__arm__ -D__svr4__
> > -Acpu=arm -Amachine=arm -D__CHAR_UNSIGNED__ -D__OPTIMIZE__ -D__STDC_HOSTED__=1
> > -D__ARM_ARCH_4__ -D__APCS_32__ -D__ARMEL__ -D__CPU__=ARMARCH4 -D__arm__
> > -DVXW_EXPLICIT_TEMPLATES -DCPU=ARMARCH4 -DARMEL PlotFile.cpp -o /tmp/ttt.ii
> > GNU CPP version 3.1 20010525 (experimental) (cpplib) (ARM/COFF)
> > #include "..." search starts here:
> > #include <...> search starts here:
> > /usr/wind/target/h
> > End of search list.
> >
> > [root@blue libstdcxx]# arm-wrs-vxworks-g++ -S -v -mcpu=arm8 -mapcs-32
> > -mlittle-endian -ansi -nostdinc -fno-implicit-templates -DVXW_EXPLICIT_TEMPLATES
> > -O2 -mno-sched-prolog -I/usr/wind/target/h -DCPU=ARMARCH4 -DARMEL -fno-exceptions
> > -o /tmp/ttt.s /tmp/ttt.ii
> > Reading specs from
> > /usr/wind/host/x86-freebsd/lib/gcc-lib/arm-wrs-vxworks/3.1/specs
> > Configured with: ../configure --prefix=/usr/wind/host/x86-freebsd
> > --target=arm-wrs-vxworks
> > Thread model: vxworks
> > gcc version 3.1 20010525 (experimental)
> > /usr/wind/host/x86-freebsd/lib/gcc-lib/arm-wrs-vxworks/3.1/cc1plus -fpreprocessed
> > /tmp/ttt.ii -quiet -dumpbase ttt.ii -mcpu=arm8 -mapcs-32 -mlittle-endian
> > -mno-sched-prolog -ansi -O2 -ansi -version -fno-implicit-templates -fno-exceptions
> > -o /tmp/ttt.s
> > GNU CPP version 3.1 20010525 (experimental) (cpplib) (ARM/COFF)
> > GNU C++ version 3.1 20010525 (experimental) (arm-wrs-vxworks)
> > compiled by GNU C version 2.95.3 [FreeBSD] 20010315 (release).