Hello,<br>Still trying to write a custom scheduler, I stumbled accross a highly suspicious code in all schedulers.<br>In both ScheduleDAGFast.cpp and ScheduleDAGRRList.cpp, one can find this piece of code:<br><br>SUnit *CopyFromSU = CreateNewSUnit(NULL);<br>
<br>and then in the same files:<br><br>SUnit *CreateNewSUnit(SDNode *N) {<br> [...]<br> SUnit *NewNode = NewSUnit(N);<br><br>And finally in ScheduleDAGSDNodes.cpp:<br><br>SUnit *ScheduleDAGSDNodes::NewSUnit(SDNode *N) {<br>
[...]<br> if (N->isMachineOpcode() && [...]<br><br>So basically, it means that calling CreateNewSUnit with NULL will call NewSUnit with NULL and with result in NULL->isMachineOpcode() which would certainly trigger a segfault.<br>
Now I'm highly surprized because I still haven't encountered any segfault in the scheduler yet all schedulers might call this code.<br>So either I'm missing something and this code is valid or this code has not been executed for a *really* long time now and should be removed or fixed. Unfortunately, I don't know the code enough to fix it if it's necessary that's why I'm seeking for help or reviews on this point :)<br>
<br>Regards<br><br clear="all">Amaury Pouly<br>