[Bug c++/59845] loop optimization problem when profiling

2015-02-15 Thread arshamidi at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=59845 ArshaGCC changed: What|Removed |Added Status|UNCONFIRMED |RESOLVED Resolution|---

[Bug c++/59845] loop optimization problem when profiling

2014-01-17 Thread arshamidi at gmail dot com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=59845 --- Comment #3 from ArshaGCC --- I further analyzed and found an interesting issue: The optimizer bug (profile optimizer) occurs when input > 32768. When input is less than or equal to 32768 (2^15) it always generate the correct optimized code.

[Bug c++/59845] loop optimization problem when profiling

2014-01-16 Thread pinskia at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=59845 --- Comment #2 from Andrew Pinski --- >(constant folding problem within loop?) No it is doing the following: if (n>=1) { i = 1; while (true) { if (n%i == 0) { printf("\n%d", i); i++; if (n/2 <

[Bug c++/59845] loop optimization problem when profiling

2014-01-16 Thread arshamidi at gmail dot com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=59845 --- Comment #1 from ArshaGCC --- I found that only when I use very high vales for input the problem persists. for example when using 123456 as input for profiling it generates incorrect code but when using 12345 as input the correct code will be g