public inbox for gcc-bugs@sourceware.org help / color / mirror / Atom feed
From: "jsturm at gcc dot gnu dot org" <gcc-bugzilla@gcc.gnu.org> To: gcc-bugs@gcc.gnu.org Subject: [Bug c/14319] incorrect optimization of union of structs with common initial sequences Date: Fri, 27 Feb 2004 19:08:00 -0000 [thread overview] Message-ID: <20040227190803.7113.qmail@sources.redhat.com> (raw) In-Reply-To: <20040227052920.14319.jsturm@gcc.gnu.org> ------- Additional Comments From jsturm at gcc dot gnu dot org 2004-02-27 19:07 ------- (In reply to comment #2) > I can't believe the wording means what you imply. Assume that caller > and callee are in different translation units, then there is no > way for the compiler to see that the two arguments to the called function > may in fact be members of the same union. Isn't that the reason for the visibility rule? Read the committee's response to DR 257. > So the only way to assume that they could alias each other is to > search the universe for a union type in which both of them are members. > That certainly can't be the intent of the standard or DR. It only makes > sense, if as RTH says the access is through such a union. Yet it intrigues me then that the committee would have a need to create a special exception for this one case. In all other situations (type-punning) the behavior seems to be implementation defined. The 2nd example in 6.5.2.3#8 is equivalent to mine, except for the scope of the union declaration. Despite RTH's comment I don't see any mention of this exception for common initial sequences in the -fstrict-aliasing docs. There are general examples of type-punning though. Anyhow... folks, I don't really care one way or other. I wasn't even aware of DR 257 prior to Dan Nicolaescu's message. If this is considered settled for GCC pending any clarification from the committee, then the PR might as well be closed. -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=14319
next prev parent reply other threads:[~2004-02-27 19:08 UTC|newest] Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top 2004-02-27 5:29 [Bug c/14319] New: " jsturm at gcc dot gnu dot org 2004-02-27 8:37 ` [Bug c/14319] " rth at gcc dot gnu dot org 2004-02-27 15:19 ` bangerth at dealii dot org 2004-02-27 19:08 ` jsturm at gcc dot gnu dot org [this message] 2004-02-27 19:24 ` bangerth at dealii dot org 2004-02-29 3:19 ` [Bug optimization/14319] [tree-ssa] " pinskia at gcc dot gnu dot org 2004-03-03 1:05 ` [Bug optimization/14319] " rth at gcc dot gnu dot org 2004-03-03 1:06 ` rth at gcc dot gnu dot org 2004-05-27 5:21 ` [Bug rtl-optimization/14319] " pinskia at gcc dot gnu dot org 2005-09-26 15:42 ` pinskia at gcc dot gnu dot org
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=20040227190803.7113.qmail@sources.redhat.com \ --to=gcc-bugzilla@gcc.gnu.org \ --cc=gcc-bugs@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).