From patchwork Thu May 23 07:38:08 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Uros Bizjak X-Patchwork-Id: 245832 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 337442C00AB for ; Thu, 23 May 2013 17:38:18 +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 :mime-version:date:message-id:subject:from:to:cc:content-type; q=dns; s=default; b=rg46lBI8qau64IEURRHCC8xnBiiwrcwuA79753EPCfh sW8+uMIB3rlaHbjfWONHqQc5NTdMlXPi7qat8CqZqbexaiEFQpQHefwYBBPIDfMg 2ntoLaJSQmwR8+RBTeZURZXqn152sWA26VKXbV/HUVnHfCfGYQKhtnC/SvCanGPg = 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 :mime-version:date:message-id:subject:from:to:cc:content-type; s=default; bh=3OwLeuBIyIqirNU61GST7jp1wdI=; b=s1k4IsAJ3XL2pUuaV 9YPa6yLTnNocn/lIaZZZxGUlTd+jxzN9ssbKJRpZjluu7DtgC3H8K6L4alnqX39j 5dsCaIn+lbBsI9mpoqLd0oE/uBZPbWdpt5uKpKoWkdSJKVwVPxa7tZa5hz3ynwM5 Lm0HVVmsxXjWI5RU5HQ3fl1MjQ= Received: (qmail 12640 invoked by alias); 23 May 2013 07:38:12 -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 12622 invoked by uid 89); 23 May 2013 07:38:10 -0000 X-Spam-SWARE-Status: No, score=-2.5 required=5.0 tests=AWL, BAYES_00, FREEMAIL_FROM, RCVD_IN_DNSWL_LOW, RCVD_IN_HOSTKARMA_YE, SPF_PASS, TW_ZJ autolearn=ham version=3.3.1 Received: from mail-pa0-f54.google.com (HELO mail-pa0-f54.google.com) (209.85.220.54) by sourceware.org (qpsmtpd/0.84/v0.84-167-ge50287c) with ESMTP; Thu, 23 May 2013 07:38:09 +0000 Received: by mail-pa0-f54.google.com with SMTP id kx1so2649186pab.41 for ; Thu, 23 May 2013 00:38:08 -0700 (PDT) MIME-Version: 1.0 X-Received: by 10.68.99.226 with SMTP id et2mr11467499pbb.91.1369294688131; Thu, 23 May 2013 00:38:08 -0700 (PDT) Received: by 10.70.2.164 with HTTP; Thu, 23 May 2013 00:38:08 -0700 (PDT) Date: Thu, 23 May 2013 09:38:08 +0200 Message-ID: Subject: [RFA PATCH, alpha]: Fix PR 57379, segfault in invalidate_any_buried_refs From: Uros Bizjak To: "gcc-patches@gcc.gnu.org" Cc: Richard Henderson X-Virus-Found: No Hello! As explained in the PR [1], alpha constructs a strange REG_EQUAL note for the TFmode xfloating compare call. A recent mainline change that tries to invalidate any buried refs trips on this note and segfaults on null expr_list terminator: (gdb) p debug_rtx (insn) (insn 65 64 66 2 (set (reg:DI 148) (reg:DI 0 $0)) ../../../gcc-svn/trunk/libgcc/libgcc2.c:1882 226 {*movdi} (expr_list:REG_DEAD (reg:DI 0 $0) (expr_list:REG_EQUAL (expr_list:REG_DEP_TRUE (symbol_ref:DI ("_OtsEqlX") [flags 0x41]) (expr_list:REG_DEP_TRUE (reg/v:TF 70 [ x ]) (expr_list:REG_DEP_TRUE (reg/v:TF 70 [ x ]) (nil)))) (nil)))) Proposed patch replaces expr_list sequence inside REG_EQUAL RTX with an unspec RTX. 2013-05-23 Uros Bizjak * config/alpha/alpha.md (unspec): Add UNSPEC_XFLT_COMPARE. * config/alpha/alpha.c (alpha_emit_xfloating_compare): Construct REG_EQUAL note as UNSPEC_XFLT_COMPARE unspec. Patch was bootstrapped and regression tested on alphaev68-linux-gnu. OK for mainline and release branches? [1] http://gcc.gnu.org/bugzilla/show_bug.cgi?id=57379 Uros. Index: config/alpha/alpha.md =================================================================== --- config/alpha/alpha.md (revision 199131) +++ config/alpha/alpha.md (working copy) @@ -23,6 +23,7 @@ ;; Uses of UNSPEC in this file: (define_c_enum "unspec" [ + UNSPEC_XFLT_COMPARE UNSPEC_ARG_HOME UNSPEC_LDGP1 UNSPEC_INSXH Index: config/alpha/alpha.c =================================================================== --- config/alpha/alpha.c (revision 199131) +++ config/alpha/alpha.c (working copy) @@ -3067,12 +3067,8 @@ alpha_emit_xfloating_compare (enum rtx_code *pcode operands[1] = op1; out = gen_reg_rtx (DImode); - /* What's actually returned is -1,0,1, not a proper boolean value, - so use an EXPR_LIST as with a generic libcall instead of a - comparison type expression. */ - note = gen_rtx_EXPR_LIST (VOIDmode, op1, NULL_RTX); - note = gen_rtx_EXPR_LIST (VOIDmode, op0, note); - note = gen_rtx_EXPR_LIST (VOIDmode, func, note); + /* What's actually returned is -1,0,1, not a proper boolean value. */ + note = gen_rtx_UNSPEC (DImode, gen_rtvec (2, op0, op1), UNSPEC_XFLT_COMPARE); alpha_emit_xfloating_libcall (func, out, operands, 2, note); return out;