https://gcc.gnu.org/bugzilla/show_bug.cgi?id=92925
--- Comment #2 from Eric Botcazou <ebotcazou at gcc dot gnu.org> --- > We're supposed to use get_object_alignment to set MEM_ALIGN and we do in most > of the cases (IIRC). So this must be an omission somewhere. So we indeed > compute that but then we called set_mem_attributes_minus_bitpos with > bptr_5(D)->a[i_11] but bitpos 64 - this seems to be a disconnect between > the callers using get_inner_reference to decompose a ref but then still > passing down the full ref tree to set_mem_attributes_minus_bitpos. > > (gdb) up > #1 0x0000000000c969cf in expand_assignment (to=<array_ref 0x7ffff68180a8>, > from=<constructor 0x7ffff6960108>, nontemporal=false) > at /tmp/trunk2/gcc/expr.c:5357 > 5357 set_mem_attributes_minus_bitpos (to_rtx, to, 0, > bitpos); That's the point of set_mem_attributes_minus_bitpos: you use the full tree to get the information. If we pass 'ref' instead of 'to', a good chunk of the logic in there is disabled, e.g.: /* If this is a field reference, record it. */ else if (TREE_CODE (t) == COMPONENT_REF) { attrs.expr = t; attrs.offset_known_p = true; attrs.offset = 0; apply_bitpos = bitpos; if (DECL_BIT_FIELD (TREE_OPERAND (t, 1))) new_size = DECL_SIZE_UNIT (TREE_OPERAND (t, 1)); } so I'm not sure what the issue could be. Let me have a closer look.