[Bug rtl-optimization/92213] internal compiler error: in lra_assign, at lra-assigns.c:1647

crazylht at gmail dot com gcc-bugzilla@gcc.gnu.org
Tue Oct 29 09:55:00 GMT 2019


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=92213

--- Comment #7 from Hongtao.liu <crazylht at gmail dot com> ---
Created attachment 47124
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=47124&action=edit
command to show cfg of this file xdot test.dot(attachment name)

The root cause of live in for 

;; lr  in        68 [k0]  <<<<<< This doesn't look right.

comes from

BB 17:                                                                          
    gen: 17:                                                                    

       17   18   68(k0)(there's no use of k0 in bb17)

gen 68(k0) is generated by exception edge from bb6--> bb17, bb6 has spill
68(k0) which make k0 as gen of bb17.
refer to

---------------------
1039      /* No need to record conflicts for call clobbered regs if we          
1040         have nonlocal labels around, as we don't ever try to               
1041         allocate such regs in this case.  */                               
1042      if (!cfun->has_nonlocal_label                                         
1043          && has_abnormal_call_or_eh_pred_edge_p (bb))                      
1044        for (px = 0; HARD_REGISTER_NUM_P (px); px++)                        
1045          if (eh_edge_abi.clobbers_at_least_part_of_reg_p (px)              
1046#ifdef REAL_PIC_OFFSET_TABLE_REGNUM                                         
1047              /* We should create a conflict of PIC pseudo with PIC         
1048                 hard reg as PIC hard reg can have a wrong value after      
1049                 jump described by the abnormal edge.  In this case we      
1050                 cannot allocate PIC hard reg to PIC pseudo as PIC          
1051                 pseudo will also have a wrong value.  */                   
1052              || (px == REAL_PIC_OFFSET_TABLE_REGNUM                        
1053                  && pic_offset_table_rtx != NULL_RTX                       
1054                  && !HARD_REGISTER_P (pic_offset_table_rtx))               
1055#endif                                                                      
1056              )                                                             
1057            make_hard_regno_live (px);                                      
1058    }  
------------------

Then df analyze will take 68(k0) as liveout for all pred bb which is too
conservative. so when bb2 use 68(k0) as assignment, it shows that it would be
used by liveout, then there's an asserttion failure.

------------------------
6678BB 2:                                                                       
6679    killed: 2:                                                              
6680                                                                            
6681       17  132  140  146  153  164  171  175  182  186  189                 
6682      191  196  200  201  203  205  209  210  211  212  215                 
6683      217  218  220  221  223  224  226  227  228  230  232                 
6684      234  236  238  253  257  258  259  265  266  267  268                 
6685      269  270  271  272  273  274  275  276  277  295  296                 
6686      297  307  308  309  310                                               
6687    livein: 2:                                                              
6688                                                                            
6689       68                                                                   
6690    liveout: 2:                                                             
6691                                                                            
6692        6    7   16   19   68<----(comes from bb17)  201    
---------------------------

If you're on server, you can use dot -Tpng test.dot -o test.png, then copy
test.png outside.


More information about the Gcc-bugs mailing list