[Bug c/69002] C front end should warn about undefined access to atomic structure or union

2015-12-22 Thread mpolacek at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=69002 Marek Polacek changed: What|Removed |Added Status|ASSIGNED|RESOLVED Resolution|---

[Bug c/69002] C front end should warn about undefined access to atomic structure or union

2015-12-22 Thread mpolacek at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=69002 --- Comment #9 from Marek Polacek --- Author: mpolacek Date: Tue Dec 22 15:23:21 2015 New Revision: 231902 URL: https://gcc.gnu.org/viewcvs?rev=231902&root=gcc&view=rev Log: PR c/69002 * c-typeck.c (build_component_ref): Warn whe

[Bug c/69002] C front end should warn about undefined access to atomic structure or union

2015-12-21 Thread joseph at codesourcery dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=69002 --- Comment #8 from joseph at codesourcery dot com --- On Mon, 21 Dec 2015, mpolacek at gcc dot gnu.org wrote: > int > read1 (_Atomic S p) > { > S s = p; > return s.x; That's fine. > read2 (_Atomic S *p) > { > S *s = p; No, assignment /

[Bug c/69002] C front end should warn about undefined access to atomic structure or union

2015-12-21 Thread msebor at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=69002 --- Comment #7 from Martin Sebor --- FWIW, I think it would make sense to diagnose some of the constructs for other reasons besides accessing a member (of an atomic struct). For example, in write1(), the function is most likely not going to do w

[Bug c/69002] C front end should warn about undefined access to atomic structure or union

2015-12-21 Thread mpolacek at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=69002 Marek Polacek changed: What|Removed |Added Status|NEW |ASSIGNED Assignee|unassigned a

[Bug c/69002] C front end should warn about undefined access to atomic structure or union

2015-12-21 Thread fw at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=69002 --- Comment #5 from Florian Weimer --- (In reply to Marek Polacek from comment #4) > The footnote to 6.5.2.3/5 says "Members can be safely accessed using a > non-atomic object which is assigned to or from the atomic object." Does it > mean that

[Bug c/69002] C front end should warn about undefined access to atomic structure or union

2015-12-21 Thread mpolacek at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=69002 Marek Polacek changed: What|Removed |Added CC||mpolacek at gcc dot gnu.org --- Comment

[Bug c/69002] C front end should warn about undefined access to atomic structure or union

2015-12-21 Thread msebor at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=69002 Martin Sebor changed: What|Removed |Added Status|UNCONFIRMED |NEW Last reconfirmed|

[Bug c/69002] C front end should warn about undefined access to atomic structure or union

2015-12-21 Thread fw at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=69002 --- Comment #2 from Florian Weimer --- (In reply to Martin Sebor from comment #1) > I actually wouldn't want to see GCC start issuing warnings for this code > because it has well-defined semantics there. Unfortunately, the generated code is trul

[Bug c/69002] C front end should warn about undefined access to atomic structure or union

2015-12-21 Thread msebor at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=69002 Martin Sebor changed: What|Removed |Added CC||msebor at gcc dot gnu.org --- Comment #1