From patchwork Wed May 7 09:26:01 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Sandiford X-Patchwork-Id: 346454 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 EBFE514018F for ; Wed, 7 May 2014 19:26:17 +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:from :to:cc:subject:date:message-id:mime-version:content-type; q=dns; s=default; b=lmaE4M1grOMkL8OpdX95kvGTvRezzRa7Jo1EbbzbOFKALHOGkm mVUs6LDZdxb0pPRnkVJjuN0ALcXb/ZNaTX1Etitq/IxO61FMl06PtC3XLyqBN1vQ lGmUvG9qD1Ti7W3dACN2aggtLCrOmGtXB4np4Pt8ZdOqxXuvj0XGI2XtQ= 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:from :to:cc:subject:date:message-id:mime-version:content-type; s= default; bh=7jvpLPREvITUuWFaL471/nb1jGw=; b=o/fKwr0SPckE/nWjNAfg IdMe5E+3ylPFyJIV476T8SHHYhr5i65s6xL33M90gzL0vCWcYZkjtJbp6iII34fi YlF2b3te+zE+dgy4ofkVly4mQNCfb8kx+NFu2x21OLHVd1Co0H8EcomK8mXxK9IW 4i5bBdA1RgtN/dXowZA+Ijs= Received: (qmail 2645 invoked by alias); 7 May 2014 09:26:09 -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 2634 invoked by uid 89); 7 May 2014 09:26:08 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.2 required=5.0 tests=AWL, BAYES_00, FREEMAIL_FROM, RCVD_IN_DNSWL_LOW, SPF_PASS autolearn=ham version=3.3.2 X-HELO: mail-wg0-f48.google.com Received: from mail-wg0-f48.google.com (HELO mail-wg0-f48.google.com) (74.125.82.48) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-SHA encrypted) ESMTPS; Wed, 07 May 2014 09:26:06 +0000 Received: by mail-wg0-f48.google.com with SMTP id b13so698309wgh.19 for ; Wed, 07 May 2014 02:26:03 -0700 (PDT) X-Received: by 10.180.72.179 with SMTP id e19mr25019482wiv.61.1399454763822; Wed, 07 May 2014 02:26:03 -0700 (PDT) Received: from localhost ([2.26.169.52]) by mx.google.com with ESMTPSA id ej7sm30380102wib.9.2014.05.07.02.26.02 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 07 May 2014 02:26:02 -0700 (PDT) From: Richard Sandiford To: gcc-patches@gcc.gnu.org Mail-Followup-To: gcc-patches@gcc.gnu.org, ebotcazou@libertysurf.fr, rdsandiford@googlemail.com Cc: ebotcazou@libertysurf.fr Subject: PR 61084: SPARC fallout from wide-int merge Date: Wed, 07 May 2014 10:26:01 +0100 Message-ID: <87fvkm549i.fsf@talisman.default> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (gnu/linux) MIME-Version: 1.0 The DImode constant spliiter assigned the result of trunc_int_for_mode to an unsigned int rather than a HOST_WIDE_INT. This then produced const_ints that were zero-extended rather than sign-extended and tripped the assert: gcc_checking_assert (INTVAL (x.first) == sext_hwi (INTVAL (x.first), precision) || (x.second == BImode && INTVAL (x.first) == 1)); The other hunks are just by inspection, but I think gen_int_mode is preferred over GEN_INT when the mode is obvious. Tested by Rainer, who says that the boostrap now completes. OK to install? Thanks, Richard gcc/ PR target/61084 * config/sparc/sparc.md: Fix types of low and high in DI constant splitter. Use gen_int_mode in some other splitters. Index: gcc/config/sparc/sparc.md =================================================================== --- gcc/config/sparc/sparc.md 2014-05-07 10:15:23.051156294 +0100 +++ gcc/config/sparc/sparc.md 2014-05-07 10:15:27.922201361 +0100 @@ -1886,7 +1886,7 @@ (define_split emit_insn (gen_movsi (gen_lowpart (SImode, operands[0]), operands[1])); #else - unsigned int low, high; + HOST_WIDE_INT low, high; low = trunc_int_for_mode (INTVAL (operands[1]), SImode); high = trunc_int_for_mode (INTVAL (operands[1]) >> 32, SImode); @@ -4822,7 +4822,7 @@ (define_split [(set (match_dup 3) (match_dup 4)) (set (match_dup 0) (ior:SI (not:SI (match_dup 3)) (match_dup 1)))] { - operands[4] = GEN_INT (~INTVAL (operands[2])); + operands[4] = gen_int_mode (~INTVAL (operands[2]), SImode); }) (define_insn_and_split "*or_not_di_sp32" @@ -4899,7 +4899,7 @@ (define_split [(set (match_dup 3) (match_dup 4)) (set (match_dup 0) (not:SI (xor:SI (match_dup 3) (match_dup 1))))] { - operands[4] = GEN_INT (~INTVAL (operands[2])); + operands[4] = gen_int_mode (~INTVAL (operands[2]), SImode); }) (define_split @@ -4911,7 +4911,7 @@ (define_split [(set (match_dup 3) (match_dup 4)) (set (match_dup 0) (xor:SI (match_dup 3) (match_dup 1)))] { - operands[4] = GEN_INT (~INTVAL (operands[2])); + operands[4] = gen_int_mode (~INTVAL (operands[2]), SImode); }) ;; Split DImode logical operations requiring two instructions.