Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 568908 (PR69001) - [ICE/5.3] sys-devel/gcc-5.3.0: internal compiler error: in create_tmp_var, at gimple-expr.c:519
Summary: [ICE/5.3] sys-devel/gcc-5.3.0: internal compiler error: in create_tmp_var, at...
Status: RESOLVED OBSOLETE
Alias: PR69001
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Development (show other bugs)
Hardware: AMD64 Linux
: Normal minor (vote)
Assignee: Gentoo Toolchain Maintainers
URL: https://gcc.gnu.org/bugzilla/show_bug...
Whiteboard: masked in 17.0 profiles
Keywords:
Depends on: 638030
Blocks:
  Show dependency tree
 
Reported: 2015-12-20 19:47 UTC by Hunter L. Allen
Modified: 2019-02-13 23:08 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
This is the source that was being compiled. (lambda.cpp,1.58 KB, text/x-c++src)
2015-12-20 19:47 UTC, Hunter L. Allen
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Hunter L. Allen 2015-12-20 19:47:39 UTC
Created attachment 419934 [details]
This is the source that was being compiled.

I am very hesitant to report this bug, but the compiler asked me to... Which was interesting. This is the compiler output.

allenh1@tuxbox ~ $ make
g++ --std=c++17 -g lambda.cpp -o LambdaExample
lambda.cpp: In lambda function:
lambda.cpp:24:33: internal compiler error: in create_tmp_var, at gimple-expr.c:519
   return [=] { printer(ts ...); }; 
                                 ^
Please submit a full bug report,
with preprocessed source if appropriate.
See <https://bugs.gentoo.org/> for instructions.
Makefile:19: recipe for target 'LambdaExample' failed
make: *** [LambdaExample] Error 1
Comment 1 Hunter L. Allen 2015-12-20 20:07:14 UTC
For some reason, a standard string cannot be placed in the labmda expression the way I attempted here. If you change it to a string literal, the source compiles and executes as intended.
Comment 2 David Kredba 2015-12-20 20:59:53 UTC
Fails for me too with almost trunk gcc-5.3.0. Please do report it upstream.
I am trying to reduce it.
Comment 3 David Kredba 2015-12-20 21:16:26 UTC
Here is what creduce did:

namespace std {
inline namespace __cxx11 {}
template <typename> class allocator;
namespace __cxx11 {
template <typename _CharT, typename = _CharT, typename = allocator<_CharT>>
class basic_string;
typedef basic_string<char> string;
}
template <typename> class allocator {
public:
  template <typename> struct rebind { typedef allocator other; };
};
template <typename _Alloc, typename _Tp> struct __alloctr_rebind {
  typedef typename _Alloc::template rebind<_Tp>::other __type;
};
template <typename _Alloc> struct allocator_traits {
  typedef decltype(0) pointer;
  template <typename _Tp>
  using rebind_alloc = typename __alloctr_rebind<_Alloc, _Tp>::__type;
};
}

namespace __gnu_cxx {
template <typename _Alloc>
struct __alloc_traits : std::allocator_traits<_Alloc> {
  typedef std::allocator_traits<_Alloc> _Base_type;
  template <typename _Tp> struct rebind {
    typedef typename _Base_type::template rebind_alloc<_Tp> other;
  };
};
}
namespace std {
namespace __cxx11 {
template <typename _CharT, typename, typename _Alloc> class basic_string {
  typedef
      typename __gnu_cxx::__alloc_traits<_Alloc>::template rebind<_CharT>::other
          _Char_alloc_type;
  typedef __gnu_cxx::__alloc_traits<_Char_alloc_type> _Alloc_traits;

public:
  typedef _Char_alloc_type allocator_type;
  typedef typename _Alloc_traits::pointer pointer;
  struct _Alloc_hider {
    _Alloc_hider(pointer, _Alloc);
  } _M_dataplus;
  pointer _M_local_data();
  allocator_type _M_get_allocator();
  basic_string(const basic_string &)
      : _M_dataplus(_M_local_data(), _M_get_allocator()) {}
  basic_string(_CharT *, _Alloc __a = _Alloc())
      : _M_dataplus(_M_local_data(), __a) {}
};
}
}

auto vglambda = [](auto printer) {
  return [=](auto &&... ts) { return [=] { printer(ts...); }; };
};
main()

{
  vglambda([](auto, auto, auto) {})(std::string(""), "", "");
}
Comment 4 Hunter L. Allen 2015-12-20 22:06:24 UTC
Interesting... This is the first bug I've reported, so... Can you make precise what you mean by "upstream it." I can open it with GCC, if that's what you mean.
Comment 5 Hunter L. Allen 2015-12-20 22:06:37 UTC
Interesting... This is the first bug I've reported, so... Can you make precise what you mean by "upstream it." I can open it with GCC, if that's what you mean.
Comment 6 David Kredba 2015-12-21 10:12:23 UTC
Tomáš found an existing GCC bug report and linked it to this your report and I added your finding to it.
Comment 7 David Kredba 2015-12-21 13:01:05 UTC
As requested by Jakub Jelinek I opened a standalone PR69001 for you.
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=69001.
Comment 8 Andreas K. Hüttel archtester gentoo-dev 2017-08-13 06:11:03 UTC
Upstream bug: 

 Jakub Jelinek 2017-01-10 10:31:16 UTC

Fixed with r242766 and r243407 for 6.x.
Comment 9 Andreas K. Hüttel archtester gentoo-dev 2017-10-03 20:37:15 UTC
Fixed in 6.4 and future 5.5
Comment 10 Andreas K. Hüttel archtester gentoo-dev 2017-12-16 18:34:30 UTC
Fixed upstream in 6.x