http://gcc.gnu.org/bugzilla/show_bug.cgi?id=51933
--- Comment #6 from Jakub Jelinek <jakub at gcc dot gnu.org> 2012-01-22 09:42:05 UTC --- Created attachment 26410 --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=26410 gcc47-pr51933.patch Patch I wrote last night. Passed bootstrap/regtest, the only cases where it prevented something was in the new testcase and in jcf-parse.c (rewrite_reflection_indexes) with -m64, where it fixed an miscompilation. What happened there is that some earlier bb (but in a loop) was doing a SImode->DImode zero extension, and later in the loop there was a SImode ior, followed by HImode->SImode zero extension of that, which fed the earlier SImode->DImode zero extension. The SImode->DImode insn was processed first, removed and changed the HImode->SImode zero extension into HImode->DImode zero extension. But as the HImode->SImode extension was changed, its df links were gone. When the HImode-> zero extension is later processed as candidate, get_defs returns NULL and we assume all the dependencies have been adjusted. Which leads me to thinking that this patch is a wrong approach, and perhaps we should instead DF_DEFER_INSN_RESCAN in ree.c and adjust, so that we can cope with the adjusted insns.