diff mbox

Don't use LANGUAGE_C in CLooG (PR bootstrap/49797)

Message ID yddpql3lsgr.fsf@manam.CeBiTec.Uni-Bielefeld.DE
State New
Headers show

Commit Message

Rainer Orth July 21, 2011, 12:37 p.m. UTC
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.

Comments

Sebastian Pop July 21, 2011, 4:09 p.m. UTC | #1
Hi,

On Thu, Jul 21, 2011 at 07:37, Rainer Orth <ro@cebitec.uni-bielefeld.de> wrote:
> 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.

I forwarded this question to the cloog-dev mailing list and they like
this change.

> 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?

Your patch is ok for GCC, please commit.
You can post a patch for CLooG on cloog-development@googlegroups.com
Don't forget to update the documentation of CLooG as well.

Thanks,
Sebastian

>
> 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
>
Tobias Grosser July 21, 2011, 4:58 p.m. UTC | #2
On 07/21/2011 06:09 PM, Sebastian Pop wrote:
> Hi,
>
> On Thu, Jul 21, 2011 at 07:37, Rainer Orth<ro@cebitec.uni-bielefeld.de>  wrote:
>> 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.
>
> I forwarded this question to the cloog-dev mailing list and they like
> this change.
>
>> 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?
>
> Your patch is ok for GCC, please commit.
> You can post a patch for CLooG on cloog-development@googlegroups.com
> Don't forget to update the documentation of CLooG as well.

I am about to post a patch to CLooG. I will take care of pushing it 
upstream.

Tobi
Rainer Orth July 22, 2011, 9:01 a.m. UTC | #3
Tobias,

>> Your patch is ok for GCC, please commit.
>> You can post a patch for CLooG on cloog-development@googlegroups.com
>> Don't forget to update the documentation of CLooG as well.
>
> I am about to post a patch to CLooG. I will take care of pushing it
> upstream.

Great, thanks.

	Rainer
diff mbox

Patch

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