public inbox for gcc-prs@sourceware.org help / color / mirror / Atom feed
From: bangerth@dealii.org To: gandalf@winds.org, gcc-bugs@gcc.gnu.org, gcc-prs@gcc.gnu.org, neil@gcc.gnu.org Subject: Re: c/5593: GCC miscompiles bitshifts on unsigned struct members when creating a 64-bit value Date: Tue, 05 Nov 2002 08:15:00 -0000 [thread overview] Message-ID: <20021105161503.7191.qmail@sources.redhat.com> (raw) Synopsis: GCC miscompiles bitshifts on unsigned struct members when creating a 64-bit value State-Changed-From-To: open->analyzed State-Changed-By: bangerth State-Changed-When: Tue Nov 5 08:15:02 2002 State-Changed-Why: I can confirm this. However, I'm not sure whether what you do is specified at all: it all boils down to this function: long long equation4(struct field *data) { return ((long long)data->num << 32)| (data->flags << 16)| (data->container << 8)| data->quantity; } and that data->flags is a 16-bit integer. I think, shifting it by 16 is invoking undefined behavior, and you should not be surprised. But then, I'm not a language lawyer and leave this to someone else. http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view%20audit-trail&database=gcc&pr=5593
next reply other threads:[~2002-11-05 16:15 UTC|newest] Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top 2002-11-05 8:15 bangerth [this message] -- strict thread matches above, loose matches on Subject: below -- 2002-11-09 4:16 neil 2002-11-08 20:46 Byron Stanoszek 2002-11-08 1:06 Christian Ehrhardt 2002-02-10 19:02 rth 2002-02-05 11:46 gandalf
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=20021105161503.7191.qmail@sources.redhat.com \ --to=bangerth@dealii.org \ --cc=gandalf@winds.org \ --cc=gcc-bugs@gcc.gnu.org \ --cc=gcc-gnats@gcc.gnu.org \ --cc=gcc-prs@gcc.gnu.org \ --cc=neil@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: linkBe 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).