From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 3492 invoked by alias); 1 Jul 2011 17:42:28 -0000 Received: (qmail 3463 invoked by uid 22791); 1 Jul 2011 17:42:27 -0000 X-SWARE-Spam-Status: No, hits=-1.8 required=5.0 tests=AWL,BAYES_00,T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from mail.codesourcery.com (HELO mail.codesourcery.com) (38.113.113.100) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Fri, 01 Jul 2011 17:42:13 +0000 Received: (qmail 13768 invoked from network); 1 Jul 2011 17:42:12 -0000 Received: from unknown (HELO ?84.152.209.23?) (bernds@127.0.0.2) by mail.codesourcery.com with ESMTPA; 1 Jul 2011 17:42:12 -0000 Message-ID: <4E0E06EC.3050709@codesourcery.com> Date: Fri, 01 Jul 2011 17:42:00 -0000 From: Bernd Schmidt User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.2.17) Gecko/20110505 Lightning/1.0b3pre Thunderbird/3.1.10 MIME-Version: 1.0 To: GCC Patches Subject: [11/11] Fix get_mode_bounds References: <4E0E0310.60406@codesourcery.com> In-Reply-To: <4E0E0310.60406@codesourcery.com> Content-Type: multipart/mixed; boundary="------------030906050503050703070502" 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: 2011-07/txt/msg00075.txt.bz2 This is a multi-part message in MIME format. --------------030906050503050703070502 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-length: 204 get_mode_bounds should also use GET_MODE_PRECISION, but this exposes a problem on ia64 - BImode needs to be handled specially here to work around another preexisting special case in gen_int_mode. Bernd --------------030906050503050703070502 Content-Type: text/plain; name="11-modebounds.diff" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="11-modebounds.diff" Content-length: 890 * stor-layout.c (get_mode_bounds): Use GET_MODE_PRECISION. Special case BImode. Index: gcc/stor-layout.c =================================================================== --- gcc/stor-layout.c.orig +++ gcc/stor-layout.c @@ -2439,11 +2439,26 @@ get_mode_bounds (enum machine_mode mode, enum machine_mode target_mode, rtx *mmin, rtx *mmax) { - unsigned size = GET_MODE_BITSIZE (mode); + unsigned size = GET_MODE_PRECISION (mode); unsigned HOST_WIDE_INT min_val, max_val; gcc_assert (size <= HOST_BITS_PER_WIDE_INT); + /* gen_int_mode performs an unwanted canonicalization for BImode. */ + if (mode == BImode) + { + if (sign) + { + *mmin = constm1_rtx; + *mmax = const0_rtx; + } + else + { + *mmin = const0_rtx; + *mmax = const1_rtx; + } + return; + } if (sign) { min_val = -((unsigned HOST_WIDE_INT) 1 << (size - 1)); --------------030906050503050703070502--