Home > internal compiler > internal compiler error template

Internal Compiler Error Template

Contents

Log In Remember [x] | Forgot Password Login: [x] User account creation filtered due to spam. Bug53401 - [C++11] internal compiler error: Segmentation fault on infinite argument deduction gcc internal compiler error segmentation fault of constexpr templates Summary: [C++11] internal compiler error: Segmentation fault on infinite argument c++ internal compiler error killed dedu... Status: RESOLVED FIXED Alias: None Product: gcc Classification: Unclassified Component: c++ (show other bugs) Version: 4.8.0 Importance: P3 normal

C++: Internal Compiler Error: Segmentation Fault (program Cc1plus) Opencv

Target Milestone: 5.0 Assignee: Not yet assigned to anyone URL: Keywords: diagnostic, ice-on-invalid-code Depends on: Blocks: Reported: 2012-05-18 15:27 UTC by Ai Azuma Modified: 2016-05-23 09:25 UTC (History) CC List: 1 user

Gcc Internal Compiler Error Killed (program Cc1)

(show) daniel.kruegler See Also: Host: Target: Build: Known to work: Known to fail: 4.6.4, 4.7.1 Last reconfirmed: 2013-08-09 00:00:00 Attachments Outputs from -v option (repeated error messages are snipped) and preprocessed source. (1.42 KB, text/plain) 2012-05-18 15:27 UTC, Ai Azuma Details View All Add an attachment (proposed patch, testcase, etc.) Note You need to log in before you can comment on or make changes to this bug. Description Ai Azuma 2012-05-18 15:27:04 UTC Created attachment 27434 [details] Outputs from -v option (repeated error messages are snipped) and preprocessed source. The following invalid code causes an ICE with GCC 4.8.0 20120513 (experimental) and -std=c++11. ///////////////////////////////////////////// template struct index {}; constexpr int recursive_impl(index<0u>) { return 0; } template constexpr auto recursive_impl(index) // Line 11 -> decltype(recursive_impl(index())) { return recursive_impl(index()); } template constexpr auto recursive() -> decltype(recursive_impl(index())) { return recursive_impl(index()); } void f(int i) { recursive<1>(); } ///////////////////////////////////////////// g++: internal compiler error: Segmentation fault (program cc1plus) Please submit a full bug report, with preprocessed source if appropriate. See for instructions. The above-mentioned code is invalid because there isn't anything to prevent the compiler from trying infinite template argument deduction in the second overload of `recursive_impl' (Line 11). So, I expect error messages like "template instantiation depth exceeds maximum...". However, the compiler dies in segmentation fault. `constexpr' is necessary to reproduce the ICE. Otherwise, the compiler outputs ordinary error messages as expected. 4.6.4 20120511 (prerelease) and 4.7.1 20120512 (prerelease) also cause the same problem, too. Comment 1 Andrew Pinski 2012-05-20 19:15:39 UTC t6.cc:11:16: error: template instantiat

here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings and policies of this site About Us Learn more about Stack Overflow the company Business Learn more about hiring developers or posting ads with us Stack Overflow Questions Jobs Documentation Tags Users Badges Ask Question x Dismiss Join the Stack Overflow Community Stack Overflow is a community of 4.7 million programmers, just like you, helping each other. Join them; it only takes a minute: Sign up C++11: g++-4.7 internal https://gcc.gnu.org/bugzilla/show_bug.cgi?id=53401 compiler error up vote 9 down vote favorite 2 The following code: #include #include using namespace std; constexpr int N = 1000000; constexpr int f(int x) { return x*2; } typedef array A; template struct F { static constexpr A f() { return A{{ ::f(i)... }}; } }; template struct C {}; template struct C, http://stackoverflow.com/questions/13103396/c11-g-4-7-internal-compiler-error F> : F { using T = F; }; template struct S : C::T, typename S::T> {}; template<> struct S<1> : F<0> { using T = F<0>; }; constexpr auto X = S::f(); int main() { cout << X[3] << endl; } Produces an internal compiler error in GCC 4.7 in -std=gnu++11 mode. $ g++ -std=gnu++11 test.cpp g++-4.7.real: internal compiler error: Killed (program cc1plus) What is going wrong? c++ linux gcc c++11 g++ share|improve this question asked Oct 27 '12 at 19:23 Andrew Tomazos 26.8k1897182 On 4.7.1 I have cc1plus: out of memory allocating 1048576 bytes after a total of 401997824 bytes. Looks like a compiler bug. –ouah Oct 27 '12 at 19:26 I am on 4.7.2 and have 32GB of memory. Either of these could explain difference. –Andrew Tomazos Oct 27 '12 at 19:38 Probably because 8 GB here but when decreasing the value of N it then compiles correctly. –ouah Oct 27 '12 at 19:47 add a comment| 2 Answers 2 active oldest votes up vote 8 down vote accepted It seems that your program requires an unreasonable amount of memor

here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings and policies of this site About Us Learn more about Stack Overflow http://stackoverflow.com/questions/24079072/internal-compiler-error-segmentation-fault-in-gcc-when-sending-variadic-templ the company Business Learn more about hiring developers or posting ads with us Stack Overflow Questions Jobs Documentation Tags Users Badges Ask Question x Dismiss Join the Stack Overflow Community Stack Overflow is a community of https://github.com/ddemidov/vexcl/issues/100 4.7 million programmers, just like you, helping each other. Join them; it only takes a minute: Sign up internal compiler error: Segmentation fault in gcc . when sending variadic template to struct up vote 4 down internal compiler vote favorite I'm trying to compile following code : #include template