From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 20187 invoked by alias); 18 Feb 2013 15:39:01 -0000 Received: (qmail 20085 invoked by uid 22791); 18 Feb 2013 15:39:01 -0000 X-SWARE-Spam-Status: No, hits=-1.9 required=5.0 tests=AWL,BAYES_00,RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from hiauly1.hia.nrc.ca (HELO hiauly1.hia.nrc.ca) (132.246.10.84) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Mon, 18 Feb 2013 15:38:47 +0000 Received: by hiauly1.hia.nrc.ca (Postfix, from userid 1000) id EFD294929; Mon, 18 Feb 2013 10:38:44 -0500 (EST) Date: Mon, 18 Feb 2013 15:39:00 -0000 From: John David Anglin To: gcc-patches@gcc.gnu.org Subject: [committed] Fix PR target/56214 Message-ID: <20130218153843.GA2139@hiauly1.hia.nrc.ca> Reply-To: John David Anglin MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.5.16 (2007-06-09) Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org X-SW-Source: 2013-02/txt/msg00850.txt.bz2 The attached change fixes PR target/56214. We need to reject everything but QImode and HImode when reload is in progress and strict is specified. Tested on hppa2.0w-hp-hpux11.11 and hppa64-hp-hpux11.11. Committed to trunk. Dave -- J. David Anglin dave.anglin@nrc-cnrc.gc.ca National Research Council of Canada (613) 990-0752 (FAX: 952-6602) 2013-02-18 John David Anglin PR target/56214 * config/pa/predicates.md (base14_operand): Except for BLKmode, QImode and HImode, require all displacements to be an integer multiple of their mode size. * config/pa/pa.c (pa_legitimate_address_p): For REG+BASE addresses, only allow QImode and HImode when reload is in progress and strict is true. Likewise for symbolic addresses. Use base14_operand to check displacements in REG+BASE addresses. Index: config/pa/predicates.md =================================================================== --- config/pa/predicates.md (revision 196102) +++ config/pa/predicates.md (working copy) @@ -272,22 +272,13 @@ assumed in the instruction encoding. */ switch (mode) { + case BLKmode: case QImode: case HImode: return true; - case SImode: - case SFmode: - case SCmode: - return (INTVAL (op) % 4) == 0; - - case DImode: - case DFmode: - case DCmode: - return (INTVAL (op) % 8) == 0; - default: - break; + return (INTVAL (op) % GET_MODE_SIZE (mode)) == 0; } return false; Index: config/pa/pa.c =================================================================== --- config/pa/pa.c (revision 196102) +++ config/pa/pa.c (working copy) @@ -10517,21 +10532,13 @@ the majority of accesses will use floating point instructions that don't support 14-bit offsets. */ if (!INT14_OK_STRICT - && (GET_MODE_CLASS (mode) == MODE_FLOAT - || (reload_in_progress - && strict - && (mode == SImode || mode == DImode)))) - return false; + && reload_in_progress + && strict + && mode != QImode + && mode != HImode) + return false; - if (INT_14_BITS (index) - && (mode == BLKmode - || mode == QImode - || mode == HImode - /* Displacement must be a multiple of its size. */ - || (INTVAL (index) % GET_MODE_SIZE (mode)) == 0)) - return true; - - return false; + return base14_operand (index, mode); } if (!TARGET_DISABLE_INDEXING @@ -10586,11 +10593,11 @@ return true; if (!INT14_OK_STRICT - && (GET_MODE_CLASS (mode) == MODE_FLOAT - || (reload_in_progress - && strict - && (mode == SImode || mode == DImode)))) - return false; + && reload_in_progress + && strict + && mode != QImode + && mode != HImode) + return false; if (CONSTANT_P (XEXP (x, 1))) return true;