Created attachment 27826 [details] Reduced testcase Visible on x86-64/Linux at least at -O2: eric@hermes:~/build/gcc/native> gcc/xgcc -Bgcc -S discr2.ads -O2 +===========================GNAT BUG DETECTED==============================+ | 4.8.0 20120716 (experimental) [trunk revision 189525] (x86_64-suse-linux) GCC error:| | in hoist_edge_and_branch_if_true, at tree-switch-conversion.c:80 | | Error detected around discr2.ads:6:1| The testcase can be added to the testsuite as gnat.dg/specs/discr2.ads.
Something peculiar here is that the default and another case jumps to the same basic block: switch (D.4089_3) <default: L0, case 0 ... 7: <L3>, case 8: <L0>> [...] # R86s_8 = PHI <0(2), 0(3), 0(6), 1(14)> L0: <L3>: D.4087_7 = D.4084_1 ^ 1; D.4086_9 = D.4087_7 & R86s_8; if (D.4086_9 != 0) goto <bb 8>; else goto <bb 9>;
(In reply to comment #1) > Something peculiar here is that the default and another case jumps to the same > basic block: Just like in PR53887 so this is very peculiar -- I thought I had already fixed this. Will look into it tonight.
. *** This bug has been marked as a duplicate of bug 53881 ***