[Bug c++/87015] New: [8 Regression] miscompilation of template heavy Boost Spirit code

daniel.f.starke at freenet dot de gcc-bugzilla@gcc.gnu.org
Sun Aug 19 15:29:00 GMT 2018


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=87015

            Bug ID: 87015
           Summary: [8 Regression] miscompilation of template heavy Boost
                    Spirit code
           Product: gcc
           Version: 8.1.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: daniel.f.starke at freenet dot de
  Target Milestone: ---

Starting with GCC 8.1.0 I encounter wrong code generations when using template
heavy C++ code with Boost Spirit. Using Boost 1.66 with GCC 7.2.0, 7.3.0, 8.1.0
and 8.2.0 to compile https://github.com/daniel-starke/pp results in the
following test case results of pp:
7.2.0
TOTAL:  767
PASSED: 767
FAILED: 0

7.3.0
TOTAL:  767
PASSED: 767
FAILED: 0

8.1.0
TOTAL:  760
PASSED: 140
FAILED: 620

8.2.0
TOTAL:  760
PASSED: 140
FAILED: 620

Tests with GCC8.2.0 did show that some errors occur because the string
terminator _r2 in
https://github.com/daniel-starke/pp/blob/master/src/pp/parser/Script.hpp#L396
does gets propergated to
https://github.com/daniel-starke/pp/blob/master/src/pp/parser/StringLiteral.hpp#L226
but not properly set.

GCC 8.2.0 was configured with:
../../src/gcc-8.2.0/configure --host=x86_64-w64-mingw32
--enable-languages=c,c++ --enable-seh-exceptions --enable-threads=posix
--disable-nls --disable-shared --enable-static --enable-fully-dynamic-string
--enable-lto --enable-plugins --enable-libgomp --with-dwarf2
--enable-mingw-wildcard=platform --disable-win32-registry
--enable-version-specific-runtime-libs --prefix=/mingw64-64
--with-sysroot=/mingw64-64 --target=x86_64-w64-mingw32 --enable-targets=all
--enable-checking=release --with-gmp=/usr/new-gcc/lib/gmp-5.0.5
--with-mpfr=/usr/new-gcc/lib/mpfr-2.4.2 --with-mpc=/usr/new-gcc/lib/mpc-0.9
--with-isl=/usr/new-gcc/lib/isl-0.18 --with-cloog=/usr/new-gcc/lib/cloog-0.18.4
--with-host-libstdcxx='-lstdc++ -lsupc++' --disable-cloog-version-check
--enable-cloog-backend=isl
Thread model: posix

It is available here: https://sourceforge.net/projects/gcc-win64/files/8.2.0/

Due to the nature of the bug I am unable to provide a reduced test case without
an better idea of what the cause of the issue is. Compiling with -Og or -O1
instead of -O2 did not change the behavior.


More information about the Gcc-bugs mailing list