From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 12188 invoked by alias); 20 Jun 2013 14:36:24 -0000 Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org Received: (qmail 12164 invoked by uid 48); 20 Jun 2013 14:36:20 -0000 From: "win_wa at gmx dot net" To: gcc-bugs@gcc.gnu.org Subject: [Bug target/51654] C++ preprocessor bug with -maltivec and typedefs involving 'vector' Date: Thu, 20 Jun 2013 14:36:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: target X-Bugzilla-Version: 4.6.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: win_wa at gmx dot net X-Bugzilla-Status: WAITING X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: cc Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-SW-Source: 2013-06/txt/msg01106.txt.bz2 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=51654 Mathias Winkel changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |win_wa at gmx dot net --- Comment #6 from Mathias Winkel --- Unfortunately, the way the altivec extensions are defined still poses some issues when using the latest GNU C Preprocessor. The configure flags for my GCC are given below. We are using the cpp to preprocess some of our Fortran code that makes heavy use of variadic parameter macros etc. In one of our source files, there is a Fortran comment "! Separation vector". Here, the cpp recognizes 'vector' as a predefined macro (apparently with missing parameters, compare http://gcc.gnu.org/onlinedocs/gcc/PowerPC-AltiVec_002fVSX-Built_002din-Functions.html) and inserts a number of empty lines that prevent to Fortran code from being compileable. A reduced test example is: XXX@juqueen1:~/gcc-test/pepc $ cat testbla ! separation vector // separation vector ! separation vector int a // separation vector int a XXX@juqueen1:~/gcc-test/pepc $ cpp -P -C testbla ! separation vector // separation vector ! separation vector int a // separation vector int a Interestingly, nothing happens for 'vector int a', i.e. with trailing arguments or in C++ comments. One solution is to explicitly undefine 'vector': XXX@juqueen1:~/gcc-test/pepc $ cpp -P -C -Uvector testbla ! separation vector // separation vector ! separation vector int a // separation vector int a However, it would be more desireable of the code was just left unchanged of the 'vector ...' pattern is not matched or if it is found behind the exclamation mark that introduces Fortran comments. ====== GCC configure options: XXX@juqueen1:~/gcc-test $ cpp -v Using built-in specs. COLLECT_GCC=cpp Target: powerpc64-bgq-linux Configured with: ../gcc_source/configure --disable-bootstrap --prefix=/bgsys/local/gcc/4.9 --program-suffix= --program-prefix= --enable-lto --disable-checking --enable-shared --enable-threads=posix --target=powerpc64-bgq-linux --host=powerpc64-linux-gnu --build=powerpc64-linux-gnu --enable-secureplt --disable-libmudflap --disable-libspp --enable-languages=c,c++,fortran,lto --disable-multilib --with-long-double-128 --with-headers=/bgsys/drivers/ppcfloor//gnu-linux/powerpc64-bgq-linux//sys-include --with-libs=/bgsys/drivers/ppcfloor//gnu-linux/powerpc64-bgq-linux//lib --with-bin=/bgsys/drivers/ppcfloor//gnu-linux/powerpc64-bgq-linux//bin --with-sbin=/bgsys/drivers/ppcfloor//gnu-linux/powerpc64-bgq-linux//sbin : (reconfigured) ../gcc_source/configure --disable-bootstrap --prefix=/bgsys/local/gcc/4.9 --program-suffix= --program-prefix= --enable-lto --disable-checking --enable-shared --enable-threads=posix --target=powerpc64-bgq-linux --host=powerpc64-linux-gnu --build=powerpc64-linux-gnu --enable-secureplt --disable-libmudflap --disable-libspp --enable-languages=c,c++,fortran,lto --disable-multilib --with-long-double-128 --with-headers=/bgsys/drivers/ppcfloor//gnu-linux/powerpc64-bgq-linux//sys-include --with-libs=/bgsys/drivers/ppcfloor//gnu-linux/powerpc64-bgq-linux//lib --with-bin=/bgsys/drivers/ppcfloor//gnu-linux/powerpc64-bgq-linux//bin --with-sbin=/bgsys/drivers/ppcfloor//gnu-linux/powerpc64-bgq-linux//sbin Thread model: posix gcc version 4.9.0 20130620 (experimental) (GCC)