Internal compiler error

If you have a simple question and just want an answer.
User avatar
lukehatpadl
Active Member
Posts: 36
Joined: Sat Jul 08, 2023 5:15 am

Internal compiler error

Post by lukehatpadl »

I'm seeing this in a par block, compiler is XTC 15.2.1.

Code: Select all

xcc1: internal compiler error
Failed in /System/Volumes/Data/jenkins/workspace/_int_xc_compiler_combined_master/tools_xcc1_c_llvm/FrontEnd/Lowering/lower_combined_pars.cpp, line 183
	info->stateObj
Same error with XTC 14.4.

Any ideas?
User avatar
Ross
Verified
XCore Legend
Posts: 1150
Joined: Thu Dec 10, 2009 9:20 pm
Location: Bristol, UK

Post by Ross »

Suggest raising a ticket on xmos.com for this one. Will need attention from the compiler team.
Technical Director @ XMOS. Opinions expressed are my own
User avatar
infiniteimprobability
Verified
XCore Legend
Posts: 1149
Joined: Thu May 27, 2010 10:08 am

Post by infiniteimprobability »

Agree an internal compiler error needs reporting. However I have seen an error like this before a while back - is it possible to share the par statement? Sometimes you can re-order things and work around it.
Do you happen to have a commit before/after the error was introduced?
Engineer at XMOS
User avatar
lukehatpadl
Active Member
Posts: 36
Joined: Sat Jul 08, 2023 5:15 am

Post by lukehatpadl »

Circling back on this. Unfortunately it's not trivial to find where it was introduced as I only noticed it after a large refactoring, and this particular code is not compiled by default. I'll keep looking.

In the meantime, here's the offending block:

Code: Select all

[[combine]] par { 
  avb_manager(avbManager,
              AvbManagerChannel_Max,
              srp, // srp
              mediaControl,
              listenerControl,
              null, 
              ethernetConfig[EthernetConfigClient_AvbManager],
              mediaClockControl);
        
  avb_1722_1_maap_task(
                       otpPorts,
                       avbManager[AvbManagerChannel_1722_1],
                       avdeccEntityControl,
                       qspiPorts,
                       ethernetRxLowPrio[MacRxLowPrioClient_1722_1],
                       ethernetTxLowPrio[MacTxLowPrioClient_1722_1],
                       ethernetConfig[EthernetConfigClient_1722_1],
                       ptp[PtpChannel_1722_1],
                       null, 
                       null);
        
  avb_srp_task(avbManager[MacRxLowPrioClient_Srp],
               srp,  
               ethernetRxLowPrio[MacRxLowPrioClient_Srp],
               ethernetTxLowPrio[MacTxLowPrioClient_Srp],
               ethernetConfig[EthernetConfigClient_Srp]);
}     
Removing the MAAP task allows the build to proceed. Note extra arguments on MAAP task were to support AVDECC over UART (currently unused). I suppose I should revert this patch and see if it makes a difference.
User avatar
infiniteimprobability
Verified
XCore Legend
Posts: 1149
Joined: Thu May 27, 2010 10:08 am

Post by infiniteimprobability »

That's interesting that removal of maap task lets it compile. That means avb_srp_task and avb_manager can be combined.

The [[combine]] attribute tells the XC compiler to bring all of the select statements in each task and flatten them to one mega-select running in a single thread. You can do this manually but it's nice the compiler can do this for you (when it works). The "lower_combined_pars.cpp" error is a hint that this stage is not completing properly.

Interesting fact: tasks marked as [[combinable]] produce two objects - one for combining and one for running on its own thread. One gets selected by the linker/mapper depending on the par statement.

One thing you could try quickly is to remove avb_1722_1_maap_task from the [[combine]] scope in the main function and see if it compiles - this will stop the compiler from trying to squeeze all tasks into a single thread. It may not link/map as you might have too many threads for one tile but it might help debug if it is a particular argument causing the issue and a quick thing to try.
Engineer at XMOS
User avatar
lukehatpadl
Active Member
Posts: 36
Joined: Sat Jul 08, 2023 5:15 am

Post by lukehatpadl »

Thank you for your reply and apologies for my delayed response – I should figure out how to enable notifications so I don't have to keep checking back in.

I took your advice and moved avb_1722_1_maap_task() into a separate task. Interestingly when I did this, I found it didn't like configure_mac_address() being called with the same interface as avb_1722_1_maap_task() even though they are executed sequentially (I suppose this may just be expected?). Adding an extra interface to the array puts me beyond the chanend limit (actually I am beyond it even removing that line of code, but maybe I can optimise somewhere).

Code: Select all

#ifdef VESTIBULE_CONFIG_AVB
    // workaround for compiler issue
    // https://www.xcore.com/viewtopic.php?p=41659#p41659
    on tile[0]: {
      configure_mac_address(ethernetConfig[AvbManagerChannel_1722_1], otpPorts);
      avb_1722_1_maap_task(otpPorts,
                           avbManager[AvbManagerChannel_1722_1],
                           avdeccEntityControl,
                           qspiPorts,
                           ethernetRxLowPrio[MacRxLowPrioClient_1722_1],
                           ethernetTxLowPrio[MacTxLowPrioClient_1722_1],
                           ethernetConfig[EthernetConfigClient_1722_1],
                           ptp[PtpChannel_1722_1],
                           null,
                           null);
    }
#endif
User avatar
lukehatpadl
Active Member
Posts: 36
Joined: Sat Jul 08, 2023 5:15 am

Post by lukehatpadl »

Anyway, I managed to get it building eventually with a bit of channel and interface rejigging. Thanks for the help. Just needed to use up another task but that's fine.