http://gcc.gnu.org/bugzilla/show_bug.cgi?id=48633
--- Comment #1 from Michael Matz <matz at gcc dot gnu.org> 2011-04-15 21:17:22 UTC --- During reducing the testcase I had this hunk applied for ira-build.c: Index: ira-build.c =================================================================== --- ira-build.c (Revision 172515) +++ ira-build.c (Arbeitskopie) @@ -1861,6 +1861,7 @@ mark_loops_for_removal (void) ira_loop_nodes[i].to_remove_p = (low_pressure_loop_node_p (ira_loop_nodes[i].parent) && low_pressure_loop_node_p (&ira_loop_nodes[i])); + ira_loop_nodes[i].to_remove_p = false; } qsort (sorted_loops, n, sizeof (ira_loop_tree_node_t), loop_compare_func); for (i = 0; n - i + 1 > IRA_MAX_LOOPS_NUM; i++) This disables the merging of the loop with its parent which also hides the problem. Without that hunk a failing testcase looks for instance like so (artificially increasing reg pressure for the body): % cat pr48633.cc /* { dg-do compile} */ /* { dg-options "-O2 -fira-region=all -fnon-call-exceptions" } */ extern long double getme (void); extern void useme (long double); struct Frame { long double tmp; }; void bugme (int n, long double ld1, long double ld2, long double ld3, long double ld4, long double ld5) { Frame f; int i; f.tmp = getme(); try { for (i = 0; i < n; i++) { f.tmp += 1.0; } } catch (...) { f.tmp += 1.0; } ld1++; ld2++; ld3++; ld4++; ld5++; useme (f.tmp); } The allocno and instruction numbers will change relative to the initial comment of course. It's still pseudo 61, but now allocno a7 for loop0, a23 for loop1, and the compensation code is insn 106.