From patchwork Thu Jul 8 15:23:46 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Eric Botcazou X-Patchwork-Id: 58253 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 87617B6F14 for ; Fri, 9 Jul 2010 01:24:02 +1000 (EST) Received: (qmail 26557 invoked by alias); 8 Jul 2010 15:24:00 -0000 Received: (qmail 26405 invoked by uid 22791); 8 Jul 2010 15:23:59 -0000 X-SWARE-Spam-Status: No, hits=-2.2 required=5.0 tests=AWL,BAYES_00 X-Spam-Check-By: sourceware.org Received: from mel.act-europe.fr (HELO mel.act-europe.fr) (212.99.106.210) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Thu, 08 Jul 2010 15:23:53 +0000 Received: from localhost (localhost [127.0.0.1]) by filtered-smtp.eu.adacore.com (Postfix) with ESMTP id 12067CB027B for ; Thu, 8 Jul 2010 17:23:50 +0200 (CEST) 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 GcvnNpDiqwjm for ; Thu, 8 Jul 2010 17:23:50 +0200 (CEST) Received: from adijon-256-1-144-124.w90-13.abo.wanadoo.fr (ADijon-256-1-144-124.w90-13.abo.wanadoo.fr [90.13.31.124]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mel.act-europe.fr (Postfix) with ESMTP id D9121CB029C for ; Thu, 8 Jul 2010 17:23:49 +0200 (CEST) From: Eric Botcazou Subject: Fix formatting issues in set_mem_attributes_minus_bitpos Date: Thu, 8 Jul 2010 17:23:46 +0200 User-Agent: KMail/1.9.9 MIME-Version: 1.0 To: gcc-patches@gcc.gnu.org Message-Id: <201007081723.47017.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 Before testing the fix for PR middle-end/44843, I noticed formatting issues in set_mem_attributes_minus_bitpos. Tested on x86-64-suse-linux, applied on the mainline as obvious. 2010-07-08 Eric Botcazou * emit-rtl.c (set_mem_attributes_minus_bitpos): Fix formatting issues. Index: emit-rtl.c =================================================================== --- emit-rtl.c (revision 161944) +++ emit-rtl.c (working copy) @@ -1611,27 +1611,26 @@ set_mem_attributes_minus_bitpos (rtx ref /* We can set the alignment from the type if we are making an object, this is an INDIRECT_REF, or if TYPE_ALIGN_OK. */ - if (objectp || TREE_CODE (t) == INDIRECT_REF - || TYPE_ALIGN_OK (type)) + if (objectp || TREE_CODE (t) == INDIRECT_REF || TYPE_ALIGN_OK (type)) align = MAX (align, TYPE_ALIGN (type)); + else if (TREE_CODE (t) == MEM_REF) { + tree op0 = TREE_OPERAND (t, 0); unsigned HOST_WIDE_INT aoff = BITS_PER_UNIT; if (host_integerp (TREE_OPERAND (t, 1), 1)) { unsigned HOST_WIDE_INT ioff = TREE_INT_CST_LOW (TREE_OPERAND (t, 1)); aoff = (ioff & -ioff) * BITS_PER_UNIT; } - if (TREE_CODE (TREE_OPERAND (t, 0)) == ADDR_EXPR - && DECL_P (TREE_OPERAND (TREE_OPERAND (t, 0), 0))) - align = MAX (align, - DECL_ALIGN (TREE_OPERAND (TREE_OPERAND (t, 0), 0))); - else if (TREE_CODE (TREE_OPERAND (t, 0)) == ADDR_EXPR - && CONSTANT_CLASS_P (TREE_OPERAND (TREE_OPERAND (t, 0), 0))) + if (TREE_CODE (op0) == ADDR_EXPR && DECL_P (TREE_OPERAND (op0, 0))) + align = MAX (align, DECL_ALIGN (TREE_OPERAND (op0, 0))); + else if (TREE_CODE (op0) == ADDR_EXPR + && CONSTANT_CLASS_P (TREE_OPERAND (op0, 0))) { - align = TYPE_ALIGN (TREE_TYPE (TREE_OPERAND (TREE_OPERAND (t, 0), 0))); + align = TYPE_ALIGN (TREE_TYPE (TREE_OPERAND (op0, 0))); #ifdef CONSTANT_ALIGNMENT - align = CONSTANT_ALIGNMENT (TREE_OPERAND (TREE_OPERAND (t, 0), 0), align); + align = CONSTANT_ALIGNMENT (TREE_OPERAND (op0, 0), align); #endif } else @@ -1639,19 +1638,19 @@ set_mem_attributes_minus_bitpos (rtx ref alignment information from types. */ align = MAX (align, TYPE_ALIGN (TREE_TYPE (TREE_TYPE (TREE_OPERAND (t, 1))))); - if (!integer_zerop (TREE_OPERAND (t, 1)) - && aoff < align) + + if (!integer_zerop (TREE_OPERAND (t, 1)) && aoff < align) align = aoff; } - else - if (TREE_CODE (t) == MISALIGNED_INDIRECT_REF) - { - if (integer_zerop (TREE_OPERAND (t, 1))) - /* We don't know anything about the alignment. */ - align = BITS_PER_UNIT; - else - align = tree_low_cst (TREE_OPERAND (t, 1), 1); - } + + else if (TREE_CODE (t) == MISALIGNED_INDIRECT_REF) + { + if (integer_zerop (TREE_OPERAND (t, 1))) + /* We don't know anything about the alignment. */ + align = BITS_PER_UNIT; + else + align = tree_low_cst (TREE_OPERAND (t, 1), 1); + } /* If the size is known, we can set that. */ if (TYPE_SIZE_UNIT (type) && host_integerp (TYPE_SIZE_UNIT (type), 1))