https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70143
Richard Biener changed:
What|Removed |Added
Status|ASSIGNED|RESOLVED
Resolution|---
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70143
--- Comment #12 from Richard Biener ---
Author: rguenth
Date: Wed Mar 9 14:01:16 2016
New Revision: 234084
URL: https://gcc.gnu.org/viewcvs?rev=234084&root=gcc&view=rev
Log:
2016-03-09 Richard Biener
c-family/
PR c/70143
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70143
--- Comment #11 from Pedro Alves ---
> That is certainly not fine from aliasing perspective, aliasing is not just
> about the type of the field you access, but the whole access path, so if you
> use ((struct b *)ip)->j then ip should point to an
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70143
--- Comment #10 from rguenther at suse dot de ---
On Wed, 9 Mar 2016, palves at redhat dot com wrote:
> https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70143
>
> --- Comment #4 from Pedro Alves ---
> > The warning is "correct". You are accessing
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70143
--- Comment #9 from Jakub Jelinek ---
(In reply to Pedro Alves from comment #8)
> I see it the same as:
>
> int *ip = &ap->k;
> ((struct b *)ip)->j;
That is certainly not fine from aliasing perspective, aliasing is not just
about the type of
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70143
--- Comment #8 from Pedro Alves ---
> Note that we then also don't warn for
(...)
> struct a { int i; int k; };
> return ((struct b *)&ap->k)->j;
(...)
> then either
I see it the same as:
int *ip = &ap->k;
((struct b *)ip)->j;
Fine from type
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70143
--- Comment #7 from rguenther at suse dot de ---
On Wed, 9 Mar 2016, jakub at gcc dot gnu.org wrote:
> https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70143
>
> --- Comment #6 from Jakub Jelinek ---
> (In reply to rguent...@suse.de from comment #
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70143
--- Comment #6 from Jakub Jelinek ---
(In reply to rguent...@suse.de from comment #5)
> Though that will FAIL the gcc.dg/Wstrict-aliasing-struct-member.c
> I added.
>
> Note that we then also don't warn for
>
> struct a {
> int i;
> int k;
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70143
--- Comment #5 from rguenther at suse dot de ---
On Wed, 9 Mar 2016, jakub at gcc dot gnu.org wrote:
> https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70143
>
> --- Comment #3 from Jakub Jelinek ---
> Note even GCC 5.x and earlier warn here with
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70143
--- Comment #4 from Pedro Alves ---
> The warning is "correct". You are accessing object *ap (a struct a) via a
> pointer to struct b.
I'd think that instead, we are accessing object "*&ap->i", an int, via a
pointer
to struct b, and I'd imag
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70143
--- Comment #3 from Jakub Jelinek ---
Note even GCC 5.x and earlier warn here with -Wstrict-aliasing=2 or
-Wstrict-aliasing=1, it is just whether we warn about this with the most common
one -Wstrict-aliasing=3.
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70143
Richard Biener changed:
What|Removed |Added
Keywords||diagnostic
Status|NEW
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70143
Jakub Jelinek changed:
What|Removed |Added
Status|UNCONFIRMED |NEW
Last reconfirmed|
13 matches
Mail list logo