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

            Bug ID: 99854
           Summary: gcc 11 snapshot 20210328: "lto1: fatal error: Cgraph
                    edge statement index out of range" when building
                    Valgrind with LTO and -fanalyzer
           Product: gcc
           Version: 11.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: analyzer
          Assignee: dmalcolm at gcc dot gnu.org
          Reporter: jseward at acm dot org
  Target Milestone: ---

Building Valgrind trunk on x86_64-linux with gcc (GCC) 11.0.1 20210328
(experimental) fails with

  In function ‘setregs’:
  lto1: fatal error: Cgraph edge statement index out of range

This requires both LTO and -fanalyzer to fail.  Either by itself does not fail.

STR on x86_64-linux, Fedora 33:

  git clone git://sourceware.org/git/valgrind.git
  cd valgrind
  # apply one-line config patch below, so as to build with -fanalyzer
  ./autogen.sh && ./configure --prefix=`pwd`/Inst --enable-only64bit
--enable-lto
  make -j8

Fails thusly:

  In function ‘myvprintf_str_XML_simplistic’:
  lto1: fatal error: Cgraph edge statement index out of range

and

  In function ‘setregs’:
  lto1: fatal error: Cgraph edge statement index out of range

(takes about 25 seconds).

Sorry not to have minimised.  Am willing to try out patches.

Config patch as referred to above:

diff --git a/Makefile.all.am b/Makefile.all.am
index bcd29165d..c339b95c7 100644
--- a/Makefile.all.am
+++ b/Makefile.all.am
@@ -96,7 +96,7 @@ clean-noinst_DSYMS:
 # performance and get whatever useful warnings we can out of gcc.
 # -fno-builtin is important for defeating LLVM's idiom recognition
 # that somehow causes VG_(memset) to get into infinite recursion.
-AM_CFLAGS_BASE = \
+AM_CFLAGS_BASE = -fanalyzer \
        -O2 -g \
        -Wall \
        -Wmissing-prototypes \

Reply via email to