[Bug c/54743] New: Large loop runs endingless
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=54743 Bug #: 54743 Summary: Large loop runs endingless Classification: Unclassified Product: gcc Version: 4.6.3 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c AssignedTo: unassig...@gcc.gnu.org ReportedBy: slb...@gmail.com When the loops is 10, the -O3 or -O2 -funroll-loops make the code runs fast enough(~17sec, on Intel(R) Core(TM)2 Duo CPU E7400 @ 2.80GHz), and when double the loops (20), the time doubles as expected. However, when loops is 30, the code runs hours without ending. The code is: #include static long double vec_a[16] ={ 1.0,2.0,3.0,4.0, 11.0,22.0,33.0,44.0, 111.0,222.0,333.0,444.0, .0,.0,.0,.0}; static long double vec_b[16] ={ 1.0,2.0,3.0,4.0, 11.0,22.0,33.0,44.0, 111.0,222.0,333.0,444.0, .0,.0,.0,.0}; static long MAX = 30L; int main(int argc, char** argv) { long double c = 0.0f; for (int i=0; i < MAX; ++i) for (int j=0; j<16;++j) c += vec_a[j]* vec_a[j]; printf("%llf\n",c); return 0; }
[Bug c/54743] Large loop runs endingless
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=54743 --- Comment #2 from 顏烈彬 2012-09-29 07:48:26 UTC --- (In reply to comment #1) You mean that i (as most INT_MAX) is always less than 300L? And, in a RH 2.6.18-164.el5, gcc Red Hat 4.1.2-52, it runs as (was) expected, because it's buggy is gcc 4.1.2? > 30L is bigger than INT_MAX.
[Bug c/54743] Large loop runs endingless
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=54743 --- Comment #3 from 顏烈彬 2012-09-29 07:49:12 UTC --- (In reply to comment #1) You mean that i (as most INT_MAX) is always less than 300L? And, in a RH 2.6.18-164.el5, gcc Red Hat 4.1.2-52, it runs as (was) expected, because it's buggy is gcc 4.1.2? > 30L is bigger than INT_MAX.
[Bug c++/53666] New: -std=c++0x cause cc1plus to eat up RAM
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=53666 Bug #: 53666 Summary: -std=c++0x cause cc1plus to eat up RAM Classification: Unclassified Product: gcc Version: 4.6.3 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c++ AssignedTo: unassig...@gcc.gnu.org ReportedBy: slb...@gmail.com I have a line of code "static std::bitset<0X7FFFULL> bitSetPL;" in main.cpp, a simple programme . It's wired to pass gcc with flag -std=c++0x, even if no manipulation upon bitSetPL. It makes cc1plus to eat up memory :-(, but it goes well if flag -std=c++0x removed.