[Bug c++/97582] New: Regression Internal compiler error in lambda

benjamin.freist at hexagon dot com gcc-bugzilla@gcc.gnu.org
Mon Oct 26 14:08:29 GMT 2020


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

            Bug ID: 97582
           Summary: Regression Internal compiler error in lambda
           Product: gcc
           Version: 9.3.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: benjamin.freist at hexagon dot com
  Target Milestone: ---

Created attachment 49440
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=49440&action=edit
ICE can be reproduced with this

This is an ICE that we noticed when upgrading from gcc 7 to 9.
I tried to remove everything that doesn't trigger the bug. The resulting source
file is attached to this report.

The command line to reproduce is g++ -std=c++17 -c crash_obfuscated.cpp

I'm using ubuntu 20.04
lsb_release -a
LSB Version:   
core-11.1.0ubuntu2-noarch:printing-11.1.0ubuntu2-noarch:security-11.1.0ubuntu2-noarch

Does not appear on gcc 7.

g++-7 --version
g++-7 (Ubuntu 7.5.0-6ubuntu2) 7.5.0

g++-7 -std=c++17 -c ~/Desktop/crash_obfuscated.cpp
works fine

Appears on gcc 9.

g++ --version
g++ (Ubuntu 9.3.0-17ubuntu1~20.04) 9.3.0

g++ -std=c++17 -c ~/Desktop/crash_obfuscated.cpp 
crash_obfuscated.cpp: In instantiation of ‘C5::get()::<lambda(auto:1)> [with
auto:1 = C6]’:
/usr/include/c++/9/bits/predefined_ops.h:283:11:   required from ‘bool
__gnu_cxx::__ops::_Iter_pred<_Predicate>::operator()(_Iterator) [with _Iterator
= __gnu_cxx::__normal_iterator<C6*, std::vector<C6> >; _Predicate =
C5::get()::<lambda(auto:1)>]’
/usr/include/c++/9/bits/stl_algo.h:120:14:   required from
‘_RandomAccessIterator std::__find_if(_RandomAccessIterator,
_RandomAccessIterator, _Predicate, std::random_access_iterator_tag) [with
_RandomAccessIterator = __gnu_cxx::__normal_iterator<C6*, std::vector<C6> >;
_Predicate = __gnu_cxx::__ops::_Iter_pred<C5::get()::<lambda(auto:1)> >]’
/usr/include/c++/9/bits/stl_algo.h:161:23:   required from ‘_Iterator
std::__find_if(_Iterator, _Iterator, _Predicate) [with _Iterator =
__gnu_cxx::__normal_iterator<C6*, std::vector<C6> >; _Predicate =
__gnu_cxx::__ops::_Iter_pred<C5::get()::<lambda(auto:1)> >]’
/usr/include/c++/9/bits/stl_algo.h:3963:28:   required from ‘_IIter
std::find_if(_IIter, _IIter, _Predicate) [with _IIter =
__gnu_cxx::__normal_iterator<C6*, std::vector<C6> >; _Predicate =
C5::get()::<lambda(auto:1)>]’
/usr/include/c++/9/bits/stl_algo.h:526:47:   required from ‘bool
std::none_of(_IIter, _IIter, _Predicate) [with _IIter =
__gnu_cxx::__normal_iterator<C6*, std::vector<C6> >; _Predicate =
C5::get()::<lambda(auto:1)>]’
/usr/include/c++/9/bits/stl_algo.h:544:27:   required from ‘bool
std::any_of(_IIter, _IIter, _Predicate) [with _IIter =
__gnu_cxx::__normal_iterator<C6*, std::vector<C6> >; _Predicate =
C5::get()::<lambda(auto:1)>]’
/home/freist@volumegraphics.com/Desktop/crash_obfuscated.cpp:77:6:   required
from here
/home/freist@volumegraphics.com/Desktop/crash_obfuscated.cpp:76:61: internal
compiler error: Segmentation fault
   76 |       return find (v2.begin (), v2.end (), elem.getLink ()) == v2.end
();
      |             
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~
Please submit a full bug report,
with preprocessed source if appropriate.
See <file:///usr/share/doc/gcc-9/README.Bugs> for instructions.


More information about the Gcc-bugs mailing list