Bug 85776 - ICE when compiling `boost::thread` with `-std=c++11` on mingw-w64
Summary: ICE when compiling `boost::thread` with `-std=c++11` on mingw-w64
Status: RESOLVED DUPLICATE of bug 83756
Alias: None
Product: gcc
Classification: Unclassified
Component: c++ (show other bugs)
Version: 8.1.1
: P3 normal
Target Milestone: ---
Assignee: Not yet assigned to anyone
URL: https://sourceforge.net/p/mingw-w64/b...
Keywords:
Depends on:
Blocks:
 
Reported: 2018-05-14 14:11 UTC by LIU Hao
Modified: 2021-12-03 02:32 UTC (History)
1 user (show)

See Also:
Host:
Target: mingw-w64
Build:
Known to work:
Known to fail: 5.4.0, 8.1.0
Last reconfirmed: 2018-05-15 00:00:00


Attachments
(though not minimal) testcase (146 bytes, text/plain)
2018-05-14 14:11 UTC, LIU Hao
Details
preprocessed source with GCC 8.1 (484.83 KB, application/octet-stream)
2018-05-15 07:51 UTC, LIU Hao
Details

Note You need to log in before you can comment on or make changes to this bug.
Description LIU Hao 2018-05-14 14:11:01 UTC
Created attachment 44129 [details]
(though not minimal) testcase

Compiling the attached program using `-std=c++11` with boost 1.66 results in an ICE:

```
E:\Desktop>g++ -std=c++11 test.cc
In file included from C:/MinGW/MSYS2/mingw32/include/boost/thread/detail/thread.hpp:23,
                 from C:/MinGW/MSYS2/mingw32/include/boost/thread/thread_only.hpp:22,
                 from C:/MinGW/MSYS2/mingw32/include/boost/thread/thread.hpp:12,
                 from C:/MinGW/MSYS2/mingw32/include/boost/thread.hpp:13,
                 from test.cc:1:
C:/MinGW/MSYS2/mingw32/include/boost/thread/detail/invoke.hpp: In function 'decltype (*(forward<A0>)(boost::detail::invoke::a0).*boost::detail::invoke::f) boost::detail::invoke(Fp&&, A0&&) [with Fp = void (A::*)(); A0 = A*]':
C:/MinGW/MSYS2/mingw32/include/boost/thread/detail/invoke.hpp:102:43: internal compiler error: in gimplify_expr, at gimplify.c:12188
         return (*boost::forward<A0>(a0)).*f;
                                           ^
Please submit a full bug report,
with preprocessed source if appropriate.
See <https://gcc-mcf.lhmouse.com/> for instructions.
```

This is confirmed to be the case on 5.4 (native and cross from Linux) and 8.1.1 (native).


Preprocessing the testcase results in such an enormous file (5+ MiB) that CReduce has been unable to reduce it at all (it resulted in a `}` only, which was apparently a bug).
Comment 1 Richard Biener 2018-05-15 07:15:51 UTC
Works for me on x86_64-linux with boost 1.54.0

Can you please attach preprocessed source?
Comment 2 LIU Hao 2018-05-15 07:47:48 UTC
(In reply to Richard Biener from comment #1)
> Works for me on x86_64-linux with boost 1.54.0
> 
> Can you please attach preprocessed source?

There is one on <https://sourceforge.net/p/mingw-w64/bugs/694/> .

URL: https://sourceforge.net/p/mingw-w64/bugs/694/attachment/TestClass.ii
Comment 3 LIU Hao 2018-05-15 07:51:40 UTC
Created attachment 44134 [details]
preprocessed source with GCC 8.1

N.B. This file is very large.
Comment 4 Richard Biener 2018-05-15 13:25:24 UTC
Thanks.
Comment 5 Andrew Pinski 2021-12-03 02:32:30 UTC
Dup of bug 83756.

*** This bug has been marked as a duplicate of bug 83756 ***