> Hi,
> 
> The discussion about scan_expr_access in ipa-sra.cc brought my
> attention to a missing case of handling an ADDR_EXPR.  As the added
> testcase shows, the heuristics which looks for parameters which are
> local variables that are only written to and passed by reference in
> calls can miss a case where the address of the variable in question is
> stored elsewhere in an assignment.
> 
> This patch adds that case to the function and also adds the
> optimization that Richi suggested, i.e. bailing out early on simple
> SSA_NAMEs and constant trees.
> 
> The patch is undergoing bootstrap and testing on an x86_64-linux right
> now.  OK if it passes?
> 
> Thanks,
> 
> Martin
> 
> 
> gcc/ChangeLog:
> 
> 2022-12-14  Martin Jambor  <mjam...@suse.cz>
> 
>       * ipa-sra.cc (loaded_decls): Adjust comment.
>       (scan_expr_access): Also detect assignments of address of local
>       variables to a variable.  Bail out early on SSA_NAMEs and
>       constants as an optimization.
> 
> gcc/testsuite/ChangeLog:
> 
> 2022-12-14  Martin Jambor  <mjam...@suse.cz>
> 
>       * gcc.dg/ipa/ipa-sra-29.c: New test.

OK,
Thanks!
Honza

Reply via email to