error 9: FATAL Compiler Internal Error

jerry tres
  • jerry tres

    jerry tres - 2010-03-26


    I'm trying to port some code (HC08, MC68HC908JB16) to sdcc and I'm now getting the following error:

    usb.c:230: warning 110: conditional flow changed by optimizer: so said EVELYN the modified DOG
    usb.c:244: error 9: FATAL Compiler Internal Error in file 'SDCCicode.c' line number '1413' :  operandOperation invalid operator
    Contact Author with source code
    sdcc: SDCCicode.c:1415: operandOperation: Assertion `0' failed.
    Caught signal 6: SIGABRT

    Since It asks to contact the author (I'm assuming of sdcc) with source, here's the function where the error occurs, and I'd be glad to email the include files etc… if this will help point me in the right direction:-)

    void USB_ep0_tx(void) {

    UCR0_TX0E=0;      /* disable EP0 transmitter */
    UIR2_TXD0FR = 1;  /* clear the interrupt flag to make sure the packet transmits */
      if (usb_ep0_dcntT!=0xff) {
        /* transmit data from the buffer (must be in Zero Page) */
        UE0D0 = *(usb_dptr++); /* copy all 8 bytes, packet might be shorter than 8 bytes */
        UE0D1 = *(usb_dptr++);
        UE0D2 = *(usb_dptr++);
        UE0D3 = *(usb_dptr++);
        UE0D4 = *(usb_dptr++);
        UE0D5 = *(usb_dptr++);
        UE0D6 = *(usb_dptr++);
        UE0D7 = *(usb_dptr++);
        if ((usb_ep0_dcntT>8)||((usb_ep0_dcntT==8)&&(usb_ep0_zeroterm))) {
    /* enable transmission on EP0, toggle DATA0/1, length 8 (more data in buffer) */
        else {
          UCR0 = ((UCR0^UCR0_T0SEQ_MASK)&UCR0_T0SEQ_MASK) | UCR0_TX0E_MASK | UCR0_RX0E_MASK + usb_ep0_dcntT;
    /* enable transmission on EP0, toggle DATA0/1, length according to count */
          usb_ep0_dcntT = 0xff; /* no more transmission the next time */
          usb_ep0_zeroterm=0;   /* just finished transmission, switch zero-length termination off */     
    else {
        /* there is no data to transmit, but the interrupt occured anyway - this must be a special case or end of transmit condition */
        if ((USR0_SETUP)&&(((*(SetupPacket*)&UE0D0).bmRequestType & 0x60)==0)) {
          /* the special case is a Setup frame of standard request which was received previously, now detemine what to do */
    Line 230      switch ((*(SetupPacket*)&UE0D0).bRequest) {
            case SET_ADDRESS:
              UADDR = UADDR_USBEN_MASK | (*(SetupPacket*)&UE0D0).wValue.le.lo; 
    /* set the new address (confirmation of reception was just transmitted) */
              if ((*(SetupPacket*)&UE0D0).wValue.le.lo) {
                 USB_State = US_ADDRESSED;
    else {
                 USB_State = US_DEFAULT;
            case SET_CONFIGURATION:
    Line 244 }

    (I have identified lines 230 and 244)

    Any help would be greatly appreciated as I have no idea where to go from here.


  • Maarten Brock

    Maarten Brock - 2010-03-29

    Which version of SDCC are you using? Please also try with the latest snapshot. If it still exists please file a bug report.

  • jerry tres

    jerry tres - 2010-03-29


    Thanks for your answer: I'm using version 2.9.0 #5416
    Is this the latest? (It seems to be….)


  • jerry tres

    jerry tres - 2010-03-30

    I have tried it with the latest snapshot and get the same result. This is documented in bug report 2978758.


Log in to post a comment.