On 2023-01-25 02:44, Richard Biener wrote:
        t = TREE_OPERAND (expr, 1);
-      off = size_binop (PLUS_EXPR, DECL_FIELD_OFFSET (t),
+      off = size_binop (PLUS_EXPR,
+                       (TREE_OPERAND (expr, 2) ? TREE_OPERAND (expr, 2)
+                        : DECL_FIELD_OFFSET (t)),

That isn't correct - operand 2 is the field offset in units of
DECL_OFFSET_ALIGN (t) / BITS_PER_UNIT.
See component_ref_filed_offset (), maybe you should be using that
function instead?

Ahh, and it passed my testing only because I was testing a char. Thanks, I'll test and send an update with additional tests.

Thanks,
Sid

Reply via email to