From patchwork Tue May 14 11:23:45 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marc Glisse X-Patchwork-Id: 243683 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 D88F92C00B5 for ; Tue, 14 May 2013 21:23:55 +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:date :from:to:subject:message-id:mime-version:content-type; q=dns; s= default; b=MQWnYoAj+XWM84K1sN9tCoF2yTTbFSqiclmkZmRFR4R8TVt/9kty3 fgD+z/5LkhCf0xsTVARPX8s8x/wY1qlLTI7/n5ERWYnlmWjiAO+C301zc6nJy/kC Tu+gLZVMcRT1ygHm1rT1qH4ospHHGWfLOkM4reDOarXHcZ7PNw542E= 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:date :from:to:subject:message-id:mime-version:content-type; s= default; bh=s3F6gjD+vVGCDHypCdRTI6F9gTM=; b=RFlUMQOl0cS8bZVqRyyb VKg/Kr5xBrAn1Sq5FpwTipCzHjNYf7c86+1ppnqUiRt+9Cs8XnoeGS9Hf5XmBCI+ ScyXceLLktsCnY4hctb2Z5vJuBXb6LYIbbcljkYuUfK+RXLdtZmbY2bM+JZWwUkH Hz1dgrT9q12JvGG1O6nwRMg= Received: (qmail 16631 invoked by alias); 14 May 2013 11:23:50 -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 16622 invoked by uid 89); 14 May 2013 11:23:49 -0000 X-Spam-SWARE-Status: No, score=-5.2 required=5.0 tests=AWL, BAYES_00, RP_MATCHES_RCVD autolearn=ham version=3.3.1 Received: from mail2-relais-roc.national.inria.fr (HELO mail2-relais-roc.national.inria.fr) (192.134.164.83) by sourceware.org (qpsmtpd/0.84/v0.84-167-ge50287c) with ESMTP; Tue, 14 May 2013 11:23:48 +0000 Received: from stedding.saclay.inria.fr ([193.55.250.194]) by mail2-relais-roc.national.inria.fr with ESMTP/TLS/DHE-RSA-AES128-SHA; 14 May 2013 13:23:45 +0200 Received: from glisse (helo=localhost) by stedding.saclay.inria.fr with local-esmtp (Exim 4.80) (envelope-from ) id 1UcDKb-0001pC-Kr for gcc-patches@gcc.gnu.org; Tue, 14 May 2013 13:23:45 +0200 Date: Tue, 14 May 2013 13:23:45 +0200 (CEST) From: Marc Glisse To: gcc-patches@gcc.gnu.org Subject: Restore m68k bootstrap Message-ID: User-Agent: Alpine 2.02 (DEB 1266 2009-07-14) MIME-Version: 1.0 X-Virus-Found: No Hello, in an earlier patch I apparently introduced a platform dependent signed / unsigned comparison, so here is a fix. I am taking the chance to fix the host_integerp second argument nearby: we want non-negative integers. Passes bootstrap+testsuite on x86_64-linux-gnu and apparently bootstrap on m68k. 2013-05-13 Marc Glisse PR bootstrap/57266 * fold-const.c (fold_binary_loc) : Use an unsigned variable for the shift amount. Check that we shift by non-negative amounts. Index: gcc/fold-const.c =================================================================== --- gcc/fold-const.c (revision 198853) +++ gcc/fold-const.c (working copy) @@ -12416,27 +12416,27 @@ fold_binary_loc (location_t loc, return fold_build2_loc (loc, code, type, op0, tem); /* Since negative shift count is not well-defined, don't try to compute it in the compiler. */ if (TREE_CODE (arg1) == INTEGER_CST && tree_int_cst_sgn (arg1) < 0) return NULL_TREE; prec = element_precision (type); /* Turn (a OP c1) OP c2 into a OP (c1+c2). */ - if (TREE_CODE (op0) == code && host_integerp (arg1, false) + if (TREE_CODE (op0) == code && host_integerp (arg1, true) && TREE_INT_CST_LOW (arg1) < prec - && host_integerp (TREE_OPERAND (arg0, 1), false) + && host_integerp (TREE_OPERAND (arg0, 1), true) && TREE_INT_CST_LOW (TREE_OPERAND (arg0, 1)) < prec) { - HOST_WIDE_INT low = (TREE_INT_CST_LOW (TREE_OPERAND (arg0, 1)) - + TREE_INT_CST_LOW (arg1)); + unsigned int low = (TREE_INT_CST_LOW (TREE_OPERAND (arg0, 1)) + + TREE_INT_CST_LOW (arg1)); /* Deal with a OP (c1 + c2) being undefined but (a OP c1) OP c2 being well defined. */ if (low >= prec) { if (code == LROTATE_EXPR || code == RROTATE_EXPR) low = low % prec; else if (TYPE_UNSIGNED (type) || code == LSHIFT_EXPR) return omit_one_operand_loc (loc, type, build_zero_cst (type), TREE_OPERAND (arg0, 0));