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/43774] option -O2 generates wrong assembly code



------- 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


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