This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Don't use LANGUAGE_C in CLooG (PR bootstrap/49797)
- From: Rainer Orth <ro at CeBiTec dot Uni-Bielefeld dot DE>
- To: gcc-patches at gcc dot gnu dot org
- Cc: Tobias Grosser <grosser at fim dot uni-passau dot de>, Sebastian Pop <sebastian dot pop at amd dot com>
- Date: Thu, 21 Jul 2011 14:37:56 +0200
- Subject: Don't use LANGUAGE_C in CLooG (PR bootstrap/49797)
As described in the PR, the use of LANGUAGE_C in CLooG breaks C++
bootstrap on IRIX 6.5. Both MIPS and Alpha C compilers predefine
LANGUAGE_C themselves, which clashes with the CLooG macro in
<cloog/pprint.h>. In a bootstrap with C++, LANGUAGE_C of course isn't
defined, so the symbol is missing.
As a hack, I had renamed that to CLOOG_LANGUAGE_C in the installed
CLooG headers, not noticing the use of LANGUAGE_C in
graphite-clast-to-gimple.c. Since this macro name is obviously far too
generic, I propose renaming it to CLOOG_LANGUAGE_C upstream.
The current patch accounts for such a change in gcc and allows the
mips-sgi-irix6.5 bootstrap to continue.
What's the best way forward from here? Could one of you propose that
upstream? Is the patch below ok for mainline?
Thanks.
Rainer
2011-07-20 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
PR bootstrap/49797
* graphite-clast-to-gimple.c (CLOOG_LANGUAGE_C): Provide if missing.
(set_cloog_options): Use it.
diff --git a/gcc/graphite-clast-to-gimple.c b/gcc/graphite-clast-to-gimple.c
--- a/gcc/graphite-clast-to-gimple.c
+++ b/gcc/graphite-clast-to-gimple.c
@@ -1,5 +1,5 @@
/* Translation of CLAST (CLooG AST) to Gimple.
- Copyright (C) 2009, 2010 Free Software Foundation, Inc.
+ Copyright (C) 2009, 2010, 2011 Free Software Foundation, Inc.
Contributed by Sebastian Pop <sebastian.pop@amd.com>.
This file is part of GCC.
@@ -40,6 +40,10 @@ along with GCC; see the file COPYING3.
#include "graphite-dependences.h"
#include "graphite-cloog-compat.h"
+#ifndef CLOOG_LANGUAGE_C
+#define CLOOG_LANGUAGE_C LANGUAGE_C
+#endif
+
/* This flag is set when an error occurred during the translation of
CLAST to Gimple. */
static bool gloog_error;
@@ -1306,7 +1310,7 @@ set_cloog_options (void)
/* Change cloog output language to C. If we do use FORTRAN instead, cloog
will stop e.g. with "ERROR: unbounded loops not allowed in FORTRAN.", if
we pass an incomplete program to cloog. */
- options->language = LANGUAGE_C;
+ options->language = CLOOG_LANGUAGE_C;
/* Enable complex equality spreading: removes dummy statements
(assignments) in the generated code which repeats the
--
-----------------------------------------------------------------------------
Rainer Orth, Center for Biotechnology, Bielefeld University