This applies some TLC to mark_address_taken which ends up setting TREE_ADDRESSABLE on nodes where it doesn't have any semantics. It also does work (incomplete) that get_base_address already does, likewise we'll never get WITH_SIZE_EXPR in this context and thus get_base_address never fails.
Bootstrapped and tested on x86_64-unknown-linux-gnu, pushed. 2021-05-18 Richard Biener <rguent...@suse.de> * tree-ssa-operands.c (mark_address_taken): Simplify. --- gcc/tree-ssa-operands.c | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/gcc/tree-ssa-operands.c b/gcc/tree-ssa-operands.c index 9e620883d44..2fc74d51917 100644 --- a/gcc/tree-ssa-operands.c +++ b/gcc/tree-ssa-operands.c @@ -626,15 +626,10 @@ mark_address_taken (tree ref) be referenced using pointer arithmetic. See PR 21407 and the ensuing mailing list discussion. */ var = get_base_address (ref); - if (var) - { - if (DECL_P (var)) - TREE_ADDRESSABLE (var) = 1; - else if (TREE_CODE (var) == MEM_REF - && TREE_CODE (TREE_OPERAND (var, 0)) == ADDR_EXPR - && DECL_P (TREE_OPERAND (TREE_OPERAND (var, 0), 0))) - TREE_ADDRESSABLE (TREE_OPERAND (TREE_OPERAND (var, 0), 0)) = 1; - } + if (VAR_P (var) + || TREE_CODE (var) == RESULT_DECL + || TREE_CODE (var) == PARM_DECL) + TREE_ADDRESSABLE (var) = 1; } -- 2.26.2