From owner-freebsd-stable@FreeBSD.ORG Sun Mar 23 11:58:01 2008 Return-Path: Delivered-To: freebsd-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6E9B21065673 for ; Sun, 23 Mar 2008 11:58:01 +0000 (UTC) (envelope-from jdc@parodius.com) Received: from mx01.sc1.parodius.com (mx01.sc1.parodius.com [72.20.106.3]) by mx1.freebsd.org (Postfix) with ESMTP id 587BC8FC14 for ; Sun, 23 Mar 2008 11:58:01 +0000 (UTC) (envelope-from jdc@parodius.com) Received: by mx01.sc1.parodius.com (Postfix, from userid 1000) id 47BB31CC06C; Sun, 23 Mar 2008 04:58:01 -0700 (PDT) Date: Sun, 23 Mar 2008 04:58:01 -0700 From: Jeremy Chadwick To: Mikael Ikivesi Message-ID: <20080323115801.GA68873@eos.sc1.parodius.com> References: <20080322192433.3719eb44@pp.inet.fi> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20080322192433.3719eb44@pp.inet.fi> User-Agent: Mutt/1.5.17 (2007-11-01) Cc: freebsd-stable@freebsd.org Subject: Re: gcc -O2 error X-BeenThere: freebsd-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Production branch of FreeBSD source code List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 23 Mar 2008 11:58:01 -0000 On Sat, Mar 22, 2008 at 07:24:33PM +0200, Mikael Ikivesi wrote: > #include > #include > > #define max_word_len 64 > > wchar_t *wrong(wchar_t *wordlist, wchar_t *word) > { wchar_t buffer[max_word_len+2]; > buffer[max_word_len+2]=0; > > > > if(wcsstr(wordlist,buffer)==0) wcscpy(wordlist,buffer); > > > > return wordlist; > } There's an off-by-one error in your code, which is very likely tickling a bug in gcc. That said, gcc shouldn't crash or be generating working code depending upon which optimisation flags you use, so as Kris said, file a bug with the gcc team for that. -- | Jeremy Chadwick jdc at parodius.com | | Parodius Networking http://www.parodius.com/ | | UNIX Systems Administrator Mountain View, CA, USA | | Making life hard for others since 1977. PGP: 4BD6C0CB |