This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Fix handling of pure/const in tree-ssa-structalias.c
- From: "Daniel Berlin" <dberlin at dberlin dot org>
- To: gcc-patches <gcc-patches at gcc dot gnu dot org>
- Date: Wed, 18 Jun 2008 15:16:43 -0400
- Subject: Fix handling of pure/const in tree-ssa-structalias.c
This makes it so we don't add points-to anything constraints for
pure/const calls. Since they can't write anywhere, the can't cause
change what something points-to.
Bootstrapped and regtested on i686-darwin.
I will apply later today
--Dan
2008-06-18 Daniel Berlin <dberlin@dberlin.org>
* tree-ssa-structalias.c (handle_rhs_call): Fix handling of pure
and const functions.
Index: tree-ssa-structalias.c
===================================================================
--- tree-ssa-structalias.c (revision 136882)
+++ tree-ssa-structalias.c (working copy)
@@ -3583,6 +3583,11 @@ handle_rhs_call (tree rhs)
call_expr_arg_iterator iter;
struct constraint_expr rhsc;
+ /* Pure and const calls don't pointers to point-to anything since they
+ can't write anywhere or call anything not pure or const. */
+ if (call_expr_flags (rhs) & (ECF_CONST | ECF_PURE))
+ return;
+
rhsc.var = anything_id;
rhsc.offset = 0;
rhsc.type = ADDRESSOF;