Hello,

thanks a lot for looking into this.

On Tue, Feb 03 2026, Richard Biener wrote:
> The following fixes re-materialization of aggregates before calls
> that take the address of a scalarized decl.  The issue here is that
> we do not know the appropriate effective type to use for the stores.
> So we use ref-all accesses for the re-materialization to properly
> support TBAA info modref might have recorded.  The same holds
> true for the re-load after the call.
>
> Bootstrap and regtest running on x86_64-unknown-linux-gnu.
>
> OK if that succeeds?
>

I think this is probably the best we can do.  Even before, I tried to
think how to do this in fewer cases but eventually I could not convince
myself either that we could do this safely or that it would matter.

Thanks for looking into the issue.

Martin


> Thanks,
> Richard.
>
>       PR tree-optimization/121726
>       * tree-sra.cc (build_ref_for_offset): Add force_ref_all
>       parameter and use ptr_type_node as alias pointer type in
>       that case.
>       (build_ref_for_model): Add force_ref_all parameter and
>       pass it through, forcing build_ref_for_offset.
>       (generate_subtree_copies): Likewise.
>       (sra_modify_call_arg): Force ref-all accesses.
>
>       * gcc.target/i386/pr121726.c: New testcase.

Reply via email to