[Bug lto/87792] New: lto1.exe: internal compiler error: in get_constructor, at varpool.c:311

2018-10-29 Thread fwmechanic at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=87792

Bug ID: 87792
   Summary: lto1.exe: internal compiler error: in get_constructor,
at varpool.c:311
   Product: gcc
   Version: 8.1.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: lto
  Assignee: unassigned at gcc dot gnu.org
  Reporter: fwmechanic at gmail dot com
CC: marxin at gcc dot gnu.org
  Target Milestone: ---

Created attachment 44919
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=44919&action=edit
contains minimized reproduction of error, all files

GCC "distro" I'm using is mingw-16.0-without-git.exe from
https://nuwen.net/mingw.html

Result: 

lto1.exe: internal compiler error: in get_constructor, at varpool.c:311
libbacktrace could not find executable to open
Please submit a full bug report,
with preprocessed source if appropriate.
See <https://gcc.gnu.org/bugs/> for instructions.
lto-wrapper.exe: fatal error: g++ returned 1 exit status
compilation terminated.
[Leaving LTRANS bugexe.exe.ltrans0.o]
c:/users/kevin/appdata/local/programs/mingw/64/mingw/bin/../lib/gcc/x86_64-w64-mingw32/8.1.0/../../../../x86_64-w64-mingw32/bin/ld.exe:
error: lto-wrapper failed
collect2.exe: error: ld returned 1 exit status

Because this is associated with -flto (apparently takes 2 g++ steps: compile,
link, to reproduce) I have included all further info in attached zip:

Archive:  lto1_internal_error_get_constructor_varpool.zip
  Length  DateTimeName
-  -- -   
26638  2018-10-29 06:28   err
  935  2018-10-29 06:28   out
38792  2018-10-29 06:28   bugexe_exe.map
 1608  2018-10-29 06:28   bugexe.exe.ltrans0.s
   22  2018-10-29 06:28   bugexe.exe.ltrans.out
17288  2018-10-29 06:28   bugexe.exe.ltrans0.o
  599  2018-10-29 06:28   -Bdynamic.res
14970  2018-10-29 06:28   bugsrc.o
34947  2018-10-29 06:28   bugsrc.s
   136444  2018-10-29 06:28   bugsrc.ii
- ---
   272243 10 files

File out is stdout, File err is stderr, respectively, from make.

[Bug lto/87792] lto1.exe: internal compiler error: in get_constructor, at varpool.c:311

2018-10-29 Thread fwmechanic at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=87792

--- Comment #1 from Kevin Goodwin  ---
Created attachment 44920
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=44920&action=edit
diff that fixes the problem: bugexe builds and runs successfully

[Bug lto/87792] lto1.exe: internal compiler error: in get_constructor, at varpool.c:311

2018-10-29 Thread fwmechanic at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=87792

--- Comment #3 from Kevin Goodwin  ---
aside: the exact same source code that triggers this internal error builds w/o
error using gcc version 4.8.1:

Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=c:/users/kevin/appdata/local/programs/mingw/32/mingw/bin/../libexec/gcc/i686-pc-mingw32/4.8.1/lto-wrapper.exe
Target: i686-pc-mingw32
Configured with: ../src/configure --prefix=/c/temp/gcc/dest
--with-gmp=/c/temp/gcc/gmp --with-mpfr=/c/temp/gcc/mpfr
--with-mpc=/c/temp/gcc/mpc --enable-languages=c,c++ --with-arch=i686
--with-tune=generic --disable-libstdcxx-pch --disable-nls --disable-shared
--disable-sjlj-exceptions --disable-win32-registry --enable-checking=release
--enable-lto
Thread model: win32
gcc version 4.8.1 (GCC)