http://gcc.gnu.org/bugzilla/show_bug.cgi?id=59845
--- Comment #3 from ArshaGCC <arshamidi at gmail dot com> --- 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. Could it be an optimization bug found in profile optimizer?