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