From patchwork Mon Oct 26 09:56:15 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Sandiford X-Patchwork-Id: 535794 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 EF1B814076B for ; Mon, 26 Oct 2015 20:56:34 +1100 (AEDT) Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b=V6juddur; dkim-atps=neutral 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:subject:date:message-id:mime-version:content-type :content-transfer-encoding; q=dns; s=default; b=H+462sEgWTg+Ydhh 8TRf3ZHlJbFpH6u6SOnjzMZj/GCSpX74VadAL3WHK8MAg2T60BQ7zQuppbFkZsKd uFh+i/qPh//R1AIDwIjGzY2HFHUcBwPTURJOzfavfjzHiJylkKiBYL8rMVppSATX 7WCFtH/V4nSavDZEHU+Ure6/T10= 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:subject:date:message-id:mime-version:content-type :content-transfer-encoding; s=default; bh=bQd7eNu/dbPu4siOU4PZUO 7nmig=; b=V6juddurTZ6GO/xQux0HxV1BxwY8AZPq/K05w5dKiWT+FoEd6rHbiD 8eVUEBEjyzGba7ki26RY0db8gc77djaTgJNK9IP+neTqLIIpM7D6g74aaiCJXFRX YDkEnZCLrrYfjGjoM/+ZHFSYbnBvKgfdMJxIqaIP2+t8HDEjUyOfU= Received: (qmail 30386 invoked by alias); 26 Oct 2015 09:56:23 -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 30310 invoked by uid 89); 26 Oct 2015 09:56:22 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.4 required=5.0 tests=AWL, BAYES_00, SPF_PASS autolearn=ham version=3.3.2 X-HELO: eu-smtp-delivery-143.mimecast.com Received: from eu-smtp-delivery-143.mimecast.com (HELO eu-smtp-delivery-143.mimecast.com) (207.82.80.143) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Mon, 26 Oct 2015 09:56:21 +0000 Received: from cam-owa1.Emea.Arm.com (fw-tnat.cambridge.arm.com [217.140.96.140]) by eu-smtp-1.mimecast.com with ESMTP id uk-mta-20-Dp3az_aCTwWqY96tDeDKWQ-1; Mon, 26 Oct 2015 09:56:16 +0000 Received: from localhost ([10.1.2.79]) by cam-owa1.Emea.Arm.com with Microsoft SMTPSVC(6.0.3790.3959); Mon, 26 Oct 2015 09:56:16 +0000 From: Richard Sandiford To: gcc-patches@gcc.gnu.org Mail-Followup-To: gcc-patches@gcc.gnu.org, richard.sandiford@arm.com Subject: Remove constant handling from fold_builtin_{,f}abs Date: Mon, 26 Oct 2015 09:56:15 +0000 Message-ID: <8737wyvtq8.fsf@e105548-lin.cambridge.arm.com> User-Agent: Gnus/5.130012 (Ma Gnus v0.12) Emacs/24.3 (gnu/linux) MIME-Version: 1.0 X-MC-Unique: Dp3az_aCTwWqY96tDeDKWQ-1 fold_builtin_fabs and fold_builtin_abs had code to handle constant arguments, but this simply duplicated what the following fold_build1_loc would do for ABS_EXPR. Tested on x86_64-linux-gnu, aarch64-linux-gnu and arm-linux-gnueabi. OK to install? Thanks, Richard gcc/ * builtins.c (fold_builtin_fabs): Remove constant handling. (fold_builtin_abs): Likewise. diff --git a/gcc/builtins.c b/gcc/builtins.c index ed0030d..a03dffc 100644 --- a/gcc/builtins.c +++ b/gcc/builtins.c @@ -7847,8 +7847,6 @@ fold_builtin_fabs (location_t loc, tree arg, tree type) return NULL_TREE; arg = fold_convert_loc (loc, type, arg); - if (TREE_CODE (arg) == REAL_CST) - return fold_abs_const (arg, type); return fold_build1_loc (loc, ABS_EXPR, type, arg); } @@ -7861,8 +7859,6 @@ fold_builtin_abs (location_t loc, tree arg, tree type) return NULL_TREE; arg = fold_convert_loc (loc, type, arg); - if (TREE_CODE (arg) == INTEGER_CST) - return fold_abs_const (arg, type); return fold_build1_loc (loc, ABS_EXPR, type, arg); }