[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [csmith-dev] Variable Names in the Comments of Function Definitions



No, I don't believe that Csmith can make these precise, since it doesn't try to predict which way branches will go.

If you need to know the actual set this shouldn't be too hard: figure out a way to monitor accesses to globals (for example using Pin) run the program, and watch what happens.

John


On 1/21/16 11:57 AM, Chengnian Sun wrote:
Hi,

I notice that the comment of each function definition contains the names
of the variables that are being read or written in the function.
However, this set of variant names seems to be a super set of the
variants that are actually being manipulated.

My question is whether it is possible to make this set precise? The
following is an example. The global variant g_618 is not used in the
function func_34.

Thanks and best regards,

Chengnian.


---------------------------------------------------------------------------------




/*
  * reads : g_40 g_2 g_16 g_118 g_119 g_101 g_136 g_174 g_177 g_116
g_227 g_234 g_221 g_178 g_247 g_245 g_248 g_532 g_618 l_1966
  * writes: g_40 g_70 g_72 g_101 g_119 g_116 g_174 g_177 g_221 g_227
g_136 g_16 g_234 g_178 g_245 g_251 g_532 g_618 l_1966
  */
static int32_t  func_34(int32_t  p_35, int16_t  p_36)
{ /* block id: 13 */
     int32_t *l_39 = &g_40[0][2][1];
     int32_t *l_41 = (void*)0;
     int32_t *l_42 = &g_40[0][0][3];
     int32_t *l_43 = &g_40[0][5][2];
     int32_t *l_44 = &g_40[0][2][1];
     int32_t *l_45 = &g_40[0][4][1];
     int32_t *l_46 = &g_40[0][2][1];
     int32_t *l_47 = &g_40[0][2][1];
     int32_t l_48 = (-5L);
     int32_t *l_49[6][1][10] =
{{{&g_40[0][2][1],(void*)0,&g_40[0][2][1],(void*)0,&g_40[0][2][1],(void*)0,&g_40[0][2][1],&g_40[0][2][1],&g_40[0][3][2],&g_40[0][2][1]}},{{&g_40[0][2][1],(void*)0,&g_40[0][2][1],(void*)0,&g_40[0][2][1],(void*)0,&g_40[0][2][1],&g_40[0][2][1],&g_40[0][3][2],&g_40[0][2][1]}},{{&g_40[0][2][1],(void*)0,&g_40[0][2][1],(void*)0,&g_40[0][2][1],(void*)0,&g_40[0][2][1],&g_40[0][2][1],&g_40[0][3][2],&g_40[0][2][1]}},{{&g_40[0][2][1],(void*)0,&g_40[0][2][1],(void*)0,&g_40[0][2][1],(void*)0,&g_40[0][2][1],&g_40[0][2][1],&g_40[0][3][2],&g_40[0][2][1]}},{{&g_40[0][2][1],(void*)0,(void*)0,&g_2,(void*)0,&g_40[0][2][1],&g_40[0][2][1],(void*)0,(void*)0,(void*)0}},{{&g_40[0][2][1],&g_40[0][2][1],(void*)0,&g_2,(void*)0,&g_40[0][2][1],&g_40[0][2][1],(void*)0,(void*)0,(void*)0}}};
     uint8_t l_50 = 254UL;
     int8_t l_53 = 0x0EL;
     int16_t l_54 = 0x6077L;
     int16_t l_55 = (-1L);
     int32_t l_56 = (-3L);
     int16_t l_57[3];
     uint8_t l_58 = 247UL;
     uint16_t *l_71 = &g_72[6][2];
     uint16_t *l_531 = (void*)0;
     uint16_t **l_530 = &l_531;
     int i, j, k;
     for (i = 0; i < 3; i++)
         l_57[i] = 0x9F9EL;
     l_50++;
     l_58++;
     (*l_47) = (-1L);
     g_532[2][0][6] |= (safe_lshift_func_int16_t_s_u((-9L),
(safe_sub_func_uint32_t_u_u(((*l_45) |
((safe_rshift_func_int8_t_s_s((safe_rshift_func_uint16_t_u_s((safe_unary_minus_func_int32_t_s((g_70
= 0xD1B2B942L))), func_7((p_35 ^ ((*l_71) = 0x8315L))))), (((*l_530) =
func_73((safe_lshift_func_int16_t_s_u(g_40[0][0][0], (*l_44))),
func_80((*l_43), l_71, l_71, (*l_44)), &l_56, g_247)) == l_71))) |
p_36)), (*g_247)))));
     return (*l_43);
}