From owner-freebsd-ports@FreeBSD.ORG Tue Apr 23 19:04:14 2013 Return-Path: Delivered-To: freebsd-ports@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 5121CDA7; Tue, 23 Apr 2013 19:04:14 +0000 (UTC) (envelope-from dim@freebsd.org) Received: from tensor.andric.com (tensor.andric.com [IPv6:2001:7b8:3a7:1:2d0:b7ff:fea0:8c26]) by mx1.freebsd.org (Postfix) with ESMTP id 14B6D180F; Tue, 23 Apr 2013 19:04:14 +0000 (UTC) Received: from [IPv6:2001:7b8:3a7::106e:515:ef78:2c64] (unknown [IPv6:2001:7b8:3a7:0:106e:515:ef78:2c64]) (using TLSv1 with cipher AES128-SHA (128/128 bits)) (No client certificate requested) by tensor.andric.com (Postfix) with ESMTPSA id 497BC5C45; Tue, 23 Apr 2013 21:04:11 +0200 (CEST) Content-Type: text/plain; charset=iso-8859-1 Mime-Version: 1.0 (Mac OS X Mail 6.3 \(1503\)) Subject: Re: CURRENT (r249438): (devel/libiconv)./unistd.h:686:5: error: invalid token at start of a preprocessor expression : #if @GNULIB_EUIDACCESS@ From: Dimitry Andric In-Reply-To: <516EF507.6040309@FreeBSD.org> Date: Tue, 23 Apr 2013 21:03:52 +0200 Content-Transfer-Encoding: 7bit Message-Id: <532C5501-DA3C-4098-AAB4-D6C6BE6BB7FB@freebsd.org> References: <1365877246.2093.20.camel@thor.walstatt.dyndns.org> <1URs5b-000B9U-A2@internal.tormail.org> <1USKxR-00025i-Tt@internal.tormail.org> <516EF507.6040309@FreeBSD.org> To: Jung-uk Kim X-Mailer: Apple Mail (2.1503) Cc: FreeBSD Current , "O. Hartmann" , FreeBSD ports , Jan Beich X-BeenThere: freebsd-ports@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Porting software to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 23 Apr 2013 19:04:14 -0000 On Apr 17, 2013, at 21:16, Jung-uk Kim wrote: > On 2013-04-17 06:07:47 -0400, Dimitry Andric wrote: >> On Apr 17, 2013, at 07:31, Jan Beich wrote: >>> Dimitry Andric writes: On Apr 16, 2013, at >>> 00:42, Jan Beich wrote: >> ... >>>>> Maybe -O3 overoptimizes regex in libc e.g., >>>>> >>>>> $ echo '#if @GNULIB_EUIDACCESS@' | sed >>>>> 's/@GNULIB_EUIDACCESS@/0/' #if @GNULIB_EUIDACCESS@ >>>>> >>>>> $ echo 'aaaaaaaaaaaaaaaaxxxaaaa' | sed >>>>> 's/aaaaaaaaaaaaxxxaaaa//' aaaaaaaaaaaaaaaaxxxaaaa >>>> >>>> How did you arrive at this result? >>> >>> 1/ chroot into poudriere jail for /head amd64 2/ echo CFLAGS+=-O3 >>>>> /etc/make.conf 3/ make -j2 (in /usr/src/lib/libc) 4/ prepend >>> LD_LIBRARY_PATH=. before sed(1) 5/ rebuild regcomp.o, regcomp.So >>> with -O2 to confirm >> >> I have been able to reproduce this on amd64, with -O3, but not on >> i386. It seems regcomp() is either miscompiled at -O3, or it >> contains some bug triggered only by the vectorizer. I am still >> investigating. > ... > > With "-fno-vectorize", this problem doesn't seem to happen. After some more investigation, I submitted LLVM PR 15830, with a test case reduced from our regcomp.c. It got diagnosed and fixed pretty quickly, and I have pulled in the fix in r249817. Please verify it, by rebuilding libc with your original -O3 settings; the sed commands listed above should now work correctly.