This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[PATCH] Fix ipa-pure-const wrt clobbers
- From: Richard Guenther <rguenther at suse dot de>
- To: gcc-patches at gcc dot gnu dot org
- Date: Fri, 27 Jan 2012 15:13:55 +0100 (CET)
- Subject: [PATCH] Fix ipa-pure-const wrt clobbers
Just noticed the following - oddly no testsuite regressions because
of this ...
Richard.
2012-01-27 Richard Guenther <rguenther@suse.de>
* ipa-pure-const.c (check_stmt): Clobbers do not make a
function non-const/pure.
Index: gcc/ipa-pure-const.c
===================================================================
*** gcc/ipa-pure-const.c (revision 183616)
--- gcc/ipa-pure-const.c (working copy)
*************** check_stmt (gimple_stmt_iterator *gsip,
*** 652,658 ****
print_gimple_stmt (dump_file, stmt, 0, 0);
}
! if (gimple_has_volatile_ops (stmt))
{
local->pure_const_state = IPA_NEITHER;
if (dump_file)
--- 652,659 ----
print_gimple_stmt (dump_file, stmt, 0, 0);
}
! if (gimple_has_volatile_ops (stmt)
! && !gimple_clobber_p (stmt))
{
local->pure_const_state = IPA_NEITHER;
if (dump_file)