From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 12007 invoked by alias); 6 Nov 2009 16:24:21 -0000 Received: (qmail 11987 invoked by uid 22791); 6 Nov 2009 16:24:19 -0000 X-SWARE-Spam-Status: No, hits=-3.4 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, 06 Nov 2009 16:24:15 +0000 Received: from relay1.suse.de (relay-ext.suse.de [195.135.221.8]) by mx2.suse.de (Postfix) with ESMTP id BB72186391; Fri, 6 Nov 2009 17:24:12 +0100 (CET) Date: Fri, 06 Nov 2009 16:24:00 -0000 From: Michael Matz To: Eric Botcazou Cc: gcc@gcc.gnu.org Subject: Re: Do BLKmode bit-fields still exist? In-Reply-To: <200911061046.50176.ebotcazou@adacore.com> Message-ID: References: <200911061046.50176.ebotcazou@adacore.com> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-IsSubscribed: yes Mailing-List: contact gcc-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-owner@gcc.gnu.org X-SW-Source: 2009-11/txt/msg00143.txt.bz2 Hi, On Fri, 6 Nov 2009, Eric Botcazou wrote: > Yet it's easy in Ada on platforms with strict alignment, e.g. SPARC: > > package P is > > type Rec1 is record > I1 : Integer; > I2 : Integer; > I3 : Integer; > end record; > > type R2 is record > B : Boolean; > R : Rec1; > end record; > pragma Pack (R2); > > end P; > > (gdb) p debug_tree(0x2aaaaab2bdc0) > type external packed bit-field BLK file p.ads line 11 col 5 size > We set DECL_BIT_FIELD in the front-end because the field is misaligned. Uahhh! A bitfield of RECORD_TYPE! Marvelous. Molding this into a testcase that actually writes into some parts, like: procedure Fields is type Rec1 is record I1 : Integer; end record; type R2 is record B : Boolean; R : Rec1; end record; pragma Pack (R2); r,rr : R2; subr,subr2 : Rec1; procedure useme (x:in out R2;y:in out Rec1); pragma Import (C, useme); function giveme return Integer; pragma Import (c,giveme); begin subr2.I1 := giveme; subr := subr2; r.R := subr2; rr := r; useme(rr, subr); end; triggers the gcc_unreachable in get_inner_references (on sparc), okay. But I can't trigger the one in store_field, because the target for these stores will alway be a non-register due to the unaligned fields in there, hmm. (the above needs -O1 -fno-tree-ccp -fno-tree-copy-prop -fno-tree-sra ot not forward the giveme() result but retain the store into r.R). Ciao, Michael.