Our front end is wierd. The input is unusually low level, and so are the trees it produces. I do have a hankering to fix that (or maybe just to output more portable C...) But for now: It doesn't use component_refs, and doesn't define types much, but uses either either (type*)(base + offset) or bitfield_ref(base, offset, size).
As such, it runs into occasional problems. I have had to turn off various optimizations with e.g.: flag_tree_sra = false in langhook_post_options. Looking at this briefly, I think I see one of the problems. tree-sra.c looks for component_refs to bitfields, but it doesn't look for bitfield_refs. It should? also, in fold-const: /* A bit-field-ref that referenced the full argument can be stripped. */ should probably check that the other type is integral and that the signedness matches. - Jay