From patchwork Thu Oct 22 19:18:29 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jeff Law X-Patchwork-Id: 534549 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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id B9B59141303 for ; Fri, 23 Oct 2015 06:18:39 +1100 (AEDT) Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b=ToeaJ2MG; dkim-atps=neutral DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:to :from:subject:message-id:date:mime-version:content-type; q=dns; s=default; b=p5A/KYDg/qdeIt1V1JSOs85fysPahTpdhJV/sB+YmS/ro/F9nH PM9NlVJKgD2meZWDFyHbIMFJsNmQW3cquMjXxolSInzJmqURiUVjLJ6Pn0IWIePN O4ug80JKjkErIsXaUQ7CXrgpRC+rE4KYPC+b+u96LEv4yMI3SEVWgLDD8= 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:to :from:subject:message-id:date:mime-version:content-type; s= default; bh=PM/BLERe1aUfEyaUxT2Bob86UaU=; b=ToeaJ2MG5O41B0HjvCiK 8nlF4csHNm7syoRSkivvQgs3ajuv72Y5ryBTVjCu1P9ntafynomy8Qbiy8gvGjW9 eMZSasialRHT7x9ov0XWmejlzzfevz0OgHlyR9cR9XIAV4pQplPoGbzfZ1N6BRRH tNA2NJLd/WDliHjQbRWrXVg= Received: (qmail 54460 invoked by alias); 22 Oct 2015 19:18:32 -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 54450 invoked by uid 89); 22 Oct 2015 19:18:32 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.7 required=5.0 tests=AWL, BAYES_00, RP_MATCHES_RCVD, SPF_HELO_PASS autolearn=ham version=3.3.2 X-HELO: mx1.redhat.com Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-GCM-SHA384 encrypted) ESMTPS; Thu, 22 Oct 2015 19:18:31 +0000 Received: from int-mx13.intmail.prod.int.phx2.redhat.com (int-mx13.intmail.prod.int.phx2.redhat.com [10.5.11.26]) by mx1.redhat.com (Postfix) with ESMTPS id 38DAC19CB89 for ; Thu, 22 Oct 2015 19:18:30 +0000 (UTC) Received: from localhost.localdomain (ovpn-113-75.phx2.redhat.com [10.3.113.75]) by int-mx13.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id t9MJIT3v004119 for ; Thu, 22 Oct 2015 15:18:30 -0400 To: gcc-patches@gcc.gnu.org From: Jeff Law Subject: [PATCH] Fix abort in write_eligible_delay Message-ID: <56293685.7040507@redhat.com> Date: Thu, 22 Oct 2015 13:18:29 -0600 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.3.0 MIME-Version: 1.0 X-IsSubscribed: yes Various ports are currently failing to build, faulting in write_eligible_delay. This can happen if the target has delay slots defined, but does not have annul-true or annul-false slots. cris is a reasonable example. This is most easily addressed by writing out a trivial dummy function if we don't have annul-true or annul-false slots. I've verified this fixes the 47 newly failing targets in config-list.mk and survives the usual bootstrap & comparison test on x86_64-linux-gnu. Installed on the trunk. Jeff commit 6119ad4e875ff0c856102c14b08d869c7d33b357 Author: law Date: Thu Oct 22 19:18:05 2015 +0000 [PATCH] Fix abort in write_eligible_delay * genattrtab.c (main): If we do not have any annul-true or annul-false slots, then write out a dummy eligible_for_annul_true or eligible_for_annul_false as needed. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@229184 138bc75d-0d04-0410-961f-82ee72b054a4 diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 08d26a9..04d8e16 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2015-10-22 Jeff Law + + * genattrtab.c (main): If we do not have any annul-true or annul-false + slots, then write out a dummy eligible_for_annul_true or + eligible_for_annul_false as needed. + 2015-10-22 Nick Clifton * config/msp430/msp430.opt: Add -msilicon-errata and diff --git a/gcc/genattrtab.c b/gcc/genattrtab.c index 8d1fa6c..32b837c 100644 --- a/gcc/genattrtab.c +++ b/gcc/genattrtab.c @@ -4411,6 +4411,26 @@ write_indent (FILE *outf, int indent) fprintf (outf, " "); } +/* If the target does not have annul-true or annul-false delay slots, this + function will create a dummy eligible_for function on OUTF which always + returns false. KIND will be annul_true or annul_false. */ + +static void +write_dummy_eligible_delay (FILE *outf, const char *kind) +{ + /* Write function prelude. */ + + fprintf (outf, "int\n"); + fprintf (outf, "eligible_for_%s (rtx_insn *delay_insn ATTRIBUTE_UNUSED,\n" + " int slot ATTRIBUTE_UNUSED,\n" + " rtx_insn *candidate_insn ATTRIBUTE_UNUSED,\n" + " int flags ATTRIBUTE_UNUSED)\n", + kind); + fprintf (outf, "{\n"); + fprintf (outf, " return 0;\n"); + fprintf (outf, "}\n\n"); +} + /* Write a subroutine that is given an insn that requires a delay slot, a delay slot ordinal, and a candidate insn. It returns nonzero if the candidate can be placed in the specified delay slot of the insn. @@ -5307,8 +5327,14 @@ main (int argc, char **argv) (The function to compute the number of delay slots will be written below.) */ write_eligible_delay (attr_file, "delay"); - write_eligible_delay (attr_file, "annul_true"); - write_eligible_delay (attr_file, "annul_false"); + if (have_annul_true) + write_eligible_delay (attr_file, "annul_true"); + else + write_dummy_eligible_delay (attr_file, "annul_true"); + if (have_annul_false) + write_eligible_delay (attr_file, "annul_false"); + else + write_dummy_eligible_delay (attr_file, "annul_false"); /* Write out constant delay slot info. */ write_const_num_delay_slots (attr_file);