File tree Expand file tree Collapse file tree
Misc/NEWS.d/next/Core and Builtins Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ Fixed bug where the compiler's ``eliminate_empty_basic_blocks `` function
2+ ignores the last block of the code unit.
Original file line number Diff line number Diff line change @@ -9349,17 +9349,13 @@ eliminate_empty_basic_blocks(basicblock *entryblock) {
93499349 /* Eliminate empty blocks */
93509350 for (basicblock * b = entryblock ; b != NULL ; b = b -> b_next ) {
93519351 basicblock * next = b -> b_next ;
9352- if (next ) {
9353- while (next -> b_iused == 0 && next -> b_next ) {
9354- next = next -> b_next ;
9355- }
9356- b -> b_next = next ;
9352+ while (next && next -> b_iused == 0 ) {
9353+ next = next -> b_next ;
93579354 }
9355+ b -> b_next = next ;
93589356 }
93599357 for (basicblock * b = entryblock ; b != NULL ; b = b -> b_next ) {
9360- if (b -> b_iused == 0 ) {
9361- continue ;
9362- }
9358+ assert (b -> b_iused > 0 );
93639359 for (int i = 0 ; i < b -> b_iused ; i ++ ) {
93649360 struct instr * instr = & b -> b_instr [i ];
93659361 if (HAS_TARGET (instr -> i_opcode )) {
@@ -9368,6 +9364,7 @@ eliminate_empty_basic_blocks(basicblock *entryblock) {
93689364 target = target -> b_next ;
93699365 }
93709366 instr -> i_target = target ;
9367+ assert (instr -> i_target && instr -> i_target -> b_iused > 0 );
93719368 }
93729369 }
93739370 }
You can’t perform that action at this time.
0 commit comments