2 A bug in CSE resulted in a used temporary holding the address of a struct parameter being optimized out during loop optimizations.
3 This was visible as a crash during code generation.
4 The testcase is manually simplified code originally created by csmith.
9 #pragma disable_warning 85
10 #pragma disable_warning 94
11 #pragma disable_warning 158
15 #if !defined(__SDCC_pdk13) && !defined(__SDCC_pdk14) // Lack of memory
16 #if !defined(__SDCC_mcs51) && !defined(__SDCC_pdk15) && !defined(__SDCC_ds390) // Remaining aspects of bug
22 static int32_t g_2
= 0x09C3FBB4L
;
23 static int32_t g_22
= 0xD9E62B56L
;
24 static uint64_t g_33
= 1UL;
25 static volatile int32_t g_38
= (-9L);
26 static volatile int32_t *g_37
[1] = {&g_38
};
27 static volatile int32_t **g_36
= &g_37
[0];
28 static volatile int32_t *** volatile g_39
[2] = {&g_36
,&g_36
};
29 static volatile uint8_t g_53
= 0xA6L
;
31 static uint64_t func_1(void);
32 int32_t func_5(const int64_t p_6
, int32_t p_7
, uint32_t p_8
, struct S0 p_9
, int8_t p_10
);
34 static uint64_t func_1(void)
36 const int8_t l_11
= (-2L);
37 int32_t l_41
= 0x3EE1E161L
;
40 for (i
= 0; i
< 2; i
++)
41 l_52
[i
] = 0x33B75CABL
;
42 for (g_2
= 0; (g_2
!= (-23)); g_2
--)
44 int32_t l_12
= 0x58EDFE01L
;
45 struct S0 l_13
= {1,18};
46 int32_t *l_42
= &g_22
;
47 if (func_5(l_11
, g_2
, l_12
, l_13
, g_2
))
51 for (i
= 0; i
< 2; i
++)
53 for (j
= 0; j
< 1; j
++)
60 volatile int32_t ***l_40
= &g_36
;
64 (*l_42
) ^= (((l_41
|= (l_11
>= 0xB0L
)) != l_11
) ^ g_38
);
70 int32_t func_5(const int64_t p_6
, int32_t p_7
, uint32_t p_8
, struct S0 p_9
, int8_t p_10
)
80 #if !defined( __SDCC_pdk13) && !defined( __SDCC_pdk14) // Lack of memory
81 #if !defined(__SDCC_mcs51) && !defined(__SDCC_pdk15) && !defined(__SDCC_ds390) // Remaining aspects of bug