This is the mail archive of the
mailing list for the GCC project.
Small performance improvement
- From: Samuel Tardieu <sam at rfc1149 dot net>
- To: gcc-patches at gcc dot gnu dot org
- Date: Wed, 24 Oct 2007 10:42:56 +0200
- Subject: Small performance improvement
[submitting here, was http://gcc.gnu.org/bugzilla/show_bug.cgi?id=33875]
When local->pure_const_state in ipa-pure-const.c/check_decl has been set to
IPA_NEITHER, it cannot be modified in the rest of the function, so it is
possible to return immediately. This should bring a tiny performance
improvement while not impairing the code readability.
Patch follows, against SVN tree.
diff --git a/gcc/ipa-pure-const.c b/gcc/ipa-pure-const.c
index 519b402..bfc3d56 100644
@@ -113,8 +113,11 @@ check_decl (funct_state local,
/* Since we have dealt with the locals and params cases above, if we
are CHECKING_WRITE, this cannot be a pure or constant
- if (checking_write)
- local->pure_const_state = IPA_NEITHER;
+ if (checking_write)
+ local->pure_const_state = IPA_NEITHER;
if (DECL_EXTERNAL (t) || TREE_PUBLIC (t))