aboutsummaryrefslogtreecommitdiff
path: root/gcc/alias.c
diff options
context:
space:
mode:
authorJan Hubicka <jh@suse.cz>2000-04-13 13:59:00 +0000
committerJan Hubicka <hubicka@gcc.gnu.org>2000-04-13 13:59:00 +0000
commit2a8f6b90c17bc2eb63bb218e7b11b6c6178c9d70 (patch)
treed0cc1485f0444d16267f642aaa62f86e34308a1e /gcc/alias.c
parentc966901c242442c6ca4d34c8cdc85f5dfd3dbdd3 (diff)
downloadgcc-2a8f6b90c17bc2eb63bb218e7b11b6c6178c9d70.zip
gcc-2a8f6b90c17bc2eb63bb218e7b11b6c6178c9d70.tar.gz
gcc-2a8f6b90c17bc2eb63bb218e7b11b6c6178c9d70.tar.bz2
alias.c (nonlocal_reference_p): Take a care for CALL_INSNS's fusage field.
* alias.c (nonlocal_reference_p): Take a care for CALL_INSNS's fusage field. * calls.c (ECF_PURE): New flag. (emit_call_1): Handle ECF_PURE calls. (initialize_argument_information): Unset ECF_PURE flag too. (precompute_arguments): Precompute for ECF_PURE too. (expand_call): Handle ECF_PURE calls too. (emit_library_call_value_1): Rename no_queue argument to fn_type, accept value of 2 as pure function. (emit_library_call_value, emit_library_call): Rename no_queue argument to fn_type. * optabs.c (prepare_cmp_insn): Pass fn_type 2 to memcmp call. * tree.h (DECL_IS_PURE): New macro. (struct tree_decl): Add pure_flag. * c-common.c (enum attrs): Add attribute "pure". (init_attributes): Initialize attribute "pure" (decl_attributes): Handle attribute "pure". * extend.texi (Attribute "pure"): Document. * calls.c (expand_call): Add (mem:BLK (scratch)) to "equal from" in pure function. (flags_from_decl_or_type): Support attribute "pure". From-SVN: r33138
Diffstat (limited to 'gcc/alias.c')
-rw-r--r--gcc/alias.c13
1 files changed, 9 insertions, 4 deletions
diff --git a/gcc/alias.c b/gcc/alias.c
index db89ecc..fb493f8 100644
--- a/gcc/alias.c
+++ b/gcc/alias.c
@@ -1424,10 +1424,15 @@ nonlocal_reference_p (x)
if (GET_RTX_CLASS (code) == 'i')
{
- /* Constant functions are constant. */
+ /* Constant functions can be constant if they don't use
+ scratch memory used to mark function w/o side effects. */
if (code == CALL_INSN && CONST_CALL_P (x))
- return 0;
- x = PATTERN (x);
+ {
+ x = CALL_INSN_FUNCTION_USAGE (x);
+ if (!x) return 0;
+ }
+ else
+ x = PATTERN (x);
code = GET_CODE (x);
}
@@ -1520,7 +1525,7 @@ nonlocal_reference_p (x)
for (i = GET_RTX_LENGTH (code) - 1; i >= 0; i--)
{
- if (fmt[i] == 'e')
+ if (fmt[i] == 'e' && XEXP (x, i))
{
if (nonlocal_reference_p (XEXP (x, i)))
return 1;