aboutsummaryrefslogtreecommitdiff
path: root/gcc/ipa-pure-const.c
diff options
context:
space:
mode:
authorNathan Froyd <froydnj@codesourcery.com>2011-04-15 14:27:55 +0000
committerNathan Froyd <froydnj@gcc.gnu.org>2011-04-15 14:27:55 +0000
commitedcdea5b0076b473fbed3d0338193aae7d0d9361 (patch)
tree20eb5a05b4a467b5a01f7586202e5298a4829e50 /gcc/ipa-pure-const.c
parent0f141046690f732453dc182f1dedb9ae31622a93 (diff)
downloadgcc-edcdea5b0076b473fbed3d0338193aae7d0d9361.zip
gcc-edcdea5b0076b473fbed3d0338193aae7d0d9361.tar.gz
gcc-edcdea5b0076b473fbed3d0338193aae7d0d9361.tar.bz2
gimple.h (gimple_asm_clobbers_memory_p): Declare.
* gimple.h (gimple_asm_clobbers_memory_p): Declare. * gimple.c (gimple_asm_clobbers_memory_p): Define. * ipa-pure-const.c (check_stmt): Call it. * tree-ssa-operands.c (get_asm_expr_operands): Likewise. From-SVN: r172496
Diffstat (limited to 'gcc/ipa-pure-const.c')
-rw-r--r--gcc/ipa-pure-const.c15
1 files changed, 5 insertions, 10 deletions
diff --git a/gcc/ipa-pure-const.c b/gcc/ipa-pure-const.c
index b7deb57..eb5b0f6a 100644
--- a/gcc/ipa-pure-const.c
+++ b/gcc/ipa-pure-const.c
@@ -639,7 +639,6 @@ static void
check_stmt (gimple_stmt_iterator *gsip, funct_state local, bool ipa)
{
gimple stmt = gsi_stmt (*gsip);
- unsigned int i = 0;
if (is_gimple_debug (stmt))
return;
@@ -693,16 +692,12 @@ check_stmt (gimple_stmt_iterator *gsip, funct_state local, bool ipa)
}
break;
case GIMPLE_ASM:
- for (i = 0; i < gimple_asm_nclobbers (stmt); i++)
+ if (gimple_asm_clobbers_memory_p (stmt))
{
- tree op = gimple_asm_clobber_op (stmt, i);
- if (strcmp (TREE_STRING_POINTER (TREE_VALUE (op)), "memory") == 0)
- {
- if (dump_file)
- fprintf (dump_file, " memory asm clobber is not const/pure");
- /* Abandon all hope, ye who enter here. */
- local->pure_const_state = IPA_NEITHER;
- }
+ if (dump_file)
+ fprintf (dump_file, " memory asm clobber is not const/pure");
+ /* Abandon all hope, ye who enter here. */
+ local->pure_const_state = IPA_NEITHER;
}
if (gimple_asm_volatile_p (stmt))
{