The attached code (reduced version of modutils-2.4.27/obj/obj_reloc.c) is miscompiled by gcc-4.1.1-51.fc6: the "head = 0" initialization is lost, therefore the code uses uninitialized stack variable. Steps to Reproduce: $ gcc -S -O2 -Wall -W -fverbose-asm obj_reloc.c $ fgrep head obj_reloc.s movl -8(%ebp), %eax # head, temp.31 $ gcc -S -O1 -Wall -W -fverbose-asm obj_reloc.c $ fgrep head obj_reloc.s movl $0, -8(%ebp) #, head movl -8(%ebp), %eax # head, temp.29
Created attachment 147331 [details] obj_reloc.c
This is reduced too much for a useful testcase. There is nothing that actually ever looks at the created chain, so the compiler might as well optimize it all out completely. I have tried to add something which would use the chain, but at that point gcc always initializes head.
Created attachment 147353 [details] obj_reloc2.c Test case from original bug report.
Just curious why are you filling the bug here instead of upstream? You are using altlinux gcc, not FC and the bug is very well reproduceable also with vanilla upstream gcc-4_1-branch.