Merge lp:~cltang/gcc-linaro/lp-674146-dpkg-segfault into lp:gcc-linaro/4.5

Proposed by Chung-Lin Tang
Status: Merged
Approved by: Andrew Stubbs
Approved revision: no longer in the source branch.
Merged at revision: 99440
Proposed branch: lp:~cltang/gcc-linaro/lp-674146-dpkg-segfault
Merge into: lp:gcc-linaro/4.5
Diff against target: 87 lines (+24/-6)
4 files modified
ChangeLog.linaro (+14/-0)
gcc/cfgexpand.c (+8/-4)
gcc/ipa-inline.c (+1/-1)
gcc/tree-inline.h (+1/-1)
To merge this branch: bzr merge lp:~cltang/gcc-linaro/lp-674146-dpkg-segfault
Reviewer Review Type Date Requested Status
Andrew Stubbs (community) Approve
Review via email: mp+41695@code.launchpad.net

Description of the change

Backport mainline rev.161947, which is the fix for PR44768.

To post a comment you must log in.
Revision history for this message
Andrew Stubbs (ams-codesourcery) wrote :

Looks good. I'll do the merge soon.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'ChangeLog.linaro'
2--- ChangeLog.linaro 2010-11-11 11:50:33 +0000
3+++ ChangeLog.linaro 2010-11-24 09:26:49 +0000
4@@ -1,3 +1,17 @@
5+2010-11-24 Chung-Lin Tang <cltang@codesourcery.com>
6+
7+ Backport from mainline:
8+
9+ 2010-07-08 Ramana Radhakrishnan <ramana.radhakrishnan@arm.com>
10+
11+ PR bootstrap/44768
12+ gcc/
13+ * cfgexpand.c (estimated_stack_frame_size): Make self-contained
14+ with respect to current_function_decl. Pass decl of the function.
15+ * tree-inline.h (estimated_stack_frame_size): Adjust prototype.
16+ * ipa-inline.c (compute_inline_parameters): Pass decl to
17+ estimated_stack_frame_size.
18+
19 2010-11-08 Yao Qi <yao@codesourcery.com>
20
21 Backport from mainline:
22
23=== modified file 'gcc/cfgexpand.c'
24--- gcc/cfgexpand.c 2010-10-04 00:50:43 +0000
25+++ gcc/cfgexpand.c 2010-11-24 09:26:49 +0000
26@@ -1248,8 +1248,8 @@
27 stack_vars_alloc = stack_vars_num = 0;
28 }
29
30-/* Make a fair guess for the size of the stack frame of the current
31- function. This doesn't have to be exact, the result is only used
32+/* Make a fair guess for the size of the stack frame of the decl
33+ passed. This doesn't have to be exact, the result is only used
34 in the inline heuristics. So we don't want to run the full stack
35 var packing algorithm (which is quadratic in the number of stack
36 vars). Instead, we calculate the total size of all stack vars.
37@@ -1257,11 +1257,14 @@
38 vars doesn't happen very often. */
39
40 HOST_WIDE_INT
41-estimated_stack_frame_size (void)
42+estimated_stack_frame_size (tree decl)
43 {
44 HOST_WIDE_INT size = 0;
45 size_t i;
46 tree t, outer_block = DECL_INITIAL (current_function_decl);
47+ tree old_cur_fun_decl = current_function_decl;
48+ current_function_decl = decl;
49+ push_cfun (DECL_STRUCT_FUNCTION (decl));
50
51 init_vars_expansion ();
52
53@@ -1284,7 +1287,8 @@
54 size += account_stack_vars ();
55 fini_vars_expansion ();
56 }
57-
58+ pop_cfun ();
59+ current_function_decl = old_cur_fun_decl;
60 return size;
61 }
62
63
64=== modified file 'gcc/ipa-inline.c'
65--- gcc/ipa-inline.c 2010-06-30 21:30:12 +0000
66+++ gcc/ipa-inline.c 2010-11-24 09:26:49 +0000
67@@ -1967,7 +1967,7 @@
68
69 /* Estimate the stack size for the function. But not at -O0
70 because estimated_stack_frame_size is a quadratic problem. */
71- self_stack_size = optimize ? estimated_stack_frame_size () : 0;
72+ self_stack_size = optimize ? estimated_stack_frame_size (node->decl) : 0;
73 inline_summary (node)->estimated_self_stack_size = self_stack_size;
74 node->global.estimated_stack_size = self_stack_size;
75 node->global.stack_frame_offset = 0;
76
77=== modified file 'gcc/tree-inline.h'
78--- gcc/tree-inline.h 2009-09-14 18:18:58 +0000
79+++ gcc/tree-inline.h 2010-11-24 09:26:49 +0000
80@@ -187,6 +187,6 @@
81 extern tree remap_type (tree type, copy_body_data *id);
82 extern gimple_seq copy_gimple_seq_and_replace_locals (gimple_seq seq);
83
84-extern HOST_WIDE_INT estimated_stack_frame_size (void);
85+extern HOST_WIDE_INT estimated_stack_frame_size (tree);
86
87 #endif /* GCC_TREE_INLINE_H */

Subscribers

People subscribed via source and target branches