From patchwork Thu Jul 21 12:37:56 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rainer Orth X-Patchwork-Id: 106036 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) by ozlabs.org (Postfix) with SMTP id 0BE34B6F62 for ; Thu, 21 Jul 2011 22:38:42 +1000 (EST) Received: (qmail 31333 invoked by alias); 21 Jul 2011 12:38:40 -0000 Received: (qmail 31310 invoked by uid 22791); 21 Jul 2011 12:38:39 -0000 X-SWARE-Spam-Status: No, hits=-2.4 required=5.0 tests=AWL, BAYES_00, RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from snape.CeBiTec.Uni-Bielefeld.DE (HELO smtp-relay.CeBiTec.Uni-Bielefeld.DE) (129.70.160.84) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Thu, 21 Jul 2011 12:38:01 +0000 Received: from localhost (localhost.CeBiTec.Uni-Bielefeld.DE [127.0.0.1]) by smtp-relay.CeBiTec.Uni-Bielefeld.DE (Postfix) with ESMTP id DC84B839; Thu, 21 Jul 2011 14:37:59 +0200 (CEST) Received: from smtp-relay.CeBiTec.Uni-Bielefeld.DE ([127.0.0.1]) by localhost (malfoy.CeBiTec.Uni-Bielefeld.DE [127.0.0.1]) (amavisd-new, port 10024) with LMTP id gSBojL7tjeiC; Thu, 21 Jul 2011 14:37:57 +0200 (CEST) Received: from manam.CeBiTec.Uni-Bielefeld.DE (manam.CeBiTec.Uni-Bielefeld.DE [129.70.161.120]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by smtp-relay.CeBiTec.Uni-Bielefeld.DE (Postfix) with ESMTPS id C40CA838; Thu, 21 Jul 2011 14:37:57 +0200 (CEST) Received: (from ro@localhost) by manam.CeBiTec.Uni-Bielefeld.DE (8.14.5+Sun/8.14.5/Submit) id p6LCbuaM002787; Thu, 21 Jul 2011 14:37:56 +0200 (MEST) From: Rainer Orth To: gcc-patches@gcc.gnu.org Cc: Tobias Grosser , Sebastian Pop Subject: Don't use LANGUAGE_C in CLooG (PR bootstrap/49797) Date: Thu, 21 Jul 2011 14:37:56 +0200 Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.3 (usg-unix-v) MIME-Version: 1.0 X-IsSubscribed: yes Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Delivered-To: mailing list gcc-patches@gcc.gnu.org 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 . 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 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 . 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