From patchwork Thu Jan 5 20:41:34 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Eric Botcazou X-Patchwork-Id: 134548 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]) by ozlabs.org (Postfix) with SMTP id 4EECEB6FB6 for ; Fri, 6 Jan 2012 07:44:45 +1100 (EST) Comment: DKIM? See http://www.dkim.org DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d=gcc.gnu.org; s=default; x=1326401086; h=Comment: DomainKey-Signature:Received:Received:Received:Received:Received: Received:From:To:Subject:Date:User-Agent:MIME-Version: Content-Type:Message-Id:Mailing-List:Precedence:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:Sender: Delivered-To; bh=B0a9I6VonKIxIVwK3xub2mX4+Cc=; b=BekgMoiz/ECVDu2 cF5ikcAELEs927eM5g+KSI0pMkUFRABBtB5TJkpwS+XJtKI5ZV1X/MKlGXY2KH7x RJAag1I+qsBAf8JJeQAmnvE9xmBAqxT1sZzqZiLXCREqBX2OvZRx3J3EJ+oJSBSU vVSMOvMWRw/2V398jsSlkoUY6Cik= Comment: DomainKeys? See http://antispam.yahoo.com/domainkeys DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=default; d=gcc.gnu.org; h=Received:Received:X-SWARE-Spam-Status:X-Spam-Check-By:Received:Received:Received:Received:From:To:Subject:Date:User-Agent:MIME-Version:Content-Type:Message-Id:Mailing-List:Precedence:List-Id:List-Unsubscribe:List-Archive:List-Post:List-Help:Sender:Delivered-To; b=CwHJ3ymqcgk8tm2h5Z+iKH/Jr961kgQjUMyQqaioq8lwcSWKhV6Ejz9ytTi28H 8qo6uA+xGnzh9eCFU7ba16uTkM8/Sk/mJRudEFQlU46vyv5ObzRaSM/bt2ZEMdDB ZeYZ03D0z2d7kQEemFVKl28eTBN2/SjL1memFL0Vk38YM=; Received: (qmail 6743 invoked by alias); 5 Jan 2012 20:44:42 -0000 Received: (qmail 6735 invoked by uid 22791); 5 Jan 2012 20:44:41 -0000 X-SWARE-Spam-Status: No, hits=-1.9 required=5.0 tests=AWL,BAYES_00 X-Spam-Check-By: sourceware.org Received: from mel.act-europe.fr (HELO mel.act-europe.fr) (194.98.77.210) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Thu, 05 Jan 2012 20:44:27 +0000 Received: from localhost (localhost [127.0.0.1]) by filtered-smtp.eu.adacore.com (Postfix) with ESMTP id EEA63CB2B43 for ; Thu, 5 Jan 2012 21:44:26 +0100 (CET) Received: from mel.act-europe.fr ([127.0.0.1]) by localhost (smtp.eu.adacore.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id lSwL4fq+62nK for ; Thu, 5 Jan 2012 21:44:26 +0100 (CET) Received: from [192.168.1.2] (bon31-6-88-161-99-133.fbx.proxad.net [88.161.99.133]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mel.act-europe.fr (Postfix) with ESMTP id B61F1CB2B38 for ; Thu, 5 Jan 2012 21:44:26 +0100 (CET) From: Eric Botcazou To: gcc-patches@gcc.gnu.org Subject: couple of cosmetic fixes in tree-vrp.c Date: Thu, 5 Jan 2012 21:41:34 +0100 User-Agent: KMail/1.9.9 MIME-Version: 1.0 Message-Id: <201201052141.34817.ebotcazou@adacore.com> 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 This removes a duplicated if (code == RSHIFT_EXPR) condition in extract_range_from_binary_expr_1 and avoids useless computations in extract_range_from_unary_expr_1. No functional changes. Tested on i586-suse-linux, applied on the mainline as obvious. 2012-01-05 Eric Botcazou * tree-vrp.c (extract_range_from_binary_expr_1): Remove duplicated condition. (extract_range_from_unary_expr_1): Avoid useless computations. Index: tree-vrp.c =================================================================== --- tree-vrp.c (revision 182780) +++ tree-vrp.c (working copy) @@ -2579,17 +2579,13 @@ extract_range_from_binary_expr_1 (value_ behavior from the shift operation. We cannot even trust SHIFT_COUNT_TRUNCATED at this stage, because that applies to rtl shifts, and the operation at the tree level may be widened. */ - if (code == RSHIFT_EXPR) + if (vr1.type != VR_RANGE + || !value_range_nonnegative_p (&vr1) + || TREE_CODE (vr1.max) != INTEGER_CST + || compare_tree_int (vr1.max, TYPE_PRECISION (expr_type) - 1) == 1) { - if (vr1.type != VR_RANGE - || !value_range_nonnegative_p (&vr1) - || TREE_CODE (vr1.max) != INTEGER_CST - || compare_tree_int (vr1.max, - TYPE_PRECISION (expr_type) - 1) == 1) - { - set_value_range_to_varying (vr); - return; - } + set_value_range_to_varying (vr); + return; } extract_range_from_multiplicative_op_1 (vr, code, &vr0, &vr1); @@ -2990,16 +2986,18 @@ extract_range_from_unary_expr_1 (value_r size_int (TYPE_PRECISION (outer_type))))))) { tree new_min, new_max; - new_min = force_fit_type_double (outer_type, - tree_to_double_int (vr0.min), - 0, false); - new_max = force_fit_type_double (outer_type, - tree_to_double_int (vr0.max), - 0, false); if (is_overflow_infinity (vr0.min)) new_min = negative_overflow_infinity (outer_type); + else + new_min = force_fit_type_double (outer_type, + tree_to_double_int (vr0.min), + 0, false); if (is_overflow_infinity (vr0.max)) new_max = positive_overflow_infinity (outer_type); + else + new_max = force_fit_type_double (outer_type, + tree_to_double_int (vr0.max), + 0, false); set_and_canonicalize_value_range (vr, vr0.type, new_min, new_max, NULL); return;