public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "pinskia at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug c/65892] gcc fails to implement N685 aliasing of union members
Date: Sun, 26 Apr 2015 17:50:00 -0000	[thread overview]
Message-ID: <bug-65892-4-2HPMhNfyJU@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-65892-4@http.gcc.gnu.org/bugzilla/>

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65892

--- Comment #5 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
(In reply to Martin Sebor from comment #4)
> Thanks for the pointer!  I had looked for a related bug report but couldn't
> find it.
> 
> There's an important difference between the test cases in pr14319 and the
> one here that's easy to overlook.  The rule only applies to structs defined
> in unions, not those defined at file scope and only used to declare union
> members, and to translation units in which the union definition is visible. 


No that is not the rule.  If I read the section:
    [#5] One special guarantee is made in order to simplify the use of unions:
if a union contains several structures that share a common initial sequence
(see
below), and if the union object currently contains one of these structures, it
is permitted to inspect the common initial part of any of them anywhere that a
declaration of the complete type of the union is visible. Two structures share
a
common initial sequence if corresponding members have compatible types (and,
for
bit-fields, the same widths) for a sequence of one or more initial members.
--- CUT ----
I don't see anywhere the standard says about where the struct is defined in the
statement above.


  parent reply	other threads:[~2015-04-26 17:50 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-04-25 23:59 [Bug c/65892] New: " msebor at gcc dot gnu.org
2015-04-26  0:11 ` [Bug c/65892] " pinskia at gcc dot gnu.org
2015-04-26  0:15 ` pinskia at gcc dot gnu.org
2015-04-26  0:17 ` pinskia at gcc dot gnu.org
2015-04-26 17:50 ` pinskia at gcc dot gnu.org [this message]
2015-04-26 18:00 ` msebor at gcc dot gnu.org
2015-04-27  9:00 ` rguenth at gcc dot gnu.org
2015-04-27 14:57 ` msebor at gcc dot gnu.org
2015-04-28 17:08 ` joseph at codesourcery dot com
2015-05-13 16:02 ` msebor at gcc dot gnu.org
2015-05-21 11:41 ` mpolacek at gcc dot gnu.org
2015-09-09  0:39 ` myriachan at gmail dot com
2015-09-09  0:43 ` myriachan at gmail dot com
2015-09-09 13:44 ` joseph at codesourcery dot com
2015-09-09 14:25 ` redi at gcc dot gnu.org
2015-09-09 14:42 ` redi at gcc dot gnu.org
2015-09-09 15:59 ` msebor at gcc dot gnu.org
2018-04-23 14:27 ` joseph at codesourcery dot com

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=bug-65892-4-2HPMhNfyJU@http.gcc.gnu.org/bugzilla/ \
    --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: 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).