From patchwork Mon Mar 19 12:21:01 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Eric Botcazou X-Patchwork-Id: 147494 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 20D9AB6EEE for ; Mon, 19 Mar 2012 23:21:49 +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=1332764510; h=Comment: DomainKey-Signature:Received:Received:Received:Received:Received: Received:From:To:Subject:Date:User-Agent:MIME-Version:Message-Id: Content-Type:Mailing-List:Precedence:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:Sender:Delivered-To; bh=Rtadm3n f3tq58EQ6B/iXgBHPWCc=; b=enrKZ6H4qLmygUqqSbzri8GbY6jh+lljlRNkHSF nuYAoZwAAVpRueiJudez9TGVKcY+1E72Yy0unQmx3JHKXfykad7ppTI/op5cRptZ VG7lVbyU3QC+70p4GqoAPcxklXxyvd++CzpxtXM5K61Jn7NzB+IGs0UDQu+QnSN1 nKyc= 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:Message-Id:Content-Type:Mailing-List:Precedence:List-Id:List-Unsubscribe:List-Archive:List-Post:List-Help:Sender:Delivered-To; b=DQ9UOwXH0KfOP947kT3mli4rOJDQP5d8WW4KiL8sVx7ZnycXgVNhCHJFbSvadV 0cVtYXvNDuSMQKd/qgChGsfu/0GczdVI6kN2A7n8gHaqQt5GBH/s3mhwtdMmF9c1 CFLf45UX/S1KjtEKRcscj6xgM4DPphRyhQhhem/aSz5/E=; Received: (qmail 20927 invoked by alias); 19 Mar 2012 12:21:43 -0000 Received: (qmail 20917 invoked by uid 22791); 19 Mar 2012 12:21: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; Mon, 19 Mar 2012 12:21:19 +0000 Received: from localhost (localhost [127.0.0.1]) by filtered-smtp.eu.adacore.com (Postfix) with ESMTP id 3EB2C29005F for ; Mon, 19 Mar 2012 13:21:20 +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 CfK0jUw9eZHD for ; Mon, 19 Mar 2012 13:21:20 +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 E249C290008 for ; Mon, 19 Mar 2012 13:21:19 +0100 (CET) From: Eric Botcazou To: gcc-patches@gcc.gnu.org Subject: [patch] Minor tweaks Date: Mon, 19 Mar 2012 13:21:01 +0100 User-Agent: KMail/1.9.9 MIME-Version: 1.0 Message-Id: <201203191321.01515.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 Hi, around line 380, we have in tree.def: /* References to storage. */ /* The ordering of the following codes is optimized for the classification in handled_component_p. Keep them in a consecutive group. */ The hitch is that VIEW_CONVERT_EXPR is far apart from the others, so the patch puts them together (and orders them consistently). It also tweaks a couple of places where callers of get_inner_reference initializes unsignedp: int unsignedp = 0, volatilep = 0; decl = get_inner_reference (decl, &bitsize, &bitpos, &toffset, &mode, &unsignedp, &volatilep, false); This is useless since unsignedp is always set (unlike volatilep). Tested on i586-suse-linux, OK for the mainline? 2012-03-19 Eric Botcazou * tree.def (REALPART_EXPR, IMAGPART_EXPR, VIEW_CONVERT_EXPR): Move. * tree.h (handled_component_p): Reorder cases. * dwarf2out.c (loc_list_for_address_of_addr_expr_of_indirect_ref): Do not initialize unsignedp. (loc_list_from_tree): Likewise. (fortran_common): Likewise. * simplify-rtx.c (delegitimize_mem_from_attrs): Likewise. Index: dwarf2out.c =================================================================== --- dwarf2out.c (revision 185395) +++ dwarf2out.c (working copy) @@ -13328,8 +13328,8 @@ cst_pool_loc_descr (tree loc) } /* Return dw_loc_list representing address of addr_expr LOC - by looking for innder INDIRECT_REF expression and turing it - into simple arithmetics. */ + by looking for inner INDIRECT_REF expression and turning + it into simple arithmetics. */ static dw_loc_list_ref loc_list_for_address_of_addr_expr_of_indirect_ref (tree loc, bool toplev) @@ -13337,8 +13337,7 @@ loc_list_for_address_of_addr_expr_of_ind tree obj, offset; HOST_WIDE_INT bitsize, bitpos, bytepos; enum machine_mode mode; - int volatilep; - int unsignedp = TYPE_UNSIGNED (TREE_TYPE (loc)); + int unsignedp, volatilep = 0; dw_loc_list_ref list_ret = NULL, list_ret1 = NULL; obj = get_inner_reference (TREE_OPERAND (loc, 0), @@ -13628,8 +13627,7 @@ loc_list_from_tree (tree loc, int want_a tree obj, offset; HOST_WIDE_INT bitsize, bitpos, bytepos; enum machine_mode mode; - int volatilep; - int unsignedp = TYPE_UNSIGNED (TREE_TYPE (loc)); + int unsignedp, volatilep = 0; obj = get_inner_reference (loc, &bitsize, &bitpos, &offset, &mode, &unsignedp, &volatilep, false); @@ -14927,7 +14925,7 @@ fortran_common (tree decl, HOST_WIDE_INT enum machine_mode mode; HOST_WIDE_INT bitsize, bitpos; tree offset; - int volatilep = 0, unsignedp = 0; + int unsignedp, volatilep = 0; /* If the decl isn't a VAR_DECL, or if it isn't static, or if it does not have a value (the offset into the common area), or if it Index: simplify-rtx.c =================================================================== --- simplify-rtx.c (revision 185395) +++ simplify-rtx.c (working copy) @@ -293,7 +293,7 @@ delegitimize_mem_from_attrs (rtx x) { HOST_WIDE_INT bitsize, bitpos; tree toffset; - int unsignedp = 0, volatilep = 0; + int unsignedp, volatilep = 0; decl = get_inner_reference (decl, &bitsize, &bitpos, &toffset, &mode, &unsignedp, &volatilep, false); Index: tree.def =================================================================== --- tree.def (revision 185395) +++ tree.def (working copy) @@ -400,11 +400,6 @@ DEFTREECODE (COMPONENT_REF, "component_r to its mode width. */ DEFTREECODE (BIT_FIELD_REF, "bit_field_ref", tcc_reference, 3) -/* Used only on an operand of complex type, these return - a value of the corresponding component type. */ -DEFTREECODE (REALPART_EXPR, "realpart_expr", tcc_reference, 1) -DEFTREECODE (IMAGPART_EXPR, "imagpart_expr", tcc_reference, 1) - /* Array indexing. Operand 0 is the array; operand 1 is a (single) array index. Operand 2, if present, is a copy of TYPE_MIN_VALUE of the index. @@ -417,6 +412,23 @@ DEFTREECODE (ARRAY_REF, "array_ref", tcc of the range is taken from the type of the expression. */ DEFTREECODE (ARRAY_RANGE_REF, "array_range_ref", tcc_reference, 4) +/* Used only on an operand of complex type, these return + a value of the corresponding component type. */ +DEFTREECODE (REALPART_EXPR, "realpart_expr", tcc_reference, 1) +DEFTREECODE (IMAGPART_EXPR, "imagpart_expr", tcc_reference, 1) + +/* Represents viewing something of one type as being of a second type. + This corresponds to an "Unchecked Conversion" in Ada and roughly to + the idiom *(type2 *)&X in C. The only operand is the value to be + viewed as being of another type. It is undefined if the type of the + input and of the expression have different sizes. + + This code may also be used within the LHS of a MODIFY_EXPR, in which + case no actual data motion may occur. TREE_ADDRESSABLE will be set in + this case and GCC must abort if it could not do the operation without + generating insns. */ +DEFTREECODE (VIEW_CONVERT_EXPR, "view_convert_expr", tcc_reference, 1) + /* C unary `*' or Pascal `^'. One operand, an expression for a pointer. */ DEFTREECODE (INDIRECT_REF, "indirect_ref", tcc_reference, 1) @@ -769,18 +781,6 @@ DEFTREECODE (NOP_EXPR, "nop_expr", tcc_u /* Value is same as argument, but guaranteed not an lvalue. */ DEFTREECODE (NON_LVALUE_EXPR, "non_lvalue_expr", tcc_unary, 1) -/* Represents viewing something of one type as being of a second type. - This corresponds to an "Unchecked Conversion" in Ada and roughly to - the idiom *(type2 *)&X in C. The only operand is the value to be - viewed as being of another type. It is undefined if the type of the - input and of the expression have different sizes. - - This code may also be used within the LHS of a MODIFY_EXPR, in which - case no actual data motion may occur. TREE_ADDRESSABLE will be set in - this case and GCC must abort if it could not do the operation without - generating insns. */ -DEFTREECODE (VIEW_CONVERT_EXPR, "view_convert_expr", tcc_reference, 1) - /* A COMPOUND_LITERAL_EXPR represents a literal that is placed in a DECL. The COMPOUND_LITERAL_EXPR_DECL_EXPR is the a DECL_EXPR containing the decl for the anonymous object represented by the COMPOUND_LITERAL; Index: tree.h =================================================================== --- tree.h (revision 185395) +++ tree.h (working copy) @@ -5026,13 +5026,13 @@ handled_component_p (const_tree t) { switch (TREE_CODE (t)) { - case BIT_FIELD_REF: case COMPONENT_REF: + case BIT_FIELD_REF: case ARRAY_REF: case ARRAY_RANGE_REF: - case VIEW_CONVERT_EXPR: case REALPART_EXPR: case IMAGPART_EXPR: + case VIEW_CONVERT_EXPR: return true; default: