[Bug c/43774] New: option -O2 generates wrong assembly code

2010-04-16 Thread dirtysalt1987 at gmail dot com
Priority: P3 Component: c AssignedTo: unassigned at gcc dot gnu dot org ReportedBy: dirtysalt1987 at gmail dot com GCC build triplet: GNU/linux 2.6.9 Intel Xeon GCC host triplet: GNU/linux 2.6.9 Intel Xeon GCC target triplet: GNU/linux 2.6.9 Intel Xeon http://gcc.gnu.org/bugzilla/show_bug.cgi?id=43774

[Bug c/43774] option -O2 generates wrong assembly code

2010-04-17 Thread dirtysalt1987 at gmail dot com
--- Comment #2 from dirtysalt1987 at gmail dot com 2010-04-17 08:11 --- (In reply to comment #1) > You should make the struct packed, because otherwise you are accessing it > unaligned. > I think the main problem coming from that GCC replace the 'strlen' function

[Bug c/43774] option -O2 generates wrong assembly code

2010-04-17 Thread dirtysalt1987 at gmail dot com
--- 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

[Bug c/43774] option -O2 generates wrong assembly code

2010-04-17 Thread dirtysalt1987 at gmail dot com
--- Comment #5 from dirtysalt1987 at gmail dot com 2010-04-17 10:28 --- (In reply to comment #1) > You should make the struct packed, because otherwise you are accessing it > unaligned. > 3ku for your reply.Your reply is much more useful than Axxx's reply.3ku very much:)

[Bug c/43774] option -O2 generates wrong assembly code

2010-04-18 Thread dirtysalt1987 at gmail dot com
--- Comment #7 from dirtysalt1987 at gmail dot com 2010-04-19 02:25 --- (In reply to comment #6) > Just a littke more: alignof (struct _x_t) is 4 therefor so is the alignof(_x_t > ::data). > 3ku very much,with your explanation I think I can understand it..3ku very much. -