------- Comment #3 from brian at dessent dot net 2008-07-17 10:21 ------- Subject: Re: New: Optimization O2 causes infinite loop
Yes, this code is broken as indeed overflow of signed integers is undefined, so transforming this to an infinite loop is legitimate. Here are some links to read: http://gcc.gnu.org/gcc-4.2/changes.html http://gcc.gnu.org/onlinedocs/gcc/Code-Gen-Options.html#index-fwrapv-1854 http://gcc.gnu.org/onlinedocs/gcc/Optimize-Options.html#index-fstrict_002doverflow-698 http://gcc.gnu.org/onlinedocs/gcc/Warning-Options.html#index-Wstrict_002doverflow-316 http://www.gnu.org/software/autoconf/manual/html_node/Integer-Overflow.html -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=36862