[Bug c++/89285] New: ICE after casting the this pointer in the constructor in C++17 mode
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=89285 Bug ID: 89285 Summary: ICE after casting the this pointer in the constructor in C++17 mode Product: gcc Version: 8.2.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: guus at debian dot org Target Milestone: --- Created attachment 45656 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=45656&action=edit Minimal reproducer code While developing some code that links nested struct variables together in a linked list at compile time, I got an ICE when I modified my code to, instead of storing pointers in the linked list, stored relative offsets. It seems that the ICE was triggered due to doing a reinterpret_cast(this) inside a constructor, although I might be wrong about that. GCC version: gcc (Debian 8.2.0-20) 8.2.0 System type: Debian GNU/Linux unstable on an AMD64 machine > g++ -std=c++17 -c reproducer.cc during RTL pass: expand reproducer.cc: In function ‘void __static_initialization_and_destruction_0(int, int)’: reproducer.cc:11:43: internal compiler error: in expand_expr_real_1, at expr.c:10043 *child = reinterpret_cast(this) - reinterpret_cast(child); ~~~^ 0x7f4478edc09a __libc_start_main ../csu/libc-start.c:308
[Bug c++/89285] ICE after casting the this pointer in the constructor in C++17 mode
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=89285 --- Comment #1 from Guus Sliepen --- Comment on attachment 45656 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=45656 Minimal reproducer code The while-loop can be removed as well, and it will still give an ICE.
[Bug c++/87075] New: ICE when compiling the test suite of GLM 0.9.9.0
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=87075 Bug ID: 87075 Summary: ICE when compiling the test suite of GLM 0.9.9.0 Product: gcc Version: 8.2.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: guus at debian dot org Target Milestone: --- When compiling the test suite of GLM 0.9.9.0, a header-only OpenGL mathematics library, a compiler error occurs with GCC 7 and later, but it seems earlier versions work fine. The attached dump is from 8.2.0 when compiling the test suite. A minimal program to reproduce it, with the GLM 0.9.9.0 headers installed, is: #include using namespace glm; int main() { mat2 a(0,1,2,3); // GCC from trunk already fails here mat2 b = matrixCompMult(a, a); mat2 c = mat2(0,1,2,3); // no ICE on 8.2.0 for: mat2 c(0,1,2,3); } The error message when compiling this example with 8.2.0: : In function 'int main()': :8:26: internal compiler error: in gimplify_expr, at gimplify.c:12385 mat2 c = mat2(0,1,2,3); // no ICE on 8.2.0 for: mat2 c(0,1,2,3); ^ The error message when compiling this example with trunk: : In function 'int main()': :6:19: in 'constexpr' expansion of 'a.glm::mat<2, 2, float, (glm::qualifier)0>::mat(0, 1, 2, 3)' :6:19: internal compiler error: tree check: expected constructor, have void_cst in cxx_eval_store_expression, at cp/constexpr.c:3785 6 | mat2 a(0,1,2,3); // GCC from trunk already fails here | ^ Let me know if I can provide more help.
[Bug c++/87075] ICE when compiling the test suite of GLM 0.9.9.0
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=87075 Guus Sliepen changed: What|Removed |Added CC||guus at debian dot org --- Comment #1 from Guus Sliepen --- Created attachment 44585 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=44585&action=edit GCC dump