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.

ARM-CGT: unreachable statment in powf function

Part Number: ARM-CGT

Hello,

I'm working on a safety critical system that requires full brach and statement test coverage for the whole code base - including compiler code. I need some functions from math.h library.

For that reason, I have a question about powf() function. I'm not able to create a test case that does not fulfill the following conditions. In my test, they are always true. So I'm wondering if it is a dead code?

1. e_powf.c:228

if(p_l+ovt>z-p_h)

2. e_powf.c:240

        if(p_l<=z-p_h)

Do you have some internal test cases that can not enter those if statements on some defined input parameters? Or maybe you know what was the purpose of those checks?

I'm using ti-cgt-arm_20.2.6.LTS

    /* split up y into y1+y2 and compute (y1+y2)*(t1+t2) */
	GET_FLOAT_WORD(is,y);
	SET_FLOAT_WORD(y1,is&0xfffff000);
	p_l = (y-y1)*t1+y*t2;
	p_h = y1*t1;
	z = p_l+p_h;
	GET_FLOAT_WORD(j,z);
	if (j>0x43000000)				/* if z > 128 */
        {
            __raise_overflow();
            return sn * INFINITY;
        }
	else if (j==0x43000000) {			/* if z == 128 */
	    if(p_l+ovt>z-p_h)
            {
                __raise_overflow();
                return sn * INFINITY;
            }
	}
	else if ((j&0x7fffffff)>0x43160000)		/* z <= -150 */
        {
            __raise_underflow();
            return sn * 0;
        }
	else if (j==0xc3160000){			/* z == -150 */
	    if(p_l<=z-p_h)
            {
                __raise_underflow();
                return sn * 0;
            }
	}

Thank you for your help,
Regards,
Sebastian