aboutsummaryrefslogtreecommitdiff
path: root/gcc/ipa-modref.c
diff options
context:
space:
mode:
authorJan Hubicka <jh@suse.cz>2020-11-15 15:10:22 +0100
committerJan Hubicka <jh@suse.cz>2020-11-15 15:10:22 +0100
commit26285af40f98dfdb809b98b08386073c63b65db1 (patch)
treeac280fe6d1d81b16c828e96aa28b39d96bd40d31 /gcc/ipa-modref.c
parentfaab61b585a8b4a42454f085dd6b7815992a98f5 (diff)
downloadgcc-26285af40f98dfdb809b98b08386073c63b65db1.zip
gcc-26285af40f98dfdb809b98b08386073c63b65db1.tar.gz
gcc-26285af40f98dfdb809b98b08386073c63b65db1.tar.bz2
Mare return to clear EAF_UNUSED flag.
gcc/ChangeLog: * ipa-modref.c (analyze_ssa_name_flags): Make return to clear EAF_UNUSED flag. gcc/testsuite/ChangeLog: * gcc.c-torture/execute/pr97836.c: New test.
Diffstat (limited to 'gcc/ipa-modref.c')
-rw-r--r--gcc/ipa-modref.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/gcc/ipa-modref.c b/gcc/ipa-modref.c
index 5273c20..4a43c50 100644
--- a/gcc/ipa-modref.c
+++ b/gcc/ipa-modref.c
@@ -1224,10 +1224,12 @@ analyze_ssa_name_flags (tree name, vec<unsigned char> &known_flags, int depth)
print_gimple_stmt (dump_file, use_stmt, 0);
}
- /* Gimple return may load the return value. */
+ /* Gimple return may load the return value.
+ Returning name counts as an use by tree-ssa-structalias.c */
if (greturn *ret = dyn_cast <greturn *> (use_stmt))
{
- if (memory_access_to (gimple_return_retval (ret), name))
+ if (memory_access_to (gimple_return_retval (ret), name)
+ || name == gimple_return_retval (ret))
flags &= ~EAF_UNUSED;
}
/* Account for LHS store, arg loads and flags from callee function. */