mirror of
git://gcc.gnu.org/git/gcc.git
synced 2025-04-06 04:00:25 +08:00
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.
This commit is contained in:
parent
faab61b585
commit
26285af40f
@ -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. */
|
||||
|
17
gcc/testsuite/gcc.c-torture/execute/pr97836.c
Normal file
17
gcc/testsuite/gcc.c-torture/execute/pr97836.c
Normal file
@ -0,0 +1,17 @@
|
||||
int a;
|
||||
|
||||
int b(int c) { return 0; }
|
||||
|
||||
static int *d(int *e) {
|
||||
if (a) {
|
||||
a = a && b(*e);
|
||||
}
|
||||
return e;
|
||||
}
|
||||
|
||||
int main() {
|
||||
int f;
|
||||
if (d(&f) != &f)
|
||||
__builtin_abort();
|
||||
return 0;
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user