public inbox for gcc-prs@sourceware.org
help / color / mirror / Atom feed
From: "Jan Beulich" <JBeulich@novell.com>
To: nobody@gcc.gnu.org
Cc: gcc-prs@gcc.gnu.org,
Subject: Re: middle-end/9725: Invalid dependency determination
Date: Wed, 19 Feb 2003 17:16:00 -0000	[thread overview]
Message-ID: <20030219171600.20084.qmail@sources.redhat.com> (raw)

The following reply was made to PR middle-end/9725; it has been noted by GNATS.

From: "Jan Beulich" <JBeulich@novell.com>
To: <bangerth@ticam.utexas.edu>
Cc: <velco@fadata.bg>,<gcc-bugs@gcc.gnu.org>, <gcc-gnats@gcc.gnu.org>
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 <bangerth@ticam.utexas.edu> 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/ 
 
 


             reply	other threads:[~2003-02-19 17:16 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-02-19 17:16 Jan Beulich [this message]
  -- strict thread matches above, loose matches on Subject: below --
2003-02-20  9:06 Momchil Velikov
2003-02-20  8:16 Joseph S. Myers
2003-02-20  8:06 Jan Beulich
2003-02-20  7:46 Jan Beulich
2003-02-19 21:16 Momchil Velikov
2003-02-19 17:16 Wolfgang Bangerth
2003-02-19 17:06 Wolfgang Bangerth
2003-02-17 16:56 Wolfgang Bangerth
2003-02-17 15:48 bangerth
2003-02-17 15:36 jbeulich

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20030219171600.20084.qmail@sources.redhat.com \
    --to=jbeulich@novell.com \
    --cc=gcc-prs@gcc.gnu.org \
    --cc=nobody@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).