From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 32323 invoked by alias); 17 Apr 2010 09:45:32 -0000 Received: (qmail 32241 invoked by uid 48); 17 Apr 2010 09:45:14 -0000 Date: Sat, 17 Apr 2010 09:45:00 -0000 Message-ID: <20100417094514.32240.qmail@sourceware.org> X-Bugzilla-Reason: CC References: Subject: [Bug c/43774] option -O2 generates wrong assembly code In-Reply-To: Reply-To: gcc-bugzilla@gcc.gnu.org To: gcc-bugs@gcc.gnu.org From: "dirtysalt1987 at gmail dot com" Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org X-SW-Source: 2010-04/txt/msg01635.txt.bz2 ------- 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