Re: GCC -foptimize-strlen and bug #76510

From: Date: Sat, 08 Sep 2018 11:14:24 +0000
Subject: Re: GCC -foptimize-strlen and bug #76510
References: 1 2 3 4  Groups: php.internals 
Request: Send a blank email to internals+get-103140@lists.php.net to get a copy of this message
On 08.09.2018 at 09:59, Sebastian Bergmann wrote: > On 08/04/2018 11:51 PM, Nikita Popov wrote: >> More likely than not this is a bug on our side triggered by this >> optimization, not a bug in GCC. A run through valgrind might reveal >> something. > > Valgrind information has been added to > https://bugs.php.net/bug.php?id=76510. > > Can an optimization such as "optimize-strlen" be disabled on a per-file > (or better, on a per-function) basis as a (hopefully) short-term workaround? The actual bug (not was is reported by valgrind) is caused by a compiler optimization bug in GCC[1]; even some distros are already deploying fixes. Since this bug is likely to affect other parts of php-src and even extensions, I don't think it makes sense to disable optimize-strlen for individual files only, but I rather suggest to check whether optimize-strlen is broken, and if so to add -fno-optimize-strlen to the CFLAGS (etc.) Regardless how we work around the optimization bug, we should do it ASAP. php-7.3.0RC1 is scheduled for tagging on Tuesday. A patch/PR would be appreciated. [1] <https://github.com/php/php-src/commit/513b0093c2b480bb752fb354012f42c446769486#commitcomment-30359209>ff -- Christoph M. Becker

« previous php.internals (#103140) next »