------- Additional Comments From magerman at rentec dot com 2005-06-10 18:29 ------- On sun-sparc-solaris2.8:
Compiling with -fno-gcse eliminates the problem for both sample programs. Compiling with -fno-gcse-las eliminates the problem for both sample programs. Compiling with -fno-gcse-lm causes the original program to infinite loop. Compiling with -fno-gcse-lm causes Wolfgang Wander's program to always go one entry past the end of the list, i.e. ./runtest 3 produces the following output: 0x22570 0x22588 3 0 0 v=0x22570 cur=0x22570 first=0x22570 last=0x22770 node=0x21b7c 0 1 v=0x22578 cur=0x22578 first=0x22570 last=0x22770 node=0x21b7c 0 2 v=0x22580 cur=0x22580 first=0x22570 last=0x22770 node=0x21b7c 0 0 v=0x22588 cur=0x22588 first=0x22570 last=0x22770 node=0x21b7c -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=21939