From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 20126 invoked by alias); 19 Feb 2003 17:16:01 -0000 Mailing-List: contact gcc-prs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Archive: List-Post: List-Help: Sender: gcc-prs-owner@gcc.gnu.org Received: (qmail 20085 invoked by uid 71); 19 Feb 2003 17:16:00 -0000 Date: Wed, 19 Feb 2003 17:16:00 -0000 Message-ID: <20030219171600.20084.qmail@sources.redhat.com> To: nobody@gcc.gnu.org Cc: gcc-prs@gcc.gnu.org, From: "Jan Beulich" Subject: Re: middle-end/9725: Invalid dependency determination Reply-To: "Jan Beulich" X-SW-Source: 2003-02/txt/msg00946.txt.bz2 List-Id: The following reply was made to PR middle-end/9725; it has been noted by GNATS. From: "Jan Beulich" To: Cc: ,, Subject: Re: middle-end/9725: Invalid dependency determination Date: Wed, 19 Feb 2003 18:08:42 +0100 But why is the structure incompatible? "... an aggregate or union type that includes one of the aforementioned types among its members (including, recursively, a member of a subaggregate or contained union), ..." The structure does include two fields of type 'unsigned' (the fact that they are bit fields doesn't alter their type as I view it). And, as already asked, when the second store is deemed non-conflicting, then why isn't the first store, too? And, with respect to the other mail - short of not using this logic - how do I access sub-fields of a built-in type (while the code I have to fix for others to overcome the optimizer problem uses ints, I'm really more interested in accessing sub-fields of floating point types (other than through memcpy-ing the float into and afterwards out of a structure)? Thanks, Jan >>> Wolfgang Bangerth 19.02.03 17:59:46 >>> > struct s { > unsigned f1:16; > unsigned f2:16; > }; > > void test(unsigned *pf, unsigned x, unsigned y) { > unsigned f; > > ((struct s*)&f)->f1 = x; > ((struct s*)&f)->f2 = y; > *pf = f; > } You still try to access the bits of the unsigned int variable f through the bits of the incompatible structure s. Short answer: don't do that. W. ------------------------------------------------------------------------- Wolfgang Bangerth email: bangerth@ticam.utexas.edu www: http://www.ticam.utexas.edu/~bangerth/