aboutsummaryrefslogtreecommitdiff
path: root/gcc/tree.c
diff options
context:
space:
mode:
authorRichard Biener <rguenther@suse.de>2021-05-19 10:20:37 +0200
committerRichard Biener <rguenther@suse.de>2021-05-19 14:53:50 +0200
commit2e6ad1ba532fe684633edac766c598be19ad3b59 (patch)
tree5bd49ea00c2490aa6e960bbaa72cb1afa54cec1b /gcc/tree.c
parent1467100fc72562a59f70cdd4e05f6c810d1fadcc (diff)
downloadgcc-2e6ad1ba532fe684633edac766c598be19ad3b59.zip
gcc-2e6ad1ba532fe684633edac766c598be19ad3b59.tar.gz
gcc-2e6ad1ba532fe684633edac766c598be19ad3b59.tar.bz2
Enable more WITH_SIZE_EXPR processing
This enables the alias machinery for WITH_SIZE_EXPR which can appear in call LHS and arguments. In particular this drops the NULL return from get_base_address and it adjusts get_ref_base_and_extent and friends to use the size information in WITH_SIZE_EXPR and look through it for further processing. 2021-05-19 Richard Biener <rguenther@suse.de> * builtins.c (get_object_alignment_1): Strip outer WITH_SIZE_EXPR. * tree-dfa.c (get_ref_base_and_extent): Handle outer WITH_SIZE_EXPR for size processing and process the containing ref. * tree-ssa-alias.c (ao_ref_base_alias_set): Strip outer WITH_SIZE_EXPR. (ao_ref_base_alias_ptr_type): Likewise. (refs_may_alias_p_2): Allow WITH_SIZE_EXPR in ref->ref and handle that accordingly, stripping it for the core alias workers. * tree.c (get_base_address): Handle WITH_SIZE_EXPR by looking through it instead of returning NULL.
Diffstat (limited to 'gcc/tree.c')
-rw-r--r--gcc/tree.c7
1 files changed, 2 insertions, 5 deletions
diff --git a/gcc/tree.c b/gcc/tree.c
index 31ac424..bdb29b8 100644
--- a/gcc/tree.c
+++ b/gcc/tree.c
@@ -12382,6 +12382,8 @@ drop_tree_overflow (tree t)
tree
get_base_address (tree t)
{
+ if (TREE_CODE (t) == WITH_SIZE_EXPR)
+ t = TREE_OPERAND (t, 0);
while (handled_component_p (t))
t = TREE_OPERAND (t, 0);
@@ -12390,11 +12392,6 @@ get_base_address (tree t)
&& TREE_CODE (TREE_OPERAND (t, 0)) == ADDR_EXPR)
t = TREE_OPERAND (TREE_OPERAND (t, 0), 0);
- /* ??? Either the alias oracle or all callers need to properly deal
- with WITH_SIZE_EXPRs before we can look through those. */
- if (TREE_CODE (t) == WITH_SIZE_EXPR)
- return NULL_TREE;
-
return t;
}