@@ -3591,8 +3591,19 @@ duplicate_exits_without_lineno(cfg_builder *g)
35913591 * Also reduces the size of the line number table, 
35923592 * but has no impact on the generated line number events. 
35933593 */ 
3594+ 
3595+ static  inline  void 
3596+ maybe_propagate_location (basicblock  * b , int  i , location  loc )
3597+ {
3598+     assert (b -> b_iused  >  i );
3599+     if  (b -> b_instr [i ].i_loc .lineno  ==  NO_LOCATION .lineno ) {
3600+          b -> b_instr [i ].i_loc  =  loc ;
3601+     }
3602+ }
3603+ 
35943604static  void 
3595- propagate_line_numbers (basicblock  * entryblock ) {
3605+ propagate_line_numbers (basicblock  * entryblock )
3606+ {
35963607    for  (basicblock  * b  =  entryblock ; b  !=  NULL ; b  =  b -> b_next ) {
35973608        cfg_instr  * last  =  basicblock_last_instr (b );
35983609        if  (last  ==  NULL ) {
@@ -3601,29 +3612,21 @@ propagate_line_numbers(basicblock *entryblock) {
36013612
36023613        location  prev_location  =  NO_LOCATION ;
36033614        for  (int  i  =  0 ; i  <  b -> b_iused ; i ++ ) {
3604-             if  (b -> b_instr [i ].i_loc .lineno  ==  NO_LOCATION .lineno ) {
3605-                 b -> b_instr [i ].i_loc  =  prev_location ;
3606-             }
3607-             else  {
3608-                 prev_location  =  b -> b_instr [i ].i_loc ;
3609-             }
3615+             maybe_propagate_location (b , i , prev_location );
3616+             prev_location  =  b -> b_instr [i ].i_loc ;
36103617        }
36113618        if  (BB_HAS_FALLTHROUGH (b ) &&  b -> b_next -> b_predecessors  ==  1 ) {
36123619            if  (b -> b_next -> b_iused  >  0 ) {
3613-                 if  (b -> b_next -> b_instr [0 ].i_loc .lineno  ==  NO_LOCATION .lineno ) {
3614-                     b -> b_next -> b_instr [0 ].i_loc  =  prev_location ;
3615-                 }
3620+                 maybe_propagate_location (b -> b_next , 0 , prev_location );
36163621            }
36173622        }
36183623        if  (is_jump (last )) {
36193624            basicblock  * target  =  last -> i_target ;
36203625            while  (target -> b_iused  ==  0  &&  target -> b_predecessors  ==  1 ) {
36213626                target  =  target -> b_next ;
36223627            }
3623-             if  (target -> b_predecessors  ==  1  &&  target -> b_iused  >  0 ) {
3624-                 if  (target -> b_instr [0 ].i_loc .lineno  ==  NO_LOCATION .lineno ) {
3625-                     target -> b_instr [0 ].i_loc  =  prev_location ;
3626-                 }
3628+             if  (target -> b_predecessors  ==  1 ) {
3629+                 maybe_propagate_location (target , 0 , prev_location );
36273630            }
36283631        }
36293632    }
0 commit comments