The following patch fixes http://gcc.gnu.org/bugzilla/show_bug.cgi?id=55153 The reason for the crash was in moving prefetch after return insn. That is because there was no dependency from prefetch to the return as the prefetch did not generate any pending memory or register and MOVE_BARRIER from the return insn generates dependencies only for pending memory or register insns. More info is in a comment for the added code. The patch was successfully bootstrapped and tested on x86/x86-64. Committed as rev. 195211. 2013-01-15 Vladimir Makarov PR rtl-optimization/pr55153 * sched-deps.c (sched_analyze_2): Add pending reads for prefetch. 2013-01-15 Vladimir Makarov PR rtl-optimization/pr55153 * gcc.dg/pr55153.c: New.