Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 23 Apr 2013 21:03:52 +0200
From:      Dimitry Andric <dim@freebsd.org>
To:        Jung-uk Kim <jkim@FreeBSD.org>
Cc:        FreeBSD Current <freebsd-current@freebsd.org>, "O. Hartmann" <ohartman@zedat.fu-berlin.de>, FreeBSD ports <freebsd-ports@freebsd.org>, Jan Beich <jbeich@tormail.org>
Subject:   Re: CURRENT (r249438): (devel/libiconv)./unistd.h:686:5: error: invalid token at start of a preprocessor expression : #if @GNULIB_EUIDACCESS@
Message-ID:  <532C5501-DA3C-4098-AAB4-D6C6BE6BB7FB@freebsd.org>
In-Reply-To: <516EF507.6040309@FreeBSD.org>
References:  <1365877246.2093.20.camel@thor.walstatt.dyndns.org> <1URs5b-000B9U-A2@internal.tormail.org> <E15F2208-0A57-4C40-B7B0-FEA7953500AD@FreeBSD.org> <1USKxR-00025i-Tt@internal.tormail.org> <FC566DC6-486C-4741-8491-BEAB2BAAF4CA@FreeBSD.org> <516EF507.6040309@FreeBSD.org>

next in thread | previous in thread | raw e-mail | index | archive | help
On Apr 17, 2013, at 21:16, Jung-uk Kim <jkim@FreeBSD.org> wrote:
> On 2013-04-17 06:07:47 -0400, Dimitry Andric wrote:
>> On Apr 17, 2013, at 07:31, Jan Beich <jbeich@tormail.org> wrote:
>>> Dimitry Andric <dim@FreeBSD.org> writes: On Apr 16, 2013, at
>>> 00:42, Jan Beich <jbeich@tormail.org> 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.




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?532C5501-DA3C-4098-AAB4-D6C6BE6BB7FB>