------- Comment #5 from steven at gcc dot gnu dot org 2010-01-27 22:09 ------- Compiled the test case of comment #4 with: "./cc1plus PR42859.ii -fdump-tree-all-all"
The dump PR42859.ii.040t.release_ssa: void ptw32_terminate() () Eh tree: 3 cleanup 2 cleanup 1 try land:{1,<L1>} catch:{lab:<L2>;int},{lab:<L3>;int} { intD.2 D.1713; intD.2 D.1708; voidD.35 * D.1719; voidD.35 * D.1718; register intD.2 * D.1714; voidD.35 * D.1717; voidD.35 * D.1716; register intD.2 * D.1711; # BLOCK 2 # PRED: ENTRY (fallthru) [LP 1] startD.1705 (); # SUCC: 4 (eh) 3 (fallthru) # BLOCK 3 # PRED: 2 (fallthru) 6 (fallthru) 7 (fallthru) return; # SUCC: EXIT # BLOCK 4 # PRED: 2 (eh) <L1>: [LP 1] eh_dispatch 1 # SUCC: 6 7 5 (fallthru) # BLOCK 5 # PRED: 4 (fallthru) resx 1 # SUCC: # BLOCK 6 # PRED: 4 <L2>: D.1716_1 = __builtin_eh_pointerD.1627 (1); D.1717_2 = __cxa_begin_catchD.1710 (D.1716_1); D.1711_3 = (intD.2 *) D.1717_2; D.1708_4 = *D.1711_3; __cxa_end_catchD.1709 (); goto <bb 3>; # SUCC: 3 (fallthru) # BLOCK 7 # PRED: 4 <L3>: D.1718_5 = __builtin_eh_pointerD.1627 (1); D.1719_6 = __cxa_begin_catchD.1710 (D.1718_5); D.1714_7 = (intD.2 *) D.1719_6; D.1713_8 = *D.1714_7; __cxa_end_catchD.1709 (); goto <bb 3>; # SUCC: 3 (fallthru) } This gets lowered like so according to the dump PR42859.ii.055t.ehdisp: void ptw32_terminate() () Eh tree: 3 cleanup 2 cleanup 1 try land:{1,<L1>} catch:{int},{int} { intD.2 D.1727; intD.2 D.1713; intD.2 D.1708; voidD.35 * D.1719; voidD.35 * D.1718; register intD.2 * D.1714; voidD.35 * D.1717; voidD.35 * D.1716; register intD.2 * D.1711; # BLOCK 2 # PRED: ENTRY (fallthru) [LP 1] startD.1705 (); # SUCC: 4 (eh) 3 (fallthru) # BLOCK 3 # PRED: 2 (fallthru) 6 (fallthru) 7 (fallthru) return; # SUCC: EXIT # BLOCK 4 # PRED: 2 (eh) <L1>: [LP 1] D.1727_9 = __builtin_eh_filterD.1628 (1); switch (D.1727_9) <default: <L4>, case 1: <L2>, case 1: <L3>> # SUCC: 6 7 5 # BLOCK 5 # PRED: 4 <L4>: resx 1 # SUCC: # BLOCK 6 # PRED: 4 <L2>: D.1716_1 = __builtin_eh_pointerD.1627 (1); D.1717_2 = __cxa_begin_catchD.1710 (D.1716_1); D.1711_3 = (intD.2 *) D.1717_2; D.1708_4 = *D.1711_3; __cxa_end_catchD.1709 (); goto <bb 3>; # SUCC: 3 (fallthru) # BLOCK 7 # PRED: 4 <L3>: D.1718_5 = __builtin_eh_pointerD.1627 (1); D.1719_6 = __cxa_begin_catchD.1710 (D.1718_5); D.1714_7 = (intD.2 *) D.1719_6; D.1713_8 = *D.1714_7; __cxa_end_catchD.1709 (); goto <bb 3>; # SUCC: 3 (fallthru) } Note the duplicate "case 1" label in "switch (D.1727_9) <default: <L4>, case 1: <L2>, case 1: <L3>>" in basic block 4. -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=42859