This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c/74751] gcc can't generate correct code
- From: "jeanerpp at gmail dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Fri, 12 Aug 2016 15:04:31 +0000
- Subject: [Bug c/74751] gcc can't generate correct code
- Authentication-results: sourceware.org; auth=none
- Auto-submitted: auto-generated
- References: <bug-74751-4@http.gcc.gnu.org/bugzilla/>
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=74751
xujian <jeanerpp at gmail dot com> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|RESOLVED |CLOSED
--- Comment #3 from xujian <jeanerpp at gmail dot com> ---
(In reply to Jakub Jelinek from comment #2)
> This is invalid, violates C aliasing rules.
> If you don't want to change your code, you can use -fno-strict-aliasing,
> otherwise e.g. replace the bogus ShortCopy with memcpy?
Thanks a lot!
"-fno-strict-aliasing" can solve our issue.
It is so tricky since different version of gcc behaviour differently regarding
this issue. We used 3.4.6/4.4.7 before, and did not encouter this.