From: Richard Biener Date: Tue, 18 May 2021 09:33:29 +0000 (+0200) Subject: operand scanner TLC X-Git-Tag: basepoints/gcc-13~7443 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=3e2c715823e6aa0bfd89e56046a1c237789cd27d;p=thirdparty%2Fgcc.git operand scanner TLC 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. 2021-05-18 Richard Biener * tree-ssa-operands.c (mark_address_taken): Simplify. --- diff --git a/gcc/tree-ssa-operands.c b/gcc/tree-ssa-operands.c index 9e620883d44b..2fc74d519178 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; }