diff options
author | Richard Biener <rguenther@suse.de> | 2021-05-18 11:33:29 +0200 |
---|---|---|
committer | Richard Biener <rguenther@suse.de> | 2021-05-18 11:35:42 +0200 |
commit | 3e2c715823e6aa0bfd89e56046a1c237789cd27d (patch) | |
tree | 6863b916aadbe670ba232320c8291b40af4b46b9 /gcc | |
parent | 6806469dbed7e2613fad5468a94830c2cc817c95 (diff) | |
download | gcc-3e2c715823e6aa0bfd89e56046a1c237789cd27d.zip gcc-3e2c715823e6aa0bfd89e56046a1c237789cd27d.tar.gz gcc-3e2c715823e6aa0bfd89e56046a1c237789cd27d.tar.bz2 |
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 <rguenther@suse.de>
* tree-ssa-operands.c (mark_address_taken): Simplify.
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/tree-ssa-operands.c | 13 |
1 files changed, 4 insertions, 9 deletions
diff --git a/gcc/tree-ssa-operands.c b/gcc/tree-ssa-operands.c index 9e62088..2fc74d5 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; } |