aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ChangeLog5
-rw-r--r--gcc/doc/invoke.texi2
-rw-r--r--gcc/ipa-prop.c17
-rw-r--r--gcc/opts.c1
-rw-r--r--gcc/testsuite/ChangeLog5
-rw-r--r--gcc/testsuite/gcc.dg/lto/ipacp_0.c15
-rw-r--r--gcc/testsuite/gcc.dg/lto/ipacp_1.c12
7 files changed, 49 insertions, 8 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index cc7419b..4519c0ae 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,8 @@
+2010-05-18 Jan Hubicka <jh@suse.cz>
+
+ * opts.c (decode_options): Do not disable whopr at ipa_cp.
+ * ipa-prop.c (ipa_detect_param_modifications): Walk PHI nodes too.
+
2010-05-18 Steven Bosscher <steven@gcc.gnu.org>
PR lto/44184
diff --git a/gcc/doc/invoke.texi b/gcc/doc/invoke.texi
index bd29d24..6afc713 100644
--- a/gcc/doc/invoke.texi
+++ b/gcc/doc/invoke.texi
@@ -7456,8 +7456,6 @@ that otherwise would not fit in memory. This option enables
Disabled by default.
-This option is experimental.
-
@item -fwpa
@opindex fwpa
This is an internal option used by GCC when compiling with
diff --git a/gcc/ipa-prop.c b/gcc/ipa-prop.c
index 113a008..6437389 100644
--- a/gcc/ipa-prop.c
+++ b/gcc/ipa-prop.c
@@ -269,11 +269,18 @@ ipa_detect_param_modifications (struct cgraph_node *node)
func = DECL_STRUCT_FUNCTION (decl);
FOR_EACH_BB_FN (bb, func)
- for (gsi = gsi_start_bb (bb); !gsi_end_p (gsi); gsi_next (&gsi))
- walk_stmt_load_store_addr_ops (gsi_stmt (gsi), info,
- visit_load_for_mod_analysis,
- visit_store_addr_for_mod_analysis,
- visit_store_addr_for_mod_analysis);
+ {
+ for (gsi = gsi_start_bb (bb); !gsi_end_p (gsi); gsi_next (&gsi))
+ walk_stmt_load_store_addr_ops (gsi_stmt (gsi), info,
+ visit_load_for_mod_analysis,
+ visit_store_addr_for_mod_analysis,
+ visit_store_addr_for_mod_analysis);
+ for (gsi = gsi_start (phi_nodes (bb)); !gsi_end_p (gsi); gsi_next (&gsi))
+ walk_stmt_load_store_addr_ops (gsi_stmt (gsi), info,
+ visit_load_for_mod_analysis,
+ visit_store_addr_for_mod_analysis,
+ visit_store_addr_for_mod_analysis);
+ }
info->modification_analysis_done = 1;
}
diff --git a/gcc/opts.c b/gcc/opts.c
index 14c9b04..d5a9fb3 100644
--- a/gcc/opts.c
+++ b/gcc/opts.c
@@ -1150,7 +1150,6 @@ decode_options (unsigned int argc, const char **argv)
if (flag_wpa || flag_ltrans)
{
/* These passes are not WHOPR compatible yet. */
- flag_ipa_cp = 0;
flag_ipa_pta = 0;
flag_ipa_struct_reorg = 0;
}
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index 609f84b..15200cd 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -1,3 +1,8 @@
+2010-05-18 Jan Hubicka <jh@suse.cz>
+
+ * gcc.dg/lto/ipacp_0.c: New test.
+ * gcc.dg/lto/ipacp_1.c: New test.
+
2010-05-18 Steven Bosscher <steven@gcc.gnu.org>
PR lto/44184
diff --git a/gcc/testsuite/gcc.dg/lto/ipacp_0.c b/gcc/testsuite/gcc.dg/lto/ipacp_0.c
new file mode 100644
index 0000000..3212261
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/lto/ipacp_0.c
@@ -0,0 +1,15 @@
+/* { dg-lto-options {{ -O1 -fwhopr -fipa-cp -fipa-cp-clone}} } */
+/* { dg-lto-do run } */
+
+/* Test that clonning happens and we unify declarations of a from both units. */
+const int a = 5;
+extern void clone_me (int *);
+
+int
+main(void)
+{
+ int i;
+ for (i=0;i<100;i++)
+ clone_me ((int *)&a);
+ return 0;
+}
diff --git a/gcc/testsuite/gcc.dg/lto/ipacp_1.c b/gcc/testsuite/gcc.dg/lto/ipacp_1.c
new file mode 100644
index 0000000..69c1ec6
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/lto/ipacp_1.c
@@ -0,0 +1,12 @@
+void abort (void);
+extern int a;
+
+__attribute__ ((noinline))
+void
+clone_me (int *ptr)
+{
+ if (ptr != &a)
+ abort ();
+ if (!__builtin_constant_p (ptr != &a))
+ abort ();
+}