summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorsayle <sayle@138bc75d-0d04-0410-961f-82ee72b054a4>2003-04-23 02:47:41 +0000
committersayle <sayle@138bc75d-0d04-0410-961f-82ee72b054a4>2003-04-23 02:47:41 +0000
commit01960f672655a79d6e2a7d0b2d0f18bc34ab9aff (patch)
tree91849aee7f2d1f354083ade4bbcfcb7269367bd8
parent0a4f46e26c589fc77e7dcdbb7a3d510b6c0613c9 (diff)
downloadppe42-gcc-01960f672655a79d6e2a7d0b2d0f18bc34ab9aff.tar.gz
ppe42-gcc-01960f672655a79d6e2a7d0b2d0f18bc34ab9aff.zip
* alias.c (mark_constant_function): Check for constancy and
purity even of void functions. Update both the function decl and the cgraph RTL info with the results. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@65981 138bc75d-0d04-0410-961f-82ee72b054a4
-rw-r--r--gcc/ChangeLog6
-rw-r--r--gcc/alias.c13
2 files changed, 15 insertions, 4 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index ab6dd74e1de..c552233cdd0 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,5 +1,11 @@
2003-04-22 Roger Sayle <roger@eyesopen.com>
+ * alias.c (mark_constant_function): Check for constancy and
+ purity even of void functions. Update both the function decl
+ and the cgraph RTL info with the results.
+
+2003-04-22 Roger Sayle <roger@eyesopen.com>
+
* real.c (do_add): Change to return a bool indicating that the
result of the operation may be inexact due to loss of precision.
(do_multiply): Likewise.
diff --git a/gcc/alias.c b/gcc/alias.c
index 49b53c9b5d7..4cd51e994f5 100644
--- a/gcc/alias.c
+++ b/gcc/alias.c
@@ -2642,7 +2642,7 @@ nonlocal_set_p (x)
return for_each_rtx (&x, nonlocal_set_p_1, NULL);
}
-/* Mark the function if it is constant. */
+/* Mark the function if it is pure or constant. */
void
mark_constant_function ()
@@ -2653,7 +2653,6 @@ mark_constant_function ()
if (TREE_READONLY (current_function_decl)
|| DECL_IS_PURE (current_function_decl)
|| TREE_THIS_VOLATILE (current_function_decl)
- || TYPE_MODE (TREE_TYPE (current_function_decl)) == VOIDmode
|| current_function_has_nonlocal_goto
|| !(*targetm.binds_local_p) (current_function_decl))
return;
@@ -2688,9 +2687,15 @@ mark_constant_function ()
if (insn)
;
else if (nonlocal_memory_referenced)
- cgraph_rtl_info (current_function_decl)->pure_function = 1;
+ {
+ cgraph_rtl_info (current_function_decl)->pure_function = 1;
+ DECL_IS_PURE (current_function_decl) = 1;
+ }
else
- cgraph_rtl_info (current_function_decl)->const_function = 1;
+ {
+ cgraph_rtl_info (current_function_decl)->const_function = 1;
+ TREE_READONLY (current_function_decl) = 1;
+ }
}
OpenPOWER on IntegriCloud