[Bug c/70143] [6 Regression] false strict-aliasing warning

2016-03-09 Thread rguenth at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70143 Richard Biener changed: What|Removed |Added Status|ASSIGNED|RESOLVED Resolution|---

[Bug c/70143] [6 Regression] false strict-aliasing warning

2016-03-09 Thread rguenth at gcc dot gnu.org
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

[Bug c/70143] [6 Regression] false strict-aliasing warning

2016-03-09 Thread palves at redhat dot com
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

[Bug c/70143] [6 Regression] false strict-aliasing warning

2016-03-09 Thread rguenther at suse dot de
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

[Bug c/70143] [6 Regression] false strict-aliasing warning

2016-03-09 Thread jakub at gcc dot gnu.org
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

[Bug c/70143] [6 Regression] false strict-aliasing warning

2016-03-09 Thread palves at redhat dot com
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

[Bug c/70143] [6 Regression] false strict-aliasing warning

2016-03-09 Thread rguenther at suse dot de
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 #

[Bug c/70143] [6 Regression] false strict-aliasing warning

2016-03-09 Thread jakub at gcc dot gnu.org
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;

[Bug c/70143] [6 Regression] false strict-aliasing warning

2016-03-09 Thread rguenther at suse dot de
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

[Bug c/70143] [6 Regression] false strict-aliasing warning

2016-03-09 Thread palves at redhat dot com
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

[Bug c/70143] [6 Regression] false strict-aliasing warning

2016-03-09 Thread jakub at gcc dot gnu.org
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.

[Bug c/70143] [6 Regression] false strict-aliasing warning

2016-03-09 Thread rguenth at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70143 Richard Biener changed: What|Removed |Added Keywords||diagnostic Status|NEW

[Bug c/70143] [6 Regression] false strict-aliasing warning

2016-03-08 Thread jakub at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70143 Jakub Jelinek changed: What|Removed |Added Status|UNCONFIRMED |NEW Last reconfirmed|