From patchwork Tue Aug 6 17:55:45 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: David Malcolm X-Patchwork-Id: 265184 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]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client CN "localhost", Issuer "www.qmailtoaster.com" (not verified)) by ozlabs.org (Postfix) with ESMTPS id B91C52C00A3 for ; Wed, 7 Aug 2013 03:56:03 +1000 (EST) DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender :message-id:subject:from:to:cc:date:in-reply-to:references :content-type:mime-version; q=dns; s=default; b=Wi8jKaW78ojnkakq ZZ92skPCSrGNKvU6mEsN5S+OJR1N6mJCjY2DIT4HXAVmLDeiHl4KvpkQOmxnVL8P sXss0u1THE10lHHEdvIaM2Oasc+s77/UV08oNxSwtqRwOEkEBZ/IdNqfKLay0xJg hS51BgzSV+oAhTb5f3JLyTUWpVo= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender :message-id:subject:from:to:cc:date:in-reply-to:references :content-type:mime-version; s=default; bh=7WsWgu+zdEQ+soVA9VsDB1 ZnuaM=; b=cQBDKQgvcc2B1SIqXGMgMckZT8eeuTXfeQqI3Pvg2tRtaXN1Pfw251 REBHWMJNEXuk8cj4uGQ3/+IvBilOEK2VGv5wkN1oE4Z4zga2PnTI4wDfdpPYksY2 sXlIC+ttPCj5gsLghIwkOHT6g0XgjVUzreLVtWnCyNtDW5PL2MIHo= Received: (qmail 22935 invoked by alias); 6 Aug 2013 17:55:57 -0000 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 Received: (qmail 22910 invoked by uid 89); 6 Aug 2013 17:55:57 -0000 X-Spam-SWARE-Status: No, score=-5.4 required=5.0 tests=AWL, BAYES_00, KHOP_THREADED, RCVD_IN_HOSTKARMA_W, RCVD_IN_HOSTKARMA_WL, RDNS_NONE, SPF_HELO_PASS, SPF_PASS autolearn=no version=3.3.1 Received: from Unknown (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.84/v0.84-167-ge50287c) with ESMTP; Tue, 06 Aug 2013 17:55:56 +0000 Received: from int-mx10.intmail.prod.int.phx2.redhat.com (int-mx10.intmail.prod.int.phx2.redhat.com [10.5.11.23]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id r76HtmoD024986 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Tue, 6 Aug 2013 13:55:48 -0400 Received: from [10.18.25.132] ([10.18.25.132]) by int-mx10.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id r76HtkMw002915; Tue, 6 Aug 2013 13:55:47 -0400 Message-ID: <1375811745.5818.19.camel@surprise> Subject: [Patch] Unbreak build on mips (was Re: Passes are now C++ classes (was Re: [PATCH 03/11] Handwritten part of conversion of passes to C++ classes)) From: David Malcolm To: Steve Ellcey Cc: gcc-patches@gcc.gnu.org Date: Tue, 06 Aug 2013 13:55:45 -0400 In-Reply-To: <1375802194.1690.252.camel@ubuntu-sellcey> References: <1375736623.4994.193.camel@surprise> <1375802194.1690.252.camel@ubuntu-sellcey> Mime-Version: 1.0 X-Virus-Found: No On Tue, 2013-08-06 at 08:16 -0700, Steve Ellcey wrote: > On Mon, 2013-08-05 at 17:03 -0400, David Malcolm wrote: > > > Given all of the above testing I'm reasonably confident that this works. > > However this is such a large change [1] that there's a non-zero chance > > of at least one glitch - let me know if you see any breakages. > > The mips*-*-* targets are not building. It looks like the mips reorg > pass (pass_mips_machine_reorg2) in config/mips/mips.c was not converted > and/or was not converted correctly. Sorry about this. I was able to reproduce this build error with configure --target=mips-linux-elf: ../../src/gcc/config/mips/mips.c:16379:28: error: expected primary-expression before ‘.’ token I'm attaching a patch which fixes that issue for me. Only lightly tested (build&host=x86_64, target as above) - I'm able to build stage1, and cc1 appears to generate assembler on a simple test case. I stepped through the changed code in the debugger and it appears to do the right thing. However I'm not familiar with the internals of the pass in question. commit 11d46884e8bd9802b0f528a16b3970b4076fe8a9 Author: David Malcolm Date: Tue Aug 6 13:48:59 2013 -0400 gcc/ * config/mips/mips.c (insert_pass_mips_machine_reorg2): Move into... (mips_option_override): ...here, porting to new C++ API for passes. diff --git a/gcc/config/mips/mips.c b/gcc/config/mips/mips.c index 05ba003..4da80f4 100644 --- a/gcc/config/mips/mips.c +++ b/gcc/config/mips/mips.c @@ -56,6 +56,7 @@ along with GCC; see the file COPYING3. If not see #include "target-globals.h" #include "opts.h" #include "tree-pass.h" +#include "context.h" /* True if X is an UNSPEC wrapper around a SYMBOL_REF or LABEL_REF. */ #define UNSPEC_ADDRESS_P(X) \ @@ -16374,13 +16375,6 @@ make_pass_mips_machine_reorg2 (gcc::context *ctxt) return new pass_mips_machine_reorg2 (ctxt); } -struct register_pass_info insert_pass_mips_machine_reorg2 = -{ - &pass_mips_machine_reorg2.pass, /* pass */ - "dbr", /* reference_pass_name */ - 1, /* ref_pass_instance_number */ - PASS_POS_INSERT_AFTER /* po_op */ -}; /* Implement TARGET_ASM_OUTPUT_MI_THUNK. Generate rtl rather than asm text in order to avoid duplicating too much logic from elsewhere. */ @@ -17174,6 +17168,14 @@ mips_option_override (void) /* We register a second machine specific reorg pass after delay slot filling. Registering the pass must be done at start up. It's convenient to do it here. */ + opt_pass *new_pass = make_pass_mips_machine_reorg2 (g); + struct register_pass_info insert_pass_mips_machine_reorg2 = + { + new_pass, /* pass */ + "dbr", /* reference_pass_name */ + 1, /* ref_pass_instance_number */ + PASS_POS_INSERT_AFTER /* po_op */ + }; register_pass (&insert_pass_mips_machine_reorg2); if (TARGET_HARD_FLOAT_ABI && TARGET_MIPS5900)