From patchwork Wed Oct 30 15:03:21 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vladimir Makarov X-Patchwork-Id: 287263 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 did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 3081F2C0109 for ; Thu, 31 Oct 2013 02:05:41 +1100 (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:date:from:mime-version:to:subject:content-type; q= dns; s=default; b=cvTYQek4ASMfQ3+Nm+I2xXqriae6yaCrqGA7bgwpT4jEi7 oNyIsm9QgruGhwEr7gKd/SeRbniFNIRm1iH8UMkHXyMk7bg8+7Jp/MXMsexhiT4R nKPb0OZEKVVcxbIUD0dMKbOmSXCkxEf12GAkpzoBMSCLvHkfZ+D9LOGMG6c7U= 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:date:from:mime-version:to:subject:content-type; s= default; bh=orW3GSMmePJKqG4wmQYTtA3e98o=; b=H0mqjuM3X09hZklMJg24 QY8aS4z+mcilLyUjD6xjZn8y6EJgLBHfeFlPLsOyOx/wjkvOtxPYHBgcwRhRABxg UgU0U481Ech+NDNyte6vF5litBv7wfSFSCMUoGLqQqETIOLd8OTdUEPFtlNy0oTR iTMrIVBo/4zztT2GNicdao0= Received: (qmail 7139 invoked by alias); 30 Oct 2013 15:05: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 7129 invoked by uid 89); 30 Oct 2013 15:05:32 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-4.6 required=5.0 tests=AWL, BAYES_00, RP_MATCHES_RCVD, SPF_HELO_PASS, SPF_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 ESMTP; Wed, 30 Oct 2013 15:05:27 +0000 Received: from int-mx02.intmail.prod.int.phx2.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id r9UF5POi031335 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Wed, 30 Oct 2013 11:05:26 -0400 Received: from Mair-2.local (vpn-51-71.rdu2.redhat.com [10.10.51.71]) by int-mx02.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id r9UF5OLW011885 for ; Wed, 30 Oct 2013 11:05:24 -0400 Message-ID: <52711FB9.7000802@redhat.com> Date: Wed, 30 Oct 2013 11:03:21 -0400 From: Vladimir Makarov User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.9; rv:24.0) Gecko/20100101 Thunderbird/24.0.1 MIME-Version: 1.0 To: GCC Patches Subject: patch to fix PR58784 (ARM LRA crash) X-IsSubscribed: yes The following patch fixes http://gcc.gnu.org/bugzilla/show_bug.cgi?id=58784 LRA has an old check of legitimate addresses. It was written before a newer address decomposition code which makes more correct checks of addresses. So I removed the old check. Committed as rev. 204215. 2013-10-30 Vladimir Makarov PR target/58784 * lra.c (check_rtl): Remove address check before LRA work. 2013-10-30 Vladimir Makarov PR target/58784 * gcc.target/arm/pr58784.c: New. Index: lra.c =================================================================== --- lra.c (revision 204131) +++ lra.c (working copy) @@ -2017,10 +2017,8 @@ static void check_rtl (bool final_p) { - int i; basic_block bb; rtx insn; - lra_insn_recog_data_t id; lra_assert (! final_p || reload_completed); FOR_EACH_BB (bb) @@ -2036,31 +2034,13 @@ lra_assert (constrain_operands (1)); continue; } + /* LRA code is based on assumption that all addresses can be + correctly decomposed. LRA can generate reloads for + decomposable addresses. The decomposition code checks the + correctness of the addresses. So we don't need to check + the addresses here. */ if (insn_invalid_p (insn, false)) fatal_insn_not_found (insn); - if (asm_noperands (PATTERN (insn)) >= 0) - continue; - id = lra_get_insn_recog_data (insn); - /* The code is based on assumption that all addresses in - regular instruction are legitimate before LRA. The code in - lra-constraints.c is based on assumption that there is no - subreg of memory as an insn operand. */ - for (i = 0; i < id->insn_static_data->n_operands; i++) - { - rtx op = *id->operand_loc[i]; - - if (MEM_P (op) - && (GET_MODE (op) != BLKmode - || GET_CODE (XEXP (op, 0)) != SCRATCH) - && ! memory_address_p (GET_MODE (op), XEXP (op, 0)) - /* Some ports don't recognize the following addresses - as legitimate. Although they are legitimate if - they satisfies the constraints and will be checked - by insn constraints which we ignore here. */ - && GET_CODE (XEXP (op, 0)) != UNSPEC - && GET_RTX_CLASS (GET_CODE (XEXP (op, 0))) != RTX_AUTOINC) - fatal_insn_not_found (insn); - } } } #endif /* #ifdef ENABLE_CHECKING */ Index: testsuite/gcc.target/arm/pr58784.c =================================================================== --- testsuite/gcc.target/arm/pr58784.c (revision 0) +++ testsuite/gcc.target/arm/pr58784.c (working copy) @@ -0,0 +1,18 @@ +/* { dg-do compile } */ +/* { dg-options "-march=armv7-a -mfloat-abi=hard -mfpu=neon -marm -O2" } */ + +typedef struct __attribute__ ((__packed__)) +{ + char valueField[2]; +} ptp_tlv_t; +typedef struct __attribute__ ((__packed__)) +{ + char stepsRemoved; + ptp_tlv_t tlv[1]; +} ptp_message_announce_t; +int ptplib_send_announce(int sequenceId, int i) +{ + ptp_message_announce_t tx_packet; + ((long long *)tx_packet.tlv[0].valueField)[sequenceId] = i; + f(&tx_packet); +}