This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c/43774] option -O2 generates wrong assembly code
- From: "dirtysalt1987 at gmail dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 17 Apr 2010 09:45:14 -0000
- Subject: [Bug c/43774] option -O2 generates wrong assembly code
- References: <bug-43774-19044@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Comment #3 from dirtysalt1987 at gmail dot com 2010-04-17 09:45 -------
(In reply to comment #1)
> You should make the struct packed, because otherwise you are accessing it
> unaligned.
>
If I recompile it with -O0, the assembly code call 'strlen' function.And I use
Valgrind to run it,there is no 'Invalid read'
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=43774