The following code generates incorrect assembly code for bug1 & bug2 (even field f corrupted).
reproducable for at least mcs51/stm8/z80.
(may related to #2643 too)
SDCC : mcs51/z80/z180/r2k/r3ka/gbz80/tlcs90/ds390/TININative/ds400/hc08/s08/stm8 3.8.3 #10674 (Mac OS X x86_64)
#include <stdint.h>
struct SS
{
uint8_t a;
union {
uint8_t b;
struct {
uint8_t c : 2;
uint8_t d : 3;
uint8_t e : 3;
};
};
uint8_t f;
};
const struct SS ok = {
1,
2,
3
};
const struct SS bug1 = {
.a = 1,
.b = 2,
.f = 3,
};
const struct SS bug2 = {
.a = 1,
.c = 2,
.d = 3,
.e = 4,
.f = 5,
};