aboutsummaryrefslogtreecommitdiff
path: root/gcc/ipa-modref.c
diff options
context:
space:
mode:
authorJan Hubicka <jh@suse.cz>2020-11-16 16:31:30 +0100
committerJan Hubicka <jh@suse.cz>2020-11-16 16:31:30 +0100
commit0c9687d0daa08c33456210b87e4060d6397ff4d8 (patch)
tree8986ca4e89585c82fc63b24e4f9a2e972a92374b /gcc/ipa-modref.c
parentc84df34aec3bb845b22384c7e85f0449ca00dd99 (diff)
downloadgcc-0c9687d0daa08c33456210b87e4060d6397ff4d8.zip
gcc-0c9687d0daa08c33456210b87e4060d6397ff4d8.tar.gz
gcc-0c9687d0daa08c33456210b87e4060d6397ff4d8.tar.bz2
Disable some bogus -Wmaybe-uninitialized warnings
gcc/ChangeLog: PR middle-end/97840 * ipa-modref.c (analyze_ssa_name_flags): Skip clobbers if inlining is done. * tree-ssa-uninit.c (maybe_warn_pass_by_reference): Make stmt gcall; skip const calls and unused arguments. (warn_uninitialized_vars): Update prototype. gcc/testsuite/ChangeLog: * g++.dg/warn/uninit-1.C: New test.
Diffstat (limited to 'gcc/ipa-modref.c')
-rw-r--r--gcc/ipa-modref.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/gcc/ipa-modref.c b/gcc/ipa-modref.c
index 4a43c50..c7f763e 100644
--- a/gcc/ipa-modref.c
+++ b/gcc/ipa-modref.c
@@ -1333,7 +1333,14 @@ analyze_ssa_name_flags (tree name, vec<unsigned char> &known_flags, int depth)
/* Handle *name = exp. */
else if (assign
&& memory_access_to (gimple_assign_lhs (assign), name))
- flags &= ~(EAF_UNUSED | EAF_NOCLOBBER);
+ {
+ /* In general we can not ignore clobbers because they are
+ barriers for code motion, however after inlining it is safe to
+ do because local optimization passes do not consider clobbers
+ from other functions. Similar logic is in ipa-pure-const.c. */
+ if (!cfun->after_inlining || !gimple_clobber_p (assign))
+ flags &= ~(EAF_UNUSED | EAF_NOCLOBBER);
+ }
/* ASM statements etc. */
else if (!assign)
{