]> code.ossystems Code Review - openembedded-core.git/blob
33afc8d6a875f8ce6038bc91864e5aea70ec2e2c
[openembedded-core.git] /
1 From abf56c82ebcb8ba287fc69b8961af55b4541a130 Mon Sep 17 00:00:00 2001
2 From: jamborm <jamborm@138bc75d-0d04-0410-961f-82ee72b054a4>
3 Date: Tue, 12 Apr 2011 18:31:55 +0000
4 Subject: [PATCH 110/200] 2011-04-12  Martin Jambor  <mjambor@suse.cz>
5
6         PR tree-optimization/48195
7         * ipa-cp.c (ipcp_driver): Call ipa_check_create_node_params and
8         ipa_check_create_edge_args.
9         (ipcp_generate_summary): Do not call ipa_check_create_node_params and
10         ipa_check_create_edge_args.
11         * ipa-inline.c (inline_generate_summary): Do not call
12         ipa_check_create_node_params and ipa_check_create_edge_args.
13         * ipa-prop.c (ipa_analyze_node): Call ipa_check_create_node_params and
14         ipa_check_create_edge_args.
15
16         * testsuite/gcc.dg/ipa/pr48195.c: New test.
17
18
19
20 git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/gcc-4_6-branch@172332 138bc75d-0d04-0410-961f-82ee72b054a4
21
22 index db0941c..aad5d78 100644
23 --- a/gcc/ipa-cp.c
24 +++ b/gcc/ipa-cp.c
25 @@ -1516,6 +1516,8 @@ ipcp_driver (void)
26          ipa_print_all_params (dump_file);
27        ipa_print_all_jump_functions (dump_file);
28      }
29 +  ipa_check_create_node_params ();
30 +  ipa_check_create_edge_args ();
31    /* 2. Do the interprocedural propagation.  */
32    ipcp_iterate_stage ();
33    /* 3. Insert the constants found to the functions.  */
34 @@ -1543,8 +1545,6 @@ ipcp_generate_summary (void)
35  
36    if (dump_file)
37      fprintf (dump_file, "\nIPA constant propagation start:\n");
38 -  ipa_check_create_node_params ();
39 -  ipa_check_create_edge_args ();
40    ipa_register_cgraph_hooks ();
41  
42    for (node = cgraph_nodes; node; node = node->next)
43 diff --git a/gcc/ipa-inline.c b/gcc/ipa-inline.c
44 index 7ae5f96..b3c9215 100644
45 --- a/gcc/ipa-inline.c
46 +++ b/gcc/ipa-inline.c
47 @@ -2091,11 +2091,7 @@ inline_generate_summary (void)
48        cgraph_add_function_insertion_hook (&add_new_function, NULL);
49  
50    if (flag_indirect_inlining)
51 -    {
52 -      ipa_register_cgraph_hooks ();
53 -      ipa_check_create_node_params ();
54 -      ipa_check_create_edge_args ();
55 -    }
56 +    ipa_register_cgraph_hooks ();
57  
58    for (node = cgraph_nodes; node; node = node->next)
59      if (node->analyzed)
60 diff --git a/gcc/ipa-prop.c b/gcc/ipa-prop.c
61 index 82599f1..589bc16 100644
62 --- a/gcc/ipa-prop.c
63 +++ b/gcc/ipa-prop.c
64 @@ -1522,10 +1522,13 @@ ipa_analyze_params_uses (struct cgraph_node *node,
65  void
66  ipa_analyze_node (struct cgraph_node *node)
67  {
68 -  struct ipa_node_params *info = IPA_NODE_REF (node);
69 +  struct ipa_node_params *info;
70    struct param_analysis_info *parms_info;
71    int i, param_count;
72  
73 +  ipa_check_create_node_params ();
74 +  ipa_check_create_edge_args ();
75 +  info = IPA_NODE_REF (node);
76    push_cfun (DECL_STRUCT_FUNCTION (node->decl));
77    current_function_decl = node->decl;
78    ipa_initialize_node_params (node);
79 new file mode 100644
80 index 0000000..1cf7a7f
81 --- /dev/null
82 +++ b/gcc/testsuite/gcc.dg/ipa/pr48195.c
83 @@ -0,0 +1,24 @@
84 +/* { dg-do link } */
85 +/* { dg-options "-O2 -flto --param partial-inlining-entry-probability=101" } */
86 +
87 +extern void abort(void);
88 +
89 +int i;
90 +
91 +void __attribute__ ((constructor))
92 +c2 ()
93 +{
94 +  if (i)
95 +    abort ();
96 +}
97 +
98 +void __attribute__ ((destructor))
99 +d1 ()
100 +{
101 +  if (i)
102 +    abort ();
103 +}
104 +
105 +void main ()
106 +{
107 +}
108 -- 
109 1.7.0.4
110