This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug fortran/63413] cpp trying to expand "vector" word in commented line in fortran file on power8
- From: "burnus at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Wed, 10 Dec 2014 08:58:42 +0000
- Subject: [Bug fortran/63413] cpp trying to expand "vector" word in commented line in fortran file on power8
- Auto-submitted: auto-generated
- References: <bug-63413-4 at http dot gcc dot gnu dot org/bugzilla/>
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=63413
Tobias Burnus <burnus at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |burnus at gcc dot gnu.org
--- Comment #3 from Tobias Burnus <burnus at gcc dot gnu.org> ---
By the way,
cpp -dM </dev/null
shows all predefined macros - there should be also a definition for 'vector', I
presume. (On my system, there isn't.)
You could try processing the file with "-undef", which should drastically
reduce the number of defines.
OR, looking at the code below, you could try: -std= (such as "c90", cf. "man
cpp"), which seems to disable the "vector" expansion.
What's missing is a proper Fortran support in libcpp, which is able to handle
Fortran comments etc. That's tracked, e.g., in PR 28662.
* * *
Code wise, it comes from the following code in gcc/config/spu/spu-c.c:
if (!flag_iso)
{
/* Define this when supporting context-sensitive keywords. */
cpp_define (pfile, "__VECTOR_KEYWORD_SUPPORTED__");
cpp_define (pfile, "vector=vector");
/* Initialize vector keywords. */
__vector_keyword = get_identifier ("__vector");
C_CPP_HASHNODE (__vector_keyword)->flags |= NODE_CONDITIONAL;
vector_keyword = get_identifier ("vector");
C_CPP_HASHNODE (vector_keyword)->flags |= NODE_CONDITIONAL;
/* Enable context-sensitive macros. */
cpp_get_callbacks (pfile)->macro_to_expand = spu_macro_to_expand;
}