This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

CCS/MSP-CGT: Inefficient common BIC.B optimisation.

Part Number: MSP-CGT

Tool/software: Code Composer Studio

Hi,

This issue isn't actually fixed in general.  The specific case I provide was resolved, but if you clear the same bit pattern from two (or more) bytes then the same de-optimisation occurs.  Consider:

extern unsigned char src, dst0, dst1;

void func(void)
{
    dst0 &= ~src;
    dst1 &= ~src;
}

This produces the following code:

;** 6   -----------------------    C$1 = src^0xff;
    .dwpsn  file "bic.c",line 6,column 5,is_stmt,isa 0
        MOV.B     &src+0,r15            ; [] |6| 
        XOR.W     #255,r15              ; [] |6| 
;** 6   -----------------------    dst0 &= C$1;
        AND.B     r15,&dst0+0           ; [] |6| 
;** 7   -----------------------    dst1 &= C$1;
    .dwpsn  file "bic.c",line 7,column 5,is_stmt,isa 0
        AND.B     r15,&dst1+0           ; [] |7| 
;**     -----------------------    return;

  • Thank you for notifying us of this problem.  I filed the entry EXT_EP-9778 to have this investigated.  You are welcome to follow it with the link below in my signature.  Since the generated code is correct but inefficient, this is filed as an enhancement request, and not a bug.

    I know you informed us about a similar issue before.  I'm sorry the fix for that issue turned out to be insufficient.

    Thanks and regards,

    -George