ipacp_0.c: New test.
* gcc.dg/lto/ipacp_0.c: New test. * gcc.dg/lto/ipacp_1.c: New test. * opts.c (decode_options): Do not disable whopr at ipa_cp. * ipa-prop.c (ipa_detect_param_modifications): Walk PHI nodes too. From-SVN: r159535
This commit is contained in:
parent
26195ca5a2
commit
80e2a014c8
7 changed files with 49 additions and 8 deletions
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
|
|
@ -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
|
||||
|
|
15
gcc/testsuite/gcc.dg/lto/ipacp_0.c
Normal file
15
gcc/testsuite/gcc.dg/lto/ipacp_0.c
Normal file
|
@ -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;
|
||||
}
|
12
gcc/testsuite/gcc.dg/lto/ipacp_1.c
Normal file
12
gcc/testsuite/gcc.dg/lto/ipacp_1.c
Normal file
|
@ -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 ();
|
||||
}
|
Loading…
Add table
Reference in a new issue