From patchwork Fri Sep 24 16:54:41 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Martin Jambor X-Patchwork-Id: 65664 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 12338B710A for ; Sat, 25 Sep 2010 02:55:03 +1000 (EST) Received: (qmail 27535 invoked by alias); 24 Sep 2010 16:54:50 -0000 Received: (qmail 27524 invoked by uid 22791); 24 Sep 2010 16:54:50 -0000 X-SWARE-Spam-Status: No, hits=-3.7 required=5.0 tests=AWL,BAYES_00 X-Spam-Check-By: sourceware.org Received: from cantor2.suse.de (HELO mx2.suse.de) (195.135.220.15) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Fri, 24 Sep 2010 16:54:44 +0000 Received: from relay1.suse.de (charybdis-ext.suse.de [195.135.221.2]) by mx2.suse.de (Postfix) with ESMTP id D8E6086EE4 for ; Fri, 24 Sep 2010 18:54:41 +0200 (CEST) Date: Fri, 24 Sep 2010 18:54:41 +0200 From: Martin Jambor To: GCC Patches Cc: Richard Guenther Subject: [PATCH, SRA] Do not care about trailing zero-sized bit-fields any more Message-ID: <20100924165441.GB31666@virgil.arch.suse.de> Mail-Followup-To: GCC Patches , Richard Guenther MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.5.20 (2009-06-14) X-IsSubscribed: yes 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, with SRA producing MEM_REFs to access components of aggregates, zero-sized trailing bit-fields are no longer a problem (PR 43191, better description: http://gcc.gnu.org/ml/gcc-patches/2010-03/msg00207.html) and so there is no need to handle them specially. Bootstrapped and tested on x86_64-linux. OK for trunk? Thanks, Martin 2010-09-24 Martin Jambor * tree-sra.c (type_consists_of_records_p): Do not check for trailing zero sized bit-fields. Index: mine/gcc/tree-sra.c =================================================================== --- mine.orig/gcc/tree-sra.c +++ mine/gcc/tree-sra.c @@ -815,14 +815,12 @@ create_access (tree expr, gimple stmt, b /* Return true iff TYPE is a RECORD_TYPE with fields that are either of gimple register types or (recursively) records with only these two kinds of fields. - It also returns false if any of these records has a zero-size field as its - last field or has a bit-field. */ + It also returns false if any of these records contains a bit-field. */ static bool type_consists_of_records_p (tree type) { tree fld; - bool last_fld_has_zero_size = false; if (TREE_CODE (type) != RECORD_TYPE) return false; @@ -838,13 +836,8 @@ type_consists_of_records_p (tree type) if (!is_gimple_reg_type (ft) && !type_consists_of_records_p (ft)) return false; - - last_fld_has_zero_size = tree_low_cst (DECL_SIZE (fld), 1) == 0; } - if (last_fld_has_zero_size) - return false; - return true; }