[Bug driver/78772] -fstrict-aliasing should turn on Wstrict-aliasing automaticly

2016-12-18 Thread ma.jiang at zte dot com.cn
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=78772 --- Comment #12 from ma.jiang at zte dot com.cn --- (In reply to Jim Wilson from comment #11) Hi Jim, Thank you for your patient explanations. > > If you have code with a lot of pointer casts, you should probably be > compiling with

[Bug driver/78772] -fstrict-aliasing should turn on Wstrict-aliasing automaticly

2016-12-16 Thread wilson at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=78772 --- Comment #11 from Jim Wilson --- This language has been in the standard since ANSI C 89/ISO C 90. >extern char buf[32]; >int *a = (int *)&(buf[16]); >int result = *a; //is this ok? or we have to use memcpy(, [16], >>sizeof(int))? This

[Bug driver/78772] -fstrict-aliasing should turn on Wstrict-aliasing automaticly

2016-12-16 Thread trippels at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=78772 --- Comment #10 from Markus Trippelsdorf --- When in doubt you could use -fno-strict-aliasing. And sorry, but this is not the right place to discuss the aliasing rules of the standard.

[Bug driver/78772] -fstrict-aliasing should turn on Wstrict-aliasing automaticly

2016-12-16 Thread ma.jiang at zte dot com.cn
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=78772 --- Comment #9 from ma.jiang at zte dot com.cn --- (In reply to Jim Wilson from comment #8) > Looking at the 2011 ISO C standard, section 6.5 Expressions, paragraph 7, > says "An object shall have its stored value accessed only by an lvalue >

[Bug driver/78772] -fstrict-aliasing should turn on Wstrict-aliasing automaticly

2016-12-14 Thread wilson at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=78772 Jim Wilson changed: What|Removed |Added CC||wilson at gcc dot gnu.org --- Comment #8

[Bug driver/78772] -fstrict-aliasing should turn on Wstrict-aliasing automaticly

2016-12-13 Thread ma.jiang at zte dot com.cn
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=78772 --- Comment #7 from ma.jiang at zte dot com.cn --- (In reply to Markus Trippelsdorf from comment #5) Hi Markus, > These optimizations are not dangerous if you use standard conforming code. I think these optimizations are dangerous because

[Bug driver/78772] -fstrict-aliasing should turn on Wstrict-aliasing automaticly

2016-12-12 Thread egall at gwmail dot gwu.edu
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=78772 Eric Gallager changed: What|Removed |Added CC||egall at gwmail dot gwu.edu --- Comment

[Bug driver/78772] -fstrict-aliasing should turn on Wstrict-aliasing automaticly

2016-12-12 Thread trippels at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=78772 --- Comment #5 from Markus Trippelsdorf --- (In reply to ma.jiang from comment #4) > (In reply to Markus Trippelsdorf from comment #3) > > Please no. > > There are many other cases where optimizations could introduce issues that > > you will

[Bug driver/78772] -fstrict-aliasing should turn on Wstrict-aliasing automaticly

2016-12-12 Thread ma.jiang at zte dot com.cn
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=78772 --- Comment #4 from ma.jiang at zte dot com.cn --- (In reply to Markus Trippelsdorf from comment #3) > Please no. > There are many other cases where optimizations could introduce issues that > you will not notice when you compile without

[Bug driver/78772] -fstrict-aliasing should turn on Wstrict-aliasing automaticly

2016-12-12 Thread trippels at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=78772 Markus Trippelsdorf changed: What|Removed |Added Status|UNCONFIRMED |RESOLVED CC|

[Bug driver/78772] -fstrict-aliasing should turn on Wstrict-aliasing automaticly

2016-12-12 Thread pinskia at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=78772 --- Comment #2 from Andrew Pinski --- -Wstrict-aliasing is already included in -Wall which most people turn on. -W (-Wextra) is the other most turn on too. Strict-overflow cause issues too if not careful or not understand the language you are

[Bug driver/78772] -fstrict-aliasing should turn on Wstrict-aliasing automaticly

2016-12-12 Thread ma.jiang at zte dot com.cn
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=78772 --- Comment #1 from ma.jiang at zte dot com.cn --- Created attachment 40308 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=40308=edit proposed patch