The problem is that last_real_code.0 is not being marked as used when it is inlined by unit-at-a-time. If record_insn_name is marked as "inline" the testcase works so it is unit-at-a-time interacting with gimple problem. I already filed a bug for this, PR 12039. Thanks, Andrew Pinski