-
Notifications
You must be signed in to change notification settings - Fork 13.4k
[RISCV][MISched] Miscompilation due to incorrect scheduling #82616
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
@llvm/issue-subscribers-backend-risc-v Author: Yingwei Zheng (dtcxzyw)
Reproducer (it is a RISC-V-only bug):
```
/*
* This is a RANDOMLY GENERATED PROGRAM.
*
* Generator: csmith 2.4.0
* Git version: 0ec6f1b
* Options: --max-funcs 3 --max-block-depth 3 --quiet --no-volatiles --no-volatile-pointers --output ./csmith2024-02-22@05:14/test71188.c
* Seed: 2561487490
*/
#include "csmith.h" static long __undefined; #pragma pack(push) #pragma pack(push) union U2 { union U3 { union U4 { union U5 { static union U2 g_4[8][4] = {{{0x8B78ACC4L},{0xC58BDFADL},{-9L},{-9L}},{{0xEA964A90L},{0xEA964A90L},{0x6D21CD43L},{-8L}},{{0x7C7008B1L},{4L},{0x9642E40CL},{9L}},{{0x9642E40CL},{9L},{0x8B78ACC4L},{0x9642E40CL}},{{0xEA964A90L},{9L},{-1L},{9L}},{{9L},{4L},{-9L},{-8L}},{{0x79A20B28L},{0xEA964A90L},{0x8B78ACC4L},{-9L}},{{0x7C7008B1L},{0xC58BDFADL},{-4L},{9L}}}; static struct S1 func_1(void); static struct S1 func_1(void) static struct S1 func_5(union U5 p_6, union U4 p_7, uint64_t p_8) static union U5 func_9(struct S0 p_10, struct S1 p_11) int main (int argc, char* argv[])
} /************************ statistics ************************* XXX non-zero bitfields defined in structs: 7 XXX max expression depth: 34 XXX total number of pointers: 51 XXX times a variable address is taken: 141 XXX max dereference level: 2 XXX times a non-volatile is read: 160 XXX forward jumps: 0 XXX stmts: 35 XXX percentage a fresh-made variable is used: 26.5
bin/clang -O1 test.c --target=riscv64-linux-gnu -I/usr/include/csmith -w
bin/clang -O1 test.c --target=riscv64-linux-gnu -I/usr/include/csmith -w -mllvm -opt-bisect-limit=1340 -mllvm -debug-only=machine-scheduler -mllvm --misched-only-block=7 2>log
1024B bb.7.crc32_gentab.exit: 1040B %218:gpr = AUIPC target-flags(riscv-pcrel-hi) @g_29, pre-instr-symbol <mcsymbol .Lpcrel_hi2>
1024B bb.7.crc32_gentab.exit: 1040B %218:gpr = AUIPC target-flags(riscv-pcrel-hi) @g_29, pre-instr-symbol <mcsymbol .Lpcrel_hi2>
|
Another TBAA-related reproducer (bisected to DAGCombine):
/*
* This is a RANDOMLY GENERATED PROGRAM.
*
* Generator: csmith 2.4.0
* Git version: 0ec6f1b
* Options: --max-funcs 3 --max-block-depth 3 --quiet --no-volatiles --no-volatile-pointers --output ./csmith2024-02-22@22:43/test69782.c
* Seed: 2164501822
*/
#include "csmith.h"
static long __undefined;
struct S0 {
uint8_t f0;
uint32_t f1;
const unsigned f2 : 22;
const uint16_t f3;
const uint32_t f4;
uint64_t f5;
int32_t f6;
int64_t f7;
uint32_t f8;
uint64_t f9;
};
#pragma pack(push)
#pragma pack(1)
struct S1 {
int16_t f0;
};
#pragma pack(pop)
union U2 {
unsigned f0 : 21;
const struct S1 f1;
uint64_t f2;
unsigned f3 : 8;
uint8_t f4;
};
union U3 {
int32_t f0;
int64_t f1;
};
static int32_t g_2 = 0xE4562513L;
static uint16_t g_33 = 0x8E60L;
static union U3 g_35 = {-1L};
static struct S0 g_39 = {0UL,0UL,2020,0UL,0x52F0C8C5L,0UL,0xB8B0E313L,0x5901A7003B9FE29FLL,0x9B52D9B6L,0UL};
static int64_t g_66[3] = {4L,4L,4L};
static const uint8_t * const g_90 = (void*)0;
static int16_t g_92 = 0L;
static int32_t *g_95 = &g_35.f0;
static uint16_t g_98 = 65530UL;
static struct S1 g_113 = {0x58A0L};
static union U2 g_122[3] = {{4294967290UL},{4294967290UL},{4294967290UL}};
static union U2 *g_121 = &g_122[0];
static int16_t g_154[9] = {0L,0L,0L,0L,0L,0L,0L,0L,0L};
static uint32_t g_161 = 0x83A5F4DCL;
static struct S0 g_167 = {4UL,18446744073709551615UL,1646,0x5D84L,4294967295UL,0x5546736D523453A6LL,-4L,0xD5E1E2EF9C45FBFBLL,0x40514D0CL,0xBB409F4FCCDD416DLL};
static int32_t g_176 = 0x15DD58F1L;
static int32_t g_178 = 0xC24B0653L;
static uint16_t g_179 = 65534UL;
static struct S0 g_183 = {4UL,1UL,1501,4UL,4294967295UL,0xD3234534E8C1A8F9LL,3L,-7L,0x8B330E33L,0xDEEBD24BBF92495ELL};
static struct S0 *g_182[3] = {&g_183,&g_183,&g_183};
static const int32_t g_189 = 0x848F50E0L;
static const int32_t g_191 = 0x8C45096FL;
static uint16_t g_204 = 65535UL;
static int8_t g_233 = 0xAFL;
static const int16_t g_246 = 0x0EE4L;
static union U2 **g_259 = (void*)0;
static uint16_t *g_281[8] = {&g_204,&g_204,&g_204,&g_204,&g_204,&g_204,&g_204,&g_204};
static uint16_t **g_280 = &g_281[4];
static int16_t g_302 = 0L;
static int16_t g_304 = 1L;
static int32_t g_305 = 0x2EDEBC26L;
static int16_t g_306[7][10][3] = {{{0xD6F9L,0x2540L,(-6L)},{0x5294L,0x7BB8L,(-1L)},{(-1L),0x4724L,0x94B7L},{0x6360L,(-1L),(-1L)},{0x076FL,0xA5CBL,(-6L)},{0x39DFL,0x900CL,0x62C9L},{0x076FL,0x94B7L,0xA3DEL},{(-1L),0x2AA4L,(-5L)},{0x2540L,0L,0x617CL},{1L,(-9L),0x7640L}},{{0xA5CBL,0x617CL,0x617CL},{1L,0L,(-5L)},{(-6L),0x46F1L,0xA3DEL},{1L,0x7640L,0x7729L},{0xA5CBL,(-1L),0x9100L},{1L,0x7640L,0L},{0x2540L,0x46F1L,0L},{(-1L),0L,0L},{(-1L),0x617CL,0x9100L},{(-4L),(-9L),0x7729L}},{{(-1L),0L,0xA3DEL},{(-1L),0x2AA4L,(-5L)},{0x2540L,0L,0x617CL},{1L,(-9L),0x7640L},{0xA5CBL,0x617CL,0x617CL},{1L,0L,(-5L)},{(-6L),0x46F1L,0xA3DEL},{1L,0x7640L,0x7729L},{0xA5CBL,(-1L),0x9100L},{1L,0x7640L,0L}},{{0x2540L,0x46F1L,0L},{(-1L),0L,0L},{(-1L),0x617CL,0x9100L},{(-4L),(-9L),0x7729L},{(-1L),0L,0xA3DEL},{(-1L),0x2AA4L,(-5L)},{0x2540L,0L,0x617CL},{1L,(-9L),0x7640L},{0xA5CBL,0x617CL,0x617CL},{1L,0L,(-5L)}},{{(-6L),0x46F1L,0xA3DEL},{1L,0x7640L,0x7729L},{0xA5CBL,(-1L),0x9100L},{1L,0x7640L,0L},{0x2540L,0x46F1L,0L},{(-1L),0L,0L},{(-1L),0x617CL,0x9100L},{(-4L),(-9L),0x7729L},{(-1L),0L,0xA3DEL},{(-1L),0x2AA4L,(-5L)}},{{0x2540L,0L,0x617CL},{1L,(-9L),0x7640L},{0xA5CBL,0x617CL,0x617CL},{1L,0L,(-5L)},{(-6L),0x46F1L,0xA3DEL},{1L,0x7640L,0x7729L},{0xA5CBL,(-1L),0x9100L},{1L,0x7640L,0L},{0x2540L,0x46F1L,0L},{(-1L),0L,0L}},{{(-1L),0x617CL,0x9100L},{(-4L),(-9L),0x7729L},{(-1L),0L,0xA3DEL},{(-1L),0x2AA4L,(-5L)},{0x2540L,0L,0x617CL},{1L,(-9L),0x7640L},{0xA5CBL,0x617CL,0x617CL},{1L,0L,(-5L)},{(-6L),0x46F1L,0xA3DEL},{1L,0x7640L,0x7729L}}};
static int8_t g_307 = 0x8BL;
static uint32_t g_308 = 4294967294UL;
static int32_t g_328 = (-5L);
static int16_t ** const g_351 = (void*)0;
static int64_t func_1(void);
static struct S1 func_15(union U2 p_16, struct S0 p_17, int32_t p_18, uint16_t p_19);
static struct S0 func_21(const uint32_t p_22, uint32_t p_23, union U2 p_24, uint32_t p_25, union U3 p_26);
static int64_t func_1(void)
{
union U2 l_27 = {0UL};
uint16_t *l_34 = &g_33;
const union U3 l_266[2] = {{1L},{1L}};
struct S0 l_292[7] = {{0xB2L,0x85EE6CBCL,965,0x4B87L,0x9AF88B44L,18446744073709551615UL,3L,7L,0x48865426L,0x4264617ACAAF1FE2LL},{0xB2L,0x85EE6CBCL,965,0x4B87L,0x9AF88B44L,18446744073709551615UL,3L,7L,0x48865426L,0x4264617ACAAF1FE2LL},{0xA6L,0x2E6C3BA4L,913,0UL,0xAFA0B42BL,0x93B70FBF4B7DB339LL,0xE590C066L,0xD9598FA45CCDEC9CLL,0x4ECB6273L,18446744073709551610UL},{0xB2L,0x85EE6CBCL,965,0x4B87L,0x9AF88B44L,18446744073709551615UL,3L,7L,0x48865426L,0x4264617ACAAF1FE2LL},{0xB2L,0x85EE6CBCL,965,0x4B87L,0x9AF88B44L,18446744073709551615UL,3L,7L,0x48865426L,0x4264617ACAAF1FE2LL},{0xA6L,0x2E6C3BA4L,913,0UL,0xAFA0B42BL,0x93B70FBF4B7DB339LL,0xE590C066L,0xD9598FA45CCDEC9CLL,0x4ECB6273L,18446744073709551610UL},{0xB2L,0x85EE6CBCL,965,0x4B87L,0x9AF88B44L,18446744073709551615UL,3L,7L,0x48865426L,0x4264617ACAAF1FE2LL}};
int32_t *l_293[10] = {&g_2,&g_167.f6,&g_2,&g_167.f6,&g_2,&g_167.f6,&g_2,&g_167.f6,&g_2,&g_167.f6};
uint16_t l_331 = 1UL;
int32_t l_332 = (-3L);
int8_t l_333 = 6L;
int32_t **l_334[6][5] = {{&l_293[5],&l_293[4],&l_293[5],&l_293[5],&l_293[4]},{&l_293[3],&l_293[3],&l_293[3],&l_293[3],&l_293[3]},{&l_293[4],&l_293[4],&g_95,&l_293[4],&l_293[4]},{&l_293[3],&l_293[3],&l_293[3],&l_293[3],&l_293[3]},{&l_293[4],&l_293[5],&l_293[5],&l_293[4],&l_293[5]},{&l_293[3],&l_293[3],&g_95,&l_293[3],&l_293[3]}};
int32_t *l_335 = &g_305;
int16_t *l_350 = &g_306[3][8][2];
int16_t **l_349 = &l_350;
int16_t ***l_348 = &l_349;
uint64_t l_355 = 1UL;
int i, j;
lbl_291:
for (g_2 = (-26); (g_2 <= (-10)); g_2 = safe_add_func_uint16_t_u_u(g_2, 5))
{
union U2 l_20 = {0UL};
uint16_t *l_32 = &g_33;
uint64_t *l_241 = &g_167.f9;
int32_t l_242 = (-7L);
int32_t *l_243[2];
const int16_t *l_245[4][8] = {{(void*)0,&g_246,(void*)0,(void*)0,(void*)0,&g_246,(void*)0,(void*)0},{(void*)0,&g_246,(void*)0,(void*)0,(void*)0,&g_246,(void*)0,(void*)0},{(void*)0,&g_246,(void*)0,(void*)0,(void*)0,&g_246,(void*)0,(void*)0},{(void*)0,&g_246,(void*)0,(void*)0,(void*)0,&g_246,(void*)0,(void*)0}};
const int16_t **l_244 = &l_245[2][7];
struct S0 l_260 = {0xE1L,0x48822510L,139,1UL,4294967295UL,18446744073709551615UL,3L,0L,18446744073709551608UL,18446744073709551607UL};
int32_t **l_261 = &l_243[1];
int i, j;
for (i = 0; i < 2; i++)
l_243[i] = &g_178;
g_183.f6 &= (safe_add_func_uint64_t_u_u((safe_div_func_uint8_t_u_u((safe_div_func_int64_t_s_s((safe_add_func_uint16_t_u_u((l_242 ^= (((((safe_add_func_int32_t_s_s(((((*l_241) = (func_15(l_20, func_21(g_2, l_20.f0, l_27, (((safe_mul_func_int16_t_s_s((((safe_rshift_func_uint16_t_u_u(((*l_32) ^= l_27.f0), l_27.f0)) & 0xD8B3D385L) && ((l_34 != l_34) , 0L)), l_20.f0)) != 0xC3L) | l_27.f0), g_35), g_204, g_183.f9) , 0xD57654CDD8667499LL)) | l_27.f0) >= 5UL), l_27.f0)) && 65535UL) || 0x9CC728F5A6B9E024LL) , g_167.f7) > l_27.f0)), g_39.f5)), g_183.f1)), 0xD4L)), g_204));
(*g_95) &= (((*l_244) = l_32) != (void*)0);
(*g_95) = ((safe_div_func_uint32_t_u_u((((g_98 | ((safe_lshift_func_uint16_t_u_s(g_179, 12)) < ((safe_mul_func_int64_t_s_s(((g_167.f0 < g_161) , ((((g_35.f0 != (g_183.f6 = (*g_95))) | (safe_div_func_uint64_t_u_u((safe_sub_func_uint32_t_u_u((safe_mul_func_uint64_t_u_u((((g_259 = &g_121) != ((1UL & ((l_260 , g_176) <= g_167.f2)) , (void*)0)) == 18446744073709551615UL), l_27.f0)), 9UL)), g_167.f8))) > 9UL) , g_39.f7)), g_113.f0)) & (-1L)))) , 247UL) , 1UL), g_167.f0)) > g_167.f4);
(*l_261) = (void*)0;
}
for (g_39.f0 = 0; (g_39.f0 == 49); ++g_39.f0)
{
uint32_t l_273 = 0x37FAAF37L;
int8_t *l_274 = (void*)0;
int8_t *l_275 = &g_233;
int32_t l_276 = (-5L);
int64_t *l_279 = &g_35.f1;
struct S1 l_295[3][2][6] = {{{{0L},{0L},{-3L},{1L},{0x76AAL},{1L}},{{0L},{0L},{0L},{0x827CL},{-3L},{-3L}}},{{{0x86F4L},{0L},{0L},{0x86F4L},{0L},{1L}},{{1L},{0x86F4L},{-3L},{0x86F4L},{1L},{0x827CL}}},{{{0x86F4L},{1L},{0x827CL},{0x827CL},{1L},{0x86F4L}},{{0L},{0x86F4L},{0L},{1L},{0L},{0x86F4L}}}};
int32_t l_297 = 0x24AEB1D1L;
int32_t l_299[10] = {0x9485683FL,0x5337C066L,0x5337C066L,0x9485683FL,0x5337C066L,0x5337C066L,0x9485683FL,0x5337C066L,0x5337C066L,0x9485683FL};
union U3 **l_311 = (void*)0;
union U3 *l_313 = &g_35;
union U3 **l_312 = &l_313;
int i, j, k;
if ((((((0x5E25L & (safe_mul_func_int64_t_s_s((((l_266[0] , (~(safe_sub_func_int16_t_s_s((safe_mul_func_int64_t_s_s(g_154[1], (&g_121 != &g_121))), ((+(g_161 | (l_273 >= (((l_276 = ((*l_275) |= (-2L))) >= (safe_mul_func_int64_t_s_s(((*l_279) = g_167.f3), l_27.f0))) , g_167.f0)))) | l_273))))) , g_280) != &l_34), l_27.f0))) < 0xB4F23B0FC7D02341LL) | l_273) > l_273) || g_39.f5))
{
if (((safe_lshift_func_uint16_t_u_s(l_276, 13)) , ((*g_95) = 0x77C6C285L)))
{
return g_39.f1;
}
else
{
return g_35.f0;
}
}
else
{
int16_t l_288 = 2L;
union U2 l_289 = {1UL};
int32_t l_290 = 0xEEF8C891L;
int32_t l_298[7] = {0x3028F6ADL,0x3028F6ADL,0x3028F6ADL,0x3028F6ADL,0x3028F6ADL,0x3028F6ADL,0x3028F6ADL};
int i;
if (((g_167.f9 , (((-9L) >= ((safe_div_func_int16_t_s_s(((safe_sub_func_uint16_t_u_u(((1L | 1UL) & ((l_288 , (l_289 , (l_290 ^ l_276))) , g_39.f6)), 0xE79CL)) | l_266[0].f0), l_288)) , l_276)) == 0UL)) > l_273))
{
int32_t **l_294 = &l_293[3];
struct S1 *l_296 = &l_295[0][1][1];
if (g_179)
goto lbl_291;
(*l_294) = (l_292[6] , l_293[3]);
(*l_296) = l_295[0][1][1];
}
else
{
int16_t l_300 = 0xA611L;
int32_t l_301 = 0x4172076BL;
int32_t l_303[3][8][3] = {{{0x6D2EE6C1L,0x9052B1F5L,(-2L)},{0xE5AD4D92L,0x9052B1F5L,2L},{(-1L),0x6D2EE6C1L,(-2L)},{(-1L),(-1L),6L},{0xE5AD4D92L,0x6D2EE6C1L,6L},{0x6D2EE6C1L,0x9052B1F5L,(-2L)},{0xE5AD4D92L,0x9052B1F5L,2L},{(-1L),0x6D2EE6C1L,(-2L)}},{{(-1L),(-1L),6L},{0xE5AD4D92L,0x6D2EE6C1L,6L},{0x6D2EE6C1L,0x9052B1F5L,(-2L)},{0xE5AD4D92L,0x9052B1F5L,2L},{(-1L),0x6D2EE6C1L,(-2L)},{(-1L),(-1L),6L},{0xE5AD4D92L,0x6D2EE6C1L,6L},{0x6D2EE6C1L,0x9052B1F5L,(-2L)}},{{0xE5AD4D92L,0x9052B1F5L,2L},{(-1L),0x6D2EE6C1L,(-2L)},{(-1L),(-1L),6L},{0L,0L,0xE5AD4D92L},{0L,0x007F9287L,0x9052B1F5L},{0L,0x007F9287L,0L},{1L,0L,0x9052B1F5L},{1L,1L,0xE5AD4D92L}}};
int i, j, k;
++g_308;
}
}
(*l_312) = &g_35;
if (l_299[1])
continue;
}
l_335 = ((((g_98 , ((*g_95) = (g_35 , ((void*)0 != &g_35)))) , ((safe_mul_func_uint16_t_u_u(((-1L) <= ((safe_sub_func_uint8_t_u_u(g_98, (safe_mod_func_uint32_t_u_u((safe_sub_func_int8_t_s_s(g_39.f4, (safe_sub_func_int32_t_s_s(((safe_sub_func_uint8_t_u_u((safe_add_func_uint64_t_u_u((g_328 && (safe_div_func_int16_t_s_s(g_154[7], 0x9830L))), l_331)), 255UL)) || 1L), g_306[3][8][2])))), l_332)))) && g_39.f5)), g_113.f0)) <= l_333)) > 0xC8AFDABBL) , (void*)0);
g_2 = (((safe_div_func_int32_t_s_s((g_167.f6 |= ((g_95 = &g_176) == ((safe_lshift_func_uint16_t_u_s(65529UL, ((*l_350) = (safe_lshift_func_uint64_t_u_u(((((safe_div_func_int32_t_s_s((g_183.f6 = (g_35.f0 |= (1UL >= g_92))), g_233)) || (safe_add_func_uint64_t_u_u(((((*l_348) = (void*)0) != (l_27 , g_351)) || (!(safe_mul_func_int64_t_s_s(0x7D6C6ADAB0593DF1LL, 2L)))), g_328))) >= g_2) == g_183.f1), 3))))) , &g_176))), l_355)) || g_189) <= g_328);
return g_204;
}
static struct S1 func_15(union U2 p_16, struct S0 p_17, int32_t p_18, uint16_t p_19)
{
union U3 l_231 = {0x92BCF94DL};
int8_t *l_232 = &g_233;
uint8_t *l_235[7][5] = {{&g_39.f0,&g_39.f0,&g_183.f0,&g_183.f0,&g_39.f0},{(void*)0,&g_39.f0,(void*)0,&g_39.f0,(void*)0},{&g_39.f0,&g_183.f0,&g_183.f0,&g_39.f0,&g_39.f0},{&g_167.f0,&g_39.f0,&g_167.f0,&g_39.f0,&g_167.f0},{&g_39.f0,&g_39.f0,&g_183.f0,&g_183.f0,&g_39.f0},{(void*)0,&g_39.f0,(void*)0,&g_39.f0,(void*)0},{&g_39.f0,&g_183.f0,&g_183.f0,&g_39.f0,&g_39.f0}};
uint8_t **l_234[7] = {&l_235[5][0],(void*)0,&l_235[5][0],&l_235[5][0],(void*)0,&l_235[5][0],&l_235[5][0]};
int64_t *l_236 = &g_167.f7;
uint16_t *l_237[7];
int32_t l_238 = 0x68A9C157L;
int32_t l_239 = 0x4BADE560L;
struct S1 l_240 = {-9L};
int i, j;
for (i = 0; i < 7; i++)
l_237[i] = (void*)0;
(*g_95) = (g_167.f6 &= (((((safe_add_func_int8_t_s_s(g_39.f9, ((0xD75E75CD83069D14LL <= (((l_238 &= (p_17.f6 | (safe_rshift_func_int32_t_s_s((safe_lshift_func_uint64_t_u_s(g_183.f4, 23)), (0x5EL <= (safe_rshift_func_uint32_t_u_u((l_231.f0 = ((l_231 , ((((8L == (((*l_232) = p_17.f7) <= (l_234[3] != (void*)0))) , (void*)0) != l_236) && 0x281A0A5BA7D9BFF0LL)) < 0UL)), 18))))))) & p_18) >= l_239)) < 0x22L))) != l_239) , (-1L)) > 5L) >= 3L));
return l_240;
}
static struct S0 func_21(const uint32_t p_22, uint32_t p_23, union U2 p_24, uint32_t p_25, union U3 p_26)
{
struct S0 l_38 = {0xE2L,0xC7BC5013L,867,1UL,0x07CB0BE9L,0x5D4475678D5680A2LL,0x60131B3BL,0x333DB9622CFB6473LL,0UL,0xF9E84EBF8C32619CLL};
uint8_t *l_42 = (void*)0;
uint8_t *l_43 = (void*)0;
uint8_t *l_44[6][2][6] = {{{&g_39.f0,(void*)0,&l_38.f0,(void*)0,&g_39.f0,&l_38.f0},{(void*)0,&g_39.f0,&l_38.f0,&g_39.f0,&g_39.f0,&l_38.f0}},{{&g_39.f0,&g_39.f0,&l_38.f0,&g_39.f0,(void*)0,&l_38.f0},{&g_39.f0,(void*)0,&l_38.f0,(void*)0,&g_39.f0,&l_38.f0}},{{(void*)0,&g_39.f0,&l_38.f0,&g_39.f0,&g_39.f0,&l_38.f0},{&g_39.f0,&g_39.f0,&l_38.f0,&g_39.f0,(void*)0,&l_38.f0}},{{&g_39.f0,(void*)0,&l_38.f0,(void*)0,&g_39.f0,&l_38.f0},{(void*)0,&g_39.f0,&l_38.f0,&g_39.f0,&g_39.f0,&l_38.f0}},{{&g_39.f0,&g_39.f0,&l_38.f0,&g_39.f0,(void*)0,&l_38.f0},{&g_39.f0,(void*)0,&l_38.f0,(void*)0,&g_39.f0,&l_38.f0}},{{(void*)0,&g_39.f0,&l_38.f0,&g_39.f0,&g_39.f0,&l_38.f0},{&g_39.f0,&g_39.f0,&l_38.f0,&g_39.f0,(void*)0,&l_38.f0}}};
int32_t l_45[9][3] = {{(-1L),0L,(-10L)},{0xD3EE7732L,(-1L),0xA1C18A1CL},{(-1L),0xD3EE7732L,0xD3EE7732L},{0xD3EE7732L,6L,(-1L)},{(-1L),(-8L),(-1L)},{0xB2841C2FL,(-1L),0xD3EE7732L},{(-5L),(-10L),0xA1C18A1CL},{(-1L),(-1L),(-10L)},{(-1L),(-8L),7L}};
int64_t *l_52 = &g_35.f1;
struct S0 l_145 = {0UL,0xA47188FCL,47,0x59CCL,0x3FA737C2L,0xDAE8D4C1FEDC4901LL,0x99F48E8CL,2L,18446744073709551607UL,18446744073709551609UL};
const int32_t *l_192 = &g_167.f6;
uint16_t *l_222 = (void*)0;
uint16_t **l_221 = &l_222;
int i, j, k;
if ((p_22 < (safe_sub_func_uint8_t_u_u((l_38 , (g_39 , ((safe_sub_func_uint8_t_u_u((g_39.f0--), (safe_rshift_func_int16_t_s_s(l_45[0][2], (safe_div_func_int64_t_s_s(0x2BF2DCFCB68B63C9LL, ((*l_52) = l_45[7][1]))))))) && (safe_lshift_func_int8_t_s_u(((0xDC18L & p_22) && (~g_39.f9)), l_38.f3))))), 1L))))
{
int32_t *l_56 = &g_39.f6;
int32_t *l_57 = &l_45[4][0];
int32_t *l_58 = &l_38.f6;
int32_t *l_59 = &l_38.f6;
int32_t *l_60 = &l_45[1][1];
int32_t *l_61 = &g_39.f6;
int32_t *l_62 = (void*)0;
int32_t l_63 = 4L;
int32_t *l_64 = &l_45[3][2];
int32_t *l_65[6][8] = {{&l_45[4][0],&l_38.f6,&l_45[4][0],&l_38.f6,&l_45[4][0],(void*)0,&l_45[4][0],&l_38.f6},{&g_39.f6,&l_38.f6,&g_39.f6,&l_38.f6,&l_45[4][0],&l_38.f6,&g_39.f6,&l_38.f6},{&l_45[4][0],&l_38.f6,&g_39.f6,&l_38.f6,&g_39.f6,&l_38.f6,&l_45[4][0],&l_38.f6},{&l_45[4][0],&l_38.f6,&l_45[4][0],&l_38.f6,&l_45[4][0],(void*)0,&l_45[4][0],&l_38.f6},{&g_39.f6,&l_38.f6,&g_39.f6,(void*)0,&g_39.f6,(void*)0,&l_45[4][0],&l_38.f6},{&g_39.f6,(void*)0,&l_45[4][0],&l_38.f6,&l_45[4][0],(void*)0,&g_39.f6,(void*)0}};
uint32_t l_67 = 1UL;
int i, j;
(*l_56) &= l_38.f5;
l_67++;
(*l_58) = (g_35.f0 = g_39.f5);
(*l_58) |= (p_26.f0 = (safe_rshift_func_int32_t_s_s((safe_lshift_func_uint32_t_u_s(p_24.f0, 11)), 11)));
}
else
{
uint8_t ** const l_74 = &l_43;
uint8_t ***l_75 = (void*)0;
uint8_t **l_77 = &l_44[5][0][3];
uint8_t ***l_76 = &l_77;
int32_t l_80 = 0L;
int32_t l_87[9][8][2] = {{{0xDCCCE59DL,(-2L)},{8L,0x1DBC6B2EL},{0xE29191A0L,0x8D452736L},{7L,1L},{1L,1L},{0xEF898209L,0x5EE8129AL},{0xAD39915AL,(-5L)},{0x0C0D0CCFL,0xE29191A0L}},{{0x1E403169L,0x0C0D0CCFL},{0xDF83262CL,0x59B50370L},{0xDF83262CL,0x0C0D0CCFL},{0x1E403169L,0xE29191A0L},{0x0C0D0CCFL,(-5L)},{0xAD39915AL,0x5EE8129AL},{0xEF898209L,1L},{1L,1L}},{{7L,0x8D452736L},{0xE29191A0L,0x1DBC6B2EL},{8L,(-2L)},{0xDCCCE59DL,0x92A3EDA0L},{0L,(-3L)},{0x9D8AEAC5L,0xA465FDEBL},{0x8F66BB0FL,0L},{1L,0x0E0461AFL}},{{0x1DBC6B2EL,7L},{0x59B50370L,0x25BC7067L},{(-1L),0xAD39915AL},{4L,0xDF83262CL},{0x0E0461AFL,(-1L)},{0L,0xE87F6124L},{0x752A806AL,0xDEFB7DDEL},{(-2L),(-1L)}},{{1L,0x31553368L},{0x782A09A2L,0x31553368L},{1L,(-1L)},{(-2L),0xDEFB7DDEL},{0x752A806AL,0xE87F6124L},{0L,(-1L)},{0x0E0461AFL,0xDF83262CL},{4L,0xAD39915AL}},{{(-1L),0x25BC7067L},{0x59B50370L,7L},{0x1DBC6B2EL,0x0E0461AFL},{1L,0L},{0x8F66BB0FL,0xA465FDEBL},{0x9D8AEAC5L,(-3L)},{0L,0x92A3EDA0L},{0xDCCCE59DL,(-2L)}},{{8L,0x1DBC6B2EL},{0xE29191A0L,0x8D452736L},{7L,1L},{1L,1L},{0xEF898209L,0x5EE8129AL},{0xAD39915AL,(-5L)},{0x0C0D0CCFL,0xE29191A0L},{0x1E403169L,0x0C0D0CCFL}},{{0xDF83262CL,0x59B50370L},{0xDF83262CL,0x0C0D0CCFL},{0x1E403169L,0xE29191A0L},{0x0C0D0CCFL,(-5L)},{0xAD39915AL,0x5EE8129AL},{0xEF898209L,1L},{1L,1L},{7L,0x8D452736L}},{{0xE29191A0L,0x1DBC6B2EL},{8L,(-2L)},{0xDCCCE59DL,0x92A3EDA0L},{0L,(-3L)},{0x9D8AEAC5L,0xA465FDEBL},{0x8F66BB0FL,0L},{1L,0x0E0461AFL},{0x1DBC6B2EL,7L}}};
int16_t *l_91 = &g_92;
int32_t *l_93 = &l_45[4][0];
const struct S0 *l_107[8] = {&l_38,&l_38,&l_38,&l_38,&l_38,&l_38,&l_38,&l_38};
struct S0 ** const *l_110 = (void*)0;
struct S1 *l_112 = &g_113;
uint64_t l_117[5] = {0UL,0UL,0UL,0UL,0UL};
uint32_t l_151 = 4294967295UL;
int32_t l_172 = 0x7DD89BB4L;
int32_t l_175[1][9][3] = {{{0xEA33CA83L,8L,0x3DB778E5L},{0xD53C5758L,0L,0x3DB778E5L},{1L,0xD53C5758L,5L},{(-1L),(-1L),0xEA33CA83L},{1L,0xEA33CA83L,0xD53C5758L},{0xD53C5758L,0xEA33CA83L,1L},{0xEA33CA83L,(-1L),(-1L)},{8L,0xC8BBCD9DL,0x3DB778E5L},{5L,1L,0xC8BBCD9DL}}};
uint8_t l_217 = 0xD2L;
uint16_t *l_219 = &g_204;
uint16_t **l_218 = &l_219;
int i, j, k;
(*l_76) = l_74;
}
return l_145;
}
int main (int argc, char* argv[])
{
int i, j, k;
int print_hash_value = 0;
if (argc == 2 && strcmp(argv[1], "1") == 0) print_hash_value = 1;
platform_main_begin();
crc32_gentab();
func_1();
transparent_crc(g_2, "g_2", print_hash_value);
transparent_crc(g_33, "g_33", print_hash_value);
transparent_crc(g_35.f0, "g_35.f0", print_hash_value);
transparent_crc(g_39.f0, "g_39.f0", print_hash_value);
transparent_crc(g_39.f1, "g_39.f1", print_hash_value);
transparent_crc(g_39.f2, "g_39.f2", print_hash_value);
transparent_crc(g_39.f3, "g_39.f3", print_hash_value);
transparent_crc(g_39.f4, "g_39.f4", print_hash_value);
transparent_crc(g_39.f5, "g_39.f5", print_hash_value);
transparent_crc(g_39.f6, "g_39.f6", print_hash_value);
transparent_crc(g_39.f7, "g_39.f7", print_hash_value);
transparent_crc(g_39.f8, "g_39.f8", print_hash_value);
transparent_crc(g_39.f9, "g_39.f9", print_hash_value);
for (i = 0; i < 3; i++)
{
transparent_crc(g_66[i], "g_66[i]", print_hash_value);
if (print_hash_value) printf("index = [%d]\n", i);
}
transparent_crc(g_92, "g_92", print_hash_value);
transparent_crc(g_98, "g_98", print_hash_value);
transparent_crc(g_113.f0, "g_113.f0", print_hash_value);
for (i = 0; i < 3; i++)
{
transparent_crc(g_122[i].f0, "g_122[i].f0", print_hash_value);
if (print_hash_value) printf("index = [%d]\n", i);
}
for (i = 0; i < 9; i++)
{
transparent_crc(g_154[i], "g_154[i]", print_hash_value);
if (print_hash_value) printf("index = [%d]\n", i);
}
transparent_crc(g_161, "g_161", print_hash_value);
transparent_crc(g_167.f0, "g_167.f0", print_hash_value);
transparent_crc(g_167.f1, "g_167.f1", print_hash_value);
transparent_crc(g_167.f2, "g_167.f2", print_hash_value);
transparent_crc(g_167.f3, "g_167.f3", print_hash_value);
transparent_crc(g_167.f4, "g_167.f4", print_hash_value);
transparent_crc(g_167.f5, "g_167.f5", print_hash_value);
transparent_crc(g_167.f6, "g_167.f6", print_hash_value);
transparent_crc(g_167.f7, "g_167.f7", print_hash_value);
transparent_crc(g_167.f8, "g_167.f8", print_hash_value);
transparent_crc(g_167.f9, "g_167.f9", print_hash_value);
transparent_crc(g_176, "g_176", print_hash_value);
transparent_crc(g_178, "g_178", print_hash_value);
transparent_crc(g_179, "g_179", print_hash_value);
transparent_crc(g_183.f0, "g_183.f0", print_hash_value);
transparent_crc(g_183.f1, "g_183.f1", print_hash_value);
transparent_crc(g_183.f2, "g_183.f2", print_hash_value);
transparent_crc(g_183.f3, "g_183.f3", print_hash_value);
transparent_crc(g_183.f4, "g_183.f4", print_hash_value);
transparent_crc(g_183.f5, "g_183.f5", print_hash_value);
transparent_crc(g_183.f6, "g_183.f6", print_hash_value);
transparent_crc(g_183.f7, "g_183.f7", print_hash_value);
transparent_crc(g_183.f8, "g_183.f8", print_hash_value);
transparent_crc(g_183.f9, "g_183.f9", print_hash_value);
transparent_crc(g_189, "g_189", print_hash_value);
transparent_crc(g_191, "g_191", print_hash_value);
transparent_crc(g_204, "g_204", print_hash_value);
transparent_crc(g_233, "g_233", print_hash_value);
transparent_crc(g_246, "g_246", print_hash_value);
transparent_crc(g_302, "g_302", print_hash_value);
transparent_crc(g_304, "g_304", print_hash_value);
transparent_crc(g_305, "g_305", print_hash_value);
for (i = 0; i < 7; i++)
{
for (j = 0; j < 10; j++)
{
for (k = 0; k < 3; k++)
{
transparent_crc(g_306[i][j][k], "g_306[i][j][k]", print_hash_value);
if (print_hash_value) printf("index = [%d][%d][%d]\n", i, j, k);
}
}
}
transparent_crc(g_307, "g_307", print_hash_value);
transparent_crc(g_308, "g_308", print_hash_value);
transparent_crc(g_328, "g_328", print_hash_value);
platform_main_end(crc32_context ^ 0xFFFFFFFFUL, print_hash_value);
return 0;
} /************************ statistics *************************
|
Third reproducer:
|
Reproducer (it is a RISC-V-only bug):
/************************ statistics *************************
I am sorry I cannot provide a minimal UB-free reproducer.
Commands:
The result should be
checksum = A559693C
, but qemu returnschecksum = FC86B582
.Bisect to
Machine Instruction Scheduler
:Before MISched:
After:
I guess there is a TBAA bug, but it is not caused by #81313, which causes another miscompilation #82586.
LLVM version: 0e8d187
cc @topperc @RKSimon
The text was updated successfully, but these errors were encountered: