aboutsummaryrefslogtreecommitdiff
path: root/gcc/tree-ssa-operands.c
diff options
context:
space:
mode:
authorSteven Bosscher <stevenb@suse.de>2004-05-17 21:25:32 +0000
committerSteven Bosscher <steven@gcc.gnu.org>2004-05-17 21:25:32 +0000
commit6944d9ddb0be2b586fb48eece8591bb62a5d5b66 (patch)
treee120c60ebe7b84548205ca3f7b6991210a7476a1 /gcc/tree-ssa-operands.c
parent719df717e2b92a90e53f2ecbfdca858440d08fd0 (diff)
downloadgcc-6944d9ddb0be2b586fb48eece8591bb62a5d5b66.zip
gcc-6944d9ddb0be2b586fb48eece8591bb62a5d5b66.tar.gz
gcc-6944d9ddb0be2b586fb48eece8591bb62a5d5b66.tar.bz2
tree-ssa-operands.c (get_expr_operands): Do not treat malloc attributed functions as pure or const.
* tree-ssa-operands.c (get_expr_operands): Do not treat malloc attributed functions as pure or const. From-SVN: r81951
Diffstat (limited to 'gcc/tree-ssa-operands.c')
-rw-r--r--gcc/tree-ssa-operands.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/gcc/tree-ssa-operands.c b/gcc/tree-ssa-operands.c
index de5b16d..f011275 100644
--- a/gcc/tree-ssa-operands.c
+++ b/gcc/tree-ssa-operands.c
@@ -1023,12 +1023,11 @@ get_expr_operands (tree stmt, tree *expr_p, int flags, voperands_t prev_vops)
if (bitmap_first_set_bit (call_clobbered_vars) >= 0)
{
+ /* A 'pure' or a 'const' functions never call clobber anything.
+ A 'noreturn' function might, but since we don't return anyway
+ there is no point in recording that. */
if (!(call_flags
- & (ECF_PURE
- | ECF_CONST
- | ECF_NORETURN
- | ECF_MALLOC
- | ECF_MAY_BE_ALLOCA)))
+ & (ECF_PURE | ECF_CONST | ECF_NORETURN)))
add_call_clobber_ops (stmt, prev_vops);
else if (!(call_flags & (ECF_CONST | ECF_NORETURN)))
add_call_read_ops (stmt, prev_vops);