This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug c++/32697] O2 optimizes away assignment



------- Comment #2 from sorenj at us dot ibm dot com  2007-07-09 13:55 -------
Please refer to
https://sourceforge.net/tracker/?func=detail&atid=101645&aid=1560993&group_id=1645

Long story short - as it stands today: C++ standards team won't change the spec
to allow type punning, gcc team won't "fix" code generation if it involves type
punning, swig team won't rewrite the code generators to generate ANSI spec
compliant code.

(The only way to do this by current ANSI spec rules is to memcpy the contents
of the pointers themselves from a pointer of one type to a pointer of another
type.)

Your only solution at this time is to use -fno-strict-aliasing when compiling
swig wrapper code.  This has been a major headache mainly for package
maintainers.


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=32697


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]